From dd9a374f5585924bed0afd5652e9b685254847c8 Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Sat, 1 Jun 2024 07:42:26 +0000 Subject: [PATCH] fields without mars labelling --- src/climetlab/readers/grib/output.py | 4 ++++ src/climetlab/sources/constants.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/climetlab/readers/grib/output.py b/src/climetlab/readers/grib/output.py index dbf15db8..3b45cff4 100644 --- a/src/climetlab/readers/grib/output.py +++ b/src/climetlab/readers/grib/output.py @@ -134,6 +134,10 @@ def write( for k in NOT_IN_EDITION_1: metadata.pop(k, None) + if int(metadata.get("deleteLocalDefinition", 0)): + for k in ("class", "type", "stream", "expver", "setLocalDefinition"): + metadata.pop(k, None) + LOG.debug("GribOutput.metadata %s", metadata) for k, v in metadata.items(): diff --git a/src/climetlab/sources/constants.py b/src/climetlab/sources/constants.py index b806c499..8d55012b 100644 --- a/src/climetlab/sources/constants.py +++ b/src/climetlab/sources/constants.py @@ -10,7 +10,6 @@ import datetime import itertools import logging -from warnings import warn import numpy as np @@ -153,7 +152,7 @@ def sin_local_time(self, date): return np.sin(radians) def insolation(self, date): - warn("The function `insolation` is deprecated, please use `cos_solar_zenith_angle` instead") + # warn("The function `insolation` is deprecated, please use `cos_solar_zenith_angle` instead") return self.cos_solar_zenith_angle(date) def toa_incident_solar_radiation(self, date):