File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -915,8 +915,11 @@ class GenericDigitalMapper(DataMapper):
915915
916916 def __init__ (self , prod ):
917917 """Initialize the mapper by pulling out all the information from the product."""
918+ # Need to treat this value as unsigned, so we can use the full 16-bit range. This
919+ # is necessary at least for the DPR product, otherwise it has a value of -1.
920+ max_data_val = prod .thresholds [5 ] & 0xFFFF
921+
918922 # Values will be [0, max] inclusive, so need to add 1 to max value to get proper size.
919- max_data_val = prod .thresholds [5 ]
920923 super ().__init__ (max_data_val + 1 )
921924
922925 scale = float32 (prod .thresholds [0 ], prod .thresholds [1 ])
Original file line number Diff line number Diff line change @@ -138,7 +138,13 @@ def test_level3_files(fname):
138138 if hasattr (f , 'sym_block' ):
139139 block = f .sym_block [0 ][0 ]
140140 if 'data' in block :
141- f .map_data (block ['data' ])
141+ data = block ['data' ]
142+ # Looks for radials in the XDR generic products
143+ elif 'components' in block and hasattr (block ['components' ], 'radials' ):
144+ data = np .array ([rad .data for rad in block ['components' ].radials ])
145+ else :
146+ data = []
147+ f .map_data (data )
142148
143149 assert f .filename == fname
144150
You can’t perform that action at this time.
0 commit comments