-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add method to read bright star catalog and find bright stars in sky region #1105
Add method to read bright star catalog and find bright stars in sky region #1105
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1105 +/- ##
==========================================
+ Coverage 84.48% 84.53% +0.05%
==========================================
Files 182 184 +2
Lines 11220 11274 +54
==========================================
+ Hits 9479 9531 +52
- Misses 1741 1743 +2
Continue to review full report at Codecov.
|
@@ -6,6 +6,7 @@ | |||
from .unstructured_interpolator import UnstructuredInterpolator | |||
from .datasets import (find_all_matching_datasets, get_table_dataset, get_dataset_path, | |||
find_in_path) | |||
from .astro import get_bright_stars |
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.
Add this method to __all__
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 is still missing!
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 is still missing!
Now added
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.
ok, so what's now missing is a test.
E.g. just loading the full catalog, loading a catalog with radius and pointing (e.g. pointing is crab and check that ceta tauri is there) and max magnitude (e.g. 3.5 and check that only zeta tauri is there)
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.
Thanks for all the changes! Looks good now. The only think missing is that it does not appear in the API documentation anywhere, so you need to add something to docs/ctapipe_api/utils/index.rst
(perhaps just a section on the new astro module and an automodapi
directive for it). The easiest thing is to add a docstring at the top of the astro.py
with some overall explaination of the module, and just add:
.. automodapi:: ctapipe.utils.astro
:no-inheritance-diagram:
under the "Reference/API" section of the index.rst.
Then run "make doc" to see if it looks ok.
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.
One more request: besides the documentation, you also need to add a unit test in utils/tests
. So far no test covers this function.
Sorry, one more thing. I have a distaste for submodules called utils . They tend to acquire random stuff over time. Is there a better place for this? E.g. the coordinates submodule? |
Fine with me, if you prefer (or any other place). In any case, my idea for an 'astro' submodule was to gather there all astronomy-related stuff (which astropy or other modules) can not provide. For example, I discussed with @noahhdf last week whether potentially this could also a place to add some dark-patch-finder or selector (according to day, moon distance,...) or similar helpers. But that's another story, of course. |
I build something like this some time ago for FACT using the hipparcos star catalogue, but haven't used it in at least two years since e don't do ratescans where the shifter selects the spot anymore. https://github.com/fact-project/darkspot It uses ephem and self coded transformation, wasn't used to astropy at the time. |
We can probably make another issue or PR to deprecate |
I updated ctapipe-extra and released a new package v0.2.18 that should work with your tests. Let's see if it works. |
Hi Karl, thanks a lot!
Any idea why it doesn't find the file? Thanks and cheers |
You need to increase the version number of ctapipe-extra in the |
yes, just update
That should fix it. |
clicked approve by mistake - please see comments
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.
use get_table_dataset()
(see comments above)
Once you update the yml files it should be fine. |
And I am just updating the API doc... |
Should be done now! |
You forgot the two other yaml files (py3.6 and py3.7), unfortunately we need all three of them |
Added! |
Codecov Report
@@ Coverage Diff @@
## master #1105 +/- ##
==========================================
+ Coverage 84.48% 85.67% +1.19%
==========================================
Files 182 185 +3
Lines 11220 11451 +231
==========================================
+ Hits 9479 9811 +332
+ Misses 1741 1640 -101
Continue to review full report at Codecov.
|
* upstream/master: Reduce numba signatures to improve import time (cta-observatory#1108) Remove unused utils (cta-observatory#1112) Add method to read bright star catalog and find bright stars in sky region (cta-observatory#1105) Add Fields to calibration containers (cta-observatory#1111) Reconstruction fix (also for Divergent Pointing) (cta-observatory#946) updated AUTHORS with latest mailmap
added a new 'astro' class in
ctapipe.utils
with aget_bright_stars()
method, which returns the Yale bright star catalog (read from ctapipe-extra) into an astropy table, or with argumentsget_bright_stars(pointing = astropy.SkyCoord(), radius = astropy.Angle(), magnitude_cut = float)
selects stars brighter than the chosen magnitude in a region of given radius around a sky position