Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use falcON as a library - for vectors #103

Closed
krobsp opened this issue Aug 26, 2022 · 7 comments
Closed

Use falcON as a library - for vectors #103

krobsp opened this issue Aug 26, 2022 · 7 comments

Comments

@krobsp
Copy link

krobsp commented Aug 26, 2022

Hi all
I plan to use NEMO and falcON as a library, especially for estimating gravitational potentials with Dehnen algorithm. But my particles are not in NEMO snapshot format: they are rather stored in a N-vector of 6-vectors. Is there a way to use falcON tools directly on this array or should I have to convert it to a NEMO snapshot file then call falcON tools on it (which would be extremely exhausting:-))
Thanks

@teuben
Copy link
Owner

teuben commented Aug 26, 2022

It's going to depend what you need to do, do you just need the potentials and want to do other things in your own code? How many particles are we talking about?
Here's an example using the unix command line to get the potentials of all particles, i'm using a NEMO plummer sphere as input, but you can also use tabtos to convert your ascii format so that gyrfalcON can read it:

      mkplummer - 1000 | gyrfalcON - p1k.out tstop=0 eps=0.05 kmax=8 give=mxvpa
      snapprint p1k.out  phi   > p1k.potentials.tab

sadly gyrfalcON cannot pipe the info into snapprint

@teuben
Copy link
Owner

teuben commented Aug 26, 2022

I do believe some people have been able to use falcON as a library, your main() will be in C++.

@krobsp
Copy link
Author

krobsp commented Aug 26, 2022

Thank you for your answer
Yes, I need the potentials (with falcON) and then I am computing stuff with them, in cpp.
There is about one million halos of 1e3-1e4 particles

@teuben
Copy link
Owner

teuben commented Aug 26, 2022

Just a million is still "small enough", you could quite possibly use the ascii route to avoid having to build your potential getter.

tabtos took me 0.4sec to convert 1M partiles to snapshot format for gyrfalcON
gyrfalcON took 1.4sec to compute the potentials
snapprint took 0.2sec to dump 1M potentials to a table for you to read again.

@krobsp
Copy link
Author

krobsp commented Aug 26, 2022

OK, I will try that. Thank you for the help !
If, in the future, there is a way to interface falcON (and NEMO) with usual std structures, it would be very useful I think

@teuben
Copy link
Owner

teuben commented Aug 26, 2022

Your note is a great way to catalog this idea. If I know a better example, I'll let you know. I know of one or two projects that use falcOn via python i believe.

@jcldc
Copy link
Collaborator

jcldc commented Aug 26, 2022

You can use also falcON from python program (python 3.9 max so far ) : see https://pypi.org/project/python-unsiotools/

@teuben teuben closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants