!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
!!! CSO TROPOMI Processing
!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!-----------------------------------------------------------------------
! user specific settings:
!-----------------------------------------------------------------------

! include user specfic settings:
#include cso-user-settings.rc


!======================================================================
!===
!=== Inquire - S-5P Hub
!===
!======================================================================

! Obtain names of all available S5p files.
! Stored as csv with processing type, processor version, filenames, etc.


! time range:
cso.s5p.ch4.inquire-s5phub-table.timerange.start        :  ${my.timerange.start}
cso.s5p.ch4.inquire-s5phub-table.timerange.end          :  ${my.timerange.end}

!
! server url ; 
! provide login/password in ~/.netrc:
!
!   machine s5phub.copernicus.eu      login s5pguest        password s5pguest
!
cso.s5p.ch4.inquire-s5phub-table.url                    :  https://s5phub.copernicus.eu/dhus

! target area;
!!~ empty for no limitation:
!cso.s5p.ch4.inquire-s5phub-table.area                   :  
!~ domain specified as:  west,south:east,north
cso.s5p.ch4.inquire-s5phub-table.area                   :  ${my.region.west},${my.region.south}:${my.region.east},${my.region.north}

! search query, obtained from interactive download:
!
!   platformname     : Sentinel-5
!   producttype      : L2__CH4__        (always 10 characters!)
!   processinglevel  : L2
!
cso.s5p.ch4.inquire-s5phub-table.query                  :      platformname:Sentinel-5    AND \
                                                                producttype:L2__CH4___    AND \
                                                            processinglevel:L2

! output table, date of today:
cso.s5p.ch4.inquire-s5phub-table.output.file            :  ${my.work}/Copernicus-avail/Copernicus_S5P_CH4_%Y-%m-%d.csv


! * create plot

! renew existing plots?
cso.s5p.ch4.inquire-s5phub-plot.renew                    :  True

! listing files:
cso.s5p.ch4.inquire-s5phub-plot.file                     :  ${cso.s5p.ch4.inquire-s5phub-table.output.file}
!!~ specify dates ("yyyy-mm-dd") to use historic tables,
!!  default is table of today:
!cso.s5p.ch4.inquire-s5phub-plot.filedate                 :  2022-01-28

! output figure, date of today:
cso.s5p.ch4.inquire-s5phub-plot.output.file              :  ${my.work}/Copernicus-avail/Copernicus_S5p_CH4_${my.region}__%Y-%m-%d.png



!======================================================================
!===
!=== convert
!===
!======================================================================


! renew existing files (True|False) ?
cso.s5p.ch4.convert.renew                  :  True
!cso.s5p.ch4.convert.renew                  :  False

! time range:
cso.s5p.ch4.convert.timerange.start        :  ${my.timerange.start}
cso.s5p.ch4.convert.timerange.end          :  ${my.timerange.end}


!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! input files
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

! listing of available source files,
! created by 'inquire-s5phub-table' job:
!cso.s5p.ch4.convert.inquire.file                   :  ${my.work}/Copernicus-avail/Copernicus_S5P_CH4_%Y-%m-%d.csv
! TESTING: selection ...
cso.s5p.ch4.convert.inquire.file                   :  ${my.work}/Copernicus-avail/Copernicus_S5P_CH4_%Y-%m-%d__test.csv
!~ historic inquire ...
cso.s5p.ch4.convert.inquire.filedate               :  2023-07-02

! list of processings:
cso.s5p.ch4.convert.processings                    :  RPRO OFFL

! list of processor versions, empty for all:
cso.s5p.ch4.convert.processor_versions             :  020400 020500

! target dir for downloads:
cso.s5p.ch4.convert.input.dir                      :  ${my.work}/Copernicus/S5P/%{processing}/CH4/%Y/%m

! remove downloaded files after convert?
cso.s5p.ch4.convert.downloads.cleanup              :  False

! ..........................................

! selection names:
cso.s5p.ch4.convert.filters                        :  lons lats valid quality

! filter settings:
cso.s5p.ch4.convert.filter.lons.var                :  PRODUCT/longitude
cso.s5p.ch4.convert.filter.lons.type               :  minmax
cso.s5p.ch4.convert.filter.lons.minmax             :  ${my.region.west} ${my.region.east}
cso.s5p.ch4.convert.filter.lons.units              :  degrees_east

! filter settings:
cso.s5p.ch4.convert.filter.lats.var                :  PRODUCT/latitude
cso.s5p.ch4.convert.filter.lats.type               :  minmax
cso.s5p.ch4.convert.filter.lats.minmax             :  ${my.region.south} ${my.region.north}
cso.s5p.ch4.convert.filter.lats.units              :  degrees_north

! skip pixel with "no data", use the "qa_value" variable to check:
cso.s5p.ch4.convert.filter.valid.var               :  PRODUCT/qa_value
cso.s5p.ch4.convert.filter.valid.type              :  valid

! Comment in "PRODUCT/qa_value" variable:
!   "A continuous quality descriptor, 
!   varying between 0 (no data) and 1 (full quality data). 
!   Recommend to ignore data with qa_value < 0.5" 
! 0.5 is the recommended use so what we will use here
cso.s5p.ch4.convert.filter.quality.var             :  PRODUCT/qa_value
cso.s5p.ch4.convert.filter.quality.type            :  min
cso.s5p.ch4.convert.filter.quality.min             :  0.5
cso.s5p.ch4.convert.filter.quality.units           :  1


!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! output files
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

! output directory and filename:
! - times are taken from mid of selection, rounded to hours
! - use '%{processing}' for processing key ("RPRO","OFFL",..)
! - use '%{orbit}' for orbit number
cso.s5p.ch4.convert.output.filename            :  ${my.work}/CSO-data/${my.region}/S5p/CH4/%{processing}/%Y/%m/S5p_%{processing}_CH4_%{orbit}.nc

! pack variables on output:
cso.s5p.ch4.convert.output.packed              :  True
! zlib compression level, 0 for no compression:
cso.s5p.ch4.convert.output.complevel           :  1

! global attributes:
cso.s5p.ch4.convert.output.attrs               :  format Conventions \
                                                     author institution email
!
cso.s5p.ch4.convert.output.attr.format         :  ${my.cso.format}
cso.s5p.ch4.convert.output.attr.Conventions    :  ${my.cso.convention}
cso.s5p.ch4.convert.output.attr.author         :  ${my.attr.author}
cso.s5p.ch4.convert.output.attr.institution    :  ${my.attr.institution}
cso.s5p.ch4.convert.output.attr.email          :  ${my.attr.email}

! no need to swap layes:
cso.s5p.ch4.convert.swap_layers                :  False


! ~ variables

! which fields to be put out ?
cso.s5p.ch4.convert.output.vars    :  longitude longitude_bounds \
                                       latitude latitude_bounds \
                                       track_longitude track_longitude_bounds \
                                       track_latitude  track_latitude_bounds \
                                       time qa_value \
                                       xvmr xvmr_errvar \
                                       pressure vcd_apri kernel \
                                       solar_zenith_angle


! 
! Describe per variable:
! * .dims :  dimensions list:
!     pixel       : selected pixels
!     corner      : number of footprint bounds (probably 4)
!     layer       : number of layers in atmospheric profile (layers in kernel)
!     layeri      : number of layer interfaces in atmospheric profile (layer+1)
!     retr        : number of layers in retrieval product (1 for columns) ;
!                   for error covariance use (retr,retr0) to avoid repeated dimensions
!     track_scan  : original scan index   in 2D track
!     track_pixel : original ground pixel in 2D track
! * .specal  : keyword to select special processing
!     * None                     : no special processing (default)
!     * track_longitude          : longiudes at centers of original 2D track
!     * track_latitude           : latiudes  at centers of original 2D track
!     * track_longitude_bounds   : longiude bounds at centers of original 2D track
!     * track_latitude_bounds    : latiude  bounds at centers of original 2D track
! * .units   : target units if different from original
! * .oper    : special postprocessing, currently supported:
!     * square      :  fill variable with squared valued (used to form variance from standard deviation)
! In case no special processing is needed:
! * .from : original variable (group path and variable name)
!

! center longitudes; remove bounds attribute, no coordinate ...
cso.s5p.ch4.convert.output.var.longitude.dims                   :   pixel
cso.s5p.ch4.convert.output.var.longitude.from                   :   PRODUCT/longitude
cso.s5p.ch4.convert.output.var.longitude.attrs                  :   { 'bounds' : None }
! center latitudes; remove bounds attribute, no coordinate ...
cso.s5p.ch4.convert.output.var.latitude.dims                    :   pixel
cso.s5p.ch4.convert.output.var.latitude.from                    :   PRODUCT/latitude
cso.s5p.ch4.convert.output.var.latitude.attrs                   :   { 'bounds' : None }

! corner longitudes; no units in file:
cso.s5p.ch4.convert.output.var.longitude_bounds.dims            :   pixel corner
cso.s5p.ch4.convert.output.var.longitude_bounds.from            :   PRODUCT/SUPPORT_DATA/GEOLOCATIONS/longitude_bounds
cso.s5p.ch4.convert.output.var.longitude_bounds.units           :   degrees_east
! corner latitudes, no units in file:
cso.s5p.ch4.convert.output.var.latitude_bounds.dims             :   pixel corner
cso.s5p.ch4.convert.output.var.latitude_bounds.from             :   PRODUCT/SUPPORT_DATA/GEOLOCATIONS/latitude_bounds
cso.s5p.ch4.convert.output.var.latitude_bounds.units            :   degrees_north

! original track:
!~ center lon; remove bounds attribute, no coordinate ...
cso.s5p.ch4.convert.output.var.track_longitude.dims             :   track_scan track_pixel
cso.s5p.ch4.convert.output.var.track_longitude.special          :   track_longitude
cso.s5p.ch4.convert.output.var.track_longitude.from             :   PRODUCT/longitude
cso.s5p.ch4.convert.output.var.track_longitude.attrs            :   { 'bounds' : None }
!~ center lat; remove bounds attribute, no coordinate ...
cso.s5p.ch4.convert.output.var.track_latitude.dims              :   track_scan track_pixel
cso.s5p.ch4.convert.output.var.track_latitude.special           :   track_latitude
cso.s5p.ch4.convert.output.var.track_latitude.from              :   PRODUCT/latitude
cso.s5p.ch4.convert.output.var.track_latitude.attrs             :   { 'bounds' : None }
!~ corner lons
cso.s5p.ch4.convert.output.var.track_longitude_bounds.dims      :   track_scan track_pixel corner
cso.s5p.ch4.convert.output.var.track_longitude_bounds.special   :   track_longitude_bounds
cso.s5p.ch4.convert.output.var.track_longitude_bounds.from      :   PRODUCT/SUPPORT_DATA/GEOLOCATIONS/longitude_bounds
cso.s5p.ch4.convert.output.var.track_longitude_bounds.units     :   degrees_east
!~ corner lats
cso.s5p.ch4.convert.output.var.track_latitude_bounds.dims       :   track_scan track_pixel corner
cso.s5p.ch4.convert.output.var.track_latitude_bounds.special    :   track_latitude_bounds
cso.s5p.ch4.convert.output.var.track_latitude_bounds.from       :   PRODUCT/SUPPORT_DATA/GEOLOCATIONS/latitude_bounds
cso.s5p.ch4.convert.output.var.track_latitude_bounds.units      :   degrees_north

! time value per scan line
cso.s5p.ch4.convert.output.var.time.dims                        :   pixel
cso.s5p.ch4.convert.output.var.time.special                     :   time-delta
cso.s5p.ch4.convert.output.var.time.tref                        :   PRODUCT/time
cso.s5p.ch4.convert.output.var.time.dt                          :   PRODUCT/delta_time

! quality flag:
cso.s5p.ch4.convert.output.var.qa_value.dims                    :   pixel
cso.s5p.ch4.convert.output.var.qa_value.from                    :   PRODUCT/qa_value
!~ skip some attributes, cf-checker complains ...
cso.s5p.ch4.convert.output.var.qa_value.attrs                   :   { 'valid_min'  : None, 'valid_max'  : None, \
                                                                      'valid_min_' : None, 'valid_max_' : None }

!
! Simulated retrieval product should be computed from:
!  - model variables:  
!       V_CH4_model [(mol CH4)/m2]   =   C_CH4_model [ppb]*1e-9   *   V_air_model [(mol air)/m2]
!       V_air_model [(mol air)/m2]
!  - retrieval variables:
!       V_CH4_apri [(mol CH4)/m2]
! following:
!
!    X_CH4_model = [ sum_k V_CH4_apri[k] + sum_k K[k] ( V_CH4_model[k] - V_CH4_apri[k] ) ] / [sum_k V_air[k]] * 1e9
!
!      ppb                   mol/m2               1         mol/m2           mol/m2              mol/m2          ppb
!      (1)                    (1)                            (12)             (12)                 (1)
!
! Using converted variables 
!
!    X_CH4_model = [      vcd_apri      +       K    (  V_CH4_model   -   vcd_apri    ) ] /    sum(V_air)   * 1e9
!
!

! column mixing ratio (ppb):
cso.s5p.ch4.convert.output.var.xvmr.dims                        :   pixel retr
cso.s5p.ch4.convert.output.var.xvmr.from                        :   PRODUCT/methane_mixing_ratio_bias_corrected
cso.s5p.ch4.convert.output.var.xvmr.units                       :   ppb
cso.s5p.ch4.convert.output.var.xvmr.attrs                       :   { 'long_name' : 'methane total column-average dry-air mole fraction (bias corrected)' }

! error variance in vertical column density (after application of kernel),
! fill with single element 'covariance matrix', from square of standard error:
! use dims with different names to avoid that cf-checker complains:
cso.s5p.ch4.convert.output.var.xvmr_errvar.dims                 :   pixel retr retr0
cso.s5p.ch4.convert.output.var.xvmr_errvar.special              :   square
cso.s5p.ch4.convert.output.var.xvmr_errvar.from                 :   PRODUCT/methane_mixing_ratio_precision
cso.s5p.ch4.convert.output.var.xvmr_errvar.attrs                :   { 'long_name' :  'methane total column-average dry-air mole fraction error variance' }

! kernels:
cso.s5p.ch4.convert.output.var.kernel.dims                      :   pixel layer retr
cso.s5p.ch4.convert.output.var.kernel.from                      :   PRODUCT/SUPPORT_DATA/DETAILED_RESULTS/column_averaging_kernel
cso.s5p.ch4.convert.output.var.kernel.units                     :   1
cso.s5p.ch4.convert.output.var.kernel.attrs                     :   { 'long_name' : 'averarging kernel for column-averaged mixing ratio' }

! Convert from surface pressure and delta-pressure over layers to half-level pressure,
! which will have surface pressure for bottom and zero pressure for top:
cso.s5p.ch4.convert.output.var.pressure.dims                    :   pixel layeri
cso.s5p.ch4.convert.output.var.pressure.special                 :   sp_dp_to_pressure
cso.s5p.ch4.convert.output.var.pressure.sp                      :   PRODUCT/SUPPORT_DATA/INPUT_DATA/surface_pressure
cso.s5p.ch4.convert.output.var.pressure.dp                      :   PRODUCT/SUPPORT_DATA/INPUT_DATA/pressure_interval
cso.s5p.ch4.convert.output.var.pressure.units                   :   Pa
cso.s5p.ch4.convert.output.var.pressure.attrs                   :   { 'long_name' : 'pressure at layer interfaces' }

! apriori profile (mol/m2):
cso.s5p.ch4.convert.output.var.vcd_apri.dims                    :   pixel layer
cso.s5p.ch4.convert.output.var.vcd_apri.from                    :   PRODUCT/SUPPORT_DATA/INPUT_DATA/methane_profile_apriori
cso.s5p.ch4.convert.output.var.vcd_apri.units                   :   mol m-2
cso.s5p.ch4.convert.output.var.vcd_apri.attrs                   :   { 'long_name' : 'apriori methane column density' }

! description:
cso.s5p.ch4.convert.output.var.solar_zenith_angle.dims          :   pixel
cso.s5p.ch4.convert.output.var.solar_zenith_angle.from          :   PRODUCT/SUPPORT_DATA/GEOLOCATIONS/solar_zenith_angle
cso.s5p.ch4.convert.output.var.solar_zenith_angle.units         :   degree



!======================================================================
!===
!=== listing
!===
!======================================================================

! csv file that will hold records per file with:
! - timerange of pixels in file
! - orbit number
cso.s5p.ch4.listing.file                :  ${my.work}/CSO-data/${my.region}/S5p/CH4/listing.csv

! renew table if file already exists?
cso.s5p.ch4.listing.renew               :  True

! time range:
cso.s5p.ch4.listing.timerange.start     :  ${my.timerange.start}
cso.s5p.ch4.listing.timerange.end       :  ${my.timerange.end}

! filename filters relative to listing file that should be scanned for orbit files;
! names could include time templates ;
! if same orbit is found in multiple directories, the first found is used;
! remove existing table for safety to ensure that this is done correctly ...
cso.s5p.ch4.listing.patterns            :  RPRO/%Y/%m/S5p_*.nc

!! adhoc: use the time for which file is valid as timerange;
!! this is used for the synthetic S4 data that have no time record ...
!cso.s5p.ch4.listing.use_t               :  False

! extra columns to be added, read from global attributes:
cso.s5p.ch4.listing.xcolumns            :  orbit


!======================================================================
!===
!=== catalogue
!===
!======================================================================

! listing file with filenames/timerange.
cso.s5p.ch4.catalogue.input.listing               :  ${cso.s5p.ch4.listing.file}

! time range:
cso.s5p.ch4.catalogue.timerange.start             :  ${my.timerange.start}
cso.s5p.ch4.catalogue.timerange.end               :  ${my.timerange.end}

! target filenames; templates:
! - time values
! - %{orbit}   : from listing
! - %{varname} for variable
cso.s5p.ch4.catalogue.output.file                 :  ${my.work}/CSO-data-catalogue/S5p/CH4/${my.region}/%Y/%m/%d/S5p_CH4_%{orbit}__%{varname}.png

! map domain (west east south north)
cso.s5p.ch4.catalogue.domain                      :  ${my.region.west} ${my.region.east} ${my.region.south} ${my.region.north}

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

! renew existing files?
!cso.s5p.ch4.catalogue.renew                       :  False
cso.s5p.ch4.catalogue.renew                       :  True

! variables to be plotted:
cso.s5p.ch4.catalogue.vars                        :  xvmr xvmr_errvar qa_value

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

! extra keyword arguments for map:
cso.s5p.ch4.catalogue.map                         :  resolution='l'

! convert units:
cso.s5p.ch4.catalogue.var.xvmr.units                         :  ppb
! style:
cso.s5p.ch4.catalogue.var.xvmr.vmin                          :  1600.0
cso.s5p.ch4.catalogue.var.xvmr.vmax                          :  2200.0

! show error as std.dev, convert to xvmr units:
cso.s5p.ch4.catalogue.var.xvmr_errvar.units                  :  ppb
! style:
cso.s5p.ch4.catalogue.var.xvmr_errvar.vmax                   :  5.0

! style:
cso.s5p.ch4.catalogue.var.qa_value.vmin                     :   0.0
cso.s5p.ch4.catalogue.var.qa_value.vmax                     :   1.0
cso.s5p.ch4.catalogue.var.qa_value.colors                   :   ['red','yellow','green']


!-----------------------------------------------------------
! catalogue index
!-----------------------------------------------------------

! target location:
cso.s5p.ch4.catalogue-index.outdir                    :  ${my.work}/CSO-data-catalogue/S5p/CH4/${my.region}

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

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

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

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

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

! content type:
cso.s5p.ch4.catalogue-index.date.orbit.var.type            :  img
! define image:
cso.s5p.ch4.catalogue-index.date.orbit.var.img             :   %{date[0:4]}/%{date[4:6]}/%{date[6:8]}/S5p_CH4_%{orbit}__%{var}.png
cso.s5p.ch4.catalogue-index.date.orbit.var.kwargs          :  height=200



!!======================================================================
!!===
!!=== simulation catalogue
!!===
!!======================================================================
!
!
!!-----------------------------------------------------------
!! simulation catalogue
!!-----------------------------------------------------------
!
!! target directory for catalogue:
!cso.s5p.ch4.sim-catalogue.output.dir             :  ${my.run.base}/cso-catalogue/CH4
!
!! target files, time tempates are replaced:
!cso.s5p.ch4.sim-catalogue.output.file            :  %Y/%m/%d/S5p-co_%Y%m%d_%H%M_%{var}.png
!
!! input files:
!cso.s5p.ch4.sim-catalogue.input.data.file        :  ${my.run.base}/output/CSO_output_%Y%m%d_%H%M_S5p-co_data.nc
!cso.s5p.ch4.sim-catalogue.input.state.file       :  ${my.run.base}/output/CSO_output_%Y%m%d_%H%M_S5p-co_state.nc
!
!! time range:
!cso.s5p.ch4.sim-catalogue.timerange.start        :  ${my.timerange.start}
!cso.s5p.ch4.sim-catalogue.timerange.end          :  ${my.timerange.end}
!cso.s5p.ch4.sim-catalogue.timerange.step         :  hour
!
!! map domain used for simulations (west east south north):
!!cso.s5p.ch4.sim-catalogue.domain                 :  -10 30 35 65
!cso.s5p.ch4.sim-catalogue.domain                 :  ${my.sim-domain}
!
!! figure size (inches), default is (8,6):
!cso.s5p.ch4.sim-catalogue.figsize                :  ${my.region.figsize}
!
!! renew existing files?
!!cso.s5p.ch4.sim-catalogue.renew                  :  False
!cso.s5p.ch4.sim-catalogue.renew                  :  True
!
!! variables to be plotted:
!cso.s5p.ch4.sim-catalogue.vars                   :  yr ys
!
!! variable:
!cso.s5p.ch4.sim-catalogue.var.yr.long_name       :  TROPOMI CH4 retr.
!cso.s5p.ch4.sim-catalogue.var.yr.source          :  data:yr
!! convert units:
!cso.s5p.ch4.sim-catalogue.var.yr.units           :  1e15 mlc/cm2
!! style:
!cso.s5p.ch4.sim-catalogue.var.yr.vmin            :  1500.0
!cso.s5p.ch4.sim-catalogue.var.yr.vmax            :  3500.0
!
!! variable:
!cso.s5p.ch4.sim-catalogue.var.ys.long_name       :  EMEP simulated TROPOMI CH4 retr.
!cso.s5p.ch4.sim-catalogue.var.ys.source          :  state:ys
!! convert units:
!cso.s5p.ch4.sim-catalogue.var.ys.units           :  1e15 mlc/cm2
!! style:
!cso.s5p.ch4.sim-catalogue.var.ys.vmin            :  1500.0
!cso.s5p.ch4.sim-catalogue.var.ys.vmax            :  3500.0
!
!
!!-----------------------------------------------------------
!! sim catalogue index
!!-----------------------------------------------------------
!
!! target location:
!cso.s5p.ch4.sim-catalogue-index.outdir                    :  ${cso.s5p.ch4.sim-catalogue.output.dir}
!
!! title:
!cso.s5p.ch4.sim-catalogue-index.header                    :  CSO catalogue
!! show info on created page?
!cso.s5p.ch4.sim-catalogue-index.info                      :  True
!
!! create new page for each value?
!cso.s5p.ch4.sim-catalogue-index.newpage                   :  True
!
!! content type:
!cso.s5p.ch4.sim-catalogue-index.type                      :  list
!! define row values:
!cso.s5p.ch4.sim-catalogue-index.name                      :  date
!cso.s5p.ch4.sim-catalogue-index.values                    :  TimeSeries( ${my.timerange.start}, ${my.timerange.end}, '1 day', '%Y%m%d' )
!
!! create new page for each value:
!cso.s5p.ch4.sim-catalogue-index.date.newpage              :  True
!! content type:
!cso.s5p.ch4.sim-catalogue-index.date.type                 :  table-row
!! define row values:
!cso.s5p.ch4.sim-catalogue-index.date.name                 :  time
!cso.s5p.ch4.sim-catalogue-index.date.values               :  Range( 0, 23, 1, '%2.2i00' )
!
!! content type:
!cso.s5p.ch4.sim-catalogue-index.date.time.type            :  table-col
!! define column values:
!cso.s5p.ch4.sim-catalogue-index.date.time.name            :  var
!cso.s5p.ch4.sim-catalogue-index.date.time.values          :  ${cso.s5p.ch4.sim-catalogue.vars}
!
!! content type:
!cso.s5p.ch4.sim-catalogue-index.date.time.var.type        :  img
!! define image:
!cso.s5p.ch4.sim-catalogue-index.date.time.var.img         :  %{date[0:4]}/%{date[4:6]}/%{date[6:8]}/S5p-co_%{date}_%{time}_%{var}.png
!cso.s5p.ch4.sim-catalogue-index.date.time.var.kwargs      :  height=300
!
!
!
!!======================================================================
!!===
!!=== gridded orbits
!!===
!!======================================================================
!
!
!!-----------------------------------------------------------
!! gridded orbits
!!-----------------------------------------------------------
!
!! time range:
!cso.s5p.ch4.gridded.timerange.start        :  ${my.timerange.start}
!cso.s5p.ch4.gridded.timerange.end          :  ${my.timerange.end}
!cso.s5p.ch4.gridded.timerange.step         :  hourly
!!!~ testing ...
!!cso.s5p.ch4.gridded.timerange.start        :  2018-05-01 00:00:00
!!cso.s5p.ch4.gridded.timerange.end          :  2019-07-31 23:59:00
!!cso.s5p.ch4.gridded.timerange.step         :  hourly
!
!! renew existing files?
!cso.s5p.ch4.gridded.renew                  :  True
!!cso.s5p.ch4.gridded.renew                  :  False
!
!!~
!
!! grid definition:
!cso.s5p.ch4.gridded.grid.west              :  ${my.sim.west}
!cso.s5p.ch4.gridded.grid.east              :  ${my.sim.east}
!cso.s5p.ch4.gridded.grid.south             :  ${my.sim.south}
!cso.s5p.ch4.gridded.grid.north             :  ${my.sim.north}
!! resolution:
!cso.s5p.ch4.gridded.grid.dlon              :  ${my.gridding.dlon}
!cso.s5p.ch4.gridded.grid.dlat              :  ${my.gridding.dlat}
!
!! mapping level from footprints to grid cells;
!!!~ center only:
!!cso.s5p.ch4.gridded.mapping.levels         :  0
!!~ same as in model:
!cso.s5p.ch4.gridded.mapping.levels         :  5
!
!!~
!
!! keywords for source files; 
!! the first one should have the footprints:
!cso.s5p.ch4.gridded.sources                :  data state
!
!! input files for each source type:
!cso.s5p.ch4.gridded.source.data            :  ${my.run.base}/output/%Y/CSO_output_%Y%m%d_%H%M_S5p-co_data.nc
!cso.s5p.ch4.gridded.source.state           :  ${my.run.base}/output/%Y/CSO_output_%Y%m%d_%H%M_S5p-co_state.nc
!
!!~
!
!! keywords for filters:
!cso.s5p.ch4.gridded.filters                  :  quality
!
!! minimum quality value required:
!cso.s5p.ch4.gridded.filter.quality.var       :  qa_value
!cso.s5p.ch4.gridded.filter.quality.type      :  min
!cso.s5p.ch4.gridded.filter.quality.min       :  0.75
!cso.s5p.ch4.gridded.filter.quality.units     :  1
!        
!!~
!
!! target file, might contain templates:
!!   %Y,%m,etc     : time values
!!   %{basename}   : basename (without extension) of first source file
!cso.s5p.ch4.gridded.output.file              :  ${my.run.base}/gridded/${my.sim-region}/%Y/%m/CSO_gridded_%Y%m%d_%H%M_S5p-co.nc
!
!! data variables to be created:
!cso.s5p.ch4.gridded.output.vars              :  yr ys
!
!! input variables:
!!   data:yr    : from data file
!!   state:ys    : from state file
!cso.s5p.ch4.gridded.output.yr.source         :  data:yr
!cso.s5p.ch4.gridded.output.ys.source         :  state:ys
!
!
!!-----------------------------------------------------------
!! catalogue of gridded fields
!!-----------------------------------------------------------
!
!! time range:
!cso.s5p.ch4.gridded-catalogue-figs.timerange.start        :  ${cso.s5p.ch4.gridded.timerange.start}
!cso.s5p.ch4.gridded-catalogue-figs.timerange.end          :  ${cso.s5p.ch4.gridded.timerange.end}
!!cso.s5p.ch4.gridded-catalogue-figs.timerange.step         :  hour
!cso.s5p.ch4.gridded-catalogue-figs.timerange.step         :  month
!
!! renew existing files?
!cso.s5p.ch4.gridded-catalogue-figs.renew                  :  True
!!cso.s5p.ch4.gridded-catalogue-figs.renew                  :  False
!
!! target directory for catalogue:
!!cso.s5p.ch4.gridded-catalogue-figs.output.dir             :  ${my.run.base}/gridded/${my.sim-region}/catalogue
!cso.s5p.ch4.gridded-catalogue-figs.output.dir             :  ${my.run.base}/gridded/${my.sim-region}/catalogue-m
!
!! input files:
!!cso.s5p.ch4.gridded-catalogue-figs.input.file             :  ../%Y/%m/CSO_gridded_%Y%m%d_%H%M_S5p-co.nc
!!~ idem for daily average:
!!cso.s5p.ch4.gridded-catalogue-figs.input.file             :  ../CSO_gridded_%Y%m%d_S5p-co.nc
!!~ idem for monthly average:
!cso.s5p.ch4.gridded-catalogue-figs.input.file             :  ../CSO_gridded_%Y%m_S5p-co.nc
!
!! target files, time tempates and variable name are replaced:
!!cso.s5p.ch4.gridded-catalogue-figs.output.file            :  %Y/%m/%d/CSO_gridded_%Y%m%d_%H%M_S5p-co_%{var}.png
!!~ idem for daily average:
!!cso.s5p.ch4.gridded-catalogue-figs.output.file            :  %Y/%m/%d/CSO_gridded_%Y%m%d_S5p-co_%{var}.png
!!~ idem for monthly average:
!cso.s5p.ch4.gridded-catalogue-figs.output.file            :  %Y/%m/CSO_gridded_%Y%m_S5p-co_%{var}.png
!
!! figure size (inches), default is (8,6):
!cso.s5p.ch4.gridded-catalogue-figs.figsize                :  ${my.region.figsize}
!
!! extra keyword arguments for map:
!cso.s5p.ch4.gridded-catalogue-figs.map                    :  ${my.sim.map}
!
!! variables to be plotted:
!cso.s5p.ch4.gridded-catalogue-figs.vars                   :  yr ys
!
!! variable:
!cso.s5p.ch4.gridded-catalogue-figs.var.yr.long_name       :  TROPOMI CH4 retr.
!cso.s5p.ch4.gridded-catalogue-figs.var.yr.source          :  yr
!! convert units:
!cso.s5p.ch4.gridded-catalogue-figs.var.yr.units           :  mmol/m2
!! style:
!cso.s5p.ch4.gridded-catalogue-figs.var.yr.vmin            :  25.0
!cso.s5p.ch4.gridded-catalogue-figs.var.yr.vmax            :  50.0
!
!! variable:
!cso.s5p.ch4.gridded-catalogue-figs.var.ys.long_name       :  EMEP simulated TROPOMI CH4 retr.
!cso.s5p.ch4.gridded-catalogue-figs.var.ys.source          :  ys
!! convert units:
!cso.s5p.ch4.gridded-catalogue-figs.var.ys.units           :  mmol/m2
!! style:
!cso.s5p.ch4.gridded-catalogue-figs.var.ys.vmin            :  25.0
!cso.s5p.ch4.gridded-catalogue-figs.var.ys.vmax            :  50.0
!
!
!
!!-----------------------------------------------------------
!! gridded catalogue index (daily)
!!-----------------------------------------------------------
!
!! target location:
!cso.s5p.ch4.gridded-catalogue-index.outdir                    :  ${my.run.base}/gridded/${my.sim-region}/catalogue
!
!! title:
!cso.s5p.ch4.gridded-catalogue-index.header                    :  CSO catalogue
!! show info on created page?
!cso.s5p.ch4.gridded-catalogue-index.info                      :  True
!
!! create main page:
!cso.s5p.ch4.gridded-catalogue-index.newpage                   :  True
!
!! content type:
!cso.s5p.ch4.gridded-catalogue-index.type                      :  list
!! define row values:
!cso.s5p.ch4.gridded-catalogue-index.name                      :  date
!cso.s5p.ch4.gridded-catalogue-index.values                    :  TimeSeries( ${cso.s5p.ch4.gridded.timerange.start}, ${cso.s5p.ch4.gridded.timerange.end}, '1 day', '%Y%m%d' )
!
!! create new page for each value:
!cso.s5p.ch4.gridded-catalogue-index.date.newpage              :  True
!! content type:
!cso.s5p.ch4.gridded-catalogue-index.date.type                 :  table-row
!! define row values:
!cso.s5p.ch4.gridded-catalogue-index.date.name                 :  time
!cso.s5p.ch4.gridded-catalogue-index.date.values               :  Range( 0, 23, 1, '%2.2i00' )
!
!! content type:
!cso.s5p.ch4.gridded-catalogue-index.date.time.type            :  table-col
!! define column values:
!cso.s5p.ch4.gridded-catalogue-index.date.time.name            :  var
!cso.s5p.ch4.gridded-catalogue-index.date.time.values          :  ${cso.s5p.ch4.gridded-catalogue-figs.vars}
!
!! content type:
!cso.s5p.ch4.gridded-catalogue-index.date.time.var.type        :  img
!! define image:
!cso.s5p.ch4.gridded-catalogue-index.date.time.var.img         :  %{date[0:4]}/%{date[4:6]}/%{date[6:8]}/CSO_gridded_%{date}_%{time}_S5p-co_%{var}.png
!cso.s5p.ch4.gridded-catalogue-index.date.time.var.kwargs      :  height=300
!
!
!
!
!!======================================================================
!!===
!!=== end
!!===
!!======================================================================
!
!
