seasonder_exportLLUVRadialMetrics {SeaSondeR}R Documentation

Export LLUV Radial Metrics to a File

Description

This function extracts radial metrics from a SeaSondeRCS object and formats them for export using defined mustache templates. The formatted output, which includes MUSIC parameters, antenna pattern corrections, noise thresholds, and other spectral metrics, is written to a specified file. Additionally, the function returns the computed radial metrics as a data frame.

Usage

seasonder_exportLLUVRadialMetrics(seasonder_cs_object, LLUV_path, ...)

Arguments

seasonder_cs_object

A SeaSondeRCS object containing MUSIC detection data and related metadata.

LLUV_path

A character string specifying the output file path for the LLUV radial metrics.

...

Additional arguments passed to seasonder_exportRadialMetrics.

Details

The function performs the following steps:

  1. Retrieves the radial metrics from the SeaSondeRCS object using seasonder_exportRadialMetrics.

  2. Obtains MUSIC parameters and antenna pattern attributes from the object.

  3. Formats numeric values using predefined formats for each column.

  4. Renders a data template (from "LLUV_RDM1_data.mustache") with the formatted radial metrics.

  5. Generates a deterministic UUID from the rendered data.

  6. Renders an overall LLUV template (from "LLUV_RDM1.mustache") that incorporates the radial parameters, formatted data, header information, and the generated UUID.

  7. Writes the rendered LLUV content to the file specified by LLUV_path.

Value

Invisibly returns a data frame containing the radial metrics used in the export.

Examples

# Prepare a SeaSondeRCS object with MUSIC data
apm_file <- system.file("css_data/MeasPattern.txt", package = "SeaSondeR")
apm_obj <- seasonder_readSeaSondeRAPMFile(apm_file)
cs_file <- system.file("css_data/CSS_TORA_24_04_04_0700.cs", package = "SeaSondeR")
cs_obj <- seasonder_createSeaSondeRCS(cs_file, seasonder_apm_object = apm_obj)
FOR <- seasonder_getSeaSondeRCS_FOR(cs_obj)
cs_obj <- seasonder_setSeaSondeRCS_FOR(cs_obj,FOR[4:5])
# Optionally, run MUSIC in FOR context to populate MUSIC data
cs_obj <- seasonder_runMUSICInFOR(cs_obj)
radial_metrics <- seasonder_exportLLUVRadialMetrics(cs_obj, tempfile(fileext = ".ruv"))
head(radial_metrics)

[Package SeaSondeR version 0.2.8 Index]