Coefficients and functions for calibrating DigitalGlobe imagery in Python
Bascially a Python-implementation of https://dg-cms-uploads-production.s3.amazonaws.com/uploads/document/file/209/ABSRADCAL_FLEET_2016v0_Rel20170606.pdf with metadata parsing.
Requires numpy
as single non-trivial dependency. All other dependencies are easily pip
-installable.
pip install -r requirements.txt
pip install .
from dg_calibration import radiance
imdfile = r'/path/to/some/metadata.IMD'
dn = np.random.randint(0, 6000, size=(3, 20, 30))
rad = radiance.dn_to_radiance(dn, imdfile, band_ids=[3, 2, 1]) # band 4, 3, 2
from dg_calibration import reflectance
refl = reflectance.dn_to_reflectance(dn, imdfile, band_ids=None) # full band stack
refl = reflectance.radiance_to_reflectance(rad, imdfile, band_ids=[3, 2, 1])
from dg_calibration import gain_offset
gain = gain_offset.get_gain_values('WV02')
offset = gain_offset.get_offset_values('GE01')
python -m pytest -v