Skip to content

Commit

Permalink
Changes variable names to have stn_ prefix since latitude and longitu…
Browse files Browse the repository at this point in the history
…de were being overwritten with zeros, and also multiples cloud fraction by 100 to make it a percentage to match the forecast.
  • Loading branch information
DanielAdriaansen committed Feb 28, 2025
1 parent ed34d21 commit 0ca32c8
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
nc.close()

stn_id = np.empty(len(parent_index),dtype="U10")
latitude = np.zeros(len(parent_index))
longitude = np.zeros(len(parent_index))
elev = np.zeros(len(parent_index))
stn_lat = np.zeros(len(parent_index))
stn_lon = np.zeros(len(parent_index))
stn_elev = np.zeros(len(parent_index))
for i in range(len(parent_index)):
stn_id[i] = station_ids[parent_index[i]].tobytes().decode('utf-8').strip()
latitude[i] = latitude[parent_index[i]]
longitude[i] = longitude[parent_index[i]]
elev[i] = altitude[parent_index[i]]
stn_lat[i] = latitude[parent_index[i]]
stn_lon[i] = longitude[parent_index[i]]
stn_elev[i] = altitude[parent_index[i]]

epoch = datetime(1970, 1, 1)
formatted_times = [(epoch + timedelta(seconds=int(time))).strftime('%Y%m%d_%H%M%S') for time in time_observation]
Expand All @@ -51,10 +51,10 @@
level = level*len(parent_index)
height = low_cloud_base_altitude.astype(float)
qc_string = qc_string*len(parent_index)
obs_value = low_cloud_area_fraction.astype(float)
obs_value = low_cloud_area_fraction.astype(float)*100.0

obs_val = obs_value.filled(-9999.)
height = height.filled(-9999.)

point_data = []
point_data = [[typ,sid,vid,lat,lon,elv,var,lvl,hgt,qc,obs] for typ,sid,vid,lat,lon,elv,var,lvl,hgt,qc,obs in tuple(zip(msg_type,stn_id,vld_time,latitude,longitude,elev,var_name,level,height,qc_string,obs_val))]
point_data = [[typ,sid,vid,lat,lon,elv,var,lvl,hgt,qc,obs] for typ,sid,vid,lat,lon,elv,var,lvl,hgt,qc,obs in tuple(zip(msg_type,stn_id,vld_time,stn_lat,stn_lon,stn_elev,var_name,level,height,qc_string,obs_val))]

0 comments on commit 0ca32c8

Please sign in to comment.