Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date and time information per scanline to ASTER image class. #362

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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