Skip to content

Commit

Permalink
code changes needed to pick up wave 5 data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mle2718 committed Nov 30, 2023
1 parent 1109bd9 commit 9d977fe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions stata_code/data_extraction_processing/extraction_wrapper.do
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ do ${extraction_code}/copy_over_raw_mrip.do

/* copying over partial years of data */
global yearlist 2023(1)2023
*global wavelist 1(1)5
global wavelist 1(1)4
global wavelist 1(1)5
*global wavelist 1(1)4

do ${extraction_code}/copy_over_raw_mrip.do
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ dyndoc "$processing_code/catch_summaries.txt", saving($my_results/catch_summarie
<<dd_do:quietly>>
/* If you dyndoc this right after running your MRIP data processing code, you can comment this out.*/
do $MRIP_BLAST
global vintage_string 2023_11_08
global vintage_string 2023_12_18
global my_outputdir "${data_main}/MRIP_$vintage_string/monthly"
global mode_dir "${data_main}/MRIP_${vintage_string}/mode"

global FY_dir "${data_main}/MRIP_$vintage_string/fishing_years"
local my_common1 "atlanticcod"
Expand Down Expand Up @@ -746,9 +747,7 @@ There were no B2's measured on Private boats, so I've set the length distributio

<<dd_do:quietly>>

global mode_vintage 2023_11_30

global mode_dir "${data_main}/MRIP_$mode_vintage/mode"

use "${mode_dir}/haddock_size_mode_class_${working_year}.dta", clear
keep if year==$working_year
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ use ${stacked_month}/monthly_cod_catch_class.dta, replace



keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
/*keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,9,10,11,12))*/
keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))

replace fishing_year=`yr1'
/* annual totals */
collapse (sum) count, by(tot_cat fishing_year)
Expand Down Expand Up @@ -76,9 +78,8 @@ graph export "${my_images_vintage}/cod_catch_classPno0_ANNUAL`yr1'.tif", as(tif)
/*Load in the stacked monthly catch class distributions*/
use ${stacked_month}/monthly_haddock_catch_class.dta, replace



keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
/*keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,9,10,11,12))*/
keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
replace fishing_year=`yr1'
/* annual totals */
collapse (sum) count, by(tot_cat fishing_year)
Expand Down Expand Up @@ -146,9 +147,9 @@ graph export "${my_images_vintage}/haddock_catch_classPno0_ANNUAL`yr1'.tif", as(

/*read in the size class distributions. Keep just the relevant FY. Collapse*/
use ${stacked_month}/monthly_cod_size_class.dta, replace
/*keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,9,10,11,12))*/
keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))


keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
replace fishing_year=`yr1'
collapse (sum) count, by(lngcat fishing_year)

Expand Down Expand Up @@ -184,11 +185,13 @@ graph export "${my_images_vintage}/cod_size_classP_ANNUAL`yr1'.tif", as(tif) rep
use ${stacked_month}/monthly_cod_size_class.dta, replace


keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
/*keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,9,10,11,12))*/
keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))

replace fishing_year=`yr1'


gen open=inlist(month,4,9,10)
gen open=inlist(month,9,10)
collapse (sum) count, by(lngcat fishing_year open)
preserve
keep if open==1
Expand Down Expand Up @@ -251,7 +254,8 @@ graph export "${my_images_vintage}/cod_size_classP_OPEN_SPLIT`yr1'.tif", as(tif)
use ${stacked_month}/monthly_haddock_size_class.dta, replace


keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
/*keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,9,10,11,12))*/
keep if fishing_year==`yr1' | (fishing_year==`lastyr' & inlist(month,1,2,3,4,11,12))
replace fishing_year=`yr1'

collapse (sum) count, by(lngcat fishing_year)
Expand Down

0 comments on commit 9d977fe

Please sign in to comment.