1616import  iris .fileformats .nimrod_load_rules 
1717
1818
19- # general header (int16) elements 
19+ # general header (int16) elements 1-31 (Fortran bytes 1-62)  
2020general_header_int16s  =  (
2121    "vt_year" ,
2222    "vt_month" ,
4747    "num_model_levels" ,
4848    "proj_biaxial_ellipsoid" ,
4949    "ensemble_member" ,
50-     "spare1 " ,
51-     "spare2 " ,
50+     "model_origin_id " ,
51+     "averagingtype " ,
5252)
5353
5454
55- # general header (float32) elements 
55+ # general header (float32) elements 32-59 (Fortran bytes 63-174)  
5656general_header_float32s  =  (
5757    "vertical_coord" ,
5858    "reference_vertical_coord" ,
7070    "true_origin_easting" ,
7171    "true_origin_northing" ,
7272    "tm_meridian_scaling" ,
73+     "threshold_value_alt" ,
74+     "threshold_value" ,
7375)
7476
7577
76- # data specific header (float32) elements 
78+ # data specific header (float32) elements 60-104 (Fortran bytes 175-354)  
7779data_header_float32s  =  (
7880    "tl_y" ,
7981    "tl_x" ,
8082    "tr_y" ,
81-     "ty_x " ,
83+     "tr_x " ,
8284    "br_y" ,
8385    "br_x" ,
8486    "bl_y" ,
8789    "sat_space_count" ,
8890    "ducting_index" ,
8991    "elevation_angle" ,
92+     "neighbourhood_radius" ,
93+     "threshold_vicinity_radius" ,
94+     "recursive_filter_alpha" ,
95+     "threshold_fuzziness" ,
96+     "threshold_duration_fuzziness" ,
9097)
9198
9299
93- # data specific header (int16) elements 
100+ # data specific header (char) elements 105-107 (bytes 355-410) 
101+ # units, source and title 
102+ 
103+ 
104+ # data specific header (int16) elements 108-159 (Fortran bytes 411-512) 
94105data_header_int16s  =  (
95-     "radar_num" ,
96-     "radars_bitmask" ,
97-     "more_radars_bitmask" ,
98-     "clutter_map_num" ,
99-     "calibration_type" ,
100-     "bright_band_height" ,
101-     "bright_band_intensity" ,
102-     "bright_band_test1" ,
103-     "bright_band_test2" ,
104-     "infill_flag" ,
105-     "stop_elevation" ,
106-     "int16_vertical_coord" ,
107-     "int16_reference_vertical_coord" ,
108-     "int16_y_origin" ,
109-     "int16_row_step" ,
110-     "int16_x_origin" ,
111-     "int16_column_step" ,
112-     "int16_float32_mdi" ,
113-     "int16_data_scaling" ,
114-     "int16_data_offset" ,
115-     "int16_x_offset" ,
116-     "int16_y_offset" ,
117-     "int16_true_origin_latitude" ,
118-     "int16_true_origin_longitude" ,
119-     "int16_tl_y" ,
120-     "int16_tl_x" ,
121-     "int16_tr_y" ,
122-     "int16_ty_x" ,
123-     "int16_br_y" ,
124-     "int16_br_x" ,
125-     "int16_bl_y" ,
126-     "int16_bl_x" ,
127-     "sensor_id" ,
128-     "meteosat_id" ,
129-     "alphas_available" ,
106+     "threshold_type" ,
107+     "probability_method" ,
108+     "recursive_filter_iterations" ,
109+     "member_count" ,
110+     "probability_period_of_event" ,
111+     "data_header_int16_05" ,
112+     "soil_type" ,
113+     "radiation_code" ,
114+     "data_header_int16_08" ,
115+     "data_header_int16_09" ,
116+     "data_header_int16_10" ,
117+     "data_header_int16_11" ,
118+     "data_header_int16_12" ,
119+     "data_header_int16_13" ,
120+     "data_header_int16_14" ,
121+     "data_header_int16_15" ,
122+     "data_header_int16_16" ,
123+     "data_header_int16_17" ,
124+     "data_header_int16_18" ,
125+     "data_header_int16_19" ,
126+     "data_header_int16_20" ,
127+     "data_header_int16_21" ,
128+     "data_header_int16_22" ,
129+     "data_header_int16_23" ,
130+     "data_header_int16_24" ,
131+     "data_header_int16_25" ,
132+     "data_header_int16_26" ,
133+     "data_header_int16_27" ,
134+     "data_header_int16_28" ,
135+     "data_header_int16_29" ,
136+     "data_header_int16_30" ,
137+     "data_header_int16_31" ,
138+     "data_header_int16_32" ,
139+     "data_header_int16_33" ,
140+     "data_header_int16_34" ,
141+     "data_header_int16_35" ,
142+     "data_header_int16_36" ,
143+     "data_header_int16_37" ,
144+     "data_header_int16_38" ,
145+     "data_header_int16_39" ,
146+     "data_header_int16_40" ,
147+     "data_header_int16_41" ,
148+     "data_header_int16_42" ,
149+     "data_header_int16_43" ,
150+     "data_header_int16_44" ,
151+     "data_header_int16_45" ,
152+     "data_header_int16_46" ,
153+     "data_header_int16_47" ,
154+     "data_header_int16_48" ,
155+     "data_header_int16_49" ,
156+     "period_seconds" ,
130157)
131158
132159
@@ -144,6 +171,11 @@ class NimrodField:
144171
145172    Capable of converting itself into a :class:`~iris.cube.Cube` 
146173
174+     References: 
175+         Met Office (2003): Met Office Rain Radar Data from the NIMROD System. 
176+         NCAS British Atmospheric Data Centre, date of citation. 
177+         http://catalogue.ceda.ac.uk/uuid/82adec1f896af6169112d09cc1174499 
178+ 
147179    """ 
148180
149181    def  __init__ (self , from_file = None ):
@@ -247,9 +279,6 @@ def _read_data(self, infile):
247279                "Expected data leading_length of %d"  %  num_data_bytes 
248280            )
249281
250-         # TODO: Deal appropriately with MDI. Can't just create masked arrays 
251-         #       as cube merge converts masked arrays with no masks to ndarrays, 
252-         #       thus mergable cube can split one mergable cube into two. 
253282        self .data  =  np .fromfile (infile , dtype = numpy_dtype , count = num_data )
254283
255284        if  sys .byteorder  ==  "little" :
0 commit comments