This python tool is use to query the ONC ERDDAP server matching the terms below for a given time range:
- Baynes Sound Carbon Dioxide Sensor
- Baynes Sound Conductivity Temperature Depth
And the region
- Latitude: [49.45, 49.70]
- Longitude: [-124.966, -124.7]
The tool use the erddapy package and the ERDDAP Advance Search_for method to retrieve the data sets which are matching the expressions:
Baynes Sound Carbon Dioxide Sensor
Baynes Sound Conductivity Temperature Depth
and consider only the variables matching the following list:
'time', 'depth', 'latitude', 'longitude','partial_pressure', 'salinity', 'temperature'
If no data is available within the CIOOS database, the last 60 days of data available is retrieved. Otherwise, any data collected since the latest record available within the CIOOS datasbase is retrieved.
Each data sets available on ONC's ERDDAP servers matching the requirement above are then retrieved and amalgamated together based on the variable name and units.
Once all the data retrieved, the following steps are applied:
- Group each datasets within three depth layers, and assign a fix depth:
- Near surface (0m < depth < 10m) = 5m
- Mid layer (10m < depth < 30m) = 20m
- Deep layer (depth < 30m) = 40m
- Group data by depth, and bin average to a 5 minutes interval.
- Convert Temperature from Kelvin to Celsius
- Derive sea pressure from depth and latitude with the TEOS-10 GSW package.
- Derive Alkalinity (59.88 * df_total['salinity'] + 278.9)
- Derive the pH Total and Calcite Saturation with pyCO2SYS package.
Once all the steps applied the resulting data is uploaded to the CIOOS database.