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
bsipocz
left a comment
There was a problem hiding this comment.
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.)
| >>> 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.
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'] |
|
|
||
| return files | ||
|
|
||
| def download_files_from_program(self, proposal_id, *, product_type=None, verbose=False): |
There was a problem hiding this comment.
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.
@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)