pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.06k stars 292 forks source link

(land_water_mask) variable is not among the available datasets #1557

Open anikfal opened 3 years ago

anikfal commented 3 years ago

One of the variables inside a VIIRS datafile is land_water_mask, which is missing in the available datasets:

from satpy.scene import Scene
scn = Scene(reader='viirs_l1b', filenames=["VNP03IMG_NRT.A2021024.0848.001.nc"])
print(scn.all_dataset_names())

Output:

['DNB', 'I01', 'I02', 'I03', 'I04', 'I05', 'M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12', 'M13', 'M14', 'M15', 'M16', 'dnb_lat', 'dnb_lon', 'dnb_lunar_zenith_angle', 'dnb_moon_illumination_fraction', 'dnb_solar_zenith_angle', 'i_lat', 'i_lon', 'i_satellite_azimuth_angle', 'i_satellite_zenith_angle', 'i_solar_azimuth_angle', 'i_solar_zenith_angle', 'm_lat', 'm_lon', 'satellite_azimuth_angle', 'satellite_zenith_angle', 'solar_azimuth_angle', 'solar_zenith_angle']

I want to apply land_water_mask on the output maps, but cannot even load it.

djhoese commented 3 years ago

The datasets for the VIIRS L1b reader are manually configured (as opposed to automatically discovered) here: https://github.com/pytroll/satpy/blob/master/satpy/etc/readers/viirs_l1b.yaml

I was not aware they had a land_water_mask. What does the ncdump -h look like for the land_water_mask variable? If you'd like to make the dataset available then a pull request would be welcome.

djhoese commented 3 years ago
        ubyte land_water_mask(number_of_lines, number_of_pixels) ;
                land_water_mask:long_name = "Land/Water mask at pixel locations" ;
                land_water_mask:_FillValue = 255UB ;
                land_water_mask:flag_values = 0UB, 1UB, 2UB, 3UB, 4UB, 5UB, 6UB, 7UB ;
                land_water_mask:flag_meanings = "Shallow_Ocean Land Coastline Shallow_Inland Ephemeral Deep_Inland Continental Deep_Ocean" ;

Nevermind, found it in my own files. A pull request would still be welcome to add the ability to load this.