Skip to content

Commit 177f084

Browse files
committed
Update: support of ESA SCOPE PP parameter files
1 parent fd0c800 commit 177f084

File tree

10 files changed

+98
-11
lines changed

10 files changed

+98
-11
lines changed

INSTALL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ The `pytest` output will be printed to the console and will read like, e.g.:
8181
test/kaleidoscope/test_generators.py . [ 42%]
8282
test/kaleidoscope/test_reader.py .... [ 71%]
8383
test/kaleidoscope/test_writer.py .... [100%]
84-
======================= 14 passed in 152.59s (0:02:32) =======================
84+
85+
======================= 14 passed in 145.04s (0:02:25) =======================

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ processor. The processor is invoked from the command line. Typing
2121
will print a detailed usage message to the screen
2222

2323
usage: kaleidoscope [-h]
24-
--source-type {esa-cci-oc,esa-scope-exchange,ghrsst,glorys}
24+
--source-type {esa-cci-oc,esa-scope-cs,esa-scope-pp-parameters,ghrsst,glorys}
2525
--selector SELECTOR
2626
[--engine-reader {h5netcdf,netcdf4,zarr}]
2727
[--engine-writer {h5netcdf,netcdf4,zarr}]
@@ -40,7 +40,7 @@ will print a detailed usage message to the screen
4040

4141
options:
4242
-h, --help show this help message and exit
43-
--source-type {esa-cci-oc,esa-scope-exchange,ghrsst,glorys}
43+
--source-type {esa-cci-oc,esa-scope-cs,esa-scope-pp-parameters,ghrsst,glorys}
4444
the source type. (default: None)
4545
--selector SELECTOR the Monte Carlo stream selector. An integral number
4646
which must not be negative. (default: None)

kaleidoscope/config/config.random.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
]
163163
}
164164
},
165-
"esa-scope-exchange": {
165+
"esa-scope-cs": {
166166
"fco2": {
167167
"uncertainty": "fco2_tot_unc",
168168
"coverage": 2.0,
@@ -211,6 +211,28 @@
211211
]
212212
}
213213
},
214+
"esa-scope-pp-parameters": {
215+
"rho": {
216+
"uncertainty": 0.1,
217+
"distribution": "lognormal"
218+
},
219+
"sigma": {
220+
"uncertainty": 1.0,
221+
"distribution": "lognormal"
222+
},
223+
"zm": {
224+
"uncertainty": 1.0,
225+
"distribution": "lognormal"
226+
},
227+
"alphaB": {
228+
"uncertainty": 0.01,
229+
"distribution": "lognormal"
230+
},
231+
"PmB": {
232+
"uncertainty": 0.1,
233+
"distribution": "normal"
234+
}
235+
},
214236
"ghrsst": {
215237
"analysed_sst": {
216238
"uncertainty": "analysed_sst_uncertainty",

kaleidoscope/config/config.reader.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lat": 2160,
1111
"lon": 2160
1212
},
13-
"esa-scope-exchange": {
13+
"esa-scope-cs": {
1414
"time": 12,
1515
"latitude": 0,
1616
"longitude": 0

kaleidoscope/config/config.writer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lat": 270,
1111
"lon": 270
1212
},
13-
"esa-scope-exchange": {
13+
"esa-scope-cs": {
1414
"time": 12,
1515
"latitude": 0,
1616
"longitude": 0

kaleidoscope/parser.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ def _add_options(parser):
6767
parser.add_argument(
6868
"--source-type",
6969
help="the source type.",
70-
choices=["esa-cci-oc", "esa-scope-exchange", "ghrsst", "glorys"],
70+
choices=[
71+
"esa-cci-oc",
72+
"esa-scope-cs",
73+
"esa-scope-pp-parameters",
74+
"ghrsst",
75+
"glorys",
76+
],
7177
required=True,
7278
dest="source_type",
7379
)
File renamed without changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
netcdf PE_mro_mean_prv_4km_120psummer_cor {
2+
dimensions:
3+
lat = 4320 ;
4+
lon = 8640 ;
5+
variables:
6+
float latitude(lat) ;
7+
latitude:_FillValue = -999.f ;
8+
latitude:units = "degrees north" ;
9+
latitude:_Storage = "contiguous" ;
10+
latitude:_Endianness = "little" ;
11+
float longitude(lon) ;
12+
longitude:_FillValue = -999.f ;
13+
longitude:units = "degrees east" ;
14+
longitude:_Storage = "contiguous" ;
15+
longitude:_Endianness = "little" ;
16+
double sigma(lat, lon) ;
17+
sigma:_FillValue = -999. ;
18+
sigma:units = "mg m-3" ;
19+
sigma:_Storage = "contiguous" ;
20+
sigma:_Endianness = "little" ;
21+
double zm(lat, lon) ;
22+
zm:_FillValue = -999. ;
23+
zm:units = "m" ;
24+
zm:_Storage = "contiguous" ;
25+
zm:_Endianness = "little" ;
26+
double rho(lat, lon) ;
27+
rho:_FillValue = -999. ;
28+
rho:units = "dimensionless" ;
29+
rho:_Storage = "contiguous" ;
30+
rho:_Endianness = "little" ;
31+
double alphaB(lat, lon) ;
32+
alphaB:_FillValue = -999. ;
33+
alphaB:units = "mgC mgChl-1 h-1 (W m-2)-1" ;
34+
alphaB:_Storage = "contiguous" ;
35+
alphaB:_Endianness = "little" ;
36+
double PmB(lat, lon) ;
37+
PmB:_FillValue = -999. ;
38+
PmB:units = "mgC mgChl-1 h-1" ;
39+
PmB:_Storage = "contiguous" ;
40+
PmB:_Endianness = "little" ;
41+
double lat(lat) ;
42+
lat:_FillValue = NaN ;
43+
lat:_Storage = "contiguous" ;
44+
lat:_Endianness = "little" ;
45+
double lon(lon) ;
46+
lon:_FillValue = NaN ;
47+
lon:_Storage = "contiguous" ;
48+
lon:_Endianness = "little" ;
49+
50+
// global attributes:
51+
:description = "Physio_parameters_summer" ;
52+
:source = "netCDF3 python" ;
53+
:history = "Created Thu Jul 4 09:46:47 2024" ;
54+
:_NCProperties = "version=2,netcdf=4.9.2,hdf5=1.14.3" ;
55+
:_SuperblockVersion = 2 ;
56+
:_IsNetcdf4 = 1 ;
57+
:_Format = "netCDF-4" ;
58+
}

test/kaleidoscope/test_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def test_read_esa_cci_oc(self):
7070
"""Tests writing a generated target dataset."""
7171
self.assert_read("esa-cci-oc")
7272

73-
def test_read_esa_scope_exchange(self):
73+
def test_read_esa_scope_cs(self):
7474
"""Tests writing a generated target dataset."""
75-
self.assert_read("esa-scope-exchange")
75+
self.assert_read("esa-scope-cs")
7676

7777
def test_read_ghrsst(self):
7878
"""Tests writing a generated target dataset."""

test/kaleidoscope/test_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def test_write_esa_cci_oc(self):
6363
"""Tests writing a generated target dataset."""
6464
self.assert_write("esa-cci-oc")
6565

66-
def test_write_esa_scope_exchange(self):
66+
def test_write_esa_scope_cs(self):
6767
"""Tests writing a generated target dataset."""
68-
self.assert_write("esa-scope-exchange")
68+
self.assert_write("esa-scope-cs")
6969

7070
def test_write_ghrsst(self):
7171
"""Tests writing a generated target dataset."""

0 commit comments

Comments
 (0)