openquake.hmtk.parsers.strain package#
Submodules#
openquake.hmtk.parsers.strain.strain_csv_parser module#
Module: openquake.hmtk.parsers.strain.strain_csv_parser contains the :classes: ReadStrainCsv and WriteStrainCsv to read and write strain data from and to csv format.
- class openquake.hmtk.parsers.strain.strain_csv_parser.ReadStrainCsv(strain_file)[source]#
Bases:
object
openquake.hmtk.parsers.strain_csv_parser.ReadStrainCsv
reads a strain model (defined by :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain) from a headed csv file- Parameters:
filename (str) – Name of strain file in csv format
strain – Container for the strain data as instance of :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain
- read_data(scaling_factor=1e-09, strain_headers=None)[source]#
Reads the data from the csv file
- Parameters:
scaling_factor (float) – Scaling factor used for all strain values (default 1E-9 for nanostrain)
strain_headers (list) – List of the variables in the file that correspond to strain parameters
- Returns:
strain - Strain model as an instance of the :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain
- class openquake.hmtk.parsers.strain.strain_csv_parser.WriteStrainCsv(filename)[source]#
Bases:
object
openquake.hmtk.parsers.strain_csv_parser.WriteStrainCsv
writes a strain model (defined by :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain) to a headed csv file- Parameters:
filename (str) – Name of output file for writing
- slice_rates_to_data(strain)[source]#
For the strain data, checks to see if seismicity rates have been calculated. If so, each column in the array is sliced and stored as a single vector in the strain.data dictionary with the corresponding magnitude as a key.
- Parameters:
strain – Instance of :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain
- Returns:
strain - Instance of strain class with updated data dictionary output_variables - Updated list of headers