Replies: 1 comment 13 replies
-
Hi! I think I'll need some more info to be able to help.
could you try just setting up an interpRZPotential with |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi again!
I'm having an issue of sorts where the orbits I run using an interpolated potential are running extremely slow (at least for my purposes). 10 orbits within the following potential for example take around 5 minutes. I was wondering if there are any tips or optimisations that I can make/if I'm doing this correctly? I'm currently using a leapfrog integrator to process the orbits. Further context below. Currently using galpy==1.8.0 (1.8.1 has an issue with loading in the unpickled potentials, but this seemingly goes away with 1.8.2 - which I can't install on my current machine as my local pip installation can't find it. This is probably a local issue with my laptop as the issue goes away when I use a different machine.)
spi= pot.InterpSnapshotRZPotential(data_cut.s,rgrid=(np.log10(1e-4),np.log10(1e3),101),logR=True,zgrid=(-60.,60.,101),interpepifreq=True, interpverticalfreq=True,interpPot=True,zsym=False,enable_c=True,numcores=4)
Is the convention with the log grid correct here? I suspect as custom interpolated potentials are generally more detailed than fully analytical potentials, they require longer times to integrate orbits over - is this the case?
#Context:
I am aiming to distil a galaxy simulation (in this case AURIGA - built on GADGET) into a workable potential to calculate orbits via galpy. I have loaded in the galaxy box into pynbody, pre-processed it (cutting around the region of interest), and used galpy to produce a potential for the stellar disc using the snippet above (where data_cut.s is the trimmed stellar component of the trimmed data set). This works fine and I've pickled it using the method from the discussion in #507. I have since unpickled it and loaded it into a separate script for the orbits. The orbits themselves aren't anything fancy, as I just wanted to get the basic foundation functional. I compared the included MWPotential2014 against "spi" potential produced above. The former runs in <1s, whilst the latter can take up to 20-30s per orbit - with the same input parameters. Producing the rotation curve alone can also take some time.
For the DM and Gas components of the galaxy, I originally used a SCF profile for their potentials. However, when compared to the rotation curves produced directly in pynbody, they were off - which I guess was expected as the SCF reflected a Hernquist potential whilst the galaxy's DM for example was more akin to a NFW profile. I have since switched these two similar interpolations as the stellar case above. Stacking the potentials doesn't seem to change the speed of the orbits. The rotation curves are more akin to what pynbody reports too.
For reference: Each component has few x 10-100 x 10^6 particles that are being passed through the interpolation script.
Beta Was this translation helpful? Give feedback.
All reactions