Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VIIRS EDR reader #626

Merged
merged 10 commits into from
Aug 18, 2023
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def setup(app):
"readers/viirs_edr_active_fires.rst",
"readers/viirs_l1b.rst",
"readers/viirs_sdr.rst",
"readers/viirs_edr.rst",
"readers/virr_l1b.rst",
"verification/modis_verification.rst",
"verification/viirs_verification.rst",
Expand Down
1 change: 1 addition & 0 deletions doc/source/readers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ using the ``--list-products`` option.
:polar2grid:acspo
:polar2grid:clavrx
:polar2grid:viirs_edr_active_fires
:polar2grid:viirs_edr
:polar2grid:mersi2_l1b
:geo2grid:abi_l1b
:geo2grid:abi_l2_nc
Expand Down
32 changes: 32 additions & 0 deletions doc/source/readers/viirs_edr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
VIIRS EDR Reader
================

.. automodule:: polar2grid.readers.viirs_edr
:noindex:

Command Line Arguments
----------------------

.. argparse::
:module: polar2grid.readers.viirs_edr
:func: add_reader_argument_groups
:prog: polar2grid.sh -r viirs_edr -w <writer>
:passparser:

Examples:

.. code-block:: bash

polar2grid.sh -r viirs_edr -w geotiff -f <path to files>/<list of files>

polar2grid.sh -r viirs_edr -w geotiff -h

polar2grid.sh -r viirs_edr -w geotiff --list-products -f ../edr/*.h5

polar2grid.sh -r viirs_edr -w geotiff -p true_color_surf false_color_surf --num-workers 8 --no-tiled -f ../edr/*.h5


Product Explanation
-------------------

TODO
2 changes: 1 addition & 1 deletion doc/source/readers/viirs_sdr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Examples:

polar2grid.sh -r viirs_sdr -w geotiff --fill-value 0 -f ../sdr/*.h5

polar2grid.sh -r viirs_sdr -w geotiff -p true_color false_color --num-workers 8 --tiled -f ../sdr/*.h5
polar2grid.sh -r viirs_sdr -w geotiff -p true_color false_color --num-workers 8 --no-tiled -f ../sdr/*.h5

polar2grid.sh -r viirs_sdr -w awips_tiled -p i04 adaptive_dnb dynamic_dnb --awips-true-color --awips-false-color --sza-threshold=90.0 --letters --compress --sector-id Polar -g polar_alaska_1km --dnb-saturation-correction -f <path to files>

Expand Down
95 changes: 75 additions & 20 deletions etc/enhancements/abi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,46 +32,101 @@ enhancements:
kwargs: {stretch: 'crude', min_stretch: 280., max_stretch: 180.}

# Level 2
aerosol_optical_depth:
name: AOD
cloud_top_height:
name: HT
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: 0.0
max_value: 1.0
min_value: -300
max_value: 20000

cloud_top_height:
name: HT
cloud_top_temperature:
name: TEMP
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: -300
max_value: 20000

land_surface_temp:
min_value: 300
max_value: 200
lst:
name: LST
sensor: abi
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
method: !!python/name:polar2grid.enhancements.colorize
kwargs:
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: 223.15
max_value: 323.15
# AWIPS "VTRSB.cmap"
- min_value: 223.15
max_value: 429.15
values: [
0.0,
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1.0,
]
colors: [
[0.0, 0.0, 0.0],
[0.5, 0.0, 1.0],
[0.0, 0.0, 1.0],
[0.0, 0.5, 1.0],
[0.0, 1.0, 1.0],
[0.0, 1.0, 0.5],
[0.0, 1.0, 0.0],
[0.5, 1.0, 0.0],
[1.0, 1.0, 0.0],
[1.0, 0.5, 0.0],
[1.0, 0.0, 0.0],
]
color_scale: 1.0

cloud_top_temperature:
name: TEMP
aod:
name: AOD
sensor: abi
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
method: !!python/name:polar2grid.enhancements.colorize
kwargs:
# AWIPS "VTRSB.cmap"
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: 300
max_value: 200
- min_value: 0.0
max_value: 1.0
values: [
0.0,
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1.0,
]
colors: [
[0.0, 0.0, 0.0],
[0.5, 0.0, 1.0],
[0.0, 0.0, 1.0],
[0.0, 0.5, 1.0],
[0.0, 1.0, 1.0],
[0.0, 1.0, 0.5],
[0.0, 1.0, 0.0],
[0.5, 1.0, 0.0],
[1.0, 1.0, 0.0],
[1.0, 0.5, 0.0],
[1.0, 0.0, 0.0],
]
color_scale: 1.0
9 changes: 9 additions & 0 deletions etc/enhancements/generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ enhancements:
- name: gamma
method: !!python/name:satpy.enhancements.gamma
kwargs: {gamma: 2.0}
surface_reflectance_default:
standard_name: surface_bidirectional_reflectance
operations:
- name: linear_stretch
method: !!python/name:satpy.enhancements.stretch
kwargs: {stretch: 'crude', min_stretch: 0.0, max_stretch: 100.}
- name: gamma
method: !!python/name:satpy.enhancements.gamma
kwargs: {gamma: 2.0}
day_night_mix:
standard_name: day_night_mix
operations:
Expand Down
175 changes: 175 additions & 0 deletions etc/enhancements/viirs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,178 @@ enhancements:
# name: WaterDetection
# sensor: viirs
# operations: {}

veg_index:
standard_name: normalized_difference_vegetation_index
sensor: viirs
operations:
- name: colorize
method: !!python/name:polar2grid.enhancements.colorize
kwargs:
palettes:
- {
values: [
0.00000,
0.06000,
0.06001,
0.29210,
0.29211,
0.35000,
0.35001,
0.40999,
0.41000,
0.47000,
0.47001,
0.52700,
0.52701,
0.58600,
0.58601,
0.64500,
0.64501,
0.70400,
0.70401,
0.76200,
0.76201,
0.81000,
0.81001,
0.88000,
0.88001,
0.93900,
0.93901,
0.99599,
0.99600,
1.00000,
],
colors: [
[235,235,235,255],
[235,235,235,255],
[202,108,32,255],
[255,222,104,255],
[126,156,44,255],
[126,156,44,255],
[150,182,19,255],
[150,182,19,255],
[117,170,0,255],
[117,170,0,255],
[103,161,0,255],
[103,161,0,255],
[82,148,0,255],
[82,148,0,255],
[61,134,1,255],
[61,134,1,255],
[28,115,1,255],
[28,115,1,255],
[0,95,1,255],
[0,95,1,255],
[0,72,0,255],
[0,72,0,255],
[2,55,1,255],
[2,55,1,255],
[0,41,1,255],
[0,41,1,255],
[1,19,1,255],
[1,19,1,255],
[235,235,235,255],
[0,0,0,255],
]
}

vlst:
name: VLST
sensor: viirs
operations:
- name: colorize
method: !!python/name:polar2grid.enhancements.colorize
kwargs:
palettes:
# AWIPS "VTRSB.cmap"
- min_value: 223.15
max_value: 429.15
values: [
0.0,
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1.0,
]
colors: [
[0.0, 0.0, 0.0],
[0.5, 0.0, 1.0],
[0.0, 0.0, 1.0],
[0.0, 0.5, 1.0],
[0.0, 1.0, 1.0],
[0.0, 1.0, 0.5],
[0.0, 1.0, 0.0],
[0.5, 1.0, 0.0],
[1.0, 1.0, 0.0],
[1.0, 0.5, 0.0],
[1.0, 0.0, 0.0],
]
color_scale: 1.0

aod550:
name: AOD550
sensor: viirs
operations:
- name: colorize
method: !!python/name:polar2grid.enhancements.colorize
kwargs:
# AWIPS "VTRSB.cmap"
palettes:
- min_value: 0.0
max_value: 1.0
values: [
0.0,
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1.0,
]
colors: [
[0.0, 0.0, 0.0],
[0.5, 0.0, 1.0],
[0.0, 0.0, 1.0],
[0.0, 0.5, 1.0],
[0.0, 1.0, 1.0],
[0.0, 1.0, 0.5],
[0.0, 1.0, 0.0],
[0.5, 1.0, 0.0],
[1.0, 1.0, 0.0],
[1.0, 0.5, 0.0],
[1.0, 0.0, 0.0],
]
color_scale: 1.0

cloud_top_height:
name: CldTopHght
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: -300
max_value: 20000

cloud_top_temperature:
name: CldTopTemp
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
palettes:
- filename: colormaps/abi_l2_modified_cloud_top.cmap
min_value: 300
max_value: 200
2 changes: 1 addition & 1 deletion polar2grid/add_coastlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def _get_colormap_object(input_tiff, num_bands, cmin, cmax):
if num_bands in (3, 4) and colormap_csv is None:
raise ValueError("RGB and RGBA geotiffs must have a colormap " "specified with '--colorbar-colormap-file'.")
if num_bands in (3, 4) or colormap_csv is not None:
cmap = Colormap.from_file(colormap_csv)
cmap = Colormap.from_string(colormap_csv)
vmin, vmax = _get_colorbar_vmin_vmax(cmin, cmax, metadata, input_dtype)
cmap = cmap.set_range(vmin, vmax, inplace=False)
return cmap
Expand Down
Loading
Loading