-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve ASTER latitude, longitude grid calculation #364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general 👍 I left some minor comments
@@ -919,3 +950,15 @@ def cloudtopheight_IR(bt, cloudmask, latitude, month, method="modis"): | |||
bt_clear_avg = np.nanmean(bt[mask_clear]) | |||
|
|||
return (bt_clear_avg - bt_cloudy) / lapserate | |||
|
|||
def geocentric2geodetic(latitude): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a function for that in typhon.geodesy
. I am not sure if it does the same, but you could check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! However, the conversion given here is from the ASTER user guide. Might be an approximation, but as it's stated there I'd like to stay consistent within the ASTER L1B data. The typhon.geodesy
seems more complicated (might be more precise?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough! You may mention that in the docstring or define the function as a staticmethod of the Aster image class. But having it in the typhon.cloudmask.aster
may already sufficient ;)
typhon/cloudmask/aster.py
Outdated
"TIR": (14, 15) | ||
} | ||
|
||
latstr = (f"HDF4_SDS:UNKNOWN:{self.filename}:{sdsidx[self.channel2sensor[channel]][0]}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for the parantheses around the f-string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but the string is too long :) I'll fix it
typhon/cloudmask/aster.py
Outdated
'5', '6', '7', '8', '9', '10', '11', '12', '13', '14'. | ||
|
||
Returns: | ||
tuple(ndarray, ndarray): latitude, longitude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuple(ndarray, ndarray): latitude, longitude | |
ndarray, ndarray: latitude, longitude |
latidx = np.arange(11) * imagedimension.lat / 10 | ||
lonidx = np.arange(11) * imagedimension.lon / 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the image dimensions always dividable by ten? Otherwise you could use an integer division x // 10
to ensure an int
result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ASTER L1B user guide specifies geolocation boxes, their sizes, and the corresponding lattice points (which don't change).latidx
and lonidx
are those lattice points and are only needed for defining the interpolation function and not necessarily need to be int
.
ASTER subsensor information and channel information are connected. The derivation of channel information changed, but not accessing the variable.
* `geocentric2geodetic`: transform latitude values from geocentric to geodetic values. * `read_coordinates`: reada reduced latitude, longitude grid from ASTER HDF file.
* `get_latlon_grid`: instead of a linear interpolation between the scene corner coordinates, the more detailed geolocation information from sds in ASTER HDF files is used and linearly interpolated in between the 11 x 11 defined grid points per image.
78880a8
to
1aa1fef
Compare
No description provided.