Are hsd data scaled by geocat tools?

Post Reply
laetis
Posts: 2
Joined: Tue Aug 29, 2023 7:03 am

Are hsd data scaled by geocat tools?

Post by laetis »

Hi,
I downloaded the CSSP-geocat scripts to convert hsd himawari-9 files to netcdf files. When I look at the resulting file I am a bit puzzled. The meta data seems to indicate integers pixelated data that need to be scales, a scaling factor and offset is given. However when looking at the values, they seem already scaled.
Here what I have when exploring the L1 nc files geocat as produced:

Code: Select all

<class 'netCDF4._netCDF4.Variable'>
int16 himawari_9_ahi_channel_11_brightness_temperature(lines, elements)
    _FillValue: -32768
    add_offset: 275.00000000000006
    algorithm_index: 32
    algorithm_name: NA
    algorithm_version: NA
    long_name: pixel-resolution array of brightness temperatures for channel 11 from himawari_9_ahi
    reference: all data are referenced to the instrument-native channels
    scale_factor: 0.003204443494979705
    scaling_method: 1
    units: K
    valid_max: 32767
    valid_min: -32767
    valid_range: [-32767  32767]
unlimited dimensions: 
current shape = (5500, 5500)
There is a scale factor, an offset and values are expected between -32767 and 32767.
If I print the value of the data in this field, I have:

Code: Select all

array([187.20786157, 187.70775475, 187.9544969 , ..., 313.40525529,
       313.53984191, 313.65520188])
which seems already scaled. Moreover, if I wanted to rescale this data, the range of the data would then be [ 275.6 276]. It's not making much sense.
I would, however, very much to be certain that the data produce by geocat are already scale beside what is printed in the meta data. Could someone confirm that?

Thank you very much

Best
kathys
Posts: 500
Joined: Tue Jun 22, 2010 4:51 pm

Re: Are hsd data scaled by geocat tools?

Post by kathys »

Hello,

If you are using a python shell to inspect the values, then python NetCDF4 applies the scale_factor and add_offset automatically and presents the data as already rescaled. If you do not want this to happen, you can get the unaltered values by using the following command:

src_var_obj.set_auto_maskandscale(False)

Let us know if you have any more questions,

Kathy
laetis
Posts: 2
Joined: Tue Aug 29, 2023 7:03 am

Re: Are hsd data scaled by geocat tools?

Post by laetis »

Hello,

thank you very much for this answer. I was indeed using python and I had no idea it was auto scaling! First time using this lib... should have read the doc better....

Best
Post Reply