-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Method to get all products by program id (proposal id) #3073
Method to get all products by program id (proposal id) #3073
Conversation
…align it with hubble Fix the position of the proposal_id mandatory argument in the method definition
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.
Looks good, thank you! I have just one minor suggestion for a nicer output for the user docs, but your code was in fact the right one that got returned (but as we ignore that output, I would suggest going with the nicer-looking version.)
docs/esa/jwst/jwst.rst
Outdated
>>> from astroquery.esa.jwst import Jwst | ||
>>> observation_list = Jwst.download_files_from_program(proposal_id='6651', product_type='preview') | ||
>>> print(observation_list) # doctest: +IGNORE_OUTPUT | ||
[np.str_('jw06651001001_05201_00001_nis'), np.str_('jw06651002001_05201_00001_nis')] |
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.
Interesting that the values come up wrapped in a np.str_
as opposed to be just strings, and thus leading to this somewhat ugly print as opposed to (of course looping through the values works nicely, but that would be uglier for the docs)
['jw06651001001_05201_00001_nis', 'jw06651002001_05201_00001_nis']
Maybe this can be have a look into sometimes in the future in JwstClass.get_decoded_string
?
And here, given that the output is already been ignored, I would suggest to format it nicely.
[np.str_('jw06651001001_05201_00001_nis'), np.str_('jw06651002001_05201_00001_nis')] | |
['jw06651001001_05201_00001_nis', 'jw06651002001_05201_00001_nis'] |
@@ -1035,6 +1035,40 @@ def get_obs_products(self, *, observation_id=None, cal_level="ALL", | |||
|
|||
return files | |||
|
|||
def download_files_from_program(self, proposal_id, *, product_type=None, verbose=False): |
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.
Ahh, one more nitpick: The same method in esa.hubble
has the signature:
def download_files_from_program(self, program, *, folder=None, calibration_level=None,
data_product_type=None, intent=None,
obs_collection=None, instrument_name=None,
filters=None, only_fits=False):
Would you mind making this consistent by using arg names program
instead of proposal_id
, and also maybe data_product_type
instead of product_type
? Though the latter doesn't seem to be exactly the same, consistency may be useful.
I'll also consider this as a follow-up item for a new PR, so will merge this as currently is.
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.
@davidglt - not sure you've seen this as I merged the PR as is, without waiting for an API cleanup discussion.
bb4600c
to
9c1fdf4
Compare
9c1fdf4
to
2019702
Compare
Method to get all products by program id (proposal id)