desihub / desiutil

General DESI utilities, shell scripts, desiInstall, etc.
BSD 3-Clause "New" or "Revised" License
3 stars 9 forks source link

annotate_fits warning about overriding units that aren't changing #210

Open sbailey opened 2 months ago

sbailey commented 2 months ago

When running annotate_fits on a file that already has units (e.g. to fill in missing units and/or to update columns), it reports warnings like:

WARNING:annotate.py:437:annotate_fits: Overriding units for column 'FLUX_G': 'nanomaggy' -> 'nanomaggy'.
WARNING:annotate.py:437:annotate_fits: Overriding units for column 'FLUX_R': 'nanomaggy' -> 'nanomaggy'.
WARNING:annotate.py:437:annotate_fits: Overriding units for column 'FLUX_Z': 'nanomaggy' -> 'nanomaggy'.
WARNING:annotate.py:437:annotate_fits: Overriding units for column 'FLUX_W1': 'nanomaggy' -> 'nanomaggy'.
WARNING:annotate.py:437:annotate_fits: Overriding units for column 'FLUX_W2': 'nanomaggy' -> 'nanomaggy'.

In this case, the overridden unit is identical to the unit that is already there and shouldn't generate a warning. This should only be a warning if it is overriding it to something different.

I think this is a simple fix, but I'm filing a ticket to remember to do this later.