TNO Intern

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

Merge branch 'sesam' into 'master'

Copernicus Dataspace download.

See merge request !34
parents 27c7653f 6dfd3be3
Loading
Loading
Loading
Loading
Loading
+16.3 KiB
Loading image diff...
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ of the *Product Algorithm Laboratory* portal. Also this will produce a table fil
To visualize what is available from the various portals, the
:py:class:`CSO_Inquire_Plot <.CSO_Inquire_Plot>` could be used to create an overview figure:

.. figure:: figs/NO2/Copernicus_S5p_NO2.png
.. figure:: figs/NO2/Copernicus_S5p_NO2_inquire-versions.png
   :scale: 50 %
   :align: center
   :alt: Overview of available NO\ :sub:`2` processings.
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ should have created an overview figure next to the table file::

The figure should look like:

.. figure:: figs/NO2/Copernicus_S5p_NO2.png
.. figure:: figs/NO2/Copernicus_S5p_NO2_inquire-versions.png
   :scale: 50 %
   :align: center
   :alt: Overview of available NO2 processings on DataSpace.
+18 −6
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@
#   Added production time of data files to listings.
#   Select file with latest production time if multiple are found.
#
# 2026-04, Arjo Segers
#   Skip files that cannot be accessed, for example a broken link.
#

########################################################################
###
@@ -209,13 +212,22 @@ class CSO_ColHubMirror_Inquire(utopya.UtopyaRc):
                    for fname in files:
                        # data file?
                        if fnmatch.fnmatch(fname, fpattern):
                            # already in table?
                            if fname in listing:
                            # full path:
                            href = os.path.join(root, fname)
                            #~ sometimes links to non-existing targets ...
                            if not os.path.isfile(href):
                                # info ...
                                logging.info(f"{indent}  keep entry %s ..." % fname)
                                logging.info(f"{indent}  WARNING - invalid file (broken link?): {href}")
                            #
                            #~ already in table?
                            elif fname in listing:
                                # info ...
                                logging.info(f"{indent}  keep entry {fname} ...")
                            #
                            #~ new entry:
                            else:
                                # info ...
                                logging.info(f"{indent}  add entry %s ..." % fname)
                                logging.info(f"{indent}  add entry {fname} ...")
                                # Example filename:
                                #   S5P_RPRO_L2__CH4____20180430T001851_20180430T020219_02818_01_010301_20190513T141133.nc
                                #
@@ -270,7 +282,7 @@ class CSO_ColHubMirror_Inquire(utopya.UtopyaRc):
                                data["collection"] = collection
                                data["processor_version"] = processor_version
                                data["production_time"] = production_time
                                data["href"] = os.path.join(root, fname)
                                data["href"] = href
                                # update record:
                                listing.UpdateRecord(fname, data, indent=f"{indent}    ")
                            # endif  # new record?
@@ -290,7 +302,7 @@ class CSO_ColHubMirror_Inquire(utopya.UtopyaRc):
            # endfor # archive_dir

            # info ...
            logging.warning(f"{indent}save ...")
            logging.info(f"{indent}save ...")
            # sort:
            listing.Sort(by="orbit")
            # save:
Loading