Morelia.Stream.Drain package
Submodules
Morelia.Stream.Drain.ToEDF module
- class Morelia.Stream.Drain.ToEDF.DrainToEDF(dataBucket: Bucket, fileName: str, preampDevice: str | None = None)
Bases:
DrainToFile
Class to to drain, or save, the data drops collected by a Bucket into an EDF file.
- file
Text file where streaming data is saved to.
- Type:
EdfWriter|None
- CloseFile()
Closes the file that data is saved to.
- static DigitalMax() Literal[32767]
- static DigitalMin() Literal[-32768]
- DrainDropToFile()
Write one drop of data to the save file.
- Raises:
Exception – Can only save data to EDF if the hose is filtered with InsertValue, TakePast, or TakeFuture.
- OpenFile()
Opens and initializes a file using the fileName to save data to.
- static PhysicalBound() Literal[2046]
Morelia.Stream.Drain.ToFile module
- class Morelia.Stream.Drain.ToFile.DrainToFile(dataBucket: Bucket, fileName: str, preampDevice: str | None = None)
Bases:
object
Interface class to to drain, or save, the data drops collected by a Bucket into a file.
- fileName
Name (with optional file path) of the file to save data to.
- Type:
str
- preampDevice
Optional preamplifier for the 8401-HR.
- Type:
str | None
- deviceHandler
Class to help handle different POD device types.
- Type:
- CloseFile()
Closes the file that data is saved to.
- DrainDropToFile()
Write one drop of data to the save file.
- static GetExtension(fileName: str) str
Gets the extension from a file, such as ‘.txt’, ‘.csv’, or ‘.edf’.
- Parameters:
fileName (str) – Name of the file with an extension.
- Returns:
File extension.
- Return type:
str
- static GetHandlerForBucket(bkt: Bucket, preampDevice: str | None = None) Drain8206HR | Drain8401HR | Drain8274D
Selects the proper POD device handler for a given Bucket.
- Parameters:
bkt (Bucket) – Bucket to collect streaming data.
preampDevice (str | None, optional) – Optional preamplifier for the 8401-HR. Defaults to None.
- Raises:
Exception – POD Device is not supported.
- Returns:
POD Device Handler.
- Return type:
- OpenFile()
Opens and initializes a file using the fileName to save data to.
Morelia.Stream.Drain.ToText module
- class Morelia.Stream.Drain.ToText.DrainToTXT(dataBucket: Bucket, fileName: str, preampDevice: str | None = None)
Bases:
DrainToFile
Class to to drain, or save, the data drops collected by a Bucket into a text file.
- file
Text file where streaming data is saved to.
- Type:
TextIOWrapper|None
- CloseFile()
Closes the file that data is saved to.
- DrainDropToFile()
Write one drop of data to the save file.
- OpenFile()
Opens and initializes a file using the fileName to save data to.
- static _GetTimeHeader() str
Builds a string containing the current date and time to be written to the text file header.
- Returns:
String containing the date and time. Each line begins with ‘#’ and ends with a newline.
- Return type:
str