Code that provides a static method of planning oceanographic cruises
The script cruisePlanning.R
contains code that aids in the planning of oceanographic cruises. As of now it is a single script that requires the user to change a few lines for it to work for the user.
In order for the script to run successfully, the following directories need to be present. Some are optional, but suggested in certain circumstances. They are all provided here in the Github repo, so no alteration or addition in needed by the user with the exception of the bathymetry
directory.
-
bathymetry
This is an optional directory, which could contain a high resolution bathymetry.asc
file. If it is not present, the script will call the functiondownload.topo
from theoce
package, and download 1 minute resolution data over the range of latitudes and logitudes loaded from the given.csv
file. note : the user should insure the bathymetry data is present before going to sea. -
functions
This contains various functions used in the script. -
routes
This includes, input.csv
, output.html
, output.csv
, and route shapefiles for ArcGIS.
In order for the script to run, a .csv
file must be pointed to which contains the following contents, in no particular order. An example has been provided.
lon_dd
A numeric value indicating longitude in decimal degreeslat_dd
A numeric value indicating latitude in decimal degreesstation
An character string of the station nameoperation
An character string indicating the specific operation order for the given operation type. For example, if thetype
isTransit
, then theoperation
will likely beTransit
as well. For thetype
Operations
, this could beNet_CTD
, indicating first a net will be taken then a CTD profile. If multiple items are happening, distingish by a number, for example,Net_2_CTD_2_Argo_2
indicates that 2 nets will be taken, then 2 CTD profiles, then the deployment of 2 Argo floats.core
An optional numeric value indicating if1
it is apart of the core program, or0
it is not apart of the core program.optime
A numeric value indicating the total expected operational time at that location in hours.xoptime
A numeric value indicating any extra operational time in hours that is anticipated during the occupation. For example, +2 hrs at the end of an occupation to wait for daylight.type
A character string indicating eitherTransit
orOperations
, anything else is ignored.comments
An optional character string for any comments, an example of this use is explaining why extra operational time is required.owner
An optional character string indicating who the owner is, if applicable. As of now, this is mainly used forMooring
operation
to identify the client.loc1
kts
A numeric value indicating the transit speed of the vessel between locations.
An overview, summarized below. See cruisePlanning.R
for additional details on what and where to change a few lines.
-
Downloads the packages if they are not already installed
-
Loads all of the required libraries (1 and 2 only need to be run the first time the script is run in an open R session).
-
Choose input file. This requires the user to supply the name of the file
-
Enter the start date for the mission
s <- ISOdate(2019, 10, 05, 18)
start date and time for mission (Year, month, day, 24hr time) -
Load in bathymetry file if present OR download 1-minute resolution bathymetry data from NOAA.
-
Distance calculations, and converts coordinates in decimal degrees to varying different forms.
-
This extracts the depth from the ASCII bathymetry file to each point, or it extracts bathymetry from the downloaded NOAA bathymetry. It then preps the data for export.
-
Write shapefile and save .csv. Create and save htmlplot.
After it is run you should see a dated map as a plot and the associate files should have been generated in your output folder, including your route timing .csv (attached with date/time).