meascsv: Legacy MCPT log file parser

This parser handles the reading and processing of the legacy log files created by the LabView interface for the MCPT instrument. With a provided calibration, this parser calculates the temperature, inlet composition, and the inlet flow of the MCPT instrument.

DEPRECATED in yadg-4.0

As of yadg-4.0, this parser is deprecated and should not be used for new data. Please consider switching to the basiccsv parser.

Usage

Available since yadg-3.0. Deprecated since yadg-4.0. The parser supports the following parameters:

pydantic model dgbowl_schemas.yadg.dataschema_4_2.step.MeasCSV.Params

Show JSON schema
{
   "title": "Params",
   "type": "object",
   "properties": {
      "timestamp": {
         "title": "Timestamp",
         "default": {
            "timestamp": {
               "index": 0,
               "format": "%Y-%m-%d-%H-%M-%S"
            }
         },
         "anyOf": [
            {
               "$ref": "#/definitions/Timestamp"
            },
            {
               "$ref": "#/definitions/TimeDate"
            },
            {
               "$ref": "#/definitions/UTS"
            }
         ]
      },
      "calfile": {
         "title": "Calfile",
         "deprecated": true,
         "type": "string"
      },
      "convert": {
         "title": "Convert",
         "deprecated": true
      }
   },
   "additionalProperties": false,
   "definitions": {
      "TimestampSpec": {
         "title": "TimestampSpec",
         "description": "Specification of the column index and string format of the timestamp.",
         "type": "object",
         "properties": {
            "index": {
               "title": "Index",
               "type": "integer"
            },
            "format": {
               "title": "Format",
               "type": "string"
            }
         },
         "additionalProperties": false
      },
      "Timestamp": {
         "title": "Timestamp",
         "description": "Timestamp from a column containing a single timestamp string.",
         "type": "object",
         "properties": {
            "timestamp": {
               "$ref": "#/definitions/TimestampSpec"
            }
         },
         "required": [
            "timestamp"
         ],
         "additionalProperties": false
      },
      "TimeDate": {
         "title": "TimeDate",
         "description": "Timestamp from a separate date and/or time column.",
         "type": "object",
         "properties": {
            "date": {
               "$ref": "#/definitions/TimestampSpec"
            },
            "time": {
               "$ref": "#/definitions/TimestampSpec"
            }
         },
         "additionalProperties": false
      },
      "UTS": {
         "title": "UTS",
         "description": "Timestamp from a column containing a Unix timestamp.",
         "type": "object",
         "properties": {
            "uts": {
               "$ref": "#/definitions/TimestampSpec"
            }
         },
         "required": [
            "uts"
         ],
         "additionalProperties": false
      }
   }
}

field timestamp: Union[dgbowl_schemas.yadg.dataschema_4_2.timestamp.Timestamp, dgbowl_schemas.yadg.dataschema_4_2.timestamp.TimeDate, dgbowl_schemas.yadg.dataschema_4_2.timestamp.UTS] = Timestamp(timestamp=TimestampSpec(index=0, format='%Y-%m-%d-%H-%M-%S'))
field calfile: Optional[str] = None

Column calibration specification.

DEPRECATED in DataSchema-4.2

This feature is deprecated as of yadg-4.2 and will stop working in yadg-5.0.

field convert: Optional[Any] = None

Column renaming specification.

DEPRECATED in DataSchema-4.2

This feature is deprecated as of yadg-4.2 and will stop working in yadg-5.0.

Provides

The parser is used to extract all of the tabular data in the input file, storing them in the same format as basiccsv, using the column headers as keys. The functionality exposed by this parser is using basiccsv behind the scenes.

Submodules

yadg.parsers.meascsv.main.process(fn, encoding='utf-8', timezone='localtime', parameters=None)

Legacy MCPT measurement log parser.

This parser is included to maintain parity with older schemas and datagrams. It is essentially a wrapper around yadg.parsers.basiccsv.main.process_row().

DEPRECATED in yadg-4.0

For new applications, please use the basiccsv parser.

Parameters
  • fn (str) – File to process

  • encoding (str) – Encoding of fn, by default “utf-8”.

  • timezone (str) – A string description of the timezone. Default is “localtime”.

  • parameters (Optional[BaseModel]) – Parameters for MeasCSV.

Returns

(data, metadata, fulldate) – Tuple containing the timesteps, metadata, and full date tag. No metadata is returned. The full date is always provided in meascsv-compatible files.

Return type

tuple[list, dict, bool]