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

Improve ASTER latitude, longitude grid calculation #364

Merged
merged 3 commits into from
Apr 14, 2020

Conversation

tmieslinger
Copy link
Contributor

No description provided.

Copy link
Member

@lkluft lkluft left a 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):
Copy link
Member

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.

Copy link
Contributor Author

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?)

Copy link
Member

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 ;)

"TIR": (14, 15)
}

latstr = (f"HDF4_SDS:UNKNOWN:{self.filename}:{sdsidx[self.channel2sensor[channel]][0]}")
Copy link
Member

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?

Copy link
Contributor Author

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

'5', '6', '7', '8', '9', '10', '11', '12', '13', '14'.

Returns:
tuple(ndarray, ndarray): latitude, longitude
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tuple(ndarray, ndarray): latitude, longitude
ndarray, ndarray: latitude, longitude

typhon/cloudmask/aster.py Outdated Show resolved Hide resolved
Comment on lines +534 to +549
latidx = np.arange(11) * imagedimension.lat / 10
lonidx = np.arange(11) * imagedimension.lon / 10
Copy link
Member

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

Copy link
Contributor Author

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.

typhon/cloudmask/aster.py Outdated Show resolved Hide resolved
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.
@lkluft lkluft merged commit 191f220 into atmtools:master Apr 14, 2020
@tmieslinger tmieslinger deleted the change_latlon_calc branch April 14, 2020 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants