OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

CsvOptions

public sealed record CsvOptions : IEquatable<CsvOptions>

How a CSV snapshot spells its table, for a spreadsheet set to a locale other than English.

An instance you have not touched writes exactly the CSV ThermalCamera.SaveSnapshot(…) 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 ThermalCamera.SaveCsvSnapshot(…) to write the spelling it expects.

The file depends on these properties and on nothing else. The thread's culture and the Windows regional settings never reach it. To follow the user's own settings, read them yourself, for example from CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator and TextInfo.ListSeparator, and set the two characters here.

Example

camera.SaveCsvSnapshot("capture.csv", new CsvOptions
{
    Delimiter = ';',
    DecimalSeparator = ',',
    LeaveUnmeasuredEmpty = true,
});

// The same in degrees Fahrenheit.
camera.SaveCsvSnapshot("capture_f.csv", new CsvOptions
{
    TemperatureUnit = TemperatureUnit.Fahrenheit,
});

CsvOptions: constructors

public CsvOptions()

CsvOptions: properties

public char DecimalSeparator { get; init; }

What goes before the decimals: . (the default) or ,.

Anything else is refused with SdkConfigurationException, and so is a decimal separator equal to CsvOptions.Delimiter, because a reader could not tell 1,5 from two values. It applies to every number in the file, the # header lines included.

public char Delimiter { get; init; }

What goes between two values on a row: , (the default), ; or a tab ('\t').

Anything else is refused with SdkConfigurationException and nothing is written.

public bool LeaveUnmeasuredEmpty { get; init; }

Write a pixel that was not measured as an empty field instead of nan.

Every spreadsheet reads an empty field as a blank cell; it reads nan as text.

public bool OmitHeaderLines { get; init; }

Leave out the # header lines, so the file is the table and nothing else. The # Unit: line goes with them.

public TemperatureUnit TemperatureUnit { get; init; }

The unit every temperature in the file is written in: the pixels and the ambient header line. Degrees Celsius by default, whatever Sdk.TemperatureUnit says: a CSV is a file and keeps its own explicit choice.

In Fahrenheit each value is converted at full precision and then rounded once to the file's two decimals, half away from zero, the way Temperatures.Format(…) rounds; a pixel that was not measured stays nan (or empty); the header says # Unit: degF, and the ambient line is keyed AmbientTempF instead of AmbientTempC. Every file, Celsius too, names its unit on a # Unit: line, which a reader that skips the # lines never sees. Emissivity and transmissivity are not temperatures and do not change. A value outside the enum is refused with SdkConfigurationException.