def convert_areaSource(self, node):
        """
        Convert the given node into an area source object.

        :param node: a node with tag areaGeometry
        :returns: a :class:`openquake.hazardlib.source.AreaSource` instance
        """
        geom = node.areaGeometry
        coords = split_coords_2d(~geom.Polygon.exterior.LinearRing.posList)
        polygon = geo.Polygon([geo.Point(*xy) for xy in coords])
        msr = valid.SCALEREL[~node.magScaleRel]()
        area_discretization = geom.attrib.get(
            'discretization', self.area_source_discretization)
        if area_discretization is None:
            raise ValueError(
                'The source %r has no `discretization` parameter and the job.'
                'ini file has no `area_source_discretization` parameter either'
                % node['id'])
        return source.AreaSource(
            source_id=node['id'],
            name=node['name'],
            tectonic_region_type=node.attrib.get('tectonicRegion'),
            mfd=self.convert_mfdist(node),
            rupture_mesh_spacing=self.rupture_mesh_spacing,
            magnitude_scaling_relationship=msr,
            rupture_aspect_ratio=~node.ruptAspectRatio,
            upper_seismogenic_depth=~geom.upperSeismoDepth,
            lower_seismogenic_depth=~geom.lowerSeismoDepth,
            nodal_plane_distribution=self.convert_npdist(node),
            hypocenter_distribution=self.convert_hpdist(node),
            polygon=polygon,
            area_discretization=area_discretization,
            temporal_occurrence_model=self.get_tom(node))
def convert_areaSource ( self , node ) : geom = node . areaGeometry coords = split_coords_2d ( ~ geom . Polygon . exterior . LinearRing . posList ) polygon = geo . Polygon ( [ geo . Point ( * xy ) for xy in coords ] ) msr = valid . SCALEREL [ ~ node . magScaleRel ] ( ) area_discretization = geom . attrib . get ( 'discretization' , self . area_source_discretization ) if area_discretization is None : raise ValueError ( 'The source %r has no `discretization` parameter and the job.' 'ini file has no `area_source_discretization` parameter either' % node [ 'id' ] ) return source . AreaSource ( source_id = node [ 'id' ] , name = node [ 'name' ] , tectonic_region_type = node . attrib . get ( 'tectonicRegion' ) , mfd = self . convert_mfdist ( node ) , rupture_mesh_spacing = self . rupture_mesh_spacing , magnitude_scaling_relationship = msr , rupture_aspect_ratio = ~ node . ruptAspectRatio , upper_seismogenic_depth = ~ geom . upperSeismoDepth , lower_seismogenic_depth = ~ geom . lowerSeismoDepth , nodal_plane_distribution = self . convert_npdist ( node ) , hypocenter_distribution = self . convert_hpdist ( node ) , polygon = polygon , area_discretization = area_discretization , temporal_occurrence_model = self . get_tom ( node ) )
Convert the given node into an area source object.

        :param node: a node with tag areaGeometry
        :returns: a :class:`openquake.hazardlib.source.AreaSource` instance