radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
98 stars 65 forks source link

Read HISTORY from CASA log table #749

Open keflavich opened 3 years ago

keflavich commented 3 years ago

casaformatsio can read it: https://github.com/radio-astro-tools/casa-formats-io/issues/9

so we need to make that part of the header data

keflavich commented 2 years ago

Process ought to be:

import casa_formats_io
from astropy.table import Table
history = Table.read('G327.29_B6_spw1_12M_spw1.image/logtable')

...cube.hdulist[2] = history ....

We need either: (1) a history attribute that gets attached to the SpectralCube or (2) to convert the HISTORY to FITS HISTORY.

The latter requires less infrastructure but is going to be somewhat lossy.

keflavich commented 2 years ago

https://github.com/casacore/casacore/blob/dbf28794ef446bbf4e6150653dbe404379a3c429/fits/FITS/FITSHistoryUtil.cc is how CASA does it.