@@ -835,6 +835,8 @@ def get_by_name(attr, section='Abstracted_Metadata'):
835835 meta ['polarizations' ] = list (set ([x for x in pols if '-' not in x ]))
836836 meta ['spacing' ] = (round (float (get_by_name ('range_spacing' , section = section )), 6 ),
837837 round (float (get_by_name ('azimuth_spacing' , section = section )), 6 ))
838+ meta ['looks' ] = (float (get_by_name ('range_looks' , section = section )),
839+ float (get_by_name ('azimuth_looks' , section = section )))
838840 meta ['samples' ] = int (self .root .find ('.//BAND_RASTER_WIDTH' ).text )
839841 meta ['lines' ] = int (self .root .find ('.//BAND_RASTER_HEIGHT' ).text )
840842 meta ['bands' ] = int (self .root .find ('.//NBANDS' ).text )
@@ -2048,14 +2050,23 @@ def scanMetadata(self):
20482050 sp_rg = [float (x .find ('.//rangePixelSpacing' ).text ) for x in ann_trees ]
20492051 sp_az = [float (x .find ('.//azimuthPixelSpacing' ).text ) for x in ann_trees ]
20502052 meta ['spacing' ] = (median (sp_rg ), median (sp_az ))
2053+
2054+ looks_rg = [float (x .find ('.//rangeProcessing/numberOfLooks' ).text ) for x in ann_trees ]
2055+ looks_az = [float (x .find ('.//azimuthProcessing/numberOfLooks' ).text ) for x in ann_trees ]
2056+ meta ['looks' ] = (median (looks_rg ), median (looks_az ))
2057+
20512058 samples = [x .find ('.//imageAnnotation/imageInformation/numberOfSamples' ).text for x in ann_trees ]
20522059 meta ['samples' ] = sum ([int (x ) for x in samples ])
2060+
20532061 lines = [x .find ('.//imageAnnotation/imageInformation/numberOfLines' ).text for x in ann_trees ]
20542062 meta ['lines' ] = sum ([int (x ) for x in lines ])
2063+
20552064 heading = median (float (x .find ('.//platformHeading' ).text ) for x in ann_trees )
20562065 meta ['heading' ] = heading if heading > 0 else heading + 360
2066+
20572067 incidence = [float (x .find ('.//incidenceAngleMidSwath' ).text ) for x in ann_trees ]
20582068 meta ['incidence' ] = median (incidence )
2069+
20592070 meta ['image_geometry' ] = ann_trees [0 ].find ('.//projection' ).text .replace (' ' , '_' ).upper ()
20602071
20612072 return meta
0 commit comments