Skip to content
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

Retain NAs in CHL output #77

Merged
merged 1 commit into from
Apr 18, 2023
Merged
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
14 changes: 5 additions & 9 deletions neslter/parsing/chl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def parse_chl(chl_xl_path):
cols2delete.add(c)
for c in cols2delete:
df.pop(c)
# drop rows with nas
df = df.dropna(subset=['vol_extracted',
'tau_calibration','fd_calibration','ra','rb',
'blank','chl','phaeo','filter_size'])
# cast the int columns
df = df.astype({ 'filter_size': int })
# convert floats like 20180905.0 to dates
Expand Down Expand Up @@ -76,11 +72,11 @@ def subset_chl(parsed_chl):
def merge_bottle_summary(chl, bottle_summary):
chl = chl.copy()
bottle_summary = bottle_summary.copy()
chl.cast = chl.cast.astype(str)
chl.niskin = chl.niskin.astype(str)
bottle_summary.cast = bottle_summary.cast.astype(str)
bottle_summary.niskin = bottle_summary.niskin.astype(str)
return chl.merge(bottle_summary, on=['cruise','cast','niskin'])
chl.cast = chl.cast.astype(int)
chl.niskin = chl.niskin.astype(int)
bottle_summary.cast = bottle_summary.cast.astype(int)
bottle_summary.niskin = bottle_summary.niskin.astype(int)
return chl.merge(bottle_summary, on=['cruise','cast','niskin'], how='left')

def parse_ryn_chl(chl_xl_path):
# read Excel file
Expand Down