TNO Intern

Commit 590002ff authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixed creation of super-observations on local domain.

parent d965b04f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -326,4 +326,10 @@ Synchronized change logs in source files between master and development versions
  py/


v2.7.1
~~~~~~

Fixed creation of super-observations on local domain.
  py/cso_superobs.py

+132 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ cso.tutorial.elements : inquire \
!
! ... create super-observations
!cso.tutorial.elements                          :  superobs
!cso.tutorial.elements                          :  superobs-catalogue
!
! ... after running the obs.oper:
!cso.tutorial.elements                          :  sim-catalogue
@@ -120,6 +121,21 @@ cso.tutorial.superobs.create.args : '${__filename__}', rcbase='cso
cso.tutorial.superobs.listing.class            :  cso.CSO_S5p_Listing
cso.tutorial.superobs.listing.args             :  '${__filename__}', rcbase='cso.tutorial.superobs-listing'

! *

! single step:
cso.tutorial.superobs-catalogue.class          :  utopya.UtopyaJobStep
! two tasks:
cso.tutorial.superobs-catalogue.tasks          :  figs index
! catalogue creation task:
cso.tutorial.superobs-catalogue.figs.class     :  cso.CSO_Catalogue
cso.tutorial.superobs-catalogue.figs.args      :  '${__filename__}', \
                                                   rcbase='cso.tutorial.superobs-catalogue'
! indexer task:
cso.tutorial.superobs-catalogue.index.class    :  utopya.Indexer
cso.tutorial.superobs-catalogue.index.args     :  '${__filename__}', \
                                                    rcbase='cso.tutorial.superobs-catalogue-index'

!
! * gridded fields
!
@@ -312,7 +328,7 @@ cso.tutorial.inquire-plot.renew : True
cso.tutorial.inquire-plot.file                     :  ${cso.tutorial.inquire-table-dataspace.output.file}
!!~ specify dates ("yyyy-mm-dd") to use historic tables,
!!  default is table of today:
!cso.tutorial.inquire-plot.filedate                 :  2022-01-28
!cso.tutorial.inquire-plot.filedate                 :  2022-01-18

! annote:
cso.tutorial.inquire-plot.title                    :  S5p/NO2 %Y-%m-%d
@@ -995,6 +1011,121 @@ cso.tutorial.superobs-listing.patterns : %Y/%m/S5p_*.nc
cso.tutorial.superobs-listing.xcolumns            :  orbit processing processor_version


!-----------------------------------------------------------
! catalogue of superobs fields
!-----------------------------------------------------------

! listing file with filenames/timerange.
cso.tutorial.superobs-catalogue.input.listing               :  ${cso.tutorial.superobs-listing.file}

! time range:
cso.tutorial.superobs-catalogue.timerange.start             :  ${my.timerange.start}
cso.tutorial.superobs-catalogue.timerange.end               :  ${my.timerange.end}

! target filenames; templates:
! - time values
! - %{orbit}   : from listing
! - %{varname} for variable
cso.tutorial.superobs-catalogue.output.file                 :  ${my.work}/CSO-data-catalogue__${my.supobs.key}/${my.region}/S5p/NO2/${my.tutorial.selection}/%Y/%m/%d/S5p_NO2_%{orbit}__%{varname}.png

! map domain (west east south north)
cso.tutorial.superobs-catalogue.domain                      :  ${my.region.west} ${my.region.east} ${my.region.south} ${my.region.north}

! figure size (inches), default is (8,6):
cso.tutorial.superobs-catalogue.figsize                     :  ${my.region.figsize}

! renew existing files?
!cso.tutorial.superobs-catalogue.renew                       :  False
cso.tutorial.superobs-catalogue.renew                       :  True

! variables to be plotted:
cso.tutorial.superobs-catalogue.vars                        :  vcd vcd_errvar qa_value \
                                                               amf amf_trop nla \
                                                               cloud_fraction cloud_radiance_fraction

!! color for no-data values in track, default '0.8' (gray):
!cso.tutorial.superobs-catalogue.color_nan                   :  white

!! extra keyword arguments for map:
!cso.tutorial.superobs-catalogue.map                         :  resolution='h'

! convert units:
cso.tutorial.superobs-catalogue.var.vcd.units                         :  umol/m2
! style:
cso.tutorial.superobs-catalogue.var.vcd.vmin                          :   0.0
cso.tutorial.superobs-catalogue.var.vcd.vmax                          :  100.0

! show error as std.dev, convert to vcd units:
cso.tutorial.superobs-catalogue.var.vcd_errvar.units                  :  umol/m2
! style:
cso.tutorial.superobs-catalogue.var.vcd_errvar.vmax                   :  100.0

! style:
cso.tutorial.superobs-catalogue.var.amf.vmin                          :   0.0
cso.tutorial.superobs-catalogue.var.amf.vmax                          :   4.0

! style:
cso.tutorial.superobs-catalogue.var.amf_trop.vmin                     :   0.0
cso.tutorial.superobs-catalogue.var.amf_trop.vmax                     :   4.0

! style:
cso.tutorial.superobs-catalogue.var.nla.vmin                          :   1
cso.tutorial.superobs-catalogue.var.nla.vmax                          :   34

! style:
cso.tutorial.superobs-catalogue.var.qa_value.vmin                     :   0.5
cso.tutorial.superobs-catalogue.var.qa_value.vmax                     :   1.0
cso.tutorial.superobs-catalogue.var.qa_value.colors                   :   ['red','yellow','green']

! style:
cso.tutorial.superobs-catalogue.var.cloud_fraction.vmax               :   1.0
cso.tutorial.superobs-catalogue.var.cloud_fraction.colors             :   ['blue','cyan','white']

! style:
cso.tutorial.superobs-catalogue.var.cloud_radiance_fraction.vmax      :   1.0
cso.tutorial.superobs-catalogue.var.cloud_radiance_fraction.colors    :   ['blue','cyan','white']


! *** catalogue index

! target location:
cso.tutorial.superobs-catalogue-index.outdir                    :  ${my.work}/CSO-data-catalogue__${my.supobs.key}/${my.region}/S5p/NO2/${my.tutorial.selection}

! title:
cso.tutorial.superobs-catalogue-index.header                    :  CSO catalogue
! show info on created page?
cso.tutorial.superobs-catalogue-index.info                      :  True

! create new page for each value?
cso.tutorial.superobs-catalogue-index.newpage                   :  True

! content type:
cso.tutorial.superobs-catalogue-index.type                      :  list
! define row values:
cso.tutorial.superobs-catalogue-index.name                      :  date
cso.tutorial.superobs-catalogue-index.values                    :  TimeSeries( ${my.timerange.start}, ${my.timerange.end}, '1 day', '%Y%m%d' )

! create new page for each value:
cso.tutorial.superobs-catalogue-index.date.newpage                   :  True
! content type:
cso.tutorial.superobs-catalogue-index.date.type                      :  table-row
! define row values:
cso.tutorial.superobs-catalogue-index.date.name                      :  orbit
cso.tutorial.superobs-catalogue-index.date.values                    :  CsvFile( '%{date[0:4]}/%{date[4:6]}/%{date[6:8]}/orbits.csv' )

! content type:
cso.tutorial.superobs-catalogue-index.date.orbit.type                :  table-col
! define column values:
cso.tutorial.superobs-catalogue-index.date.orbit.name                :  var
cso.tutorial.superobs-catalogue-index.date.orbit.values              :  ${cso.tutorial.superobs-catalogue.vars}

! content type:
cso.tutorial.superobs-catalogue-index.date.orbit.var.type            :  img
! define image:
cso.tutorial.superobs-catalogue-index.date.orbit.var.img             :  %{date[0:4]}/%{date[4:6]}/%{date[6:8]}/S5p_NO2_%{orbit}__%{var}.png
cso.tutorial.superobs-catalogue-index.date.orbit.var.kwargs          :  height=300



!======================================================================
!===
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ copyright = "2020-2024, Arjo Segers"
author = "Arjo Segers"

# The full version, including alpha/beta/rc tags
release = "v2.7"
release = "v2.7.1"


# -- General configuration ---------------------------------------------------
+7 −1
Original line number Diff line number Diff line
@@ -533,7 +533,13 @@ class CSO_SuperObs(utopya.UtopyaRc):
                    enough_input = df2["ww"].values >= minimum_number
                #
                elif wtype == "area":
                    # minimum area fraction:
                    # minimum area fraction;
                    # some target cells might be outside the domain and will be excluded below,
                    # for the moment simply clip them to allowed range:
                    enough_input = (
                        df2["ww"].values / cell_area[jj2.clip(0, nlat - 1), ii2.clip(0, nlon - 1)]
                        >= minimum_coverage
                    )
                    enough_input = df2["ww"].values / cell_area[jj2, ii2] >= minimum_coverage
                #
                else: