PIFSC-Protected-Species-Division / cruise-maps-live

This repository contains code necessary to generate daily maps of the cetacean survey cruises
https://storymaps.arcgis.com/stories/b3bbf0e90d0141f7bf47edc5339ccb7a
MIT License
3 stars 0 forks source link

Multi-vessel processing and plotting #37

Closed sfregosi closed 1 year ago

sfregosi commented 1 year ago

Time to make a plan for including the Lasker!

Discussions of what we want this to look like resulted in the following plan:

Code changes need to happen in a few places...

Within run.R:

Within plotMap.R:

Within makeSummaryTable.R:

sfregosi commented 1 year ago

Sent example .Rda files to @badgerjj (data files aren't uploaded here as we don't necessarily want the raw data on the public repository)

I basically duplicated data from 9/30 and then updated all vessel and cruise info columns to be what they will be for the Lasker and shifted the lat/lon positions by 1 degree (not sure if they will actually still be in EEZ or not).

compiledEffortPoints_twoBoats_combined.rda: loads an epC variable...same as the previous ep variable for 'effort points' but now for both vessels combined newEffortPoints_twoBoats_combined.rda: loads an epNewC variable, like epNew from before, but now combined for both boats. This is ONLY the last day's locations compiledSightings_twoBoats_combined.rda: vsC variable for 'visual sightings combined', for all vessels, all legs compiledDetections_twoBoats_combined.rda: adC variable for 'acoustic detections combined', all legs, both vessels combined

So, for the existing mapping code, before a call for a map of visuals was: plotMap(dir_wd, ep, epNew, vs, shipCode, dataType = 'visual')

Now it would be: plotMap(dir_wd, epC, epNewC, vsC, shipCode, dataType = 'visual') We can drop the shipCode argument because it was just used as a catch for two boats

sfregosi commented 1 year ago

Modified run.R to loop through the two vessels and process any new das or acoustic files for each in turn. The outputs from each iteration of the loop are aggregated into a list, and then that list is 'collapsed' into a combined data.frame that can be used in the mapping and summary table functions.

Still need to build in some catches for missing new das or new acoustic databases, overcome whatever weirdness might happen on the first day of the Lasker, and likely more. But the looping framework is set up.

Also, need to decide about saving these combined datasets. As it is now, it saves each of the intermediate steps on a project ID basis within a vessel/cruise number folder (e.g., OES2303). Could continue to do this for each vessel individually, then have the combined files in the outer 'data' folder, or in a 'combined' folder.

sfregosi commented 1 year ago

More folder structure/saving thoughts:

Follow up on GPX files... Should these also stay as they are, separated by vessel? Check with EO and all CLs that these will need to remain separate because they are used for individual vessel planning and documenting effort? Or will the Sette crew want to know the Lasker's daily? All CLs will have access to a 'compiledEffortTracks_VES####.gpx' for both vessels so they always could download and add to Coastal Explorer if interested, but this will keep it separate.



Potential changes:

sfregosi commented 1 year ago

Several delayed updates here

sfregosi commented 1 year ago

This all seems good to go but going to keep issue open and two-boats branch available until after Lasker is underway and we get first acoustics file from LSK

sfregosi commented 1 year ago

There were still several bugs to fix BUT all working now :) Closing.