Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dump/config/atmosphere/prepbufr_aircraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bufr:
query: "*/PRSLEVLA/DRFTINFO/YDR"
obsTimeMinusCycleTime:
query: "*/PRSLEVLA/DRFTINFO/HRDR"
heightOfStationMetaData: #Formerly aircraftFlightLevel
heightMetaData: #Formerly aircraftFlightLevel
query: "*/PRSLEVLA/Z___INFO/Z__EVENT{1}/ZOB"
stationElevationMetaData:
query: "*/ELV"
Expand Down Expand Up @@ -196,8 +196,8 @@ encoder:
longName: "Pressure"
units: "Pa"

- name: "MetaData/heightOfStation"
source: variables/heightOfStationMetaData
- name: "MetaData/height"
source: variables/heightMetaData
longName: "Height Of Station"
units: "m"

Expand Down
24 changes: 15 additions & 9 deletions dump/scripts/atmosphere/prepbufr_aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def make_obs(self, comm, input_path):
sequenceNum = self._compute_sequence_number(lon)
self.log.debug(f'sequenceNum min/max = {sequenceNum.min()} {sequenceNum.max()}')

self.log.debug(f'Change IALR to 0.0 based on masking and ObsType')
orig_ot = container.get('airTemperatureObservationType')
ialr = container.get('instantaneousAltitudeRate')
ialr_paths = container.get_paths('instantaneousAltitudeRate')
ialr2 = ma.array(ialr)

ialr_bc = self._compute_ialr_if_masked(orig_ot, ialr2)

self.log.debug(f'Compute Obstypes')
t_ot = container.get('airTemperatureObservationType')
q_ot = container.get('specificHumidityObservationType')
Expand All @@ -86,13 +94,6 @@ def make_obs(self, comm, input_path):
ot_specificHumidity = self._compute_typ_other(q_ot, specificHumidity)
ot_wind = self._compute_typ_uv(uv_ot, wind)

self.log.debug(f'Change IALR to 0.0 if masked for bias correction.')
ialr = container.get('instantaneousAltitudeRate')
ialr_paths = container.get_paths('instantaneousAltitudeRate')
ialr2 = ma.array(ialr)

ialr_bc = self._compute_ialr_if_masked(uv_ot, ialr2)

self.log.debug(f'Update variables in container')
container.replace('instantaneousAltitudeRate', ialr_bc)
container.replace('airTemperatureObservationType', ot_airTemperature)
Expand Down Expand Up @@ -151,8 +152,13 @@ def _compute_ialr_if_masked(self, typ, ialr):
Masked array of the updated instantaneousAltitudeRate
"""

ialr_bc = copy.deepcopy(ialr)
ialr_bc[(ialr_bc.mask) & (typ >= 330) & (typ < 340)] = 0.0

ialr_bc = ialr.copy()

cond = ialr_bc.mask & (typ >= 330) & (typ < 340)

ialr_bc.data[cond] = 0.0
ialr_bc.mask[cond] = False

return ialr_bc

Expand Down