resistics.time.reader_lemib423e module

class resistics.time.reader_lemib423e.TimeReaderLemiB423E(dataPath: str)[source]

Bases: resistics.time.reader_lemib423.TimeReaderLemiB423

Data reader for Lemi B423E data

Lemi B423E data has the following characteristics:

  • 1024 bytes of ASCII headers in the data file with basic scaling information

  • There is no separate header file for Lemi B423E data. No information for number of samples, sampling rate etc

  • Header files need to be constructed before Lemi B423E data can be read in by resistics. There are helper methods to do this.

  • Lemi B423 raw measurement data is signed long integer format

  • Getting unscaled samples returns data with unit count for electric fields.

  • Optionally, a scaling can be applied for unscaled samples which returns electric fields in microvolt.

In situations where a Lemi B423E dataset is recorded in multiple files, it is required that the recording is continuous.

Attributes
recChannelsDict

Channels in each data file

dtypenp.float32

The data type

numHeaderFilesint

The number of header files

numDataFilesint

The number of data files

Methods

setParameters()

Set parameters specific to a data format

getPhysicalSamples(**kwargs)

Get data in physical units

getScalars(paramsDict)

Get the scalars for each channel as given in the data files

getPhysicalSamples(self, **kwargs)[source]

Get data scaled to physical values

resistics uses field units, meaning physical samples will return the following:

  • Electrical channels in mV/km

  • Magnetic channels in mV

  • To get magnetic fields in nT, calibration needs to be performed

Parameters
chansList[str]

List of channels to return if not all are required

startSampleint

First sample to return

endSampleint

Last sample to return

remaveragebool

Remove average from the data

remzerosbool

Remove zeroes from the data

remnans: bool

Remove NanNs from the data

Returns
TimeData

Time data object

Notes

Once Lemi B423E data is scaled (which optionally happens in getUnscaledSamples), the electric channels are in uV (micro volts). Therefore:

  • Electric channels need to divided by 1000 along with dipole length division in km (east-west spacing and north-south spacing) to return mV/km.

getScalars(self, paramsDict: Dict) → Dict[source]

Returns the scalars from a parameter dictionary

Parameters
paramsDictDict

The parameter dictionary for a data file usually read from the headers in the file

Returns
Dict

Dictionary with channels as keys and scalings as values

setParameters(self) → None[source]

Set some data reader parameters for reading Lemi B423E data

resistics.time.reader_lemib423e.folderB423EHeaders(folderpath: str, sampleFreq: float, ex: str = 'E1', ey: str = 'E2', dx: float = 1, dy: float = 1, folders: List = []) → None[source]

Construct B423E headers for subfolders of a folder

Parameters
folderpathstr

The path to the folder

sampleFreqfloat

The sampling frequency of the data

exstr, optional

The channel E1, E2, E3 or E4 in the data that represents Ex. Default E1.

eystr, optional

The channel E1, E2, E3 or E4 in the data that represents Ey. Default E2.

dxfloat, optional

Distance between x electrodes

dyfloat, optional

Distance between y electrodes

folderList, optional

An optional list of subfolders

resistics.time.reader_lemib423e.measB423EHeaders(datapath: str, sampleFreq: float, ex: str = 'E1', ey: str = 'E2', dx: float = 1, dy: float = 1) → None[source]

Read a single B423 measurement directory and construct headers

Parameters
sitestr

The path to the site

sampleFreqfloat

The sampling frequency of the data

exstr, optional

The channel E1, E2, E3 or E4 in the data that represents Ex. Default E1.

eystr, optional

The channel E1, E2, E3 or E4 in the data that represents Ey. Default E2.

dxfloat, optional

Distance between x electrodes

dyfloat, optional

Distance between y electrodes