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 sensor angle calculation. #365

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

tmieslinger
Copy link
Contributor

  • make sensor geometry calculation more efficient and more generic. Apprication is extended to ascending satellite mode (before only descending was covered).
  • add sensor geometry for backward looking telescope of channel 3.

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.

The PR looks fine in general 👍 I left some minor picky comments that you might want to incorporate ;)


Disclaimer: I haven't looked into the logic of the calculations.

@@ -617,79 +619,100 @@ def sensor_angles(self, sensor="vnir"):
Algorithm Theoretical Basis Document for ASTER Level-1 Data
Processing (Ver. 3.0).1996.
"""
if channel is not "3B":
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.Thanks.

Comment on lines 696 to 702
zenith = np.rad2deg(np.arctan(np.sqrt((h * np.tan(np.deg2rad(P[sensor]))
+ 15 * n)**2
+ (h * np.tan(np.deg2rad(27.6))
/ np.cos(np.deg2rad(P[sensor])))**2
) / h
)
)
Copy link
Member

Choose a reason for hiding this comment

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

Did you or your IDE/code formatter chose that style? ;)
You could add a new line before h * np.tan... this gives you way more space to operate in the next line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

personal choice :) but I'm open to the back suggestions

Comment on lines 630 to 634
FOV = {"VNIR": 6.09,
"VNIRB": 5.19,
"SWIR": 4.9,
"TIR":4.9
}
Copy link
Member

Choose a reason for hiding this comment

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

Picky comment from my side ;) There is two options to format code like this:

  1. If you know that the dictionary is complete:
FOV = {"VNIR": 6.09, "VNIRB": 5.19,  "SWIR": 4.9, "TIR": 4.9}
  1. If it may be extended in the future:
FOV = {
    "VNIR": 6.09,
    "VNIRB": 5.19, 
    "SWIR": 4.9,
    "TIR": 4.9,
}

Comment on lines 599 to 597
"""Calculate sensor zenith and azimuth angles.
Angles are derived for each pixel depending on the channel and the
Copy link
Member

Choose a reason for hiding this comment

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

Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. PEP257

* make sensor geometry calculation more efficient and more generic. Apprication is extended to ascending satellite mode (before only descending was covered).
* add sensor geometry for backward looking telescope of channel 3.
@tmieslinger tmieslinger force-pushed the improve_sensor_angle_calc branch from 659d565 to fdf96ec Compare April 22, 2020 09:40
@lkluft lkluft merged commit 100ebe0 into atmtools:master Apr 22, 2020
@tmieslinger tmieslinger deleted the improve_sensor_angle_calc branch April 22, 2020 09:43
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