예제 #1
0
    def set_top_bottom(self, area, units_id = []):
        """
        Calculates top and bottom elevation coverages
        """
        if len(units_id) > 0:
            self.units = units_id
        self.x = []
        self.y = []
        self.top = []
        self.bottom = []
        for i in self.units:
            unit = Unit(i)
            unit.set_properties()
            self.top.append(unit.top)
            self.bottom.append(unit.bottom)
            self.x.append(unit.x)
            self.y.append(unit.y)
        #Grid creation and interpolation
        grid = grid_interpolator.invDist(self.x,self.y,self.top,area.xmin,area.xmax,area.ymin,area.ymax,area.nx,area.ny,power=5,smoothing=0)  
        self.topgrid = grid
        
        grid = grid_interpolator.invDist(self.x,self.y,self.bottom,area.xmin,area.xmax,area.ymin,area.ymax,area.nx,area.ny,power=5,smoothing=0)  
        self.bottomgrid = grid
		
        #SET AVERAGE BOTTOM ELEVATION 
        bottom_total_sum = 0
        bottom_total_len = 0
        for i in self.bottomgrid:
            bottom_total_sum = bottom_total_sum + sum(i)
            bottom_total_len = bottom_total_len + len(i)
        self.avg_bottom = bottom_total_sum/bottom_total_len
예제 #2
0
 def give_strt(self):
     """
     
     """
     self.strt = grid_interpolator.invDist(self.op.xlist, self.op.ylist, self.op.values_list[0], self.area.xmin, self.area.xmax, self.area.ymin, self.area.ymax, self.area.nx, self.area.ny, power=5, smoothing=0)  
     
     return self.strt
예제 #3
0
    def set_coverage(self, area, units_id = []):
        """
        Calculates coverages (rasters, grids) for a given layer when the properties are difined for the units by the Sci Py RBF interpoation method
        """
        if len(units_id) > 0:
            self.units = units_id
        self.x = []
        self.y = []
        self.properties = {3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: []}
        for i in self.units:
            unit = Unit(i)
            unit.set_properties()
            for j in self.properties:
                self.properties[j].append(unit.properties[j])
            self.x.append(unit.x)
            self.y.append(unit.y)

        #Grid creation and interpolation
        for property in self.properties:
#            if type(self.properties[property]) == float:
            grid = grid_interpolator.invDist(self.x,self.y,self.properties[property],area.xmin,area.xmax,area.ymin,area.ymax,area.nx,area.ny,power=5,smoothing=0)  
            self.coverages[property] = grid