-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config and mapping files for ADPUPA prepBUFR #17
base: develop
Are you sure you want to change the base?
Changes from 1 commit
76603e0
c3d7889
036604f
2eb25ff
53f0685
c668895
bb3f9e8
5404783
5367dfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ def logging(comm, level, message): | |
log_method(message) | ||
|
||
|
||
def Compute_dateTime(cycleTimeSinceEpoch, hrdr): | ||
def _compute_datetime(cycleTimeSinceEpoch, hrdr): | ||
|
||
int64_fill_value = np.int64(0) | ||
dateTime = np.zeros(hrdr.shape, dtype=np.int64) | ||
|
@@ -96,7 +96,7 @@ def Compute_dateTime(cycleTimeSinceEpoch, hrdr): | |
return dateTime | ||
|
||
|
||
def Mask_typ_for_var(typ, var): | ||
def _mask_typ_for_var(typ, var): | ||
|
||
typ_var = copy.deepcopy(typ) | ||
for i in range(len(typ_var)): | ||
|
@@ -109,7 +109,7 @@ def Mask_typ_for_var(typ, var): | |
def _make_description(mapping_path, cycle_time, update=False): | ||
description = bufr.encoders.Description(mapping_path) | ||
|
||
ReferenceTime = np.int64(calendar.timegm(time.strptime(str(int(cycle_time)), '%Y%m%d%H'))) | ||
reference_time = np.int64(calendar.timegm(time.strptime(str(int(cycle_time)), '%Y%m%d%H'))) | ||
|
||
if update: | ||
# Define the variables to be added in a list of dictionaries | ||
|
@@ -131,7 +131,7 @@ def _make_description(mapping_path, cycle_time, update=False): | |
longName=var['longName'] | ||
) | ||
|
||
description.add_global(name='datetimeReference', value=str(ReferenceTime)) | ||
description.add_global(name='datetimeReference', value=str(reference_time)) | ||
|
||
return description | ||
|
||
|
@@ -163,30 +163,30 @@ def _make_obs(comm, input_path, mapping_path, cycle_time): | |
|
||
logging(comm, 'DEBUG', f'Do DateTime calculation') | ||
hrdr = container.get('variables/obsTimeMinusCycleTime') | ||
hrdr_paths = container.get_paths('variables/obsTimeMinusCycleTime') | ||
#hrdr_paths = container.get_paths('variables/obsTimeMinusCycleTime') | ||
cycleTimeSinceEpoch = np.int64(calendar.timegm(time.strptime(str(int(cycle_time)), '%Y%m%d%H'))) | ||
dateTime = Compute_dateTime(cycleTimeSinceEpoch, hrdr) | ||
dateTime = _compute_datetime(cycleTimeSinceEpoch, hrdr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. result of dateTime doesn't seem to be used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rmclaren thanks, reading dateTime now. |
||
logging(comm, 'DEBUG', f'dateTime min/max = {dateTime.min()} {dateTime.max()}') | ||
|
||
logging(comm, 'DEBUG', f'Change longitude range from [0,360] to [-180,180]') | ||
lon = container.get('variables/longitude') | ||
lon_paths = container.get_paths('variables/longitude') | ||
#lon_paths = container.get_paths('variables/longitude') | ||
lon[lon>180] -= 360 | ||
|
||
logging(comm, 'DEBUG', f'observationType') | ||
typ = container.get('variables/observationType') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typ doesn't seem to be used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rmclaren thanks, fixed. |
||
typ_paths = container.get_paths('variables/observationType') | ||
#typ_paths = container.get_paths('variables/observationType') | ||
|
||
logging(comm, 'DEBUG', f'Do ps calculation') | ||
pob = container.get('variables/pressure') | ||
pob_paths = container.get_paths('variables/pressure') | ||
#pob_paths = container.get_paths('variables/pressure') | ||
ps = np.full(pob.shape[0], pob.fill_value) | ||
ps = np.where(cat == 0, pob, ps) | ||
|
||
logging(comm, 'DEBUG', f'Do tsen and tv calculation') | ||
tpc = container.get('variables/temperatureEventProgramCode') | ||
tob = container.get('variables/airTemperature') | ||
tob_paths = container.get_paths('variables/airTemperature') | ||
#tob_paths = container.get_paths('variables/airTemperature') | ||
tsen = np.full(tob.shape[0], tob.fill_value) | ||
tsen = np.where(((tpc >= 1) & (tpc < 8)), tob, tsen) | ||
tvo = np.full(tob.shape[0], tob.fill_value) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,26 +136,25 @@ encoder: | |
type: netcdf | ||
|
||
globals: | ||
- name: "data_format" | ||
- name: "dataOriginalFormatSpec" | ||
type: string | ||
value: "prepbufr" | ||
|
||
- name: "data_type" | ||
- name: "platforms" | ||
type: string | ||
value: "ADPUPA" | ||
|
||
- name: "subsets" | ||
- name: "source" | ||
type: string | ||
value: "ADPUPA" | ||
|
||
- name: "data_provider" | ||
type: string | ||
value: "U.S. NOAA" | ||
value: "prepBUFR" | ||
|
||
- name: "data_description" | ||
- name: "description" | ||
type: string | ||
value: "UPPER-AIR (RAOB, PIBAL, RECCO, DROPS) REPORTS" | ||
|
||
- name: "dataProviderOrigin" | ||
type: string | ||
value: "U.S. NOAA NCEP" | ||
|
||
variables: | ||
# Observation Type: stationPressure | ||
|
@@ -369,3 +368,4 @@ encoder: | |
- name: "ObsError/specificHumidity" | ||
source: variables/specificHumidityError | ||
longName: "Specific Humidity Error" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this have a unit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nicholasesposito thanks, added unit for specificHumidity. |
||
units: "kg kg-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete commented out code, this example and the following ones..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmclaren thanks, deleted all the commented lines.