-
Notifications
You must be signed in to change notification settings - Fork 16
ValueError in finalize_catalog() when only one hpix #99
Copy link
Copy link
Open
Description
When I run finalize_catalog() but there is only one hpix (i.e. one foo_hpix.fit) I get the issue
Traceback (most recent call last):
File "/pbs/throng/lsst/users/rsolomon/redmapper/data_prep/lib/createPixFilesParr_GCR.py", line 148, in <module>
maker.finalize_catalog()
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/redmapper/galaxy.py", line 889, in finalize_catalog
tab.to_fits_file(self.filename, header=hdr, clobber=True)
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/redmapper/catalog.py", line 146, in to_fits_file
fitsio.write(filename, temp_array, clobber=clobber, header=header, extname=extname)
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/fitsio/fitslib.py", line 409, in write
fits.write(
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/fitsio/fitslib.py", line 761, in write
self.write_table(data, units=units,
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/fitsio/fitslib.py", line 1182, in write_table
self[-1].write(data, names=names)
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/fitsio/hdu/table.py", line 291, in write
self._verify_column_data(tcolnum, tdata)
File "/sps/lsst/users/rsolomon/conda_envs/redmapper/lib/python3.11/site-packages/fitsio/hdu/table.py", line 417, in _verify_column_data
raise ValueError(
ValueError: bad input shape for column 'filenames': expected '(1,)', got '()'
Seems like a list of foo_hpix.fit file names is expected but if there is only one hpix then it does not receive a list and breaks.
This is easy enough to ignore in cosmoDC2 since the footprint is in hpix format but DP0.2 is trickier and would require really high resolution to avoid this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels