Notebook
# 1) Convert all Salinity to SA, assuming it is in PSU # Salinity_Bottle_SA for ID, S, press, lon, lat in session.query(Obs.ID, Obs.Salinity_Bottle, Press, Station.Lon, Station.Lat).\ select_from(Obs).\ join(Station, Station.ID==Obs.StationTBLID).\ filter(and_( Obs.Salinity_Bottle!=None, Press!=None, Station.Lon!=None, Station.Lat!=None)).all(): calcRec=session.query(Calcs).filter(Calcs.ObsID==ID).one() calcRec.Salinity_Bottle_SA=Sal_PSU_to_SA(S,press,lon,lat) session.commit()
# Obs.Quality_Flag_Oxyg refers to Obs.Oxygen # Obs.Flag_Oxygen_Dissolved refers to Obs.Oxygen_Dissolved or Obs.Oxygen_Dissolved_SBE # Obs.Oxygen_units: mg/l or ml/l; 1 mg/l = 22.391 ml/31.998 = 0.700 ml/l # Obs.Oxygen_Dissolved_units: mL/L or umol/kg; 1 μmol O2 = .022391 ml # Obs.Oxygen_Dissolved_SBE_units: mL/L or umol/kg; 1kg = approx 1 L water # 1 ml/l = 10^3/22.391 = 44.661 μmol/l # Molar volume at STP = 22.391 l # Molar weight of oxygen = 31.998 g [this is for an O2 molecule] # Atomic Mass of oxygen = 15.994 g/mol