Skip to contents

Reads and parses the header of processed data text files output by Jaz instruments extracting the spectral data from the body of the file and the metadata, including time and date of measurement from the header. Jaz modular spectrometers were manufactured by Ocean Optics. The company formerly named Ocean Optics is now called Ocean Insight.

Usage

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

read_oo_jazpc(
  file,
  qty.in = "Tpc",
  Tfr.type = c("total", "internal"),
  Rfr.type = c("total", "specular"),
  date = NULL,
  geocode = NULL,
  label = NULL,
  tz = NULL,
  locale = readr::default_locale()
)

read_oo_jazdata(
  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 used for interpreting times saved in the file header.

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.

qty.in

character string, one of "Tpc" (spectral transmittance, %), "A" (spectral absorbance), or "Rpc" (spectral reflectance, %).

Tfr.type

character string, either "total" or "internal".

Rfr.type

character string, either "total" or "specular".

Value

A source_spct object, a filter_spct object, a reflector_spct object or a raw_spct object.

Details

Function read_oo_jazirrad can read processed irradiance output files. Function read_oo_jazpc can read processed transmittance and reflectance output files (expressed as %s). Function read_oo_jazdata can read raw-counts data.

Note

Although the parameter is called date a date time is accepted and expected. Time resolution is < 1 s if seconds are entered with a decimal fraction, such as "2021-10-05 10:10:10.1234".

Examples


 file.name <- 
   system.file("extdata", "spectrum.jaz", 
               package = "photobiologyInOut", mustWork = TRUE)
                
 jaz.spct <- read_oo_jazpc(file = file.name)
#> Off-range transmittance values [-47.00..47.00] instead of  [0..1]
 
 jaz.spct
#> Object: filter_spct [2,048 x 2]
#> Wavelength range 190.3139-892.61151 nm, step 0.296936-0.381607 nm 
#> Label: File: spectrum.jaz 
#> Measured on 2016-04-25 12:49:02 UTC 
#> Rfr (/1): NA, thickness (mm): NA, attenuation mode: NA.
#> Variables:
#>  w.length: Wavelength [nm]
#>  Tfr: Total spectral transmittance [/1] 
#> --
#> # A tibble: 2,048 × 2
#>    w.length      Tfr
#>       <dbl>    <dbl>
#>  1     190.   0     
#>  2     191.   0     
#>  3     191.   4.00  
#>  4     191.  -2.11  
#>  5     192.  -3     
#>  6     192. -47.0   
#>  7     193.   0.400 
#>  8     193.  -0.0714
#>  9     193.  -0.533 
#> 10     194.   0.361 
#> # ℹ 2,038 more rows
 getWhenMeasured(jaz.spct)
#> [1] "2016-04-25 12:49:02 UTC"
 getWhatMeasured(jaz.spct)
#> [1] "File: spectrum.jaz"
 cat(comment(jaz.spct))
#> Ocean Optics Jaz file 'spectrum.jaz' imported as Tpc on 2024-12-24 01:19:51.539316 UTC
#> Jaz Data File
#> ++++++++++++++++++++++++++++++++++++
#> Date: Mon Apr 25 12:49:02 2016
#> User: jaz
#> Dark Spectrum Present: Yes
#> Reference Spectrum Present: Yes
#> Processed Spectrum Present: Yes
#> Spectrometers: JAZA3098
#> Integration Time (usec): 748000 (JAZA3098)
#> Spectra Averaged: 1 (JAZA3098)
#> Boxcar Smoothing: 0 (JAZA3098)
#> Correct for Electrical Dark: No (JAZA3098)
#> Strobe/Lamp Enabled: Yes (JAZA3098)
#> Correct for Detector Non-linearity: No (JAZA3098)
#> Correct for Stray Light: No (JAZA3098)
#> Number of Pixels in Processed Spectrum: 2048