resistics.project module

Classes and methods to enable a resistics project

A project is an essential element of a resistics environment together with a configuration.

In particular, this module includes the core Project, Site and Measurement clasess and some supporting functions.

resistics.project.get_calibration_path(proj_dir: pathlib.Path) pathlib.Path[source]

Get the path to the calibration data

resistics.project.get_meas_time_path(proj_dir: pathlib.Path, site_name: str, meas_name: str) pathlib.Path[source]

Get path to measurement time data

resistics.project.get_meas_spectra_path(proj_dir: pathlib.Path, site_name: str, meas_name: str, config_name: str) pathlib.Path[source]

Get path to measurement spectra data

resistics.project.get_meas_evals_path(proj_dir: pathlib.Path, site_name: str, meas_name: str, config_name: str) pathlib.Path[source]

Get path to measurement evaluation frequency spectra data

resistics.project.get_meas_features_path(proj_dir: pathlib.Path, site_name: str, meas_name: str, config_name: str) pathlib.Path[source]

Get path to measurement features data

resistics.project.get_mask_path(proj_dir: pathlib.Path, site_name: str, config_name: str) pathlib.Path[source]

Get path to mask data

resistics.project.get_mask_name(fs: float, mask_name: str) str[source]

Get the name of a mask file

resistics.project.get_results_path(proj_dir: pathlib.Path, site_name: str, config_name: str) pathlib.Path[source]

Get path to solutions

resistics.project.get_solution_name(fs: float, tf_name: str, tf_var: str, postfix: Optional[str] = None) str[source]

Get the name of a solution file

pydantic model resistics.project.Measurement[source]

Bases: resistics.common.ResisticsModel

Class for interfacing with a measurement

The class holds the original time series metadata and can provide information about other types of data

Show JSON schema
{
   "title": "Measurement",
   "description": "Class for interfacing with a measurement\n\nThe class holds the original time series metadata and can provide\ninformation about other types of data",
   "type": "object",
   "properties": {
      "site_name": {
         "title": "Site Name",
         "type": "string"
      },
      "dir_path": {
         "title": "Dir Path",
         "type": "string",
         "format": "path"
      },
      "metadata": {
         "$ref": "#/definitions/TimeMetadata"
      },
      "reader": {
         "$ref": "#/definitions/TimeReader"
      }
   },
   "required": [
      "site_name",
      "dir_path",
      "metadata",
      "reader"
   ],
   "definitions": {
      "ResisticsFile": {
         "title": "ResisticsFile",
         "description": "Required information for writing out a resistics file",
         "type": "object",
         "properties": {
            "created_on_local": {
               "title": "Created On Local",
               "type": "string",
               "format": "date-time"
            },
            "created_on_utc": {
               "title": "Created On Utc",
               "type": "string",
               "format": "date-time"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         }
      },
      "ChanMetadata": {
         "title": "ChanMetadata",
         "description": "Channel metadata",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "data_files": {
               "title": "Data Files",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "chan_type": {
               "title": "Chan Type",
               "type": "string"
            },
            "chan_source": {
               "title": "Chan Source",
               "type": "string"
            },
            "sensor": {
               "title": "Sensor",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "gain1": {
               "title": "Gain1",
               "default": 1,
               "type": "number"
            },
            "gain2": {
               "title": "Gain2",
               "default": 1,
               "type": "number"
            },
            "scaling": {
               "title": "Scaling",
               "default": 1,
               "type": "number"
            },
            "chopper": {
               "title": "Chopper",
               "default": false,
               "type": "boolean"
            },
            "dipole_dist": {
               "title": "Dipole Dist",
               "default": 1,
               "type": "number"
            },
            "sensor_calibration_file": {
               "title": "Sensor Calibration File",
               "default": "",
               "type": "string"
            },
            "instrument_calibration_file": {
               "title": "Instrument Calibration File",
               "default": "",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      },
      "Record": {
         "title": "Record",
         "description": "Class to hold a record\n\nA record holds information about a process that was run. It is intended to\ntrack processes applied to data, allowing a process history to be saved\nalong with any datasets.\n\nExamples\n--------\nA simple example of creating a process record\n\n>>> from resistics.common import Record\n>>> messages = [\"message 1\", \"message 2\"]\n>>> record = Record(\n...     creator={\"name\": \"example\", \"parameter1\": 15},\n...     messages=messages,\n...     record_type=\"example\"\n... )\n>>> record.summary()\n{\n    'time_local': '...',\n    'time_utc': '...',\n    'creator': {'name': 'example', 'parameter1': 15},\n    'messages': ['message 1', 'message 2'],\n    'record_type': 'example'\n}",
         "type": "object",
         "properties": {
            "time_local": {
               "title": "Time Local",
               "type": "string",
               "format": "date-time"
            },
            "time_utc": {
               "title": "Time Utc",
               "type": "string",
               "format": "date-time"
            },
            "creator": {
               "title": "Creator",
               "type": "object"
            },
            "messages": {
               "title": "Messages",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "record_type": {
               "title": "Record Type",
               "type": "string"
            }
         },
         "required": [
            "creator",
            "messages",
            "record_type"
         ]
      },
      "History": {
         "title": "History",
         "description": "Class for storing processing history\n\nParameters\n----------\nrecords : List[Record], optional\n    List of records, by default []\n\nExamples\n--------\n>>> from resistics.testing import record_example1, record_example2\n>>> from resistics.common import History\n>>> record1 = record_example1()\n>>> record2 = record_example2()\n>>> history = History(records=[record1, record2])\n>>> history.summary()\n{\n    'records': [\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example1',\n                'a': 5,\n                'b': -7.0\n            },\n            'messages': ['Message 1', 'Message 2'],\n            'record_type': 'process'\n        },\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example2',\n                'a': 'parzen',\n                'b': -21\n            },\n            'messages': ['Message 5', 'Message 6'],\n            'record_type': 'process'\n        }\n    ]\n}",
         "type": "object",
         "properties": {
            "records": {
               "title": "Records",
               "default": [],
               "type": "array",
               "items": {
                  "$ref": "#/definitions/Record"
               }
            }
         }
      },
      "TimeMetadata": {
         "title": "TimeMetadata",
         "description": "Time metadata",
         "type": "object",
         "properties": {
            "file_info": {
               "$ref": "#/definitions/ResisticsFile"
            },
            "fs": {
               "title": "Fs",
               "type": "number"
            },
            "chans": {
               "title": "Chans",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "n_chans": {
               "title": "N Chans",
               "type": "integer"
            },
            "n_samples": {
               "title": "N Samples",
               "type": "integer"
            },
            "first_time": {
               "title": "First Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "last_time": {
               "title": "Last Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "system": {
               "title": "System",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "wgs84_latitude": {
               "title": "Wgs84 Latitude",
               "default": -999.0,
               "type": "number"
            },
            "wgs84_longitude": {
               "title": "Wgs84 Longitude",
               "default": -999.0,
               "type": "number"
            },
            "easting": {
               "title": "Easting",
               "default": -999.0,
               "type": "number"
            },
            "northing": {
               "title": "Northing",
               "default": -999.0,
               "type": "number"
            },
            "elevation": {
               "title": "Elevation",
               "default": -999.0,
               "type": "number"
            },
            "chans_metadata": {
               "title": "Chans Metadata",
               "type": "object",
               "additionalProperties": {
                  "$ref": "#/definitions/ChanMetadata"
               }
            },
            "history": {
               "title": "History",
               "default": {
                  "records": []
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/History"
                  }
               ]
            }
         },
         "required": [
            "fs",
            "chans",
            "n_samples",
            "first_time",
            "last_time",
            "chans_metadata"
         ]
      },
      "TimeReader": {
         "title": "TimeReader",
         "description": "Base class for resistics processes\n\nResistics processes perform operations on data (including read and write\noperations). Each time a ResisticsProcess child class is run, it should add\na process record to the dataset",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "apply_scalings": {
               "title": "Apply Scalings",
               "default": true,
               "type": "boolean"
            },
            "extension": {
               "title": "Extension",
               "type": "string"
            }
         }
      }
   }
}

field site_name: str [Required]
field dir_path: pathlib.Path [Required]
field metadata: resistics.time.TimeMetadata [Required]
field reader: resistics.time.TimeReader [Required]
property name: str

Get the name of the measurement

pydantic model resistics.project.Site[source]

Bases: resistics.common.ResisticsModel

Class for describing Sites

Note

This should essentially describe a single instrument setup. If the same site is re-occupied later with a different instrument setup, it is suggested to split this into a different site.

Show JSON schema
{
   "title": "Site",
   "description": "Class for describing Sites\n\n.. note::\n\n    This should essentially describe a single instrument setup. If the same\n    site is re-occupied later with a different instrument setup, it is\n    suggested to split this into a different site.",
   "type": "object",
   "properties": {
      "dir_path": {
         "title": "Dir Path",
         "type": "string",
         "format": "path"
      },
      "measurements": {
         "title": "Measurements",
         "type": "object",
         "additionalProperties": {
            "$ref": "#/definitions/Measurement"
         }
      },
      "begin_time": {
         "title": "Begin Time",
         "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
         "examples": [
            "2021-01-01 00:00:00.000061_035156_250000_000000"
         ]
      },
      "end_time": {
         "title": "End Time",
         "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
         "examples": [
            "2021-01-01 00:00:00.000061_035156_250000_000000"
         ]
      }
   },
   "required": [
      "dir_path",
      "measurements",
      "begin_time",
      "end_time"
   ],
   "definitions": {
      "ResisticsFile": {
         "title": "ResisticsFile",
         "description": "Required information for writing out a resistics file",
         "type": "object",
         "properties": {
            "created_on_local": {
               "title": "Created On Local",
               "type": "string",
               "format": "date-time"
            },
            "created_on_utc": {
               "title": "Created On Utc",
               "type": "string",
               "format": "date-time"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         }
      },
      "ChanMetadata": {
         "title": "ChanMetadata",
         "description": "Channel metadata",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "data_files": {
               "title": "Data Files",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "chan_type": {
               "title": "Chan Type",
               "type": "string"
            },
            "chan_source": {
               "title": "Chan Source",
               "type": "string"
            },
            "sensor": {
               "title": "Sensor",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "gain1": {
               "title": "Gain1",
               "default": 1,
               "type": "number"
            },
            "gain2": {
               "title": "Gain2",
               "default": 1,
               "type": "number"
            },
            "scaling": {
               "title": "Scaling",
               "default": 1,
               "type": "number"
            },
            "chopper": {
               "title": "Chopper",
               "default": false,
               "type": "boolean"
            },
            "dipole_dist": {
               "title": "Dipole Dist",
               "default": 1,
               "type": "number"
            },
            "sensor_calibration_file": {
               "title": "Sensor Calibration File",
               "default": "",
               "type": "string"
            },
            "instrument_calibration_file": {
               "title": "Instrument Calibration File",
               "default": "",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      },
      "Record": {
         "title": "Record",
         "description": "Class to hold a record\n\nA record holds information about a process that was run. It is intended to\ntrack processes applied to data, allowing a process history to be saved\nalong with any datasets.\n\nExamples\n--------\nA simple example of creating a process record\n\n>>> from resistics.common import Record\n>>> messages = [\"message 1\", \"message 2\"]\n>>> record = Record(\n...     creator={\"name\": \"example\", \"parameter1\": 15},\n...     messages=messages,\n...     record_type=\"example\"\n... )\n>>> record.summary()\n{\n    'time_local': '...',\n    'time_utc': '...',\n    'creator': {'name': 'example', 'parameter1': 15},\n    'messages': ['message 1', 'message 2'],\n    'record_type': 'example'\n}",
         "type": "object",
         "properties": {
            "time_local": {
               "title": "Time Local",
               "type": "string",
               "format": "date-time"
            },
            "time_utc": {
               "title": "Time Utc",
               "type": "string",
               "format": "date-time"
            },
            "creator": {
               "title": "Creator",
               "type": "object"
            },
            "messages": {
               "title": "Messages",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "record_type": {
               "title": "Record Type",
               "type": "string"
            }
         },
         "required": [
            "creator",
            "messages",
            "record_type"
         ]
      },
      "History": {
         "title": "History",
         "description": "Class for storing processing history\n\nParameters\n----------\nrecords : List[Record], optional\n    List of records, by default []\n\nExamples\n--------\n>>> from resistics.testing import record_example1, record_example2\n>>> from resistics.common import History\n>>> record1 = record_example1()\n>>> record2 = record_example2()\n>>> history = History(records=[record1, record2])\n>>> history.summary()\n{\n    'records': [\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example1',\n                'a': 5,\n                'b': -7.0\n            },\n            'messages': ['Message 1', 'Message 2'],\n            'record_type': 'process'\n        },\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example2',\n                'a': 'parzen',\n                'b': -21\n            },\n            'messages': ['Message 5', 'Message 6'],\n            'record_type': 'process'\n        }\n    ]\n}",
         "type": "object",
         "properties": {
            "records": {
               "title": "Records",
               "default": [],
               "type": "array",
               "items": {
                  "$ref": "#/definitions/Record"
               }
            }
         }
      },
      "TimeMetadata": {
         "title": "TimeMetadata",
         "description": "Time metadata",
         "type": "object",
         "properties": {
            "file_info": {
               "$ref": "#/definitions/ResisticsFile"
            },
            "fs": {
               "title": "Fs",
               "type": "number"
            },
            "chans": {
               "title": "Chans",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "n_chans": {
               "title": "N Chans",
               "type": "integer"
            },
            "n_samples": {
               "title": "N Samples",
               "type": "integer"
            },
            "first_time": {
               "title": "First Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "last_time": {
               "title": "Last Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "system": {
               "title": "System",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "wgs84_latitude": {
               "title": "Wgs84 Latitude",
               "default": -999.0,
               "type": "number"
            },
            "wgs84_longitude": {
               "title": "Wgs84 Longitude",
               "default": -999.0,
               "type": "number"
            },
            "easting": {
               "title": "Easting",
               "default": -999.0,
               "type": "number"
            },
            "northing": {
               "title": "Northing",
               "default": -999.0,
               "type": "number"
            },
            "elevation": {
               "title": "Elevation",
               "default": -999.0,
               "type": "number"
            },
            "chans_metadata": {
               "title": "Chans Metadata",
               "type": "object",
               "additionalProperties": {
                  "$ref": "#/definitions/ChanMetadata"
               }
            },
            "history": {
               "title": "History",
               "default": {
                  "records": []
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/History"
                  }
               ]
            }
         },
         "required": [
            "fs",
            "chans",
            "n_samples",
            "first_time",
            "last_time",
            "chans_metadata"
         ]
      },
      "TimeReader": {
         "title": "TimeReader",
         "description": "Base class for resistics processes\n\nResistics processes perform operations on data (including read and write\noperations). Each time a ResisticsProcess child class is run, it should add\na process record to the dataset",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "apply_scalings": {
               "title": "Apply Scalings",
               "default": true,
               "type": "boolean"
            },
            "extension": {
               "title": "Extension",
               "type": "string"
            }
         }
      },
      "Measurement": {
         "title": "Measurement",
         "description": "Class for interfacing with a measurement\n\nThe class holds the original time series metadata and can provide\ninformation about other types of data",
         "type": "object",
         "properties": {
            "site_name": {
               "title": "Site Name",
               "type": "string"
            },
            "dir_path": {
               "title": "Dir Path",
               "type": "string",
               "format": "path"
            },
            "metadata": {
               "$ref": "#/definitions/TimeMetadata"
            },
            "reader": {
               "$ref": "#/definitions/TimeReader"
            }
         },
         "required": [
            "site_name",
            "dir_path",
            "metadata",
            "reader"
         ]
      }
   }
}

field dir_path: pathlib.Path [Required]
field measurements: Dict[str, resistics.project.Measurement] [Required]
field begin_time: resistics.sampling.HighResDateTime [Required]
Constraints
  • pattern = %Y-%m-%d %H:%M:%S.%f_%o_%q_%v

  • examples = [‘2021-01-01 00:00:00.000061_035156_250000_000000’]

field end_time: resistics.sampling.HighResDateTime [Required]
Constraints
  • pattern = %Y-%m-%d %H:%M:%S.%f_%o_%q_%v

  • examples = [‘2021-01-01 00:00:00.000061_035156_250000_000000’]

property name: str

The Site name

property n_meas: int

Get the number of measurements

fs() List[float][source]

Get the sampling frequencies in the Site

get_measurement(meas_name: str) resistics.project.Measurement[source]

Get a measurement

get_measurements(fs: Optional[float] = None) Dict[str, resistics.project.Measurement][source]

Get dictionary of measurements with optional filter by sampling frequency

plot() plotly.graph_objs._figure.Figure[source]

Plot the site timeline

to_dataframe() pandas.core.frame.DataFrame[source]

Get measurements list in a pandas DataFrame

Note

Measurement first and last times are converted to pandas Timestamps as these are more universally useful in a pandas DataFrame. However, this may result in a loss of precision, especially at high sampling frequencies.

Returns

Site measurement DataFrame

Return type

pd.DataFrame

pydantic model resistics.project.ProjectMetadata[source]

Bases: resistics.common.WriteableMetadata

Project metadata

Show JSON schema
{
   "title": "ProjectMetadata",
   "description": "Project metadata",
   "type": "object",
   "properties": {
      "file_info": {
         "$ref": "#/definitions/ResisticsFile"
      },
      "ref_time": {
         "title": "Ref Time",
         "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
         "examples": [
            "2021-01-01 00:00:00.000061_035156_250000_000000"
         ]
      },
      "location": {
         "title": "Location",
         "default": "",
         "type": "string"
      },
      "country": {
         "title": "Country",
         "default": "",
         "type": "string"
      },
      "year": {
         "title": "Year",
         "default": -999,
         "type": "integer"
      },
      "description": {
         "title": "Description",
         "default": "",
         "type": "string"
      },
      "contributors": {
         "title": "Contributors",
         "default": [],
         "type": "array",
         "items": {
            "type": "string"
         }
      }
   },
   "required": [
      "ref_time"
   ],
   "definitions": {
      "ResisticsFile": {
         "title": "ResisticsFile",
         "description": "Required information for writing out a resistics file",
         "type": "object",
         "properties": {
            "created_on_local": {
               "title": "Created On Local",
               "type": "string",
               "format": "date-time"
            },
            "created_on_utc": {
               "title": "Created On Utc",
               "type": "string",
               "format": "date-time"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         }
      }
   }
}

field ref_time: resistics.sampling.HighResDateTime [Required]
Constraints
  • pattern = %Y-%m-%d %H:%M:%S.%f_%o_%q_%v

  • examples = [‘2021-01-01 00:00:00.000061_035156_250000_000000’]

field location: str = ''
field country: str = ''
field year: int = -999
field description: str = ''
field contributors: List[str] = []
pydantic model resistics.project.Project[source]

Bases: resistics.common.ResisticsModel

Class to describe a resistics project

The resistics Project Class connects all resistics data. It is an essential part of processing data with resistics.

Resistics projects are in directory with several sub-directories. Project metadata is saved in the resistics.json file at the top level directory.

Show JSON schema
{
   "title": "Project",
   "description": "Class to describe a resistics project\n\nThe resistics Project Class connects all resistics data. It is an essential\npart of processing data with resistics.\n\nResistics projects are in directory with several sub-directories. Project\nmetadata is saved in the resistics.json file at the top level directory.",
   "type": "object",
   "properties": {
      "dir_path": {
         "title": "Dir Path",
         "type": "string",
         "format": "path"
      },
      "begin_time": {
         "title": "Begin Time",
         "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
         "examples": [
            "2021-01-01 00:00:00.000061_035156_250000_000000"
         ]
      },
      "end_time": {
         "title": "End Time",
         "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
         "examples": [
            "2021-01-01 00:00:00.000061_035156_250000_000000"
         ]
      },
      "metadata": {
         "$ref": "#/definitions/ProjectMetadata"
      },
      "sites": {
         "title": "Sites",
         "default": {},
         "type": "object",
         "additionalProperties": {
            "$ref": "#/definitions/Site"
         }
      }
   },
   "required": [
      "dir_path",
      "begin_time",
      "end_time",
      "metadata"
   ],
   "definitions": {
      "ResisticsFile": {
         "title": "ResisticsFile",
         "description": "Required information for writing out a resistics file",
         "type": "object",
         "properties": {
            "created_on_local": {
               "title": "Created On Local",
               "type": "string",
               "format": "date-time"
            },
            "created_on_utc": {
               "title": "Created On Utc",
               "type": "string",
               "format": "date-time"
            },
            "version": {
               "title": "Version",
               "type": "string"
            }
         }
      },
      "ProjectMetadata": {
         "title": "ProjectMetadata",
         "description": "Project metadata",
         "type": "object",
         "properties": {
            "file_info": {
               "$ref": "#/definitions/ResisticsFile"
            },
            "ref_time": {
               "title": "Ref Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "location": {
               "title": "Location",
               "default": "",
               "type": "string"
            },
            "country": {
               "title": "Country",
               "default": "",
               "type": "string"
            },
            "year": {
               "title": "Year",
               "default": -999,
               "type": "integer"
            },
            "description": {
               "title": "Description",
               "default": "",
               "type": "string"
            },
            "contributors": {
               "title": "Contributors",
               "default": [],
               "type": "array",
               "items": {
                  "type": "string"
               }
            }
         },
         "required": [
            "ref_time"
         ]
      },
      "ChanMetadata": {
         "title": "ChanMetadata",
         "description": "Channel metadata",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "data_files": {
               "title": "Data Files",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "chan_type": {
               "title": "Chan Type",
               "type": "string"
            },
            "chan_source": {
               "title": "Chan Source",
               "type": "string"
            },
            "sensor": {
               "title": "Sensor",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "gain1": {
               "title": "Gain1",
               "default": 1,
               "type": "number"
            },
            "gain2": {
               "title": "Gain2",
               "default": 1,
               "type": "number"
            },
            "scaling": {
               "title": "Scaling",
               "default": 1,
               "type": "number"
            },
            "chopper": {
               "title": "Chopper",
               "default": false,
               "type": "boolean"
            },
            "dipole_dist": {
               "title": "Dipole Dist",
               "default": 1,
               "type": "number"
            },
            "sensor_calibration_file": {
               "title": "Sensor Calibration File",
               "default": "",
               "type": "string"
            },
            "instrument_calibration_file": {
               "title": "Instrument Calibration File",
               "default": "",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      },
      "Record": {
         "title": "Record",
         "description": "Class to hold a record\n\nA record holds information about a process that was run. It is intended to\ntrack processes applied to data, allowing a process history to be saved\nalong with any datasets.\n\nExamples\n--------\nA simple example of creating a process record\n\n>>> from resistics.common import Record\n>>> messages = [\"message 1\", \"message 2\"]\n>>> record = Record(\n...     creator={\"name\": \"example\", \"parameter1\": 15},\n...     messages=messages,\n...     record_type=\"example\"\n... )\n>>> record.summary()\n{\n    'time_local': '...',\n    'time_utc': '...',\n    'creator': {'name': 'example', 'parameter1': 15},\n    'messages': ['message 1', 'message 2'],\n    'record_type': 'example'\n}",
         "type": "object",
         "properties": {
            "time_local": {
               "title": "Time Local",
               "type": "string",
               "format": "date-time"
            },
            "time_utc": {
               "title": "Time Utc",
               "type": "string",
               "format": "date-time"
            },
            "creator": {
               "title": "Creator",
               "type": "object"
            },
            "messages": {
               "title": "Messages",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "record_type": {
               "title": "Record Type",
               "type": "string"
            }
         },
         "required": [
            "creator",
            "messages",
            "record_type"
         ]
      },
      "History": {
         "title": "History",
         "description": "Class for storing processing history\n\nParameters\n----------\nrecords : List[Record], optional\n    List of records, by default []\n\nExamples\n--------\n>>> from resistics.testing import record_example1, record_example2\n>>> from resistics.common import History\n>>> record1 = record_example1()\n>>> record2 = record_example2()\n>>> history = History(records=[record1, record2])\n>>> history.summary()\n{\n    'records': [\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example1',\n                'a': 5,\n                'b': -7.0\n            },\n            'messages': ['Message 1', 'Message 2'],\n            'record_type': 'process'\n        },\n        {\n            'time_local': '...',\n            'time_utc': '...',\n            'creator': {\n                'name': 'example2',\n                'a': 'parzen',\n                'b': -21\n            },\n            'messages': ['Message 5', 'Message 6'],\n            'record_type': 'process'\n        }\n    ]\n}",
         "type": "object",
         "properties": {
            "records": {
               "title": "Records",
               "default": [],
               "type": "array",
               "items": {
                  "$ref": "#/definitions/Record"
               }
            }
         }
      },
      "TimeMetadata": {
         "title": "TimeMetadata",
         "description": "Time metadata",
         "type": "object",
         "properties": {
            "file_info": {
               "$ref": "#/definitions/ResisticsFile"
            },
            "fs": {
               "title": "Fs",
               "type": "number"
            },
            "chans": {
               "title": "Chans",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "n_chans": {
               "title": "N Chans",
               "type": "integer"
            },
            "n_samples": {
               "title": "N Samples",
               "type": "integer"
            },
            "first_time": {
               "title": "First Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "last_time": {
               "title": "Last Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "system": {
               "title": "System",
               "default": "",
               "type": "string"
            },
            "serial": {
               "title": "Serial",
               "default": "",
               "type": "string"
            },
            "wgs84_latitude": {
               "title": "Wgs84 Latitude",
               "default": -999.0,
               "type": "number"
            },
            "wgs84_longitude": {
               "title": "Wgs84 Longitude",
               "default": -999.0,
               "type": "number"
            },
            "easting": {
               "title": "Easting",
               "default": -999.0,
               "type": "number"
            },
            "northing": {
               "title": "Northing",
               "default": -999.0,
               "type": "number"
            },
            "elevation": {
               "title": "Elevation",
               "default": -999.0,
               "type": "number"
            },
            "chans_metadata": {
               "title": "Chans Metadata",
               "type": "object",
               "additionalProperties": {
                  "$ref": "#/definitions/ChanMetadata"
               }
            },
            "history": {
               "title": "History",
               "default": {
                  "records": []
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/History"
                  }
               ]
            }
         },
         "required": [
            "fs",
            "chans",
            "n_samples",
            "first_time",
            "last_time",
            "chans_metadata"
         ]
      },
      "TimeReader": {
         "title": "TimeReader",
         "description": "Base class for resistics processes\n\nResistics processes perform operations on data (including read and write\noperations). Each time a ResisticsProcess child class is run, it should add\na process record to the dataset",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "type": "string"
            },
            "apply_scalings": {
               "title": "Apply Scalings",
               "default": true,
               "type": "boolean"
            },
            "extension": {
               "title": "Extension",
               "type": "string"
            }
         }
      },
      "Measurement": {
         "title": "Measurement",
         "description": "Class for interfacing with a measurement\n\nThe class holds the original time series metadata and can provide\ninformation about other types of data",
         "type": "object",
         "properties": {
            "site_name": {
               "title": "Site Name",
               "type": "string"
            },
            "dir_path": {
               "title": "Dir Path",
               "type": "string",
               "format": "path"
            },
            "metadata": {
               "$ref": "#/definitions/TimeMetadata"
            },
            "reader": {
               "$ref": "#/definitions/TimeReader"
            }
         },
         "required": [
            "site_name",
            "dir_path",
            "metadata",
            "reader"
         ]
      },
      "Site": {
         "title": "Site",
         "description": "Class for describing Sites\n\n.. note::\n\n    This should essentially describe a single instrument setup. If the same\n    site is re-occupied later with a different instrument setup, it is\n    suggested to split this into a different site.",
         "type": "object",
         "properties": {
            "dir_path": {
               "title": "Dir Path",
               "type": "string",
               "format": "path"
            },
            "measurements": {
               "title": "Measurements",
               "type": "object",
               "additionalProperties": {
                  "$ref": "#/definitions/Measurement"
               }
            },
            "begin_time": {
               "title": "Begin Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            },
            "end_time": {
               "title": "End Time",
               "pattern": "%Y-%m-%d %H:%M:%S.%f_%o_%q_%v",
               "examples": [
                  "2021-01-01 00:00:00.000061_035156_250000_000000"
               ]
            }
         },
         "required": [
            "dir_path",
            "measurements",
            "begin_time",
            "end_time"
         ]
      }
   }
}

field dir_path: pathlib.Path [Required]
field begin_time: resistics.sampling.HighResDateTime [Required]
Constraints
  • pattern = %Y-%m-%d %H:%M:%S.%f_%o_%q_%v

  • examples = [‘2021-01-01 00:00:00.000061_035156_250000_000000’]

field end_time: resistics.sampling.HighResDateTime [Required]
Constraints
  • pattern = %Y-%m-%d %H:%M:%S.%f_%o_%q_%v

  • examples = [‘2021-01-01 00:00:00.000061_035156_250000_000000’]

field metadata: resistics.project.ProjectMetadata [Required]
field sites: Dict[str, resistics.project.Site] = {}
property n_sites: int

The number of sites

fs() List[float][source]

Get sampling frequencies in the Project

get_site(site_name: str) resistics.project.Site[source]

Get a Site object given the Site name

get_sites(fs: Optional[float] = None) Dict[str, resistics.project.Site][source]

Get sites

Parameters

fs (Optional[float], optional) – Filter by sites which have at least a single recording at a specified sampling frequency, by default None

Returns

Dictionary of site name to Site

Return type

Dict[str, Site]

get_concurrent(site_name: str) List[resistics.project.Site][source]

Find sites that recorded conscurrently to a specified site

Parameters

site_name (str) – Search for sites recording concurrently to this site

Returns

List of Site instances which were recording concurrently

Return type

List[Site]

plot() plotly.graph_objs._figure.Figure[source]

Plot a timeline of the project

to_dataframe() pandas.core.frame.DataFrame[source]

Detail Project recordings in a DataFrame