Skip to content

Commit

Permalink
Merge pull request #77 from WHOIGit/chl_retain_nas
Browse files Browse the repository at this point in the history
Retain NAs in CHL output
  • Loading branch information
joefutrelle authored Apr 18, 2023
2 parents f75bcd5 + 8f5486a commit 7fe2089
Showing 1 changed file with 5 additions and 9 deletions.
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

0 comments on commit 7fe2089

Please sign in to comment.