@@ -217,7 +217,7 @@ def __init__(self, file: Any, product: Optional[str] = None):
217217 if not product
218218 else product
219219 )
220- for pname in ["CR" , "3DREF " , "反射率" ]:
220+ for pname in ["CR" , "REF " , "反射率" ]:
221221 if pname in self .product_name :
222222 self .product_name = "CR"
223223 start_lon = header ["start_lon" ][0 ]
@@ -235,6 +235,7 @@ def __init__(self, file: Any, product: Optional[str] = None):
235235 else :
236236 # Leave data unchanged because the scale and offset are unclear
237237 self .data = np .ma .masked_equal (out , 0 )
238+ f .close ()
238239
239240 def get_data (self ) -> Dataset :
240241 r"""
@@ -421,6 +422,18 @@ def _cappi(buf):
421422 params ["filled" ] = filled
422423 return params
423424
425+ @staticmethod
426+ def _uam (buf ):
427+ params = {}
428+ iRange = np .frombuffer (buf .read (4 ), "i4" )[0 ]
429+ baseProd1 = np .frombuffer (buf .read (4 ), "i4" )[0 ]
430+ dataType1 = np .frombuffer (buf .read (4 ), "i4" )[0 ]
431+ params ["Range" ] = iRange
432+ params ["baseProd1" ] = baseProd1
433+ params ["dataType1" ] = dataType1
434+ params ["elevation" ] = 0
435+ return params
436+
424437 @staticmethod
425438 def _empty (buf ):
426439 pass
@@ -434,6 +447,7 @@ def parse(cls, product_type, param_bytes):
434447 3 : cls ._cappi ,
435448 51 : cls ._ppi ,
436449 52 : cls ._ppi ,
450+ 44 : cls ._uam ,
437451 18 : cls ._empty ,
438452 }
439453 params = {"elevation" : 0 }
@@ -1019,6 +1033,7 @@ def _parse_uam_fmt(self):
10191033 "site_longitude" : self .stationlon ,
10201034 "site_latitude" : self .stationlat ,
10211035 "task" : self .task_name ,
1036+ ** self .params ,
10221037 },
10231038 )
10241039 ds ["longitude" ] = DataArray (lon [:, 0 ])
0 commit comments