i4Ds / STIXCore

STIX Core functionalities
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

% Unit not deterministic written to FITS #268

Open nicHoch opened 2 years ago

nicHoch commented 2 years ago

Writing Data with unit "%" to FITS and reading back in will change the unit to '0.01' Depending on how often data was read/write to fits the actual unit might differ.

This could break the end2end test but should not be a reason to reject the PR as internally the both units are compatible

Maybe update astropy

   a: /tmp/pytest-of-nicky/pytest-862/origdata/solo_L1_stix-hk-maxi_20210628_V01.fits
   b: /tmp/pytest-of-nicky/pytest-862/L1/2021/06/28/HK/solo_L1_stix-hk-maxi_20210628_V01.fits
   Keyword(s) not to be compared:
    CHECKSUM DATASUM DATE HISTORY VERS_SW
   Maximum number of different data values to be reported: 10
   Relative tolerance: 0.0, Absolute tolerance: 0.0

  Extension HDU 2 (DATA, 1):

     Headers contain differences:
       Keyword COMMENT [146] has different values:
          a>   unit: '0.01'
           ?          ^^^^
          b>   unit: '%'
           ?          ^
       Keyword COMMENT [280] has different values:
          a>       unit: !astropy.units.Unit {unit: '0.01'}
           ?                                         ^^^^
          b>       unit: !astropy.units.Unit {unit: '%'}
           ?        
samaloney commented 1 year ago

There is now an upstream issue (astropy/astropy#14271) for this maybe we could just not use the percent unit for moment?

samaloney commented 1 month ago

Issue is still present upstream