def extractImage(self): from iscesys.Parsers import rdf self.metadata = rdf.parse(self.metadataFile) self.populateMetadata() slcImage = isceobj.createSlcImage() self.slcname = os.path.join( os.path.dirname(os.path.abspath(self.metadataFile)), self.metadata['slc' + self.polarization.upper()]) slcImage.setFilename(self.slcname) slcImage.setXmin(0) slcImage.setXmax(self.frame.getNumberOfSamples()) slcImage.setWidth(self.frame.getNumberOfSamples()) slcImage.setAccessMode('r') slcImage.renderHdr() self.frame.setImage(slcImage)
def extractImage(self): from iscesys.Parsers import rdf self.metadata = rdf.parse(self.metadataFile) self.populateMetadata() slcImage = isceobj.createSlcImage() if self.name == 'reference' or self.name == 'scene1': self.slcname = self.metadata['Single Look Complex Data of Pass 1'] elif self.name == 'secondary' or self.name == 'scene2': self.slcname = self.metadata['Single Look Complex Data of Pass 2'] else: print("Unrecognized sensor.name = ", sensor.name) import sys sys.exit(0) slcImage.setFilename(self.slcname) slcImage.setXmin(0) slcImage.setXmax(self.frame.getNumberOfSamples()) slcImage.setWidth(self.frame.getNumberOfSamples()) slcImage.setAccessMode('r') self.frame.setImage(slcImage) return
def parse(self): from iscesys.Parsers import rdf self.metadata = rdf.parse(self.metadataFile) self.populateMetadata()
os.makedirs(inps.outdir) else: print('Directory {0} already exists.'.format(inps.outdir)) data = [] dates = [] for ind, (ann, slc) in enumerate(zip(annlist, slclist)): ###Parse the ann file. metadata = {} width = None height = None path = None parser = rdf.parse(ann) width = int(parser['slc_1_1x1 Columns']) height = int(parser['slc_1_1x1 Rows']) metadata['WAVELENGTH'] = parser['Center Wavelength'] metadata['ACQUISITION_TIME'] = parser['Start Time of Acquisition'] path = os.path.abspath(slc) tag = metadata['ACQUISITION_TIME'] vrttmpl = '''<VRTDataset rasterXSize="{width}" rasterYSize="{height}"> <VRTRasterBand dataType="CFloat32" band="1" subClass="VRTRawRasterBand"> <sourceFilename>{PATH}</sourceFilename> <ImageOffset>0</ImageOffset> <PixelOffset>8</PixelOffset> <LineOffset>{linewidth}</LineOffset>