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. |
find_uncertainty_range
find_uncertainty_range(basename, angles_dir, num_angle_sets=5)
Find the uncertainty range of the fitted parameter from a series of fitting results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basename
|
str
|
The base name of the results files. |
required |
angles_dir
|
str
|
The directory containing the angle sets. |
required |
num_angle_sets
|
int
|
The number of angle sets to consider. Default is 5. |
5
|
Returns:
| Type | Description |
|---|---|
None
|
|
Examples:
>>> find_uncertainty_range(basename="sample_fit", angles_dir="./", num_angle_sets=5)