Skip to content

Commit

Permalink
get 2023 CA length data, working through WA comm catches
Browse files Browse the repository at this point in the history
  • Loading branch information
okenk committed Dec 12, 2024
1 parent f420065 commit e7da54e
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 49 deletions.
40 changes: 24 additions & 16 deletions docs/data_summary_doc.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,43 @@ This documents data streams for use in the Northern Yellowtail Rockfish stock as
Some summary figures:

```{r pacfin-catch, cache=TRUE}
load(here('data/confidential/commercial/pacfin_12-09-2024/PacFIN.YTRK.CompFT.09.Dec.2024.RData'))
load(here('data/confidential/commercial/pacfin_12-11-2024/PacFIN.YTRK.CompFT.11.Dec.2024.RData'))
# I have checked and LANDING_YEAR = PACFIN_YEAR for all rows.
yt_n_catch_pacfin <- catch.pacfin |>
filter(
AGENCY_CODE == 'W' | AGENCY_CODE == 'O' | COUNTY_NAME == 'DEL NORTE' | COUNTY_NAME == 'HUMBOLDT',
LANDING_YEAR < 2024
AGENCY_CODE == 'W' | AGENCY_CODE == 'O' | COUNTY_NAME == 'DEL NORTE' | COUNTY_NAME == 'HUMBOLDT', # OR, WA, N. CA
LANDING_YEAR < 2024,
!(CATCH_AREA_CODE %in% c('23A', '23C', '26A')) # exclude 48 Puget Sound fish tickets
)
# OR landings time series
or_comm_catch <- read.csv(here("Data/Confidential/commercial/Oregon Commercial landings_433_2023.csv")) |>
tibble::as_tibble() |>
group_by(YEAR) |>
summarise(catch_mt = sum(TOTAL))
summarise(catch_mt = sum(TOTAL)) |>
mutate(AGENCY_CODE = 'O')
# WA URCK/UPOP reconstruction
# WA URCK/UPOP reconstruction, use prior to 2000
wa_urck <- read.csv(here('Data/Raw_not_confidential/WA_URCK_UPOP_recon_1981-2016.csv')) |>
filter(Species_AfterComps %in% c('YTRK', 'YTR1')) |>
filter(Species_AfterComps %in% c('YTRK', 'YTR1'),
Year < 2000) |>
group_by(Year) |>
summarise(catch_mt = sum(RoundPounds_AfterComps) * 0.453592 / 1000) |>
mutate(AGENCY_CODE = 'W',
model = 'URCK/UPOP')
mutate(AGENCY_CODE = 'W') |>
rename(YEAR = Year)
# Put it all together
comm_draft_landings <- yt_n_catch_pacfin |>
filter(AGENCY_CODE != 'O') |>
filter(AGENCY_CODE != 'O',
AGENCY_CODE != 'W' | PACFIN_YEAR >= 2000
) |>
group_by(PACFIN_YEAR, AGENCY_CODE)|>
summarise(catch_mt = sum(ROUND_WEIGHT_MTONS)) |>
rename(YEAR = PACFIN_YEAR) |>
bind_rows(
mutate(or_comm_catch, AGENCY_CODE = 'O')
or_comm_catch,
wa_urck
)|>
group_by(YEAR, AGENCY_CODE) |>
summarise(catch_mt = sum(catch_mt)) |>
Expand Down Expand Up @@ -118,14 +124,16 @@ comm_draft_landings |>
bind_rows(
filter(comm2017, AGENCY_CODE == 'W')
)|>
bind_rows(wa_urck) |>
bind_rows(
mutate(wa_urck, model = 'URCK/UPOP')
) |>
ggplot() +
geom_line(aes(x = Year, y = catch_mt, col = model), linewidth = 1) +
viridis::scale_color_viridis(discrete = TRUE) +
labs(title = 'Possible sources for WA landings (vert. line = 1994)', x = 'YEAR') +
geom_vline(xintercept = 1994)
labs(title = 'Possible sources for WA landings (vert. line = 2000)', x = 'YEAR') +
geom_vline(xintercept = 2000)
```
URCK/UPOP = sum of RoundPounds_AfterComps for Species_AfterComps = YTR1 or YTRK, converted to mt.
URCK/UPOP = sum of RoundPounds_AfterComps for Species_AfterComps = YTR1 or YTRK, converted to mt. This is used *instead of* PacFIN catches prior to 2000.

Table of commercial landings by state, 1981 onward.

Expand Down Expand Up @@ -159,7 +167,7 @@ ashop_catch |>

```{r rec-catch-modern}
# WASHINGTON
wa_modern <- read.csv(here('Data/Raw_not_confidential/RecFIN_WA_catch_to_2023.csv')) |>
wa_modern <- read.csv(here('Data/Raw_not_confidential/RecFIN_WA_catch_to_2023.csv')) |>
filter(RECFIN_WATER_AREA_NAME != 'Canada', RECFIN_YEAR <= 2023) |>
tibble::as_tibble() |>
group_by(RECFIN_YEAR) |>
Expand Down Expand Up @@ -298,7 +306,7 @@ For CA rec catch estimates for the assessment:
Initial length sample sizes after running `PacFIN.Utilities::cleanPacFIN()`:

```{r comm-bio, cache=TRUE}
load(here('Data/Confidential/Commercial/pacfin_12-09-2024/PacFIN.YTRK.bds.09.Dec.2024.RData'))
load(here('Data/Confidential/Commercial/pacfin_12-11-2024/PacFIN.YTRK.bds.11.Dec.2024.RData'))
bds_clean <- PacFIN.Utilities::cleanPacFIN(bds.pacfin, verbose = FALSE)
bds_clean |>
filter(state == 'WA' | state == 'OR' | PACFIN_GROUP_PORT_CODE == 'CCA' |
Expand Down
Binary file modified docs/data_summary_doc_files/figure-html/pacfin-catch-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/data_summary_doc_files/figure-html/pacfin-catch-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/data_summary_doc_files/figure-html/pacfin-catch-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/data_summary_doc_files/figure-html/pacfin-catch-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/data_summary_doc_files/figure-html/pacfin-catch-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 33 additions & 33 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h2 class="anchored" data-anchor-id="landings">Landings</h2>
<section id="commercial-landings" class="level3">
<h3 class="anchored" data-anchor-id="commercial-landings">Commercial landings</h3>
<p>Some summary figures:</p>
<div class="cell" data-hash="data_summary_doc_cache/html/pacfin-catch_144afba9de0326475e45c80e4e70d7a6">
<div class="cell" data-hash="data_summary_doc_cache/html/pacfin-catch_29edef1b07364eb8e0e56ce0e7b98a7c">
<div class="cell-output-display">
<p><img src="data_summary_doc_files/figure-html/pacfin-catch-1.png" class="img-fluid" width="672"></p>
</div>
Expand All @@ -110,7 +110,7 @@ <h3 class="anchored" data-anchor-id="commercial-landings">Commercial landings</h
<p><img src="data_summary_doc_files/figure-html/pacfin-catch-5.png" class="img-fluid" width="672"></p>
</div>
</div>
<p>URCK/UPOP = sum of RoundPounds_AfterComps for Species_AfterComps = YTR1 or YTRK, converted to mt.</p>
<p>URCK/UPOP = sum of RoundPounds_AfterComps for Species_AfterComps = YTR1 or YTRK, converted to mt. This is used <em>instead of</em> PacFIN catches prior to 2000.</p>
<p>Table of commercial landings by state, 1981 onward.</p>
<div class="cell">
<div class="cell-output-display">
Expand All @@ -128,115 +128,115 @@ <h3 class="anchored" data-anchor-id="commercial-landings">Commercial landings</h
<td style="text-align: left;">1981</td>
<td style="text-align: left;">94.4</td>
<td style="text-align: left;">3633.5</td>
<td style="text-align: left;">5128.3</td>
<td style="text-align: left;">5325.9</td>
</tr>
<tr class="even">
<td style="text-align: left;">1982</td>
<td style="text-align: left;">331.4</td>
<td style="text-align: left;">2960.2</td>
<td style="text-align: left;">5769.4</td>
<td style="text-align: left;">5993.4</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1983</td>
<td style="text-align: left;">105.3</td>
<td style="text-align: left;">3857.1</td>
<td style="text-align: left;">5326.6</td>
<td style="text-align: left;">5812.9</td>
</tr>
<tr class="even">
<td style="text-align: left;">1984</td>
<td style="text-align: left;">357.7</td>
<td style="text-align: left;">2071.7</td>
<td style="text-align: left;">2311.8</td>
<td style="text-align: left;">2574.5</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1985</td>
<td style="text-align: left;">120.2</td>
<td style="text-align: left;">1613.9</td>
<td style="text-align: left;">1347.0</td>
<td style="text-align: left;">1550.5</td>
</tr>
<tr class="even">
<td style="text-align: left;">1986</td>
<td style="text-align: left;">268.9</td>
<td style="text-align: left;">2163.1</td>
<td style="text-align: left;">1982.7</td>
<td style="text-align: left;">2229.1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1987</td>
<td style="text-align: left;">141.6</td>
<td style="text-align: left;">2484.0</td>
<td style="text-align: left;">1876.9</td>
<td style="text-align: left;">1990.4</td>
</tr>
<tr class="even">
<td style="text-align: left;">1988</td>
<td style="text-align: left;">144.7</td>
<td style="text-align: left;">2613.8</td>
<td style="text-align: left;">2943.5</td>
<td style="text-align: left;">3231.7</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1989</td>
<td style="text-align: left;">354.0</td>
<td style="text-align: left;">2551.0</td>
<td style="text-align: left;">1689.3</td>
<td style="text-align: left;">1814.4</td>
</tr>
<tr class="even">
<td style="text-align: left;">1990</td>
<td style="text-align: left;">466.4</td>
<td style="text-align: left;">2147.3</td>
<td style="text-align: left;">1639.7</td>
<td style="text-align: left;">1725.6</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1991</td>
<td style="text-align: left;">405.8</td>
<td style="text-align: left;">2066.7</td>
<td style="text-align: left;">1140.9</td>
<td style="text-align: left;">1192.4</td>
</tr>
<tr class="even">
<td style="text-align: left;">1992</td>
<td style="text-align: left;">231.9</td>
<td style="text-align: left;">3998.1</td>
<td style="text-align: left;">1327.4</td>
<td style="text-align: left;">1418.3</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1993</td>
<td style="text-align: left;">102.3</td>
<td style="text-align: left;">3090.7</td>
<td style="text-align: left;">2014.4</td>
<td style="text-align: left;">2162.2</td>
</tr>
<tr class="even">
<td style="text-align: left;">1994</td>
<td style="text-align: left;">104.6</td>
<td style="text-align: left;">3215.4</td>
<td style="text-align: left;">1900.9</td>
<td style="text-align: left;">1908.7</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1995</td>
<td style="text-align: left;">115.9</td>
<td style="text-align: left;">3113.7</td>
<td style="text-align: left;">1482.6</td>
<td style="text-align: left;">1482.7</td>
</tr>
<tr class="even">
<td style="text-align: left;">1996</td>
<td style="text-align: left;">153.2</td>
<td style="text-align: left;">3599.3</td>
<td style="text-align: left;">1451.4</td>
<td style="text-align: left;">1451.5</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1997</td>
<td style="text-align: left;">89.6</td>
<td style="text-align: left;">1271.2</td>
<td style="text-align: left;">476.5</td>
<td style="text-align: left;">476.6</td>
</tr>
<tr class="even">
<td style="text-align: left;">1998</td>
<td style="text-align: left;">132.6</td>
<td style="text-align: left;">1744.2</td>
<td style="text-align: left;">617.0</td>
<td style="text-align: left;">617.1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">1999</td>
<td style="text-align: left;">60.9</td>
<td style="text-align: left;">1624.2</td>
<td style="text-align: left;">563.3</td>
<td style="text-align: left;">563.6</td>
</tr>
<tr class="even">
<td style="text-align: left;">2000</td>
Expand Down Expand Up @@ -296,7 +296,7 @@ <h3 class="anchored" data-anchor-id="commercial-landings">Commercial landings</h
<td style="text-align: left;">2009</td>
<td style="text-align: left;">0.6</td>
<td style="text-align: left;">32.4</td>
<td style="text-align: left;">506.3</td>
<td style="text-align: left;">506.2</td>
</tr>
<tr class="even">
<td style="text-align: left;">2010</td>
Expand Down Expand Up @@ -344,31 +344,31 @@ <h3 class="anchored" data-anchor-id="commercial-landings">Commercial landings</h
<td style="text-align: left;">2017</td>
<td style="text-align: left;">4.0</td>
<td style="text-align: left;">1908.6</td>
<td style="text-align: left;">790.0</td>
<td style="text-align: left;">789.7</td>
</tr>
<tr class="even">
<td style="text-align: left;">2018</td>
<td style="text-align: left;">11.0</td>
<td style="text-align: left;">2170.4</td>
<td style="text-align: left;">1026.3</td>
<td style="text-align: left;">1015.4</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2019</td>
<td style="text-align: left;">11.2</td>
<td style="text-align: left;">2214.1</td>
<td style="text-align: left;">1070.2</td>
<td style="text-align: left;">1064.2</td>
</tr>
<tr class="even">
<td style="text-align: left;">2020</td>
<td style="text-align: left;">14.0</td>
<td style="text-align: left;">2264.3</td>
<td style="text-align: left;">1141.6</td>
<td style="text-align: left;">1128.7</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2021</td>
<td style="text-align: left;">28.1</td>
<td style="text-align: left;">1745.7</td>
<td style="text-align: left;">986.9</td>
<td style="text-align: left;">983.8</td>
</tr>
<tr class="even">
<td style="text-align: left;">2022</td>
Expand Down Expand Up @@ -999,7 +999,7 @@ <h2 class="anchored" data-anchor-id="comp-data">Comp Data</h2>
<section id="commercial" class="level3">
<h3 class="anchored" data-anchor-id="commercial">Commercial</h3>
<p>Initial length sample sizes after running <code>PacFIN.Utilities::cleanPacFIN()</code>:</p>
<div class="cell" data-hash="data_summary_doc_cache/html/comm-bio_257620d1f3f2c9faf2cf9f54cf73b453">
<div class="cell" data-hash="data_summary_doc_cache/html/comm-bio_2668abac0d099bc72a3c1078e7275134">
<div class="cell-output cell-output-stdout">
<pre><code> AGE_METHOD1 AGE_METHOD2 AGE_METHOD3 Age method for best age n
1 B B B B 2346
Expand All @@ -1010,7 +1010,7 @@ <h3 class="anchored" data-anchor-id="commercial">Commercial</h3>
6 L &lt;NA&gt; &lt;NA&gt; L 1
7 S &lt;NA&gt; &lt;NA&gt; S 17942
8 T &lt;NA&gt; &lt;NA&gt; T 2
9 &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; 81690</code></pre>
9 &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; 82197</code></pre>
</div>
<div class="cell-output-display">
<table class="table table-sm table-striped">
Expand Down Expand Up @@ -1397,10 +1397,10 @@ <h3 class="anchored" data-anchor-id="commercial">Commercial</h3>
</tr>
<tr class="even">
<td style="text-align: left;">2021</td>
<td style="text-align: left;">603</td>
<td style="text-align: left;">633</td>
<td style="text-align: left;">1815</td>
<td style="text-align: left;">1157</td>
<td style="text-align: left;">3575</td>
<td style="text-align: left;">3605</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2022</td>
Expand All @@ -1411,10 +1411,10 @@ <h3 class="anchored" data-anchor-id="commercial">Commercial</h3>
</tr>
<tr class="even">
<td style="text-align: left;">2023</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">302</td>
<td style="text-align: left;">2145</td>
<td style="text-align: left;">1415</td>
<td style="text-align: left;">3560</td>
<td style="text-align: left;">3862</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit e7da54e

Please sign in to comment.