def angularpixelarea(self):
# get the first instrument element
instruments = self.tree.xpath("//instruments/*[1]")
if len(instruments) != 1: raise ValueError("No instruments in ski file")
instrument = instruments[0]
# get the distance in m
d = self.units().convert(instrument.get("distance"), to_unit='m', quantity='distance')
# get the field of view in m
fovx = self.units().convert(instrument.get("fieldOfViewX"), to_unit='m', quantity='length')
fovy = self.units().convert(instrument.get("fieldOfViewY"), to_unit='m', quantity='length')
# get the number of pixels
nx = int(instrument.get("pixelsX"))
ny = int(instrument.get("pixelsY"))
# calculate the angular pixel area
sx = 2 * arctan(fovx / nx / d / 2)
sy = 2 * arctan(fovy / ny / d / 2)
return sx * sy
## This function returns a list of instrument names, in order of occurrence in the ski file.
评论列表
文章目录