import matplotlib.pyplot as plt
-import numpy as np
-import pandas as pd
-
-def plot_dfo_mooring(mooring_depth):
-
-
- df = pd.DataFrame()
-
- df['Salt'] = ds.sea_water_practical_salinity.data
- df['Temp1'] = ds.sea_water_temperature.data
- df['Temp2'] = ds.TEMPST01.data
- # Get a final temp
- df['Temp'] = np.where(df['Temp1'].isnull(), df['Temp2'], df['Temp1'])
- df['depth'] = ds.depth.data
- df['Time'] = ds.time.data
-
- # Need to figure a better way to capture sensor depths - using this from the filename for now
- df['filename'] = ds.filename.data
- df['file_depth'] = df['filename'].str[-10:-8].astype(int)
-
- df_depth = df[df['file_depth'] == mooring_depth]
-
- x = df_depth.Time
- salt = df_depth.Salt
- temp = df_depth.Temp
-
-
- # try to put labels on the blank shared x axis
- #tcks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- #tklbls = ["2018-01", "2018-07", "2019-01", "2019-07", "2020-01", "2020-07", "2021-01", "2021-07", "2022-01", "2022-01"]
-
- fig, ax = plt.subplots(2, figsize=(15, 8), sharex=True)
-
- ax[0].plot(x, salt, linewidth=0.05, c='blue')
- ax[0].set_title('Salinity')
-
- ax[1].plot(x, temp, linewidth=0.5, c='orange')
- ax[1].set_title("Temperature")
-
-
- fig.subplots_adjust(hspace=0.5)
- plt.suptitle("DFO Mooring Station E01 at depth {} metres".format(str(mooring_depth)))
- plt.show()
-
-plot_dfo_mooring(75)
-