pfmc-assessments / lingcod

https://pfmc-assessments.github.io/lingcod/
2 stars 2 forks source link

use finer-scale M profiles to get states of nature if necessary #159

Closed iantaylor-NOAA closed 3 years ago

iantaylor-NOAA commented 3 years ago

Here's how we could make a profile plot to find the states of nature for a south model using output from the profiles already run using nwfscDiag.

# get directory with profiles in it
profiledir <- paste0(get_dir_ling("s", 17), '_profile_NatM_uniform_Fem_GP_1')
# load .Rdat file saved by nwfscDiag
load(file.path(profiledir, 'NatM_uniform_Fem_GP_1_profile_output.Rdat'))
# make profile plot with cutoff at ~0.66 to see where it intersects the profile
r4ss::SSplotProfile(profile_output$profilesummary,           
                    minfraction = 0.001,
                    print=TRUE,
                    legendloc='top',
                    add_cutoff = TRUE,
                    ymax = 2,             #example inputs to revise as needed
                    xlim = c(0.11, 0.29), #example inputs to revise as needed
                    cutoff_prob = 0.75,
                    plotdir = profiledir,
                    profile.string = "NatM_uniform_Fem",
                    profile.label="Female natural mortality (M)")