lightr (version 1.3)

lr_parse_trm: Parse Avantes binary file

Description

Parse Avantes binary file (TRM, ABS, ROH, DRK, REF file extensions). https://www.avantes.com/products/spectrometers

Usage

lr_parse_trm(filename)

lr_parse_abs(filename)

lr_parse_roh(filename)

lr_parse_rfl8(filename, specnum = 1L)

lr_parse_raw8(filename, specnum = 1L)

Arguments

filename

Path of the file to parse

specnum

Integer representing the position of the spectrum to read in the file. This option only makes sense for AvaSoft8 files and is ignored in the other cases.

Value

A list of two elements:

  • a dataframe with columns "wl", "dark", "white", "scope" and "processed", in that order

  • a character vector with metadata including:

    • user: Name of the spectrometer operator

    • date: Timestamp of the recording (ISO 8601 format)

    • spec_model: Model of the spectrometer

    • spec_ID: Unique ID of the spectrometer

    • white_inttime: Integration time of the white reference (in ms)

    • dark_inttime: Integration time of the dark reference (in ms)

    • sample_inttime: Integration time of the sample (in ms)

    • white_avgs: Number of averaged measurements for the white reference

    • dark_avgs: Number of averaged measurements for the dark reference

    • sample_avgs: Number of averaged measurements for the sample

    • white_boxcar: Boxcar width for the white reference

    • dark_boxcar: Boxcar width for the dark reference

    • sample_boxcar: Boxcar width for the sample reference

Details

'processed' column computed by lightr with the function compute_processed().

Examples

Run this code
# NOT RUN {
lr_parse_trm(system.file("testdata", "avantes_trans.TRM",
                         package = "lightr"))
lr_parse_roh(system.file("testdata", "avantes_reflect.ROH",
                         package = "lightr"))

lr_parse_rfl8(system.file("testdata", "compare", "Avantes",
                          "feather.RFL8",
                          package = "lightr"),
              specnum = 1)
lr_parse_rfl8(system.file("testdata", "compare", "Avantes",
                          "feather.RFL8",
                          package = "lightr"),
              specnum = 2)

# }

Run the code above in your browser using DataCamp Workspace