Skip to content

Commit

Permalink
Added dewpoint_depression to fields that are QC'd
Browse files Browse the repository at this point in the history
  • Loading branch information
swnesbitt authored and jrleeman committed Jul 5, 2018
1 parent e2fab0b commit cf8c536
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions siphon/simplewebservice/igra2.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _clean_body_df(self, df):
"""Format the dataframe, remove empty rows, and add units attribute."""
if self.suffix == '-drvd.txt':
df = df.dropna(subset=('temperature', 'reported_relative_humidity',
'u_wind', 'v_wind'), how='all').reset_index(drop=True)
'u_wind', 'v_wind'), how='all').reset_index(drop=True)

df.units = {'pressure': 'hPa',
'reported_height': 'meter',
Expand All @@ -385,11 +385,14 @@ def _clean_body_df(self, df):
np.deg2rad(df['direction']))
df['u_wind'] = np.round(df['u_wind'], 1)
df['v_wind'] = np.round(df['v_wind'], 1)

df = df.dropna(subset=('temperature', 'direction', 'speed',
'dewpoint_depression', 'u_wind', 'v_wind'),
how='all').reset_index(drop=True)

df['dewpoint'] = df['temperature'] - df['dewpoint_depression']

df.drop('dewpoint_depression', axis=1, inplace=True)
df = df.dropna(subset=('temperature', 'dewpoint', 'direction', 'speed',
'u_wind', 'v_wind'), how='all').reset_index(drop=True)

df.units = {'etime': 'second',
'pressure': 'hPa',
Expand Down

0 comments on commit cf8c536

Please sign in to comment.