ppcpy.misc.helper#
Functions
Detect the type of path (Windows or Linux) based on the input. |
|
Finds the dimension of a 3D array that matches the length of the reference list. |
|
This function locates multiple pollyxt level0 nc-zip files from one day measurements, unzipps the files to output_path and returns a list of files to be merged and the title of the new merged nc-file |
|
This function locates multiple pollyxt logbook-zip files from one day measurements, unzipps the files to output_path and merge them to one file |
|
translate {wavelength}_{total|cross|parallel|rr}_{NR|FR|DFOV} to wavelength,polarisation,telescope separataly. |
|
Calculate the mean value of x based on the least fluctuated segment of x. |
|
Smooths 2D array data while ignoring NaNs. |
- ppcpy.misc.helper.detect_path_type(fullpath)[source]#
Detect the type of path (Windows or Linux) based on the input.
- ppcpy.misc.helper.get_pollyxt_files(timestamp, device, raw_folder, output_path)[source]#
This function locates multiple pollyxt level0 nc-zip files from one day measurements, unzipps the files to output_path and returns a list of files to be merged and the title of the new merged nc-file
- ppcpy.misc.helper.get_pollyxt_logbook_files(timestamp, device, raw_folder, output_path)[source]#
This function locates multiple pollyxt logbook-zip files from one day measurements, unzipps the files to output_path and merge them to one file
- ppcpy.misc.helper.find_matching_dimension(array, reference_list)[source]#
Finds the dimension of a 3D array that matches the length of the reference list.
- Parameters:
array (np.ndarray) – The 3D NumPy array to check.
reference_list (list) – The list to compare the dimension lengths with. This can also be a dict.
- Returns:
The index of the matching dimension, or -1 if no match is found.
- Return type:
int
- ppcpy.misc.helper.mean_stable(x, win, minBin=None, maxBin=None, minRelStd=None)[source]#
Calculate the mean value of x based on the least fluctuated segment of x. The searching is based on the std inside each window of x.
- Parameters:
x (ndarray) – Signal array.
win (int) – Window width for calculating the relative standard deviation.
minBin (int, optional) – The start index for the mean calculation (default: 1).
maxBin (int, optional) – The end index for the mean calculation (default: length of x).
minRelStd (float, optional) – Minimum relative standard deviation threshold.
- Returns:
xStable (float) – Stable mean value.
xIndx (ndarray) – Index of the elements used to calculate the mean value.
xRelStd (float) – Relative uncertainty of the sequences used to calculate the mean values.
History
——-
- 2021-05-30 (First edition by Zhenping)
.. Authors (- zhenping@tropos.de)
- ppcpy.misc.helper.smooth2a(matrix_in, Nr, Nc=None)[source]#
Smooths 2D array data while ignoring NaNs.
This function smooths the data in matrix_in using a mean filter over a rectangle of size (2*Nr+1)-by-(2*Nc+1). Each element is replaced by the mean of the surrounding rectangle, ignoring NaN elements. If an element is NaN, it remains NaN in the output. At the edges, as much of the rectangle as fits is used.
- Parameters:
matrix_in (ndarray) – Original matrix to be smoothed.
Nr (int) – Number of points used to smooth rows.
Nc (int, optional) – Number of points used to smooth columns. If not specified, Nc = Nr.
- Returns:
Smoothed version of the input matrix.
- Return type:
ndarray
References
Written by Greg Reeves, March 2009, Division of Biology, Caltech.
Inspired by “smooth2” by Kelly Hilands, October 2004, Applied Research Laboratory, Penn State University.
Developed from code by Olof Liungman, 1997, Dept. of Oceanography, Earth Sciences Centre, Göteborg University.