From 75922eef5c2a33f5df3dafc261bb8e0ebce17558 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Mon, 24 Jul 2023 14:32:52 -0500 Subject: [PATCH 01/10] Add VIIRS EDR surface reflection to generic enhancements --- etc/enhancements/generic.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etc/enhancements/generic.yaml b/etc/enhancements/generic.yaml index e431a72e..da037928 100644 --- a/etc/enhancements/generic.yaml +++ b/etc/enhancements/generic.yaml @@ -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: From f6b5b4ce216447591af878d8777dc44699c832bc Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 8 Aug 2023 14:57:46 -0500 Subject: [PATCH 02/10] Add VIIRS EDR proxy python module and docs --- doc/source/readers/index.rst | 1 + doc/source/readers/viirs_edr.rst | 32 +++++++ doc/source/readers/viirs_sdr.rst | 2 +- polar2grid/readers/viirs_edr.py | 158 +++++++++++++++++++++++++++++++ polar2grid/readers/viirs_sdr.py | 6 +- 5 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 doc/source/readers/viirs_edr.rst create mode 100644 polar2grid/readers/viirs_edr.py diff --git a/doc/source/readers/index.rst b/doc/source/readers/index.rst index 04ab4c7f..ec3d1e3e 100644 --- a/doc/source/readers/index.rst +++ b/doc/source/readers/index.rst @@ -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 diff --git a/doc/source/readers/viirs_edr.rst b/doc/source/readers/viirs_edr.rst new file mode 100644 index 00000000..51d16244 --- /dev/null +++ b/doc/source/readers/viirs_edr.rst @@ -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 + :passparser: + +Examples: + +.. code-block:: bash + + polar2grid.sh -r viirs_edr -w geotiff -f / + + 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 diff --git a/doc/source/readers/viirs_sdr.rst b/doc/source/readers/viirs_sdr.rst index b83d9234..cb9f4e20 100644 --- a/doc/source/readers/viirs_sdr.rst +++ b/doc/source/readers/viirs_sdr.rst @@ -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 diff --git a/polar2grid/readers/viirs_edr.py b/polar2grid/readers/viirs_edr.py new file mode 100644 index 00000000..4e76cd2c --- /dev/null +++ b/polar2grid/readers/viirs_edr.py @@ -0,0 +1,158 @@ +# Copyright (C) 2023 Space Science and Engineering Center (SSEC), +# University of Wisconsin-Madison. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# This file is part of the polar2grid software package. Polar2grid takes +# satellite observation data, remaps it, and writes it to a file format for +# input into another program. +# Documentation: http://www.ssec.wisc.edu/software/polar2grid/ +"""The VIIRS EDR Reader operates on Environmental Data Record (SDR) HDF5 files +from the Suomi National Polar-orbiting Partnership's (NPP), the NOAA20, or the +NOAA-21 Visible/Infrared Imager Radiometer Suite (VIIRS) instrument. The VIIRS +EDR reader requires filenames to match one of a couple different standard +filename schemes used for official products. EDR files are typically named +as below:: + + JRR-AOD_v3r2_npp_s202307230941369_e202307230943011_c202307231038217.nc + +The VIIRS EDR reader supports most JPSS Risk Reduction (JRR) enterprise algorithm +output. The VIIRS EDR reader can be specified to the ``polar2grid.sh`` script +with the reader name ``viirs_edr``. + +This reader's default remapping algorithm is ``ewa`` for Elliptical Weighted +Averaging resampling. The ``--weight-delta-max`` parameter set to 40 and the +``--weight-distance-max`` parameter set to 2. + ++---------------------------+-----------------------------------------------------+ +| Product Name | Description | ++===========================+=====================================================+ +| surf_refl_i01 | I01 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_i02 | I02 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_i03 | I03 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m01 | M01 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m02 | M02 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m03 | M03 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m04 | M04 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m05 | M05 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m06 | M06 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m07 | M07 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m08 | M08 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m09 | M09 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m10 | M10 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| surf_refl_m11 | M11 Surface Reflectance Band | ++---------------------------+-----------------------------------------------------+ +| true_color_surf | Ratio sharpened surface true color | ++---------------------------+-----------------------------------------------------+ +| false_color_surf | Ratio sharpened surface false color | ++---------------------------+-----------------------------------------------------+ +| NDVI | Normalized Difference Vegetation Index | ++---------------------------+-----------------------------------------------------+ +| EVI | Enhanced Vegetation Index | ++---------------------------+-----------------------------------------------------+ +| CldTopTemp | Cloud Top Temperature | ++---------------------------+-----------------------------------------------------+ +| CldTopHght | Cloud Top Height | ++---------------------------+-----------------------------------------------------+ +| CldTopPres | Cloud Top Pressure | ++---------------------------+-----------------------------------------------------+ +| AOD550 | Aerosol Optical Depth | ++---------------------------+-----------------------------------------------------+ +| VLST | Land Surface Temperature | ++---------------------------+-----------------------------------------------------+ + +""" +from __future__ import annotations + +from argparse import ArgumentParser, _ArgumentGroup +from typing import Optional + +from satpy import DataQuery + +from ._base import ReaderProxyBase + +PREFERRED_CHUNK_SIZE: int = 6400 + +I_PRODUCTS = ["surf_refl_I{:02d}".format(chan_num) for chan_num in range(1, 4)] +M_PRODUCTS = ["surf_refl_M{:02d}".format(chan_num) for chan_num in range(1, 12)] +SURF_COMPS = ["true_color_surf", "false_color_ref"] +OTHER_PRODS = ["NDVI", "EVI", "CldTopTemp", "CldTopHght", "CldTopPres", "AOD550", "VLST"] + +PRODUCT_ALIASES = {} +SURF_ALIASES = [] + +for surf_band in I_PRODUCTS + M_PRODUCTS: + PRODUCT_ALIASES[surf_band.lower()] = surf_band + SURF_ALIASES.append(surf_band.lower()) + +DEFAULT_PRODUCTS = SURF_ALIASES + SURF_COMPS + OTHER_PRODS +P2G_PRODUCTS = SURF_ALIASES + SURF_COMPS + OTHER_PRODS + +FILTERS = { + "day_only": { + "standard_name": [ + "surface_bidirectional_reflectance", + "true_color", + "false_color", + "natural_color", + ], + }, + "night_only": {}, +} + + +class ReaderProxy(ReaderProxyBase): + """Provide Polar2Grid-specific information about this reader's products.""" + + is_polar2grid_reader = True + + def get_default_products(self) -> list[str]: + """Get products to load if users hasn't specified any others.""" + return DEFAULT_PRODUCTS + + def get_all_products(self): + """Get all polar2grid products that could be loaded.""" + return P2G_PRODUCTS + + @property + def _aliases(self) -> dict[str, DataQuery | str]: + return PRODUCT_ALIASES + + +def add_reader_argument_groups( + parser: ArgumentParser, group: Optional[_ArgumentGroup] = None +) -> tuple[Optional[_ArgumentGroup], Optional[_ArgumentGroup]]: + """Add reader-specific command line arguments to an existing argument parser. + + If ``group`` is provided then arguments are added to this group. If not, + a new group is added to the parser and arguments added to this new group. + + """ + if group is None: + group = parser.add_argument_group(title="VIIRS EDR Reader") + + return group, None diff --git a/polar2grid/readers/viirs_sdr.py b/polar2grid/readers/viirs_sdr.py index 7ed5179b..e8c35c3e 100644 --- a/polar2grid/readers/viirs_sdr.py +++ b/polar2grid/readers/viirs_sdr.py @@ -23,9 +23,9 @@ """The VIIRS SDR Reader operates on Sensor Data Record (SDR) HDF5 files from the Suomi National Polar-orbiting Partnership's (NPP) and/or the NOAA20 Visible/Infrared Imager Radiometer Suite (VIIRS) instrument. The VIIRS -SDR reader ignores filenames and uses internal file content to determine -the type of file being provided, but SDR are typically named as below -and have corresponding geolocation files:: +SDR reader requires filenames to match one of a couple different standard +filename schemes used for official products. SDR files are typically named +as below and have corresponding geolocation files:: SVI01_npp_d20120225_t1801245_e1802487_b01708_c20120226002130255476_noaa_ops.h5 From e38b675b01374bfb09ae4dd0b840d234a6d14e08 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 8 Aug 2023 17:30:47 -0500 Subject: [PATCH 03/10] Add viirs_edr.rst reader doc to ignored list for G2G docs --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 35830a5c..271d3d23 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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", From 49e5d235626acd08165d19f96c8c7861b982a9fb Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 8 Aug 2023 17:45:07 -0500 Subject: [PATCH 04/10] Remove old unnecessary Proj subclass --- polar2grid/core/proj.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/polar2grid/core/proj.py b/polar2grid/core/proj.py index b00fbbbd..0d173e5a 100644 --- a/polar2grid/core/proj.py +++ b/polar2grid/core/proj.py @@ -37,27 +37,7 @@ import sys -try: - from pyproj import Proj as BaseProj -except ImportError: - # This module is loaded by meta.py which could be all a user needs so we shouldn't fail if they don't have pyproj - import warnings - - warnings.warn("Package 'pyproj' could not be imported. Some functionality will be missing", stacklevel=2) - Proj = object - - -class Proj(BaseProj): - def is_latlong(self): - if hasattr(self, "crs"): - return self.crs.is_geographic - return super(Proj, self).is_latlong() - - def __call__(self, data1, data2, **kwargs): - if self.is_latlong(): - return data1, data2 - - return super(Proj, self).__call__(data1, data2, **kwargs) +from pyproj import Proj def get_parser(): From 4aaa2184a011104929987d2186e3fab7ac57db6d Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 8 Aug 2023 17:48:13 -0500 Subject: [PATCH 05/10] Remove unused proj script --- polar2grid/core/proj.py | 71 ----------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 polar2grid/core/proj.py diff --git a/polar2grid/core/proj.py b/polar2grid/core/proj.py deleted file mode 100644 index 0d173e5a..00000000 --- a/polar2grid/core/proj.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# encoding: utf-8 -# Copyright (C) 2013 Space Science and Engineering Center (SSEC), -# University of Wisconsin-Madison. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# This file is part of the polar2grid software package. Polar2grid takes -# satellite observation data, remaps it, and writes it to a file format for -# input into another program. -# Documentation: http://www.ssec.wisc.edu/software/polar2grid/ -# -# Written by David Hoese March 2013 -# University of Wisconsin-Madison -# Space Science and Engineering Center -# 1225 West Dayton Street -# Madison, WI 53706 -# david.hoese@ssec.wisc.edu -"""Script for converting lon/lat decimal values to X/Y values of the grid provided. - -This script mimics the `proj` binary that comes with the PROJ.4 library, but -handles any projection string that `pyproj` can handle (like 'latlong' which the -`proj` binary does not handle). - -""" - -import sys - -from pyproj import Proj - - -def get_parser(): - from argparse import ArgumentParser - - parser = ArgumentParser(description="Convert latitude/longitude coordinates to X/Y values.") - parser.add_argument( - "-i", - "--inverse", - dest="inv", - action="store_true", - default=False, - help="Convert X/Y values to latitude/longitude coordinates", - ) - parser.add_argument("proj4_str", help="PROJ.4 projection string (in quotes)") - parser.add_argument("lon_point", type=float, help="Longitude of the point to be converted (single value only)") - parser.add_argument("lat_point", type=float, help="Latitude of the point to be converted (single value only)") - return parser - - -def main(): - parser = get_parser() - args = parser.parse_args() - - p = Proj(args.proj4_str) - x, y = p(args.lon_point, args.lat_point, inverse=args.inv) - print(x, y) - - -if __name__ == "__main__": - sys.exit(main()) From e339b702fc3f6c41840e0eb94d6785bdcf36d790 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Thu, 17 Aug 2023 14:52:24 -0500 Subject: [PATCH 06/10] Remove non-existent surface reflectance products (M06, M09) --- polar2grid/readers/viirs_edr.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/polar2grid/readers/viirs_edr.py b/polar2grid/readers/viirs_edr.py index 4e76cd2c..6cd1bcd5 100644 --- a/polar2grid/readers/viirs_edr.py +++ b/polar2grid/readers/viirs_edr.py @@ -54,14 +54,10 @@ +---------------------------+-----------------------------------------------------+ | surf_refl_m05 | M05 Surface Reflectance Band | +---------------------------+-----------------------------------------------------+ -| surf_refl_m06 | M06 Surface Reflectance Band | -+---------------------------+-----------------------------------------------------+ | surf_refl_m07 | M07 Surface Reflectance Band | +---------------------------+-----------------------------------------------------+ | surf_refl_m08 | M08 Surface Reflectance Band | +---------------------------+-----------------------------------------------------+ -| surf_refl_m09 | M09 Surface Reflectance Band | -+---------------------------+-----------------------------------------------------+ | surf_refl_m10 | M10 Surface Reflectance Band | +---------------------------+-----------------------------------------------------+ | surf_refl_m11 | M11 Surface Reflectance Band | @@ -78,8 +74,6 @@ +---------------------------+-----------------------------------------------------+ | CldTopHght | Cloud Top Height | +---------------------------+-----------------------------------------------------+ -| CldTopPres | Cloud Top Pressure | -+---------------------------+-----------------------------------------------------+ | AOD550 | Aerosol Optical Depth | +---------------------------+-----------------------------------------------------+ | VLST | Land Surface Temperature | @@ -98,9 +92,9 @@ PREFERRED_CHUNK_SIZE: int = 6400 I_PRODUCTS = ["surf_refl_I{:02d}".format(chan_num) for chan_num in range(1, 4)] -M_PRODUCTS = ["surf_refl_M{:02d}".format(chan_num) for chan_num in range(1, 12)] +M_PRODUCTS = ["surf_refl_M{:02d}".format(chan_num) for chan_num in range(1, 12) if chan_num not in (6, 9)] SURF_COMPS = ["true_color_surf", "false_color_ref"] -OTHER_PRODS = ["NDVI", "EVI", "CldTopTemp", "CldTopHght", "CldTopPres", "AOD550", "VLST"] +OTHER_PRODS = ["NDVI", "EVI", "CldTopTemp", "CldTopHght", "AOD550", "VLST"] PRODUCT_ALIASES = {} SURF_ALIASES = [] From f9454dde28552c23e29b9a5208460959e8aa74fb Mon Sep 17 00:00:00 2001 From: David Hoese Date: Thu, 17 Aug 2023 14:55:54 -0500 Subject: [PATCH 07/10] Switch to non-deprecated Colormap API for loading strings --- polar2grid/add_coastlines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polar2grid/add_coastlines.py b/polar2grid/add_coastlines.py index a2c8a8d0..100f0605 100644 --- a/polar2grid/add_coastlines.py +++ b/polar2grid/add_coastlines.py @@ -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 From 42e2327ea37230b6ff862455bb5d48cc297e6a8f Mon Sep 17 00:00:00 2001 From: David Hoese Date: Thu, 17 Aug 2023 14:56:41 -0500 Subject: [PATCH 08/10] Add commented out code for reading AWIPS XML colormaps directly --- polar2grid/enhancements/shared.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/polar2grid/enhancements/shared.py b/polar2grid/enhancements/shared.py index 491f3495..7d1f49b6 100644 --- a/polar2grid/enhancements/shared.py +++ b/polar2grid/enhancements/shared.py @@ -55,10 +55,32 @@ def _parse_palettes_for_p2g_cmap(palettes: list): p2g_home = get_polar2grid_home() filename = filename.replace("$POLAR2GRID_HOME", p2g_home) filename = filename.replace("$GEO2GRID_HOME", p2g_home) + # if _is_awips_cmap(filename): + # color_arr = _get_awips_colors(filename) + # palette["colors"] = color_arr + # palette["color_scale"] = 1.0 + # del palette["filename"] + # else: palette["filename"] = filename yield palette +# def _is_awips_cmap(cmap_filename: str) -> bool: +# if not cmap_filename.endswith(".cmap"): +# return False +# with open(cmap_filename, "r") as cmap_file: +# return "xml" in cmap_file.read() +# +# +# def _get_awips_colors(cmap_file: str) -> list[tuple[float, float, float]]: +# # TODO: If this is used, add it to the dependencies +# from defusedxml import ElementTree +# +# tree = ElementTree.parse(cmap_file) +# colors = [(float(c.get("r")), float(c.get("g")), float(c.get("b"))) for c in tree.findall("color")] +# return colors + + def colorize(img, **kwargs): kwargs["palettes"] = list(_parse_palettes_for_p2g_cmap(kwargs["palettes"])) return _colorize(img, **kwargs) From abcb2d8461f880d467247251f1ea35326eda4eb0 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Thu, 17 Aug 2023 14:57:21 -0500 Subject: [PATCH 09/10] Add NDVI/EVI/LST/AOD colormaps for VIIRS --- etc/enhancements/viirs.yaml | 153 ++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/etc/enhancements/viirs.yaml b/etc/enhancements/viirs.yaml index e9d08ee0..5a09d7f9 100644 --- a/etc/enhancements/viirs.yaml +++ b/etc/enhancements/viirs.yaml @@ -45,3 +45,156 @@ 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 From 8440e64f1585cb8039362d7d270ab8e93fb2da2d Mon Sep 17 00:00:00 2001 From: David Hoese Date: Thu, 17 Aug 2023 15:35:45 -0500 Subject: [PATCH 10/10] Add AOD/LST colormaps to ABI and Cloud colormaps to VIIRS --- etc/enhancements/abi.yaml | 95 +++++++++++++++++++++++++++++-------- etc/enhancements/viirs.yaml | 22 +++++++++ 2 files changed, 97 insertions(+), 20 deletions(-) diff --git a/etc/enhancements/abi.yaml b/etc/enhancements/abi.yaml index 5f358098..05629734 100644 --- a/etc/enhancements/abi.yaml +++ b/etc/enhancements/abi.yaml @@ -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 diff --git a/etc/enhancements/viirs.yaml b/etc/enhancements/viirs.yaml index 5a09d7f9..53c3aaac 100644 --- a/etc/enhancements/viirs.yaml +++ b/etc/enhancements/viirs.yaml @@ -198,3 +198,25 @@ enhancements: [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