
Add GeoLocator DP resources from a GeoPressureTemplate
Source:R/read_geopressuretemplate.R
read_geopressuretemplate.RdRead a GeoPressureTemplate project and populate a GeoLocator Data Package with the resources that can be derived from it.
The import can combine two sources:
"interim": read.RDataoutputs fromdata/interim/, convert them to package resources, and store raw parameter objects inpkg$params. Each file must holdtagandparam. Trajectories are the variables namedpath_<type>,edge_<type>andpressurepath_<type>, where<type>is a trajectory type of GeoLocator-DP (tag,most_likely,simulationorgeopressureviz); other types are skipped with a warning."raw-tag": create tag objects fromdata/raw-tag/andconfig.yml, then derivemeasurements,tags,observations, andparams.
Interim files may have been written by an older GeoPressureR. As when
read_gldp() upgrades a package to GeoLocator-DP v1.3, SOI magnetic and
acceleration axes are converted to the forward-right-down frame when the
params of the tag record the mapping applied, and the groundspeed of
simulated edges is recomputed for tags whose params record GeoPressureR
3.2.0 to 3.7.0. Other data are left as stored.
The ring_number, tag_comments and bird_create$scientific_name entries
of each tag in config.yml fill the generated tags. They are read with
config::get(), so a tag inherits them from the default entry, and
numbers are kept as written (an unquoted ring number 0012345 stays
"0012345").
Manual data files take precedence over generated metadata:
data/tags.csvordata/tags.xlsxreplaces generatedtags. Tags missing from the file are kept from the generated table, with a warning;data/observations.csvordata/observations.xlsxreplaces generatedobservations. Generated observations take theirring_numberfromtags.
During automatic discovery, GeoLocatoR skips private GeoPressureTemplate
entries whose names start with "_": config keys, interim files, raw-tag
folders, and files inside raw-tag folders. Empty raw-tag folders are also
skipped, so raw-tag import only attempts folders with at least one
non-ignored file.
See the GeoPressureManual for a full workflow example.
Usage
read_geopressuretemplate(
directory = ".",
from = c("raw-tag", "interim"),
pkg = create_gldp()
)Arguments
- directory
Path to the GeoPressureTemplate directory.
- from
Character vector specifying which sources to import. Supported values are
"raw-tag"and/or"interim".- pkg
Optional GeoLocator Data Package object to fill. Defaults to a new package created with
create_gldp(). Its metadata is kept, but any existing resources are overwritten. Overwriting asks for confirmation, so apkgwith resources can only be used in an interactive session.
See also
create_geopressuretemplate() to create a project from a package,
params_to_tags(), params_to_observations(), and
tags_to_measurements() for the underlying conversions.