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
Staeckelecc - documentation and no_median #330
Conversation
…s (rather than median)
…haracterization, and updated the Dierickx et al. example
Codecov Report
@@ Coverage Diff @@
## staeckelecc #330 +/- ##
===============================================
+ Coverage 99.78% 99.78% +<.01%
===============================================
Files 128 128
Lines 21908 21910 +2
===============================================
+ Hits 21860 21862 +2
Misses 48 48
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ted,
This all looks great! I made a bunch of small comments and a bigger one about the test. But I think this is very close. I'll leave the PR open for now in case we want to change something else.
@@ -0,0 +1,192 @@ | |||
import os, os.path | |||
import pexpect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually used? Doesn't seem to be a standard library module, so users would have to install it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think that got left in there from an earlier version i was tinkering with - can definitely be thrown out!
tests/test_actionAngle.py
Outdated
#and the individual ones | ||
indiv = numpy.array([estimateDeltaStaeckel(MWPotential2014, o.R(ts[i]), o.z(ts[i])) for i in range(10)]) | ||
#check that values agree | ||
assert (numpy.fabs(nomed-indiv) < 1e10).all(), 'no_median option returns different values to individual Delta estimation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good test, but I think it should be 1e-10
rather than 1e10
!
doc/source/orbit.rst
Outdated
for the appoximation of actions in axisymmetric potentials), without performing any orbit integration. | ||
The method uses the geometry of the orbit tori to estimate the orbit parameters. After initialising | ||
an ``Orbit`` instance, this is done (as in the previous section) specifying ``analytic=True`` and | ||
selecting ``type='staeckel'`` (default in vX.X of galpy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the
(default in vX.X of galpy)
The documentation online is automatically the right one for this version)
doc/source/orbit.rst
Outdated
|
||
Fast orbit characterization | ||
----------------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere early in this section need to say that this is from Mackereth & Bovy (2018, in prep) which we will later replace with the link. Don't want people to just cite Binney's paper!
doc/source/orbit.rst
Outdated
|
||
>>> o.e(analytic=True, type='staeckel', pot=mp) | ||
|
||
again, where ``mp`` is the Miyamoto-Nagai potential of :ref:`Introduction: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be nitpicking, but this mp
has already been defined earlier in this page, so we can just assume that the user has done that (just like the o
object itself)
doc/source/orbit.rst
Outdated
>>> o.e(analytic=True, type='staeckel', pot=mp) | ||
|
||
again, where ``mp`` is the Miyamoto-Nagai potential of :ref:`Introduction: | ||
Rotation curves <rotcurves>`. This interface automatically computes the necessary Delta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
estimates rather than computes? Also 'delta' rather than 'Delta', because the actual keyword is delta
doc/source/orbit.rst
Outdated
``phi`` for the objects. We can then optionally estimate the individual Delta parameter | ||
for these phase-space points using | ||
|
||
>>> from galpy.actionAngle import estimateDeltaStaeckel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to later so that the logical flow is
- Use actionAngleStaeckel for arrays
- Default of that is to use a constant delta --> show example where aAS= defined using single delta and then used
- Point out that you can give
EccZmaxRperiRap
an array which can be computed usingestimateDeltaStaeckel
doc/source/orbit.rst
Outdated
the estimation at each point. This method is also applicable in the ``actionAngleIsochrone``, | ||
``actionAngleSpherical``, and ``actionAngleAdiabatic`` modules. This method returns parameters at | ||
speeds as fast as 3 microseconds per object. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really 3 microseconds? You could put an example with timeit
to explicitly show this (so people can easily test this themselves)
Can we also add an example of using the actionAngleStaeckelGrid approach and how fast that is?
doc/source/orbit.rst
Outdated
.. _fastchar: | ||
|
||
Fast orbit characterization | ||
----------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My sphinx build complains that the --- aren't long enough (they need to extend at least as far as the title)
|
||
We then find the following eccentricity distribution (from the numerical eccentricities) | ||
|
||
.. image:: images/dierickx-integratedehist.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This figure is enormous on my screen, maybe we should make it smaller? I think you can add
:scale: 50 %
or similar. Same for the figures below.
…tatement from dierickx_eccentricities
Thanks, this all looks good now. I made some more small changes to the documentation, but I'm having problems pushing them to your branch. Did you click the option "Allow commits from maintainer" in the PR? |
Thanks! Yes, i just checked and that option is on, so I'm not sure what the problem is there? |
Thanks for checking! I figured it out, for some reason git wasn't allowing me to push to your fork's |
One more thing, could you add an entry in the |
Added documentation for new analytic orbit parameters and EccZmaxRperiRap actionAngle method.
Also added no_median option to estimateDeltaStaeckel with relevant tests.