TNO Intern

Commit 230664b6 authored by Arjo Segers's avatar Arjo Segers
Browse files

Changes following deprication warnings.

parent 9a59fc0c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
# 2025-10, Arjo Segers
#   Replace ' and ' by ' & ' when selecting records.
#
# 2026-01, Arjo Segers
#   Updated use of Dataset.dims following deprication warning.
#

########################################################################
###
@@ -1128,7 +1131,7 @@ class CSO_File(object):
        logging.info(indent + "pixel selection ...")

        # init selection, by default accept all:
        selected = numpy.ones((self.ds.dims["pixel"],), "bool")
        selected = numpy.ones((self.ds.sizes["pixel"],), "bool")

        # init history:
        history = []
+7 −2
Original line number Diff line number Diff line
@@ -74,6 +74,10 @@
#   Trap multiple selections from inquire table as this might indicate
#   a problem in the table or the selection.
#
# 2026-01, Arjo Segers
#   Updated use of Dataset.dims following deprication warning.
#   Explicitly defined data type in encoding of time array folowing warning.
#


########################################################################
@@ -223,9 +227,9 @@ class S5p_File(object):
            self.nscan = ds.sizes["scanline"]
            self.ngpix = ds.sizes["ground_pixel"]
            # number 'atmoshpere' layers:
            if "layer" in ds.dims.keys():
            if "layer" in ds.dims:
                self.nlayer = ds.sizes["layer"]
            elif "level" in ds.dims.keys():
            elif "level" in ds.dims:
                self.nlayer = ds.sizes["level"]
            else:
                self.nlayer = None
@@ -1408,6 +1412,7 @@ class CSO_S5p_File(cso_file.CSO_File):
                da.attrs["long_name"] = "time"
                da.encoding["calendar"] = "standard"
                da.encoding["units"] = f"seconds since {t0.year}-01-01 00:00:000"
                da.encoding["dtype"] = "float64"

            # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            # pixel corners: for longitudes, need to ensure that also near dateline