In situ UV-Vis Spectroscopy¶
UVVIS module for in situ data.
UVVisInsituBlock
¶
Bases: GenericInSituBlock
This datablock processes in situ UV-Vis data from an input .zip file containing two specific directories:
- UV-Vis Data Directory: Contains multiple UV-Vis in-situ experiment datasets.
- Echem Data Directory: Contains echem data files in
.txtformat.
Attributes:
defaults
¶
defaults = {'start_exp': 0, 'exclude_exp': None, 'scan_time': None, 'target_sample_number': 1000, 'target_data_number': 1000, 'data_granularity': None, 'sample_granularity': None}
plotting_label_dict
¶
plotting_label_dict = {'x_axis_label': 'Wavelength (nm)', 'time_series_y_axis_label': 'Time (h)', 'line_y_axis_label': 'Absorbance', 'time_series_x_axis_label': 'Voltage (V)', 'label_source': {'label_template': 'Exp. # {exp_num}, t = {time} h, V = {voltage} V', 'label_field_map': {'exp_num': 'exp_num', 'time': 'time', 'voltage': 'voltage'}}}
generate_insitu_uvvis_plot
¶
Generate combined UVVis and electrochemical plots using the operando-style layout.
This method coordinates the creation of various plot components and combines them into a unified visualization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path | None
|
Path to the zip file containing UVVis and electrochemical data, rather than looking up in the database for attached files. |
None
|
get_available_folders
¶
Extract and return a list of available folders from the zip file.
This method opens the zip file identified by file_id, extracts the main folder and its subfolders, and returns a sorted list of subfolder names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path
|
Path to the zip file. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
Sorted list of subfolder names, or empty list if file not found or on error. |
process_and_store_data
¶
Process all in situ UV-Vis and electrochemical data and store results. This method is a wrapper for processing both UV-Vis and electrochemical data.
subsample_data
¶
subsample_data(data: Union[DataFrame, ndarray], sample_granularity: int, data_granularity: int, method: str = 'linear') -> Union[DataFrame, ndarray]
Subsample data to a specified granularity in both sample and feature dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Union[DataFrame, ndarray]
|
The data to be subsampled. |
required |
sample_granularity
|
int
|
Subsampling step along rows (samples). |
required |
data_granularity
|
int
|
Subsampling step along columns (features). |
required |
method
|
str
|
Subsampling method; currently supports only 'linear' and 'max_pooling'. |
'linear'
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, ndarray]
|
Subsampled data of the same type as input. |