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

Cleanup light curve notebook (complete Issue #177) #198

Merged
merged 9 commits into from
Jan 11, 2024
Merged

Conversation

troyraen
Copy link
Contributor

@troyraen troyraen commented Jan 5, 2024

Closes #177

  • Change HEASARC_get_lightcurves to take a dict arg instead of two lists.
  • Change ZTF to use astropy for unit conversion and use a consistent name for the radius.
  • Remove unused files mast_functions.py and tde_functions.py.
  • Panstarrs remove try/except
  • TESS/Kepler
    • Clean up the try/except.
    • Iterate directly over the search results instead of an index.

Copy link
Contributor

@jkrick jkrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran it on the SMCE, and it runs fine to completion. Changes all look good to me. I wouldn't spend any more time on the MAST archive functions (TESS/Panstarrs/HCV), just because I expect these to change once MAST tells us how to best access their data at scale.

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run the code as I see that Jessica already did it. So just a few minor comments. None of them are critical, so take them or leave them.

generated by `make_VOTable` functiom
catalog_error_radii : dict
Catalogs to query and their corresponding max error radii. Dictionary key must be one of the tables listed
here: https://astroquery.readthedocs.io/en/latest/heasarc/heasarc.html#getting-list-of-available-missions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a little bit of inconsistency that the code uses pyvo yet refers to astroquery functionality to list the available missions.

(However this discrepancy should go away as the heasarc module is being reworked (yet I don't expect us to change back this code to use astroquery)

results = ps1cone(ra,dec,radius,release='dr2')
tab = ascii.read(results)
# see if there is an object in panSTARRS at this location. if not, continue to the next object.
results = ps1cone(ra,dec,radius,release='dr2')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low priority, but you may want to run flake8 (or autopep8) on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to do that I'd rather we do it on all the files at the same time, and do it in it's own PR so that it's easier to review.

results = ps1cone(ra,dec,radius,release='dr2')
if not results:
continue
tab = ascii.read(results)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not recommend using ascii directly, but staying with the higher level Table API. There maybe other occurrences, I haven't explicitly looked for them.

Suggested change
tab = ascii.read(results)
tab = Table.read(results, format='ascii')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, in general I'm a bit proponent of using full words for variables, even if they seem superfluous. This makes the code more accessible and readable. What about results_table = ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the occurrences of ascii.read to Table.read in this file.

I'm good with full words for variable names, but if we're going to start changing pre-existing names like this one I'd rather do it in a separate PR and review/update all the files at the same time.

@troyraen troyraen merged commit 6491ad0 into main Jan 11, 2024
1 check passed
@troyraen troyraen deleted the issues/177 branch January 11, 2024 07:58
github-actions bot pushed a commit that referenced this pull request Jan 11, 2024
Cleanup light curve notebook (complete Issue #177) 6491ad0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List of things to consider cleaning up in the light curve notebook
3 participants