Skip to contents

Update the instrument descriptor embedded in raw_spct and raw_mspct objects.

Usage

update_instr_desc(x, which.descriptor.args = list())

Arguments

x

raw_spct or raw_mspct object with attribute instr.desc set.

which.descriptor.args

named list Of arguments to use to fetch the replacement descriptor.

Value

a copy of x with an updated instr.desc attribute embedded.

Details

Recomputing of physical quantities from raw counts normally reuses the embedded calibration data in raw_spct objects. Function update_inst_desc() makes it possible to update the embedded calibration before recomputing derived quantities.

Spectral objects, including those with raw counts data contain an instrument descriptor when measured or imported using functions from 'ooacquire'. The descriptor can include calibration data as well as details of the instrument used. If a calibration has been retroactively modified after data acquisition, the descriptor can be refreshed in existing raw_spct or raw_mspct objects. By default the the version of the new descriptor is that in the loaded version of 'ooacquire', corresponding to the same instrument, data acquisition date and entrance optics.

If for some reason, an instrument descriptor for the wrong spectrometer, the wrong entrance optics or for a wrong data acquisition date, a non-matching replacement can be used by passing suitable arguments through parameter which.descriptor.arg. See which_descriptor() for the details.

Note

The replacement of the instrument descriptor is not supported for spectral data not expressed as raw counts, because this would create an inconsistency between the computed data and its metadata. To achieve such a change data in physical units have to be recomputed from raw instrument counts after updating the object containing the raw detector counts.

Warning!

This function is intended only to repair objects that have corrupted information. Typical cases are acquisition using a computer with wrong date settings, unrecognized instrument serial number, or measurements done before the valid calibration was added to 'ooacquire'.

The special case when the only change to the calibration is adding newly identified bad pixels in the sensor array, function update_bad_pixs provides a "light weight" alternative.