from Longfin_Plotter import LongfinPlotter
import os

run_dir = r'J:\Longfin\bar_plots\FISH_PTM'
grd_file = os.path.join(run_dir, 'ptm.grd')
year = 2013
Var = 'Abundance'
Title = 'Test Run'
Obs_data = r"C:\git\longfin_trawl_map\lfsmelt_2013_5mm_18mm_max_0.20grow\lfsmelt_2013_5mm_18mm_max_0.20grow\results\observed_total_abundance_quantiles.csv"
Pred_data = r"C:\git\longfin_trawl_map\lfsmelt_2013_5mm_18mm_max_0.20grow\lfsmelt_2013_5mm_18mm_max_0.20grow\results\predicted_total_abundance_quantiles.csv"
surveys = [1, 2, 3, 4, 5, 6]
Obs_Label = 'Test_Observed'
Pred_Label = 'Test_Predicted'
output_directory = 'Test_Directory'
fishtype = 'Delta Smelt'

lfp = LongfinPlotter(run_dir,
                     grd_file,
                     year,
                     surveys=surveys,
                     title=Title,
                     output_directory=output_directory)
lfp.make_TotalPredvsObs_BoxWhisker(Obs_data,
                                   Pred_data,
                                   Var,
                                   Log=False,
                                   Obs_Label=Obs_Label,
                                   Pred_Label=Pred_Label,
                                   Fishtype=fishtype)
@author: scott
@organization: Resource Management Associates
@contact: [email protected]
@note:
'''

from Longfin_Plotter import LongfinPlotter
import os

run_dir = r'J:\Longfin\bar_plots\FISH_PTM'
grd_file = os.path.join(run_dir, 'ptm.grd')
year = 2013
Var = 'Larvae'
Title = 'Test Run'
output_directory = 'Test_Directory'
fishtype = 'Delta Smelt'
Pred_data = r"C:\git\longfin_trawl_map\lfsmelt_2013_5mm_18mm_max_0.20grow\lfsmelt_2013_5mm_18mm_max_0.20grow\results\predicted_cohort_source_entrainment_quantiles.csv"
cohorts = [1, 2, 3, 4, 5, 6]
max = 20000000.
lfp = LongfinPlotter(run_dir,
                     grd_file,
                     year,
                     cohorts=cohorts,
                     title=Title,
                     output_directory=output_directory)
lfp.make_TimeSeries_Plots(Pred_data,
                          Var,
                          datatype='entrainment',
                          Log=False,
                          Fishtype=fishtype)
@author: scott
@organization: Resource Management Associates
@contact: [email protected]
@note:
'''

from Longfin_Plotter import LongfinPlotter
import os

run_dir = r'J:\Longfin\bar_plots\FISH_PTM'
grd_file = os.path.join(run_dir, 'ptm.grd')
year = 2013
Var = 'Larvae'
Title = "Test Run"
output_directory = 'Test_Directory'
fishtype = 'Delta Smelt'
Pred_data = r"C:\git\longfin_trawl_map\lfsmelt_2013_5mm_18mm_max_0.20grow\lfsmelt_2013_5mm_18mm_max_0.20grow\results\cohort_hatch_quantiles.csv"
cohorts = [1, 2, 3, 4, 5, 6]
max = 5000000000.
lfp = LongfinPlotter(run_dir,
                     grd_file,
                     year,
                     cohorts=cohorts,
                     title=Title,
                     output_directory=output_directory)
lfp.make_BoxWhisker(Pred_data,
                    Var,
                    datatype='hatch',
                    Log=False,
                    max=max,
                    Fishtype=fishtype)
#output_directory = r'R:\RMA\Projects\Longfin\Analysis\R\combined_analysis_delta_smelt_raw\dsmelt_1999_5mm_15mm_max_0.20grow\plots'
output_directory = r'R:\RMA\Projects\Longfin\Analysis\R\combined_analysis_delta_smelt_raw\alpha8\dsmelt_1999_5mm_15mm_max_0.20grow\plots'
surveys = [1,2,3,4,5,6,7]
cohorts = [1,2,3,4,5,6,7,8,9]
abu_max = 5.e06
hatching_period=10 # days

#total Plots
Var = 'Abundance'
Title = 'hatch 5mm, growth 0.2 mm/day'
Obs_Label = 'Observed'
Pred_Label = 'Predicted'
Obs_total_data = os.path.join(data_dir, "observed_total_abundance_quantiles.csv")
Pred_total_data = os.path.join(data_dir, "predicted_total_abundance_quantiles.csv")
lfp = LongfinPlotter(run_dir, grd_file, year, surveys=surveys, 
#                    hatching_period=hatching_period,
                     title=Title, output_directory=output_directory)
lfp.make_TotalPredvsObs_BoxWhisker(Obs_total_data, Pred_total_data, Var, Log=False, Obs_Label=Obs_Label, Pred_Label=Pred_Label, Fishtype=fishtype, max=abu_max, cohort_data=False)


#plot pred vs obs
Var = 'Abundance'
Obs_data = os.path.join(data_dir, "observed_cohort_abundance_quantiles.csv")
Pred_data = os.path.join(data_dir, "predicted_cohort_abundance_quantiles.csv")
lfp = LongfinPlotter(run_dir, grd_file, year, surveys=surveys, 
                     cohorts=cohorts, hatching_period=hatching_period,
                     title=Title, output_directory=output_directory)
lfp.make_PredvsObs_BoxWhisker(Obs_data, Pred_data, Var, Log=False, Obs_Label=Obs_Label, Pred_Label=Pred_Label, Fishtype=fishtype, max=abu_max)


#Plot Entrainment