Skip to content

Commit

Permalink
add MTG-IRS ctests
Browse files Browse the repository at this point in the history
  • Loading branch information
stemiglio committed Feb 7, 2025
1 parent d60fed9 commit 16718e8
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
Binary file added test/testinput/cx_globalnamelist_mtgirs.nc4
Binary file not shown.
58 changes: 58 additions & 0 deletions test/testinput/cxwriter_globalnamelist_mtgirs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
time window:
begin: 2018-01-01T00:00:00Z
end: 2018-01-01T01:00:00Z

observations:
- obs space:
name: MTGIRS
obsdatain:
engine:
type: H5File
obsfile: Data/varobs_globalnamelist_mtgirs.nc4
observed variables: [radiance]
simulated variables: [brightnessTemperature]
derived variables: [brightnessTemperature]
channels: &all_channels 1, 3
geovals:
filename: Data/cx_globalnamelist_mtgirs.nc4
obs filters:
# Set the flag of observations with missing values to "pass": we want to check if these
# values are encoded correctly in the VarObsFile.
- filter: Reset Flags to Pass
flags_to_reset: [10, 15] # missing, Hfailed
### Assign nominal error (ensure not missing values) ###
- filter: Perform Action
filter variables:
- name: brightnessTemperature
channels: *all_channels
action:
name: assign error
error parameter: 10.0
- filter: BlackList
filter variables:
- name: brightnessTemperature
channels: *all_channels
where:
- variable:
name: MetaData/latitude #ensures ob2 is failed
value: is_not_valid
- filter: Cx Writer
variables_for_quality_control:
- name: brightnessTemperature
channels: *all_channels
namelist_directory: ../etc/global/cx
reject_obs_with_all_variables_failing_qc: true
general_mode: debug
IC_PLevels: 5
- filter: Cx Checker
expected_surface_variables: ["1","2","3","4","5","6","13","16","17"]
expected_upper_air_variables: ["1","5","11","29","30","31","34","35"]
expected_main_table_columns:
- # batch 1 - 9 1dvalues first ; then 2d values in expected order
# observation 3 is rejected by the tests above hence only 3 (1,2,4) columns
- ["27.10","37.10","67.10","77.10","47.10","57.10","7.10","87.10","17.10","1.10","1.20","1.30","11.10","11.20","11.30","41.10","41.20","41.30","21.10","21.20","21.30","31.10","31.20","31.30","51.10","51.20","51.30","71.10","71.20","71.30","61.10","61.20","61.30"] # column 1 - 1st observation
- ["27.30","37.30","67.30","77.30","47.30","57.30","7.30","87.30","17.30","3.10","3.20","3.30","13.10","13.20","13.30","43.10","43.20","43.30","23.10","23.20","23.30","33.10","33.20","33.30","53.10","53.20","53.30","73.10","73.20","73.30","63.10","63.20","63.30"] # column 3 - 3rd observation
- ["27.40","37.40","67.40","77.40","47.40","57.40","7.40","87.40","17.40","4.10","4.20","4.30","14.10","14.20","14.30","44.10","44.20","44.30","24.10","24.20","24.30","34.10","34.20","34.30","54.10","54.20","54.30","74.10","74.20","74.30","64.10","64.20","64.30"] # column 4 - 4th observation
HofX: ObsValue # just a placeholder -- not used, but needed to force calls to postFilter.
benchmarkFlag: 1000 # just to keep the ObsFilters test happy
flaggedBenchmark: 0
Binary file added test/testinput/varobs_globalnamelist_mtgirs.nc4
Binary file not shown.
68 changes: 68 additions & 0 deletions test/testinput/varobswriter_globalnamelist_mtgirs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
time window:
begin: 1999-01-01T00:00:00Z
end: 2032-01-01T02:00:00Z

observations:
- obs space:
name: MTGIRS
obsdatain:
engine:
type: H5File
obsfile: Data/varobs_globalnamelist_mtgirs.nc4
observed variables: [radiance]
simulated variables: [brightnessTemperature]
derived variables: [brightnessTemperature]
channels: &all_channels 1, 3
obs filters:
# Set the flag of observations with missing values to "pass": we want to check if these
# values are encoded correctly in the VarObsFile.
- filter: Reset Flags to Pass
flags_to_reset: [10, 15] # missing, Hfailed
### Assign nominal error (ensure not missing values) ###
- filter: Perform Action
filter variables:
- name: brightnessTemperature
channels: *all_channels
action:
name: assign error
error parameter: 10.0
- filter: BlackList
filter variables:
- name: brightnessTemperature
channels: *all_channels
where:
- variable:
name: MetaData/latitude #ensures ob2 is failed
value: is_not_valid
- filter: VarObs Writer
namelist_directory: ../etc/global/varobs
variables_for_quality_control:
- name: brightnessTemperature
channels: *all_channels
reject_obs_with_all_variables_failing_qc: true
general_mode: verbose
output_varbc_predictors: true
size_of_varobs_array: 4
fill_obstype_from_ops_subtype: true
- filter: VarObs Checker
expected_main_table_columns:
# Only channels 1 and 3 are simulated and hence written to the VarObs file.
# In the arrays below, rows denote locations and columns are the varobs channels are consecutive.
field: ["10","10","10","10","11","18","19","21","28","31","35","36","54","55","55","57","57","57","57","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80",
"10","10","10","10","11","18","19","21","28","31","35","36","54","55","55","57","57","57","57","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80",
"10","10","10","10","11","18","19","21","28","31","35","36","54","55","55","57","57","57","57","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80","80"]
level: ["1","2","3","4","1","1","1","1","1","1","1","1","1","1","2","1","2","3","4","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31",
"1","2","3","4","1","1","1","1","1","1","1","1","1","1","2","1","2","3","4","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31",
"1","2","3","4","1","1","1","1","1","1","1","1","1","1","2","1","2","3","4","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]
ob value: ["41.10000","41.30000","-1073741824.00000","-1073741824.00000","27.10000","77.10000","37.10000","3.00000","13.00000","47.10000","57.10000","67.10000","2.00000","1.00000","2.00000","31.10000","31.30000","-1073741824.00000","-1073741824.00000","0.00000","112.20000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000",
"43.10000","43.30000","-1073741824.00000","-1073741824.00000","27.30000","77.30000","37.30000","7.00000","17.00000","47.30000","57.30000","67.30000","2.00000","1.00000","2.00000","33.10000","33.30000","-1073741824.00000","-1073741824.00000","0.00000","116.20000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000",
"44.10000","44.30000","-1073741824.00000","-1073741824.00000","27.40000","77.40000","37.40000","9.00000","19.00000","47.40000","57.40000","67.40000","2.00000","1.00000","2.00000","34.10000","34.30000","-1073741824.00000","-1073741824.00000","0.00000","118.20000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000","0.00000"]
lat: ["7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000","7.10000",
"7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000","7.30000",
"7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000","7.40000"]
lon: ["17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000","17.10000",
"17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000","17.30000",
"17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000","17.40000"]
HofX: ObsValue
benchmarkFlag: 1000
flaggedBenchmark: 0

0 comments on commit 16718e8

Please sign in to comment.