ossama-othman / MaRC

MaRC - Map Reprojections and Conversions
GNU Lesser General Public License v2.1
1 stars 0 forks source link

User-specified DATA_MIN/MAX not scaled in virtual images. #110

Open ossama-othman opened 4 years ago

ossama-othman commented 4 years ago

Describe the bug DATA_MIN and DATA_MAX values specified in a MaRC input file are not automatically scaled in virtual images like the actual physical data values. That could result in data not being mapped if the scaled physical data values are outside of the raw DATA_MIN and DATA_MAX values.

To Reproduce Steps to reproduce the behavior:

  1. Create a map using the something like the following MaRC input file:
    MAP:    test_map.fits
        BODY:   Venus
                POL_RAD:        6051.8
                EQ_RAD:         6051.8
                ROTATION:       RETROGRADE
        DATA_TYPE:              SHORT
        GRID:                   NO
        TYPE:                   SIMPLE_C
        SAMPLES:        25
        LINES:          25
        PLANE:
        DATA_MIN: -20
        DATA_MAX: 20
                LATITUDE : GRAPHIC
  2. Examine the generated map in the test_map.fits file. The map will contain all zeroes.

Expected behavior The generated map should contain values between -2000 and 2000, corresponding to automatically scaled values of -20 and 20 degrees respectively.

Screenshots Expected FITS DATAMIN and DATAMAX values:

DATAMIN =                -1439 / minimum valid physical data value
DATAMAX =                 1439 / maximum valid physical data value 

Actual FITS DATAMIN and DATAMAX values:

DATAMIN =                    0 / minimum valid physical data value
DATAMAX =                    0 / maximum valid physical data value 

Desktop (please complete the following information):

Additional context This problem was discovered when implementing automatic setting of DATAMIN/DATAMAX FITS card values in the map FITS file.