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

Staeckelecc - documentation and no_median #330

Merged
merged 8 commits into from Jan 24, 2018

Conversation

jmackereth
Copy link
Contributor

Added documentation for new analytic orbit parameters and EccZmaxRperiRap actionAngle method.

Also added no_median option to estimateDeltaStaeckel with relevant tests.

@coveralls
Copy link

coveralls commented Jan 4, 2018

Coverage Status

Coverage increased (+2.0e-05%) to 99.782% when pulling c1bb5bd on jmackereth:staeckelecc into 549508a on jobovy:staeckelecc.

@codecov-io
Copy link

codecov-io commented Jan 4, 2018

Codecov Report

Merging #330 into staeckelecc will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           staeckelecc     #330      +/-   ##
===============================================
+ Coverage        99.78%   99.78%   +<.01%     
===============================================
  Files              128      128              
  Lines            21908    21910       +2     
===============================================
+ Hits             21860    21862       +2     
  Misses              48       48
Impacted Files Coverage Δ
galpy/actionAngle_src/actionAngleStaeckel.py 98.92% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 549508a...7ee8a83. Read the comment docs.

Copy link
Owner

@jobovy jobovy left a 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
Copy link
Owner

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.

Copy link
Contributor Author

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!

#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'
Copy link
Owner

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!

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).
Copy link
Owner

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)


Fast orbit characterization
-----------------------

Copy link
Owner

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!


>>> o.e(analytic=True, type='staeckel', pot=mp)

again, where ``mp`` is the Miyamoto-Nagai potential of :ref:`Introduction:
Copy link
Owner

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)

>>> 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
Copy link
Owner

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

``phi`` for the objects. We can then optionally estimate the individual Delta parameter
for these phase-space points using

>>> from galpy.actionAngle import estimateDeltaStaeckel
Copy link
Owner

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

  1. Use actionAngleStaeckel for arrays
  2. Default of that is to use a constant delta --> show example where aAS= defined using single delta and then used
  3. Point out that you can give EccZmaxRperiRap an array which can be computed using estimateDeltaStaeckel

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.

Copy link
Owner

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?

.. _fastchar:

Fast orbit characterization
-----------------------
Copy link
Owner

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
Copy link
Owner

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.

@coveralls
Copy link

coveralls commented Jan 5, 2018

Coverage Status

Coverage increased (+2.0e-05%) to 99.782% when pulling 9b541b9 on jmackereth:staeckelecc into 549508a on jobovy:staeckelecc.

@coveralls
Copy link

Coverage Status

Coverage decreased (-13.5%) to 86.233% when pulling 9b541b9 on jmackereth:staeckelecc into 549508a on jobovy:staeckelecc.

@jobovy
Copy link
Owner

jobovy commented Jan 5, 2018

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?

@jmackereth
Copy link
Contributor Author

Thanks! Yes, i just checked and that option is on, so I'm not sure what the problem is there?

@jobovy
Copy link
Owner

jobovy commented Jan 5, 2018

Thanks for checking! I figured it out, for some reason git wasn't allowing me to push to your fork's staeckelecc from a branch that wasn't called staeckelecc itself (I had your changes in jmackereth-staeckelecc).

@jobovy
Copy link
Owner

jobovy commented Jan 5, 2018

One more thing, could you add an entry in the HISTORY.txt file about the no_median change and add yourself to the AUTHORS.txt? Please include [ci skip] in the commit messages for those changes; this causes the test suite to not be rerun.

@coveralls
Copy link

coveralls commented Jan 8, 2018

Coverage Status

Coverage increased (+2.0e-05%) to 99.782% when pulling 7ee8a83 on jmackereth:staeckelecc into 549508a on jobovy:staeckelecc.

@jobovy jobovy merged commit 653f00f into jobovy:staeckelecc Jan 24, 2018
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

Successfully merging this pull request may close these issues.

None yet

4 participants