Skip to contents

This function exports the MUSIC detection table from a SeaSondeRCS object to a CSV file.

Usage

seasonder_exportCSVMUSICTable(seasonder_cs_object, filepath)

Arguments

seasonder_cs_object

A SeaSondeRCS object containing MUSIC detection data.

filepath

A character string specifying the path to the output CSV file.

Value

The function returns NULL invisibly. The output is saved to the specified file.

Details

This function performs the following steps:

  1. Generates a MUSIC table using seasonder_exportMUSICTable.

  2. Converts the resulting table to a data frame.

  3. Writes the data frame to the specified CSV file using data.table::fwrite.

Examples

  # Prepare a SeaSondeRCS object for examples, including APM
  apm_file <- system.file("css_data/MeasPattern.txt", package = "SeaSondeR")
  apm_obj <- seasonder_readSeaSondeRAPMFile(apm_file)
#> seasonder_createSeaSondeRAPM:  APM object created successfully.
  specs_path <- seasonder_defaultSpecsFilePath("CS")
  cs_obj <- seasonder_createSeaSondeRCS(
    system.file("css_data/CSS_TORA_24_04_04_0700.cs", package = "SeaSondeR"),
    specs_path = specs_path,
    seasonder_apm_object = apm_obj
  )
#> new_SeaSondeRCS:  SeaSondeRCS object created successfully.
cs_obj <- seasonder_initMUSICData(
 cs_obj,
 range_cells = c(rep(5,11), rep(4,11)),
 doppler_bins = c(c(669:679),c(674:684))
)
cs_obj <- seasonder_runMUSIC(cs_obj)
#> seasonder_runMUSIC:  MUSIC algorithm started.
#> seasonder_runMUSIC:  MUSIC algorithm finished.
  # Export MUSIC table to a temporary CSV file
  tmpfile <- tempfile(fileext = ".csv")
  seasonder_exportCSVMUSICTable(cs_obj, tmpfile)
  print(tmpfile)
#> [1] "/tmp/Rtmpz2XTcl/file1ba85b9a7598.csv"