SSMIS node fix#72
Conversation
|
I can confirm that the |
There was a problem hiding this comment.
Pull request overview
This PR is an additional fix for SSMIS sensor data processing, building on PR #60. It addresses the handling of the Sat_Azimuth_Angle variable for SSMIS, which actually contains the satellite ascending flag rather than the actual azimuth angle.
Changes:
- Adds special handling for SSMIS
Sat_Azimuth_Angleto correctly populatesatelliteAscendingFlag - Sets
sensorAzimuthAngleto zero for SSMIS (required but not used) - Includes explanatory comments for the SSMIS-specific logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| outdata[("satelliteAscendingFlag", 'MetaData')] = tmp | ||
| varAttrs[("satelliteAscendingFlag", 'MetaData')]['_FillValue'] = self.INT_FILL | ||
| outdata[("sensorAzimuthAngle", "MetaData")] = np.zeros(tmp.shape, dtype=np.float32) | ||
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) |
There was a problem hiding this comment.
There is trailing whitespace at the end of this line. This should be removed for code cleanliness.
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) | |
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) |
| outdata[("sensorAzimuthAngle", "MetaData")] = np.zeros(tmp.shape, dtype=np.float32) | ||
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) |
There was a problem hiding this comment.
The VarDims dictionary should be set for both new metadata variables to ensure they are properly written by the IodaWriter. Based on the pattern in this file (e.g., lines 1628, 1637, 1771, 1983), metadata variables that are manually created need to have their dimensions explicitly specified. Both satelliteAscendingFlag and sensorAzimuthAngle should have dimensions set to ['Location'] since they contain one value per observation location.
| outdata[("sensorAzimuthAngle", "MetaData")] = np.zeros(tmp.shape, dtype=np.float32) | |
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) | |
| VarDims[("satelliteAscendingFlag", 'MetaData')] = ['Location'] | |
| outdata[("sensorAzimuthAngle", "MetaData")] = np.zeros(tmp.shape, dtype=np.float32) | |
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) | |
| VarDims[("sensorAzimuthAngle", "MetaData")] = ['Location'] |
| outdata[("satelliteAscendingFlag", 'MetaData')] = tmp | ||
| varAttrs[("satelliteAscendingFlag", 'MetaData')]['_FillValue'] = self.INT_FILL | ||
| outdata[("sensorAzimuthAngle", "MetaData")] = np.zeros(tmp.shape, dtype=np.float32) | ||
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) |
There was a problem hiding this comment.
The units attribute should be set for the sensorAzimuthAngle variable. According to the units_values dictionary at line 622, sensorAzimuthAngle should have units of 'degree'. This is missing and should be added to maintain consistency with other angle metadata variables in the file.
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) | |
| varAttrs[("sensorAzimuthAngle", "MetaData")]["_FillValue"] = np.float32(self.FLOAT_FILL) | |
| varAttrs[("sensorAzimuthAngle", "MetaData")]["units"] = "degree" |
| # if loc_mdata_name in units_values.keys(): | ||
| # varAttrs[(loc_mdata_name, 'MetaData')]['units'] = units_values[loc_mdata_name] | ||
|
|
||
| # For SSMIS "Sat_Azimuth_Angle" actually contains the "satelliteAscendingFlag". So populate the latter and |
There was a problem hiding this comment.
There is trailing whitespace at the end of this line. This should be removed for code cleanliness.
Additional fix on top of #60 .