Assign names to reference data columns.

dateTime=1;
darkRefIntTime=2;
darkRef690=3;
darkRef590=4;
measureRefIntTime=5;
measureRef690=6;
measureRef590=7;
luminIntTime=8;
lumin690=9;
lumin590=10;
fluorIntTime=11;
fluor690=12;
fluor590=13;
phosIntTime=14;
phos690=15;
phos590=16;
constTgtIntTime=17;
constTgt690=18;
constTgt590=19;
code=20;

Read the data from the CSV file.

fluorM24Data=Import["/Volumes/ProjectLibrary/902305_Event_Detection_with_SES/Deployments/MARS-2024/dep-2024.06.20-02-SED-AT-MARS-2024/fluorometer.csv"];

Save the first line of column labels.

labels=fluorM24Data[[1]]

Length[labels]

Drop the labels from the data.

fluorM24Data=Drop[fluorM24Data,1];

Drop the last line as the data are bad.

fluorM24Data=Drop[fluorM24Data,-1];

Length@fluorM24Data

TableView@Prepend[fluorM24Data[[1;;10]],labels]

DateListPlot[fluorM24Data[[All,{dateTime,fluor690}]],{PlotRange->All,Joined->True,PlotLabel->"SES 690 nm Fluorescence on MARS 2024",FrameLabel->{"Date","Fluorescence (counts)"}}]

DateListPlot[fluorM24Data[[All,{dateTime,fluor590}]],{PlotRange->All,Joined->True,PlotLabel->"SES 590 nm Fluorescence on MARS 2024",FrameLabel->{"Date","Fluorescence (counts)"}}]

DateListPlot[{fluorM24Data[[All,{dateTime,measureRef590}]],fluorM24Data[[All,{dateTime,measureRef690}]]},{PlotRange->All,Joined->True,PlotLabel->"SES Fluorescence References on MARS 2024",FrameLabel->{"Date","Fluorescence (counts)"},PlotLegends->Placed[{"590 nm","690 nm"},{0.5,0.5}]}]

DateListPlot[{fluorM24Data[[All,{dateTime,constTgt590}]],fluorM24Data[[All,{dateTime,constTgt690}]]},{PlotRange->All,Joined->True,PlotLabel->"SES Fluorescence Constant Target on MARS 2024",FrameLabel->{"Date","Fluorescence (counts)"}}]

Subtract the reference from the raw readings for 690 nm.

f690M24=fluorM24Data[[All,{fluor690}]]-fluorM24Data[[All,{measureRef690}]];

f690M24date=Partition[Flatten[Riffle[fluorM24Data[[All,{dateTime}]],f690M24]],2];

f690M24date[[1;;10]]

pl690M24=DateListPlot[f690M24date,{PlotRange->All,Joined->True,PlotLabel->"SES 690 nm Fluorescence on MARS 2024",FrameLabel->{"","Fluorescence (counts)"},PlotStyle->Red}]

Subtract the reference from the raw readings for 590 nm.

f590M24=fluorM24Data[[All,{fluor590}]]-fluorM24Data[[All,{measureRef590}]];

f590M24date=Partition[Flatten[Riffle[fluorM24Data[[All,{dateTime}]],f590M24]],2];

pl590M24=DateListPlot[f590M24date,{PlotRange->All,Joined->True,PlotLabel->"SES 590 nm Fluorescence on MARS 2024",FrameLabel->{"","Fluorescence (counts)"},PlotStyle->Orange}]

Apply a low-pass filter to the data to see if there’s a lunar component.

f590M24datelp=Partition[Flatten[Riffle[fluorM24Data[[All,{dateTime}]],LowpassFilter[Flatten@f590M24,0.1]]],2];

pl590M24lp=DateListPlot[f590M24datelp,{PlotRange->All,Joined->True,PlotLabel->"SES 590 nm Fluorescence on MARS 2024",FrameLabel->{"","Fluorescence (counts)"}}];

Show[pl590M24,pl590M24lp]

ListPlot@MoonPhase[fluorM24Data[[All,dateTime]]]

tideDat=TideData[,"WaterLevel",DateRange[fluorM24Data[[1,dateTime]],fluorM24Data[[-1,dateTime]],"Days"],UnitSystem->"Metric"]

DateListPlot[tideDat]

tideDat2={#[[1]],(QuantityMagnitude@#[[2]]+0.5) 25}&/@Normal[tideDat];

DateListPlot[{f590M24date,f590M24datelp,tideDat2},PlotStyle->{Orange,Blue,Green}]

Show both wavelengths on a single plot.

Show[pl690M24,pl590M24]

Add a legend to label the traces and make the axes labels more readable.

plM24Fluor=DateListPlot[{f590M24date,f690M24date},{PlotRange->All,Joined->True,BaseStyle->{FontWeight->"Bold",FontSize->14},PlotLabel->"SES Fluorescence on MARS 2024",FrameLabel->{"","Fluorescence (PM counts)"},PlotStyle->{{Thick,Orange},{Thick,Red}},PlotLegends->Placed[{"590 nm","690 nm"},{0.3,0.75}],ImageSize->Large}]

Export["M24Fluor.pdf",plM24Fluor]