Module:
sdynpy.fileio.sdynpy_rattlesnakeSource: GitHub
Signature¶
class sdynpy.fileio.sdynpy_rattlesnake.RattlesnakeRandomEnvironmentData(channel_coordinates: 'CoordinateArray', sysid_averages: 'int', samples_per_frame: 'int', cpsd_overlap: 'int', cpsd_window: 'str', specification_frequency_lines: 'np.ndarray', specification_cpsd_matrix: 'np.ndarray', specification_warning_matrix: 'np.ndarray', specification_abort_matrix: 'np.ndarray', control_channel_indices: 'np.ndarray', fft_lines: 'int', sysid_frame_size: 'int' = None, sysid_averaging_type: 'str' = None, sysid_noise_averages: 'int' = None, sysid_exponential_averaging_coefficient: 'float' = None, sysid_estimator: 'str' = None, sysid_level: 'float' = None, sysid_level_ramp_time: 'float' = None, sysid_signal_type: 'str' = None, sysid_window: 'str' = None, sysid_overlap: 'float' = None, sysid_burst_on: 'float' = None, sysid_pretrigger: 'float' = None, sysid_burst_ramp_fraction: 'float' = None, sysid_low_frequency_cutoff: 'float' = None, sysid_high_frequency_cutoff: 'float' = None, test_level_ramp_time: 'float' = None, update_tf_during_control: 'int' = None, cola_window: 'str' = None, cola_overlap: 'float' = None, cola_window_exponent: 'float' = None, frames_in_cpsd: 'int' = None, control_python_script: 'os.pathlike' = None, control_python_function: 'str' = None, control_python_function_type: 'int' = None, control_python_function_parameters: 'str' = None, allow_automatic_aborts: 'int' = None, specification_channels: 'int' = None, control_channels: 'int' = None, **kwargs)Data for a Rattlesnake Random vibration environment.
Parses variables, dimensions, and attributes from the environment group of a Rattlesnake nc4 file and provides convenience properties that return sdynpy array objects.
Parameters¶
channel_coordinates : CoordinateArray Coordinate array for all physical channels in the parent
RattlesnakeDataobject. Used to resolve control-channel coordinates without storing a back-reference to the parent.sysid_averages : int Number of averages used during system identification.
samples_per_frame : int Number of time samples per data frame.
cpsd_overlap : int Overlap count used when computing the CPSD.
cpsd_window : str Window function name applied before CPSD computation.
specification_frequency_lines : np.ndarray Frequency axis (Hz) for the specification CPSD matrices.
specification_cpsd_matrix : np.ndarray Target CPSD specification matrix with shape
(n_freq, n_control, n_control).specification_warning_matrix : np.ndarray Warning-band CPSD matrix with shape
(2, n_freq, n_control, n_control)where index 0 is the lower bound and index 1 is the upper bound.specification_abort_matrix : np.ndarray Abort-band CPSD matrix with shape
(2, n_freq, n_control, n_control)where index 0 is the lower bound and index 1 is the upper bound.control_channel_indices : np.ndarray Integer indices into the parent channel table identifying the control channels for this environment.
fft_lines : int Number of FFT frequency lines used in control.
**kwargs
Any additional nc4 attributes, variables, or dimensions not covered
by the explicit parameters above are stored directly as instance
attributes via
__setattr__.
Attributes¶
| Name | Summary |
|---|---|
control_coordinate | Coordinate array for the control channels of this environment. |
specification_abort_psd | Upper and lower abort-band PSDs for this random environment. |
specification_cpsd | Target CPSD specification for this random environment. |
specification_warning_psd | Upper and lower warning-band PSDs for this random environment. |
control_coordinate¶
Coordinate array for the control channels of this environment.
When a response_transformation_matrix is present the coordinates
are synthetic sequential nodes (1-based, direction 0) whose count
equals the number of transformed virtual channels. Otherwise
channel_coordinates is indexed by control_channel_indices to
return the physical control-channel coordinates.
Returns¶
CoordinateArray
Coordinates for each control channel (or virtual transformed
channel) in this environment.
specification_abort_psd¶
Upper and lower abort-band PSDs for this random environment.
Assembles two PowerSpectralDensityArray objects from the lower
(index 0) and upper (index -1) slices of specification_abort_matrix
along the first axis and concatenates them into a two-element array.
Returns None when any required attribute is absent.
Returns¶
PowerSpectralDensityArray or None
Array with shape
(2, n_control)where index 0 is the lowerabort bound and index 1 is the upper abort bound, or
Noneifspecification_warning_matrix,control_coordinate, orspecification_frequency_linesare not available.
specification_cpsd¶
Target CPSD specification for this random environment.
Assembles a square PowerSpectralDensityArray from the
specification_cpsd_matrix and specification_frequency_lines
attributes loaded from the nc4 file. Returns None when any of
those attributes are absent.
Returns¶
PowerSpectralDensityArray or None
Square cross-power spectral density array with shape
(n_control, n_control)at each frequency line, orNoneif the required attributes are not available.
specification_warning_psd¶
Upper and lower warning-band PSDs for this random environment.
Assembles two PowerSpectralDensityArray objects from the lower
(index 0) and upper (index -1) slices of specification_warning_matrix
along the first axis and concatenates them into a two-element array.
Returns None when any required attribute is absent.
Returns¶
PowerSpectralDensityArray or None
Array with shape
(2, n_control)where index 0 is the lowerwarning bound and index 1 is the upper warning bound, or
Noneif
specification_abort_matrix,control_coordinate, orspecification_frequency_linesare not available.
Methods¶
| Name | Summary |
|---|---|
__init__ | Store all environment parameters as instance attributes. |
load_from_env_group | Construct an instance by reading all data from an nc4 environment group. |
__init__¶
Source: GitHub
def sdynpy.fileio.sdynpy_rattlesnake.RattlesnakeRandomEnvironmentData.__init__(self, channel_coordinates: 'CoordinateArray', sysid_averages: 'int', samples_per_frame: 'int', cpsd_overlap: 'int', cpsd_window: 'str', specification_frequency_lines: 'np.ndarray', specification_cpsd_matrix: 'np.ndarray', specification_warning_matrix: 'np.ndarray', specification_abort_matrix: 'np.ndarray', control_channel_indices: 'np.ndarray', fft_lines: 'int', sysid_frame_size: 'int' = None, sysid_averaging_type: 'str' = None, sysid_noise_averages: 'int' = None, sysid_exponential_averaging_coefficient: 'float' = None, sysid_estimator: 'str' = None, sysid_level: 'float' = None, sysid_level_ramp_time: 'float' = None, sysid_signal_type: 'str' = None, sysid_window: 'str' = None, sysid_overlap: 'float' = None, sysid_burst_on: 'float' = None, sysid_pretrigger: 'float' = None, sysid_burst_ramp_fraction: 'float' = None, sysid_low_frequency_cutoff: 'float' = None, sysid_high_frequency_cutoff: 'float' = None, test_level_ramp_time: 'float' = None, update_tf_during_control: 'int' = None, cola_window: 'str' = None, cola_overlap: 'float' = None, cola_window_exponent: 'float' = None, frames_in_cpsd: 'int' = None, control_python_script: 'os.pathlike' = None, control_python_function: 'str' = None, control_python_function_type: 'int' = None, control_python_function_parameters: 'str' = None, allow_automatic_aborts: 'int' = None, specification_channels: 'int' = None, control_channels: 'int' = None, **kwargs)Store all environment parameters as instance attributes.
Every named parameter is assigned directly to self. Any
additional keyword arguments (extra nc4 attributes, variables, or
dimensions) are stored via __setattr__.
load_from_env_group¶
Source: GitHub
def sdynpy.fileio.sdynpy_rattlesnake.RattlesnakeRandomEnvironmentData.load_from_env_group(cls, parent: "'RattlesnakeData'", env_group: 'nc4.Group') -> "'RattlesnakeRandomEnvironmentData'"Construct an instance by reading all data from an nc4 environment group.
Loads nc4 attributes, variables (including complex split-variable pairs
stored as <name>_real / <name>_imag), and dimension sizes from
env_group, then calls the constructor with
channel_coordinates=parent.coordinate.
Parameters¶
parent : RattlesnakeData The top-level data object whose
coordinateproperty provides the full physical-channel coordinate array.env_group : netCDF4.Group The nc4 group for this environment (e.g.
data['Random']).
Returns¶
RattlesnakeRandomEnvironmentData
Fully populated environment data object.