narumii.utils
narumii.utils
Tee
Tee(*files)
Redirects output to multiple file-like objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*files
|
TextIO
|
The file-like objects to which output will be written. |
()
|
Methods:
| Name | Description |
|---|---|
write |
Write to the outputs. |
flush |
Flush the outputs. |
Examples:
>>> sys.stdout = Tee(sys.stdout, f); print(...); sys.stdout = sys.__stdout__
read_fid
read_fid(filename)
Reads a SIMPSON fid file and extracts the real and imaginary parts of the data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The path to the fid file to be read. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
data_real |
ndarray
|
The real part of the data extracted from the fid file. |
data_imag |
ndarray
|
The imaginary part of the data extracted from the fid file. |
read_results
read_results(filename, skiprows=1)
Reads a results file and returns the data as a numpy array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The path to the results file to be read. |
required |
skiprows
|
int
|
The number of rows to skip at the beginning of the file. Default is 1. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
results |
ndarray
|
The data read from the results file. |