HvsrRotated

Class definition for HvsrRotated, a rotated Hvsr measurement.

class HvsrRotated(hvsr, azimuth, meta=None)

Bases: object

Class definition for rotated Horizontal-to-Vertical calculations.

Variables
  • hvsrs (list) – Container of Hvsr objects, one per azimuth.

  • azimuths (ndarray) – Vector of rotation azimuths correpsonding to Hvsr objects.

__init__(hvsr, azimuth, meta=None)

Instantiate a HvsrRotated object.

Parameters
  • hvsr (Hvsr) – Hvsr object.

  • azimuth (float) – Rotation angle in degrees measured clockwise positive from north (i.e., 0 degrees).

  • meta (dict, optional) – Meta information about the object, default is None.

Returns

HvsrRotated – Instantiated HvsrRotated object.

property amp
append(hvsr, azimuth)

Append Hvsr object at a new azimuth.

Parameters
  • hvsr (Hvsr) – Hvsr object.

  • az (float) – Rotation angle in degrees measured clockwise from north (i.e., 0 degrees).

Returns

HvsrRotated – Instantiated HvsrRotated object.

property azimuth_count
classmethod from_iter(hvsrs, azimuths, meta=None)

Create HvsrRotated from iterable of Hvsr objects.

property frq
mc_peak_amp(distribution='lognormal')

Amplitude of the peak of the mean HVSR curve.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Refer to mean_curve for details.

Returns

float – Amplitude associated with the peak of the mean HVSR curve.

mc_peak_frq(distribution='lognormal')

Frequency of the peak of the mean HVSR curve.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Refer to mean_curve for details.

Returns

float – Frequency associated with the peak of the mean HVSR curve.

mean_curve(distribution='lognormal')

Mean H/V curve considering all valid windows and azimuths.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of mean curve, default is ‘lognormal’.

Returns

ndarray – Mean HVSR curve according to the distribution specified.

Raises

NotImplementedError – If distribution does not match the available options.

mean_curves(distribution='lognormal')

Mean curve for each azimuth

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of mean curve, default is ‘lognormal’.

Returns

ndarray – Each row corresponds to an azimuth and each column a frequency.

mean_curves_peak(distribution='lognormal')

Peak from each mean curve, one per azimuth.

mean_f0_amp(distribution='lognormal')

Mean f0 amplitude from all valid timewindows and azimuths.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of f0, default is ‘lognormal’.

Returns

float – Mean amplitude of f0 across all valid time windows and azimuths.

Raises

NotImplementedError – If distribution does not match the available options.

mean_f0_frq(distribution='lognormal')

Mean f0 from all valid timewindows and azimuths.

Parameters

distribution ({‘normal’, ‘lognormal’}) – Assumed distribution of f0, default is ‘lognormal’.

Returns

float – Mean value of f0 according to the distribution specified.

Raises

NotImplementedError – If distribution does not match the available options.

nstd_curve(n, distribution)

Nth standard deviation on mean curve from all azimuths.

nstd_f0_frq(n, distribution)

Nth standard deviation on f0 from all azimuths

property peak_amp

Array of peak amplitudes, one array per azimuth.

property peak_frq

Array of peak frequencies, one array per azimuth.

print_stats(distribution_f0, places=2)

Print basic statistics of Hvsr instance.

reject_windows(**kwargs)
std_curve(distribution='lognormal')

Sample standard deviation associated with mean HVSR curve.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of HVSR curve, default is ‘lognormal’.

Returns

ndarray – Sample standard deviation of HVSR curve according to the distribution specified.

Raises
  • ValueError – If only single time window is defined.

  • NotImplementedError – If distribution does not match the available options.

std_f0_amp(distribution='lognormal')

Sample standard deviation of f0 amplitude for all valid time windows across all azimuths.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of f0, default is ‘lognormal’.

Returns

float – Sample standard deviation of the amplitude of f0 according to the distribution specified.

Raises

NotImplementedError – If distribution does not match the available options.

std_f0_frq(distribution='lognormal')

Sample standard deviation of f0 for all valid time windows across all azimuths.

Parameters

distribution ({‘normal’, ‘lognormal’}, optional) – Assumed distribution of f0, default is ‘lognormal’.

Returns

float – Sample standard deviation of f0.

Raises

NotImplementedError – If distribution does not match the available options.

to_file(fname, distribution_f0, distribution_mc, data_format='hvsrpy')

Save HVSR data to file.

Parameters
  • fname (str) – Name of file to save the results, may be the full or a relative path.

  • distribution_f0 ({‘lognormal’, ‘normal’}, optional) – Assumed distribution of f0 from the time windows, the default is ‘lognormal’.

  • distribution_mc ({‘lognormal’, ‘normal’}, optional) – Assumed distribution of mean curve, the default is ‘lognormal’.

  • data_format ({‘hvsrpy’}, optional) – Format of output data file, default is ‘hvsrpy’.

Returns

None – Writes file to disk.