Skip to content

Commit

Permalink
Merge pull request #362 from tmieslinger/add_aster_dtarray
Browse files Browse the repository at this point in the history
Add date and time information per scanline to ASTER image class.
  • Loading branch information
olemke authored Apr 7, 2020
2 parents e69aa0d + 7428b3b commit 0f5c3cb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions typhon/cloudmask/aster.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,23 @@ def get_cloudtopheight(self):

return cloudtopheight_IR(bt, cloudmask, latitude, month, method="modis")

def dt_estimate_scanlines(self, sensor='vnir'):
'''Estimate the date time per scanline.
Based on the approximate recording time for one ASTER image a date time
array is constructed along the flight direction and depending on the sensor
resolution.
Parameters:
sensor (str): ASTER sensor ("vnir", "swir", or "tir").
Returns:
(datetime): date time information per scanline.
'''
dtdelta = datetime.timedelta(seconds=8, microseconds=849000)
scanlines = {'vnir': 4200, 'swir': 2100, 'tir': 700}

return np.linspace(-.5, .5, scanlines[sensor]) * dtdelta + self.datetime

def sensor_angles(self, sensor="vnir"):
"""Calculate a sun reflection angle for a given ASTER image depending on
the sensor-sun geometry and the sensor settings.
Expand Down

0 comments on commit 0f5c3cb

Please sign in to comment.