CsvOptions
class optris_sdk.snapshot.CsvOptions
How a CSV snapshot spells its table, for a spreadsheet set to a locale other than English.
CsvOptions() writes exactly the CSV save_snapshot(..., format=SNAPSHOT_CSV) writes: , between values, . before
the decimals, nan for a pixel that was not measured, and the
# header lines. That is the form for programs, and it stays the
default so that existing readers keep working.
A spreadsheet set to German, French or most other European locales
splits on ; and reads , as the decimal separator, so it
opens the default file as one text column per row. Pass this to
optris_sdk.camera.Camera.save_csv_snapshot to write the
spelling it expects.
The file depends on these fields and on nothing else; the process locale never reaches it.
Any other delimiter, decimal separator or unit, or a delimiter and
decimal separator that are the same character, raises
optris_sdk.errors.InvalidArgumentError when the snapshot
is saved, and nothing is written.
For a German spreadsheet in degrees Fahrenheit::
optris_sdk.CsvOptions(
delimiter=';', decimal_separator=',',
temperature_unit=optris_sdk.TEMPERATURE_UNIT_FAHRENHEIT)
- Parameter
delimiter— what goes between two values on a row:','(the default),';'or'\t'. - Parameter
decimal_separator— what goes before the decimals:'.'(the default) or','. It applies to every number in the file, the#header lines included. - Parameter
leave_unmeasured_empty— True writes a pixel that was not measured as an empty field instead ofnan. Every spreadsheet reads an empty field as a blank cell; it readsnanas text. - Parameter
omit_header_lines— True leaves out the#header lines, so the file is the table and nothing else. The# Unit:line goes with them. - Parameter
temperature_unit— the unit every temperature in the file is written in, the pixels and the ambient header line:TEMPERATURE_UNIT_CELSIUS(the default) orTEMPERATURE_UNIT_FAHRENHEIT. In Fahrenheit each value is converted at full precision and then rounded once to the file's two decimals, half away from zero, asoptris_sdk.temperatures.formatrounds;nanstaysnan; the header says# Unit: degFand the ambient line is keyedAmbientTempF. Every file, Celsius too, names its unit on a# Unit:line. This is the file's own unit and does not followoptris_sdk.set_temperature_unit.