@@ -64,6 +64,7 @@ def run(self, source: Dataset) -> Dataset: # noqa: D102
6464 for v , x in target .data_vars .items ():
6565 if v not in config :
6666 continue
67+ get_logger ().info (f"starting graph for variable: { v } " )
6768 attrs : dict [str :Any ] = config [v ]
6869 f = Randomize (
6970 x .dtype ,
@@ -87,8 +88,9 @@ def run(self, source: Dataset) -> Dataset: # noqa: D102
8788 data = f .apply_to (
8889 x .data ,
8990 u .data ,
90- coverage_factor = attrs .get ("coverage_factor " , 1.0 ),
91+ coverage = attrs .get ("coverage " , 1.0 ),
9192 relative = attrs .get ("relative" , False ),
93+ clip = attrs .get ("clip" , None ),
9294 ),
9395 coords = x .coords ,
9496 dims = x .dims ,
@@ -99,37 +101,51 @@ def run(self, source: Dataset) -> Dataset: # noqa: D102
99101 b = target [attrs ["bias" ]]
100102 r = target [attrs ["rmsd" ]]
101103 target [v ] = DataArray (
102- data = f .apply_to (x .data , r .data , b .data ),
104+ data = f .apply_to (
105+ x .data ,
106+ r .data ,
107+ b .data ,
108+ clip = attrs .get ("clip" , [None , None ]),
109+ ),
103110 coords = x .coords ,
104111 dims = x .dims ,
105112 name = x .name ,
106113 attrs = x .attrs ,
107114 )
108115 if get_logger ().is_enabled (Logging .DEBUG ):
109116 get_logger ().debug (
110- f"source[{ v } ] min: { source [v ].min ().values .item () :.6f} "
117+ f"source[{ v } ] min: "
118+ f"{ source [v ].quantile (0.0001 ).values .item () :.6f} "
111119 )
112120 get_logger ().debug (
113- f"target[{ v } ] min: { target [v ].min ().values .item () :.6f} "
121+ f"target[{ v } ] min: "
122+ f"{ target [v ].quantile (0.0001 ).values .item () :.6f} "
114123 )
115124 get_logger ().debug (
116- f"source[{ v } ] max: { source [v ].max ().values .item () :.6f} "
125+ f"source[{ v } ] max: "
126+ f"{ source [v ].quantile (0.9999 ).values .item () :.6f} "
117127 )
118128 get_logger ().debug (
119- f"target[{ v } ] max: { target [v ].max ().values .item () :.6f} "
129+ f"target[{ v } ] max: "
130+ f"{ target [v ].quantile (0.9999 ).values .item () :.6f} "
120131 )
121132 get_logger ().debug (
122- f"source[{ v } ] mean: { source [v ].mean ().values .item () :.6f} "
133+ f"source[{ v } ] mean: "
134+ f"{ source [v ].mean ().values .item () :.6f} "
123135 )
124136 get_logger ().debug (
125- f"target[{ v } ] mean: { target [v ].mean ().values .item () :.6f} "
137+ f"target[{ v } ] mean: "
138+ f"{ target [v ].mean ().values .item () :.6f} "
126139 )
127140 get_logger ().debug (
128- f"source[{ v } ] std: { source [v ].std ().values .item () :.6f} "
141+ f"source[{ v } ] std: "
142+ f"{ source [v ].std ().values .item () :.6f} "
129143 )
130144 get_logger ().debug (
131- f"target[{ v } ] std: { target [v ].std ().values .item () :.6f} "
145+ f"target[{ v } ] std: "
146+ f"{ target [v ].std ().values .item () :.6f} "
132147 )
148+ get_logger ().info (f"finished graph for variable: { v } " )
133149 return target
134150
135151 @property
@@ -168,7 +184,7 @@ def config(self) -> dict[str : dict[str:Any]]:
168184 "Rrs_665" : {
169185 "bias" : "Rrs_665_bias" ,
170186 "rmsd" : "Rrs_665_rmsd" ,
171- "distribution" : "lognormal " ,
187+ "distribution" : "normal " ,
172188 },
173189 "adg_412" : {
174190 "bias" : "adg_412_bias" ,
@@ -245,35 +261,39 @@ def config(self) -> dict[str : dict[str:Any]]:
245261 "fco2" : {
246262 "uncertainty" : "fco2_tot_unc" ,
247263 # the uncertainty interval coverage factor
248- "coverage_factor " : 2.0 ,
264+ "coverage " : 2.0 ,
249265 "distribution" : "lognormal" ,
250266 },
251267 "flux" : {
252268 "uncertainty" : "flux_unc" ,
253269 # uncertainty is stated in relative terms
254270 "relative" : True ,
255- "coverage_factor " : 2.0 ,
271+ "coverage " : 2.0 ,
256272 "distribution" : "normal" ,
257273 },
258274 "ta" : {
259275 "uncertainty" : "ta_tot_unc" ,
260- "coverage_factor " : 2.0 ,
276+ "coverage " : 2.0 ,
261277 "distribution" : "lognormal" ,
278+ # clip to interval
279+ "clip" : (None , 3400.0 ),
262280 },
263281 "dic" : {
264282 "uncertainty" : "dic_tot_unc" ,
265- "coverage_factor " : 2.0 ,
283+ "coverage " : 2.0 ,
266284 "distribution" : "lognormal" ,
285+ "clip" : (None , 3200.0 ),
267286 },
268- "ph " : {
269- "uncertainty" : "ph_tot_unc " ,
270- "coverage_factor " : 2.0 ,
271- "distribution" : "lognormal " ,
287+ "pH " : {
288+ "uncertainty" : "pH_tot_unc " ,
289+ "coverage " : 2.0 ,
290+ "distribution" : "normal " ,
272291 },
273292 "saturation_aragonite" : {
274293 "uncertainty" : "saturation_aragonite_tot_unc" ,
275- "coverage_factor " : 2.0 ,
294+ "coverage " : 2.0 ,
276295 "distribution" : "lognormal" ,
296+ "clip" : (None , 6.0 ),
277297 },
278298 },
279299 "ghrsst" : {
0 commit comments