def from_shakemap(cls, shakemap_array):
        """
        Build a site collection from a shakemap array
        """
        self = object.__new__(cls)
        self.complete = self
        n = len(shakemap_array)
        dtype = numpy.dtype([(p, site_param_dt[p])
                             for p in 'sids lon lat depth vs30'.split()])
        self.array = arr = numpy.zeros(n, dtype)
        arr['sids'] = numpy.arange(n, dtype=numpy.uint32)
        arr['lon'] = shakemap_array['lon']
        arr['lat'] = shakemap_array['lat']
        arr['depth'] = numpy.zeros(n)
        arr['vs30'] = shakemap_array['vs30']
        arr.flags.writeable = False
        return self
def from_shakemap ( cls , shakemap_array ) : self = object . __new__ ( cls ) self . complete = self n = len ( shakemap_array ) dtype = numpy . dtype ( [ ( p , site_param_dt [ p ] ) for p in 'sids lon lat depth vs30' . split ( ) ] ) self . array = arr = numpy . zeros ( n , dtype ) arr [ 'sids' ] = numpy . arange ( n , dtype = numpy . uint32 ) arr [ 'lon' ] = shakemap_array [ 'lon' ] arr [ 'lat' ] = shakemap_array [ 'lat' ] arr [ 'depth' ] = numpy . zeros ( n ) arr [ 'vs30' ] = shakemap_array [ 'vs30' ] arr . flags . writeable = False return self
Build a site collection from a shakemap array