landsatTOA

Module that handles convertion of scaled radiance (DN) values from USGS to Top of Atmosphere (TOA) reflectance (*1000).

fmask.landsatTOA.earthSunDistance(date)[source]

Given a date in YYYYMMDD will compute the earth sun distance in astronomical units

fmask.landsatTOA.makeTOAReflectance(infile, mtlFile, anglesfile, outfile)[source]

Main routine - does the calculation

The eqn for TOA reflectance, p, is p = pi * L * d^2 / E * cos(theta)

d = earthSunDistance(date) L = image pixel (radiance) E = exoatmospheric irradiance for the band, and theta = solar zenith angle.

Assumes infile is radiance values in DN from USGS. mtlFile is the .mtl file. outfile will be created in the default format that RIOS is configured to use and will be top of atmosphere reflectance values *10000. Also assumes that the angles image file is scaled as radians*100, and has layers for satAzimuth, satZenith, sunAzimuth, sunZenith, in that order.

fmask.landsatTOA.readGainsOffsets(mtlInfo)[source]

Read the gains and offsets out of the .MTL file

fmask.landsatTOA.riosTOA(info, inputs, outputs, otherinputs)[source]

Called from RIOS