Skip to contents

Reads and parses the header of a processed data file as output by SpectraSuite to extract the whole header remark field. The time field is retrieved and decoded. SpectraSuite was a program, now replaced by OceanView. The company formerly named Ocean Optics is now called Ocean Insight.

Usage

read_oo_ssirrad(
  file,
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale()
)

read_oo_ssdata(
  file,
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale()
)

Arguments

file

character string

date

a POSIXct object to use to set the "when.measured" attribute. If NULL, the default, the date is extracted from the file header.

geocode

A data frame with columns lon and lat used to set attribute "where.measured".

label

character string, but if NULL the value of file is used, and if NA the "what.measured" attribute is not set.

tz

character Time zone is by default read from the file.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

Value

A source_spct object.

A raw_spct object.

Examples


 file.name <- 
   system.file("extdata", "spectrum.SSIrrad", 
               package = "photobiologyInOut", mustWork = TRUE)
                
 ooss.spct <- read_oo_ssirrad(file = file.name)
 
 ooss.spct
#> Object: source_spct [1,044 x 2]
#> Wavelength range 199.08-998.61 nm, step 0.72-0.81 nm 
#> Label: File: spectrum.SSIrrad 
#> Measured on 2013-05-06 15:13:40 UTC 
#> Variables:
#>  w.length: Wavelength [nm]
#>  s.e.irrad: Spectral energy irradiance [W m-2 nm-1] 
#> --
#> # A tibble: 1,044 × 2
#>    w.length s.e.irrad
#>       <dbl>     <dbl>
#>  1     199.     0    
#>  2     200.     0    
#>  3     201.     0    
#>  4     202.     1.37 
#>  5     202.     1.25 
#>  6     203.     1.13 
#>  7     204.     1.11 
#>  8     205.     1.09 
#>  9     206.     0.902
#> 10     206.     0.739
#> # ℹ 1,034 more rows
 getWhenMeasured(ooss.spct)
#> [1] "2013-05-06 15:13:40 UTC"
 getWhatMeasured(ooss.spct)
#> [1] "File: spectrum.SSIrrad"
 cat(comment(ooss.spct))
#> Ocean Optics Spectra Suite irradiance file 'C:/Users/aphalo/AppData/Local/Temp/Rtmpw982PX/temp_libpath798c74b3232f/photobiologyInOut/extdata/spectrum.SSIrrad' imported on 2025-03-10 15:48:24.505969 UTC
#> SpectraSuite Data File
#> ++++++++++++++++++++++++++++++++++++
#> Date: Mon May 06 15:13:40 CEST 2013
#> User: User
#> Dark Spectrum Present: Yes
#> Reference Spectrum Present: No
#> Number of Sampled Component Spectra: 1
#> Spectrometers: QEB1523
#> Integration Time (usec): 100000 (QEB1523)
#> Spectra Averaged: 1 (QEB1523)
#> Boxcar Smoothing: 0 (QEB1523)
#> Correct for Electrical Dark: No (QEB1523)
#> Strobe/Lamp Enabled: No (QEB1523)
#> Correct for Detector Non-linearity: No (QEB1523)
#> Correct for Stray Light: Yes (QEB1523)
#> Number of Pixels in Processed Spectrum: 1044