ossama-othman / MaRC

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

Blank integer value not propagated to map #94

Closed ossama-othman closed 5 years ago

ossama-othman commented 6 years ago

Describe the bug The MaRC input file DATA_BLANK value is not propagated to the code that creates and initializes the map image array when creating integer typed maps. That initialization code currently uses a default value of zero for all areas of the map that haven't been plotted:

template <typename T>
MaRC::MapFactory::map_type<T>
MaRC::MapFactory::make_map(plot_info const & info,
                           std::size_t samples,
                           std::size_t lines)
{
    map_type<T> map(samples * lines, Map_traits<T>::empty_value());
    ...
}

In some cases zero is a valid physical value. Since the blank value is not propagated, it is not always possible to distinguish between actual blank areas of the map and those with valid physical values of zero.

To Reproduce Steps to reproduce the behavior:

  1. Create a map with a MaRC input file like the following:

    MAP:    test_map4.fits
        BODY:   Jupiter
                EQ_RAD:         71492
                POL_RAD:        66854
                ROTATION:       PROGRADE
        DATA_TYPE:              SHORT
        DATA_BLANK:             -32768
        GRID:                   NO
        TYPE:                   SIMPLE_C
        SAMPLES:        500
        LINES:          250
    
        PLANE:
            DATA_MIN: 0
                MU:     SUB_OBSERV_LAT:         -25 C
                        SUB_OBSERV_LON:         214.54 E
                        RANGE:                  1210332.1 KM

The blank areas will contain zero even though the DATA_BLANK value is non-zero in the MaRC input file, as well has having the same non-zero BLANK value in the generated map FITS file.

Expected behavior Blank values in integer typed maps should contain the DATA_BLANK value specified in the MaRC input file, which could be non-zero.

Desktop (please complete the following information):