Esempio n. 1
0
    def to_openquake_site(self, missing_vs30=None):
        """
        Returns the site as an instance of the :class:
        openquake.hazardlib.site.Site
        """
        if self.vs30:
            vs30 = self.vs30
            vs30_measured = self.vs30_measured
        else:
            vs30 = missing_vs30
            vs30_measured = False
        
        if self.z1pt0:
            z1pt0 = self.z1pt0
        else:
            z1pt0 = vs30_to_z1pt0_as08(vs30)

        if self.z2pt5:
            z2pt5 = self.z2pt5
        else:
            z2pt5 = z1pt0_to_z2pt5(z1pt0)
        
        location = Point(self.longitude,
                         self.latitude,
                         -self.altitude / 1000.) # Elevation from m to km
        return Site(location,
                    vs30,
                    vs30_measured,
                    z1pt0,
                    z2pt5,
                    backarc=self.backarc,
                    id=self.id)
Esempio n. 2
0
    def to_openquake_site(self, missing_vs30=None):
        """
        Returns the site as an instance of the :class:
        openquake.hazardlib.site.Site
        """
        if self.vs30:
            vs30 = self.vs30
            vs30_measured = self.vs30_measured
        else:
            vs30 = missing_vs30
            vs30_measured = False
        
        if self.z1pt0:
            z1pt0 = self.z1pt0
        else:
            z1pt0 = vs30_to_z1pt0_as08(vs30)

        if self.z2pt5:
            z2pt5 = self.z2pt5
        else:
            z2pt5 = z1pt0_to_z2pt5(z1pt0)
        
        location = Point(self.longitude,
                         self.latitude,
                         -self.altitude / 1000.)  # Elevation from m to km
        oq_site = Site(location,
                       vs30,
                       z1pt0,
                       z2pt5,
                       vs30measured=vs30_measured,
                       backarc=self.backarc)
        setattr(oq_site, "id", self.id)
        return oq_site
 def _parse_site_data(self, metadata):
     """
     Returns the site data as an instance of the :class:
     smtk.sm_database.RecordSite
     """
     site = RecordSite(metadata["Station Sequence Number"],
                       metadata["Station ID  No."],
                       metadata["Station ID  No."],
                       get_float(metadata["Station Longitude"]),
                       get_float(metadata["Station Latitude"]),
                       0.0, # Elevation data not given
                       get_float(metadata["Preferred Vs30 (m/s)"]),
                       network_code=metadata["Owner"])
     site.nehrp = metadata["Preferred NEHRP Based on Vs30"]
     site.vs30_measured_type = metadata["Measured/Inferred Class"]
     if site.vs30_measured_type in ["0", "5"]:
         site.vs30_measured = True
     else:
         site.vs30_measured = False
     site.vs30_uncertainty = get_float(
         metadata["Sigma of Vs30 (in natural log Units)"])
     site.z1pt0 = get_float(metadata["Z1 (m)"])
     site.z1pt5 = get_float(metadata["Z1.5 (m)"])
     site.z2pt5 = get_float(metadata["Z2.5 (m)"])
     # Implement default values for z1pt0 and z2pt5
     if site.z1pt0 is None:
         site.z1pt0 = rcfg.vs30_to_z1pt0_as08(site.vs30)
     if site.z2pt5 is None:
         site.z2pt5 = rcfg.z1pt0_to_z2pt5(site.z1pt0)
     site.arc_location = metadata["Forearc/Backarc for subduction events"]
     site.instrument_type = metadata["Type of Recording"]
     return site
Esempio n. 4
0
    def to_openquake_site(self, missing_vs30=None):
        """
        Returns the site as an instance of the :class:
        openquake.hazardlib.site.Site
        """
        if self.vs30:
            vs30 = self.vs30
            vs30_measured = self.vs30_measured
        else:
            vs30 = missing_vs30
            vs30_measured = False
        
        if self.z1pt0:
            z1pt0 = self.z1pt0
        else:
            z1pt0 = vs30_to_z1pt0_as08(vs30)

        if self.z2pt5:
            z2pt5 = self.z2pt5
        else:
            z2pt5 = z1pt0_to_z2pt5(z1pt0)

        return Site(Point(self.longitude, self.latitude),
                    vs30,
                    vs30_measured,
                    z1pt0,
                    z2pt5,
                    self.id)
Esempio n. 5
0
 def _parse_site_data(self, metadata):
     """
     Returns the site data as an instance of the :class:
     smtk.sm_database.RecordSite
     """
     site = RecordSite(
         self._get_site_id(metadata["Station ID"]),
         metadata["Station ID"],
         metadata["Station Code"],
         get_float(metadata["Station Longitude (deg positive E)"]),
         get_float(metadata["Station Latitude (deg positive N)"]),
         get_float(metadata["Station Elevation (m)"]),
         get_float(metadata["Preferred Vs30 (m/s)"]),
         site_class=metadata[
             'Site Class (Hard Rock; Rock; Stiff Soil; Soft Soil)'],
         network_code=None,  # not provided
     )
     # network_code=metadata["Owner"])
     site.nehrp = metadata["Preferred NEHRP Based on Vs30"]
     site.vs30_measured_type = metadata["Measured(1)/Inferred(2) Class"]
     if metadata["Measured(1)/Inferred(2) Class"] == "1":
         site.vs30_measured = True
     else:
         site.vs30_measured = False
     site.vs30_uncertainty = get_float(
         metadata["Sigma of Vs30 (in natural log Units)"])
     site.z1pt0 = get_float(metadata["Z1 (m)"])
     site.z1pt5 = None
     # site.z1pt5 = get_float(metadata["Z1.5 (m)"])
     site.z2pt5 = get_float(metadata["Z2.5 (m)"])
     # Implement default values for z1pt0 and z2pt5
     if site.z1pt0 is None:
         site.z1pt0 = rcfg.vs30_to_z1pt0_as08(site.vs30)
     if site.z2pt5 is None:
         site.z2pt5 = rcfg.z1pt0_to_z2pt5(site.z1pt0)
     else:
         # Need to convert z2pt5 from m to km
         site.z2pt5 = site.z2pt5 / 1000.0
     if "Backarc" in metadata["Forearc/Backarc for subduction events"]:
         site.backarc = True
     site.instrument_type = metadata["Digital (D)/Analog (A) Recording"]
     return site
Esempio n. 6
0
 def _parse_site_data(self, metadata):
     """
     Returns the site data as an instance of the :class:
     smtk.sm_database.RecordSite
     """
     site = RecordSite(
         self._get_site_id(metadata["Station ID"]),
         metadata["Station ID"],
         metadata["Station Code"],
         get_float(metadata["Station Longitude (deg positive E)"]),
         get_float(metadata["Station Latitude (deg positive N)"]),
         get_float(metadata["Station Elevation (m)"]),
         get_float(metadata["Preferred Vs30 (m/s)"]),
         site_class=metadata['Site Class (Hard Rock; Rock; Stiff Soil; Soft Soil)'],
         network_code=None, # not provided
         )
         # network_code=metadata["Owner"])
     site.nehrp = metadata["Preferred NEHRP Based on Vs30"]
     site.vs30_measured_type = metadata["Measured(1)/Inferred(2) Class"]
     if metadata["Measured(1)/Inferred(2) Class"] == "1":
         site.vs30_measured = True
     else:
         site.vs30_measured = False
     site.vs30_uncertainty = get_float(
         metadata["Sigma of Vs30 (in natural log Units)"])
     site.z1pt0 = get_float(metadata["Z1 (m)"])
     site.z1pt5 = None
     # site.z1pt5 = get_float(metadata["Z1.5 (m)"])
     site.z2pt5 = get_float(metadata["Z2.5 (m)"])
     # Implement default values for z1pt0 and z2pt5
     if site.z1pt0 is None:
         site.z1pt0 = rcfg.vs30_to_z1pt0_as08(site.vs30)
     if site.z2pt5 is None:
         site.z2pt5 = rcfg.z1pt0_to_z2pt5(site.z1pt0)        
     else:
         # Need to convert z2pt5 from m to km
         site.z2pt5 = site.z2pt5/1000.0
     if "Backarc" in metadata["Forearc/Backarc for subduction events"]:
         site.backarc = True
     site.instrument_type = metadata["Digital (D)/Analog (A) Recording"]
     return site