# -*- coding: utf-8 -*-
"""
Created on Tue Mar 17 17:59:46 2026

@author: chuffard
"""
"""
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from datetime import datetime
import numpy as np
import pandas as pd
import sys
import os.path
import warnings
import glob
from pathlib import Path
import math

MARS2023atn = r"//Thalassa/ProjectLibrary/902305_Event_Detection_with_SES/Analyses/2023 MARS deployment/SES_out_atn2023MARS.csv"
MARS2023atn = pd.read_csv(MARS2023atn)
MARS2023atn.columns
# Index(['Collect_time', 'file_name', 'atn', 'year', 'month', 'day', 'date',
#        'hour', 'min', 'sec', 'time', 'date_time'],
#       dtype='object')
MARS2023atn["DateTime"] = pd.to_datetime(MARS2023atn['date_time'])
#convert atn to POC flux



#convert atn to POC flux

#from Estapa et al. 2023 optical sediment trap calibration. also accounting for image and collect area since those aren't in our og atn calculation

SEStraparea = 0.5;
#imgarea = length(find(isfinite(bgr(:))))./(0.07194.^2)./(1000000.^2);  % pix / (pix/um^2) / (um^2/m^2)#this was in Meg's example code but it's not for SES
SESimgarea = math.pi*(25/1000/2)**2  # diameter of lower end of funnel is 25 mm, compute area in m^2
SEScolltime = 5/(60*24) #in days
MARS2023atn['F_atn']= MARS2023atn['atn']/SEScolltime*SESimgarea/SEStraparea

#These are from SES at Station M in 2023 paper
MARS2023atn['POCmodel_mg']= 10**3.4 * MARS2023atn['F_atn']**0.94
MARS2023atn['POCmodel_g']= MARS2023atn['POCmodel_mg']/1000

MARS2023atn['POCmodel_g'].mean()
MARS2023atn['POCmodel_g'].plot()
plt.show()
