Skip to content

Commit 2b5a0b4

Browse files
committed
integrated changes requested by Theresa
1 parent 4cb8037 commit 2b5a0b4

File tree

2 files changed

+62
-27
lines changed

2 files changed

+62
-27
lines changed

fiduceo/cdr/test/writer/templates/uth_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,22 @@ def test_add_variables(self):
291291
self.assertEqual("lon lat", bt_inhom_desc.attrs["coordinates"])
292292
self.assertEqual("K", bt_inhom_desc.attrs["units"])
293293

294+
bt_full_inhom_asc = ds.variables["BT_full_inhomogeneity_ascend"]
295+
self.assertEqual((100, 360), bt_full_inhom_asc.shape)
296+
self.assertTrue(np.isnan(bt_full_inhom_asc.values[73, 174]))
297+
self.assertTrue(np.isnan(bt_full_inhom_asc.attrs["_FillValue"]))
298+
self.assertEqual("Standard deviation of all brightness temperatures - including cloudy pixels - in a grid box for ascending passes", bt_full_inhom_asc.attrs["description"])
299+
self.assertEqual("lon lat", bt_full_inhom_asc.attrs["coordinates"])
300+
self.assertEqual("K", bt_full_inhom_asc.attrs["units"])
301+
302+
bt_full_inhom_desc = ds.variables["BT_full_inhomogeneity_descend"]
303+
self.assertEqual((100, 360), bt_full_inhom_desc.shape)
304+
self.assertTrue(np.isnan(bt_full_inhom_desc.values[74, 175]))
305+
self.assertTrue(np.isnan(bt_full_inhom_desc.attrs["_FillValue"]))
306+
self.assertEqual("Standard deviation of all brightness temperatures - including cloudy pixels - in a grid box for descending passes", bt_full_inhom_desc.attrs["description"])
307+
self.assertEqual("lon lat", bt_full_inhom_desc.attrs["coordinates"])
308+
self.assertEqual("K", bt_full_inhom_desc.attrs["units"])
309+
294310
obs_count_all_asc = ds.variables["observation_count_all_ascend"]
295311
self.assertEqual((100, 360), obs_count_all_asc.shape)
296312
self.assertEqual(-32767, obs_count_all_asc.values[68, 180])

fiduceo/cdr/writer/templates/uth.py

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def add_variables(dataset, width, height):
2424
dataset["overpass_count_ascend"] = UTH._create_overpass_counts_variable(height, width, "Number of satellite overpasses in a grid box for ascending passes")
2525
dataset["overpass_count_descend"] = UTH._create_overpass_counts_variable(height, width, "Number of satellite overpasses in a grid box for descending passes")
2626

27-
dataset["uth_ascend"] = UTH._create_uth_variable(width, height, description="Monthly average of all UTH retrievals in a grid box for ascending passes (calculated from daily averages)",)
27+
dataset["uth_ascend"] = UTH._create_uth_variable(width, height, description="Monthly average of all UTH retrievals in a grid box for ascending passes (calculated from daily averages)", )
2828
dataset["uth_descend"] = UTH._create_uth_variable(width, height, description="Monthly average of all UTH retrievals in a grid box for descending passes (calculated from daily averages)")
2929

3030
dataset["u_independent_uth_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of UTH due to independent effects for ascending passes", coordinates="lon lat")
@@ -34,47 +34,66 @@ def add_variables(dataset, width, height):
3434
dataset["u_common_uth_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of UTH due to common effects for ascending passes", coordinates="lon lat")
3535
dataset["u_common_uth_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of UTH due to common effects for descending passes", coordinates="lon lat")
3636

37-
dataset["uth_inhomogeneity_ascend"] = tu.create_CDR_uncertainty(width, height, "Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for ascending passes", coordinates="lon lat")
38-
dataset["uth_inhomogeneity_descend"] = tu.create_CDR_uncertainty(width, height, "Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for descending passes", coordinates="lon lat")
39-
40-
dataset["BT_ascend"] = UTH._create_bt_variable(width, height, description="Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for ascending passes (calculated from daily averages)")
41-
dataset["BT_descend"] = UTH._create_bt_variable(width, height, description="Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for descending passes (calculated from daily averages)")
42-
dataset["BT_full_ascend"] = UTH._create_bt_variable(width, height, description="Monthly average of all brightness temperatures - including cloudy pixels - for ascending branches (calculated from daily averages)")
43-
dataset["BT_full_descend"] = UTH._create_bt_variable(width, height, description="Monthly average of all brightness temperatures - including cloudy pixels - for descending branches (calculated from daily averages)")
37+
dataset["uth_inhomogeneity_ascend"] = tu.create_CDR_uncertainty(width, height,
38+
"Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for ascending passes",
39+
coordinates="lon lat")
40+
dataset["uth_inhomogeneity_descend"] = tu.create_CDR_uncertainty(width, height,
41+
"Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for descending passes",
42+
coordinates="lon lat")
43+
44+
dataset["BT_ascend"] = UTH._create_bt_variable(width, height,
45+
description="Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for ascending passes (calculated from daily averages)")
46+
dataset["BT_descend"] = UTH._create_bt_variable(width, height,
47+
description="Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for descending passes (calculated from daily averages)")
48+
dataset["BT_full_ascend"] = UTH._create_bt_variable(width, height,
49+
description="Monthly average of all brightness temperatures - including cloudy pixels - for ascending branches (calculated from daily averages)")
50+
dataset["BT_full_descend"] = UTH._create_bt_variable(width, height,
51+
description="Monthly average of all brightness temperatures - including cloudy pixels - for descending branches (calculated from daily averages)")
4452

4553
dataset["u_independent_BT_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to independent effects for ascending passes", coordinates="lon lat",
4654
units="K")
4755
dataset["u_independent_BT_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to independent effects for descending passes", coordinates="lon lat",
4856
units="K")
49-
dataset["u_independent_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to independent effects for ascending branches", coordinates="lon lat",
50-
units="K")
51-
dataset["u_independent_BT_full_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to independent effects for descending branches", coordinates="lon lat",
52-
units="K")
57+
dataset["u_independent_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height,
58+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to independent effects for ascending branches",
59+
coordinates="lon lat", units="K")
60+
dataset["u_independent_BT_full_descend"] = tu.create_CDR_uncertainty(width, height,
61+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to independent effects for descending branches",
62+
coordinates="lon lat", units="K")
5363

5464
dataset["u_structured_BT_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to structured effects for ascending passes", coordinates="lon lat",
5565
units="K")
5666
dataset["u_structured_BT_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to structured effects for descending passes", coordinates="lon lat",
5767
units="K")
58-
dataset["u_structured_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to structured effects for descending branches", coordinates="lon lat",
59-
units="K")
60-
dataset["u_structured_BT_full_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to structured effects for descending branches", coordinates="lon lat",
61-
units="K")
62-
63-
dataset["u_common_BT_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to common effects for ascending passes", coordinates="lon lat",
64-
units="K")
65-
dataset["u_common_BT_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to common effects for descending passes", coordinates="lon lat",
66-
units="K")
67-
dataset["u_common_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to common effects for ascending branches", coordinates="lon lat",
68-
units="K")
69-
dataset["u_common_BT_full_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of monthly brightness temperature averages including cloudy pixels due to common effects for descending branches", coordinates="lon lat",
70-
units="K")
68+
dataset["u_structured_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height,
69+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to structured effects for descending branches",
70+
coordinates="lon lat", units="K")
71+
dataset["u_structured_BT_full_descend"] = tu.create_CDR_uncertainty(width, height,
72+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to structured effects for descending branches",
73+
coordinates="lon lat", units="K")
74+
75+
dataset["u_common_BT_ascend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to common effects for ascending passes", coordinates="lon lat", units="K")
76+
dataset["u_common_BT_descend"] = tu.create_CDR_uncertainty(width, height, "Uncertainty of brightness temperature due to common effects for descending passes", coordinates="lon lat", units="K")
77+
dataset["u_common_BT_full_ascend"] = tu.create_CDR_uncertainty(width, height,
78+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to common effects for ascending branches",
79+
coordinates="lon lat", units="K")
80+
dataset["u_common_BT_full_descend"] = tu.create_CDR_uncertainty(width, height,
81+
"Uncertainty of monthly brightness temperature averages including cloudy pixels due to common effects for descending branches",
82+
coordinates="lon lat", units="K")
7183

7284
dataset["BT_inhomogeneity_ascend"] = tu.create_CDR_uncertainty(width, height,
7385
"Standard deviation of all daily brightness temperature averages which were used to calculate the monthly brightness temperature average for ascending passes",
7486
coordinates="lon lat", units="K")
7587
dataset["BT_inhomogeneity_descend"] = tu.create_CDR_uncertainty(width, height,
76-
"Standard deviation of all daily brightness temperature averages which were used to calculate the monthly brightness temperature average for descending passes",
77-
coordinates="lon lat", units="K")
88+
"Standard deviation of all daily brightness temperature averages which were used to calculate the monthly brightness temperature average for descending passes",
89+
coordinates="lon lat", units="K")
90+
91+
dataset["BT_full_inhomogeneity_ascend"] = tu.create_CDR_uncertainty(width, height,
92+
"Standard deviation of all brightness temperatures - including cloudy pixels - in a grid box for ascending passes",
93+
coordinates="lon lat", units="K")
94+
dataset["BT_full_inhomogeneity_descend"] = tu.create_CDR_uncertainty(width, height,
95+
"Standard deviation of all brightness temperatures - including cloudy pixels - in a grid box for descending passes",
96+
coordinates="lon lat", units="K")
7897

7998
dataset["observation_count_all_ascend"] = UTH._create_observation_counts_variable(height, width, "Number of all observations in a grid box for ascending passes - no filtering done")
8099
dataset["observation_count_all_descend"] = UTH._create_observation_counts_variable(height, width, "Number of all observations in a grid box for descending passes - no filtering done")

0 commit comments

Comments
 (0)