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

Adding HAPCut functionality to astroquery.mast.Cutouts tool #2613

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

jaymedina
Copy link
Contributor

@jaymedina jaymedina commented Nov 28, 2022

This PR will expand astroquery.mast's cutout functionality to support making Hubble Advanced Products (HAP) cutouts via MAST's HAPCut API.

! Timeline: ASAB would like to see this merged before the end of Q1. Ideally before Dec 21st if possible.

Changes include:

  • New HapcutClass in cutouts.py
  • Unit testing for HapcutClass
  • Updated documentation for HapcutClass functionality
  • Updated release notes

Example download_cutouts call with sample cutout shown:

image

Example get_cutouts call with sample cutout shown

(default cutout size is 5 x 5 pixels):

image

@jaymedina jaymedina marked this pull request as draft November 28, 2022 14:21
@codecov
Copy link

codecov bot commented Nov 28, 2022

Codecov Report

Merging #2613 (10f335e) into main (5057cbc) will decrease coverage by 4.64%.
The diff coverage is 14.54%.

❗ Current head 10f335e differs from pull request most recent head e773121. Consider uploading reports for the commit e773121 to get more accurate results

@@            Coverage Diff             @@
##             main    #2613      +/-   ##
==========================================
- Coverage   68.82%   64.17%   -4.65%     
==========================================
  Files         294      130     -164     
  Lines       22215    16891    -5324     
==========================================
- Hits        15289    10840    -4449     
+ Misses       6926     6051     -875     
Impacted Files Coverage Δ
astroquery/mast/cutouts.py 65.38% <14.54%> (-13.64%) ⬇️
astroquery/heasarc/core.py 73.79% <0.00%> (-1.70%) ⬇️
astroquery/mast/__init__.py
astroquery/ibe/__init__.py
astroquery/astrometry_net/__init__.py
astroquery/dace/__init__.py
astroquery/vo_conesearch/__init__.py
astroquery/esa/iso/tests/test_iso.py
astroquery/utils/tap/conn/tests/test_conn.py
astroquery/esa/iso/tests/setup_package.py
... and 157 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jaymedina jaymedina self-assigned this Nov 30, 2022
@jaymedina jaymedina marked this pull request as ready for review December 5, 2022 15:35
@jaymedina
Copy link
Contributor Author

This question came up during one of our stand-ups: When will the next release of astroquery be?

@bsipocz
Copy link
Member

bsipocz commented Dec 6, 2022

The next tagged release is not planned before we finish most of the API cleanups we planned to do, so maybe Q1 (calendar year) next year. In the meantime I can push dev releases to pypi without any problems.

@bsipocz bsipocz added this to the v0.4.7 milestone Dec 6, 2022
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 have some big picture comments, which certainly points beyond this current PR.:

  • I wonder at what point will it make sense to make a generic mast.Cutout class, that takes the coordinate and returns all available cutouts, or maybe also takes a missing name? Even if it's not exposed to the public API, I think we reached a point where having mast cutout base class would be beneficial as some of the methods share significant amount of code (e.g. enhancements and bugfixes, or any maintenance will be easier with a baseclass).

Otherwise I have minor comments, so would only like to see a few small things to be fixed.

docs/mast/mast.rst Show resolved Hide resolved
docs/mast/mast.rst Show resolved Hide resolved
docs/mast/mast.rst Outdated Show resolved Hide resolved
@@ -1120,6 +1120,62 @@ To list the available deep field surveys at a particular location there is `~ast
['candels_gn_60mas', 'candels_gn_30mas', 'goods_north']


HAPCut
Copy link
Member

Choose a reason for hiding this comment

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

side note: the doctest are failing in an earlier example, so these has not been run during my testing

astroquery/mast/cutouts.py Show resolved Hide resolved
astroquery/mast/cutouts.py Outdated Show resolved Hide resolved
astroquery/mast/cutouts.py Outdated Show resolved Hide resolved
astroquery/mast/cutouts.py Show resolved Hide resolved
astroquery/mast/tests/test_mast_remote.py Show resolved Hide resolved
astroquery/mast/tests/test_mast_remote.py Show resolved Hide resolved
@jaymedina
Copy link
Contributor Author

jaymedina commented Dec 6, 2022

I wonder at what point will it make sense to make a generic mast.Cutout class, that takes the coordinate and returns all available cutouts, or maybe also takes a missing name? Even if it's not exposed to the public API, I think we reached a point where having mast cutout base class would be beneficial as some of the methods share significant amount of code (e.g. enhancements and bugfixes, or any maintenance will be easier with a baseclass).

This has actually been a topic of discussion recently, and we do have plans to consolidate all the cutouts classes into a single mission-agnostic cutout tool. I'm not sure what the timeline will be on this, though. We have a few more things we want to update astroquery.mast.Cutouts with, including updating TesscutClass with support for a high level science product called TICA, as well as pointing Cutouts to the cloud, so consolidating all the classes into one will likely happen after that.

@bsipocz
Copy link
Member

bsipocz commented Dec 6, 2022

This has actually been a topic of discussion recently ...

Sounds all great. It certainly points beyond this current PR, and any timeline will work that works for you.
Also re: cloud - as part of fornax (so mast is in the know), we're factoring out the cloud download logic from the mast module and upstream it into pyvo for a more generic audience, so it would be useful to communicate any plans for enhancements if it affects the bottom infrastructure.

@jaymedina
Copy link
Contributor Author

Good to know, I'll relay this to the team

@bsipocz
Copy link
Member

bsipocz commented Dec 6, 2022

Could you squash out some of the later debugging/incremental commits? I plan to come back and go through it again in the evening, but don't think there is any more things to address for merge.

@jaymedina
Copy link
Contributor Author

Yeah, I'm waiting for a science review on this from one group, once I hear back from them I'll squash this down so it's ready for merge.

@jaymedina
Copy link
Contributor Author

Squashed! @bsipocz

@bsipocz
Copy link
Member

bsipocz commented Dec 13, 2022

Thanks! No need to squash to one, it's really more about keeping the incremental fixes at the later parts into more logical chunks.
Either way, this is now good to go and I'll do it later today, but first will reuse a PR for an experiment for the gh command line client.

@bsipocz bsipocz merged commit 608e9ec into astropy:main Dec 20, 2022
@bsipocz
Copy link
Member

bsipocz commented Dec 20, 2022

Thank you @jaymedina!

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.

2 participants