tardis-sn/carsus

Consistent units in GFALL, Chianti and CMFGEN readers

Closed this issue · 1 comments

Description

This is not a bug, results are ok (but could be confusing).

Wavelength units are not consistent in GFALLReader and ChiantiReader.

In carsus/io/output/base.py:

        lines.loc[gfall_mask, 'wavelength'] = lines.loc[
            gfall_mask, 'wavelength'].apply(lambda x: x*u.nm)
        lines.loc[chianti_mask, 'wavelength'] = lines.loc[
            chianti_mask, 'wavelength'].apply(lambda x: x*u.angstrom)
        lines['wavelength'] = lines['wavelength'].apply(
            lambda x: x.to('angstrom'))
        lines['wavelength'] = lines['wavelength'].apply(lambda x: x.value)

... we can see GFALLReader stores wavelength in nm and ChiantiReader in AA. Then every line is stored in AA in TARDISAtomData object.

Since ChiantiReader (and later CMFGENReader) are tailored to mimic GFALLReader class, should store data in the same units for simplicity.

Done - commit: 8eb730a