def setState(self): ''' Create C object and populate. ''' from components.contrib.geo_autoRIFT.geogrid import geogrid from iscesys import DateTimeUtil as DTU if self._geogrid is not None: geogrid.destroyGeoGrid_Py(self._geogrid) self._geogrid = geogrid.createGeoGrid_Py() geogrid.setRadarImageDimensions_Py( self._geogrid, self.numberOfSamples, self.numberOfLines) geogrid.setRangeParameters_Py( self._geogrid, self.startingRange, self.rangePixelSize) geogrid.setAzimuthParameters_Py( self._geogrid, DTU.seconds_since_midnight(self.sensingStart), self.prf) geogrid.setRepeatTime_Py(self._geogrid, self.repeatTime) geogrid.setEPSG_Py(self._geogrid, self.epsg) geogrid.setIncidenceAngle_Py(self._geogrid, self.incidenceAngle) geogrid.setChipSizeX0_Py(self._geogrid, self.chipSizeX0) geogrid.setXLimits_Py(self._geogrid, self._xlim[0], self._xlim[1]) geogrid.setYLimits_Py(self._geogrid, self._ylim[0], self._ylim[1]) if self.demname: geogrid.setDEM_Py(self._geogrid, self.demname) if (self.dhdxname is not None) and (self.dhdyname is not None): geogrid.setSlopes_Py(self._geogrid, self.dhdxname, self.dhdyname) if (self.vxname is not None) and (self.vyname is not None): geogrid.setVelocities_Py(self._geogrid, self.vxname, self.vyname) if (self.srxname is not None) and (self.sryname is not None): geogrid.setSearchRange_Py(self._geogrid, self.srxname, self.sryname) if (self.csminxname is not None) and (self.csminyname is not None): geogrid.setChipSizeMin_Py(self._geogrid, self.csminxname, self.csminyname) if (self.csmaxxname is not None) and (self.csmaxyname is not None): geogrid.setChipSizeMax_Py(self._geogrid, self.csmaxxname, self.csmaxyname) if (self.ssmname is not None): geogrid.setStableSurfaceMask_Py(self._geogrid, self.ssmname) geogrid.setWindowLocationsFilename_Py( self._geogrid, self.winlocname) geogrid.setWindowOffsetsFilename_Py( self._geogrid, self.winoffname) geogrid.setWindowSearchRangeFilename_Py( self._geogrid, self.winsrname) geogrid.setWindowChipSizeMinFilename_Py( self._geogrid, self.wincsminname) geogrid.setWindowChipSizeMaxFilename_Py( self._geogrid, self.wincsmaxname) geogrid.setWindowStableSurfaceMaskFilename_Py( self._geogrid, self.winssmname) geogrid.setRO2VXFilename_Py( self._geogrid, self.winro2vxname) geogrid.setRO2VYFilename_Py( self._geogrid, self.winro2vyname) geogrid.setLookSide_Py(self._geogrid, self.lookSide) geogrid.setNodataOut_Py(self._geogrid, self.nodata_out) self._orbit = self.orbit.exportToC() geogrid.setOrbit_Py(self._geogrid, self._orbit)
def finalize(self): ''' Clean up all the C pointers. ''' from components.contrib.geo_autoRIFT.geogrid import geogrid from isceobj.Util import combinedlibmodule combinedlibmodule.freeCOrbit(self._orbit) self._orbit = None geogrid.destroyGeoGrid_Py(self._geogrid) self._geogrid = None