Skip to content

astroquery.mast Catalogs: HSC spectra downloaded with incorrect filename  #2182

@jaymedina

Description

@jaymedina

While writing my unit tests for Catalogs I found a bug in Catalogs.download_hsc_spectra that's due to a small typo on Line 471:

local_path = os.path.join(base_dir, "{spec['DatasetName']}.fits")
. Basically all the files are downloaded with the name {spec['DatasetName']}.fits instead of with the observation's unique dataset name. See below:

In [46]: table[1]['DatasetName']
Out[46]: 'HAG_J072655.69+691648.9_J8HPAOZMQ_V01.SPEC1D'

In [47]: r = Catalogs.download_hsc_spectra(table[1])
Downloading URL https://hla.stsci.edu/cgi-bin/ecfproxy?file_id=spec["DatasetName"].fits to ./mastDownload/HSC/{spec['DatasetName']}.fits ...
|=======================================================================|  37 / 37  (100.00%)         0s

In [48]: ls ./mastDownload/HSC/
{spec['DatasetName']}.fits

The fix is quick. Just fixing a string formatting typo on what is currently Line 471. PR will be linked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions