-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e3a3ae
commit 503ae3b
Showing
14 changed files
with
3,852 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,7 @@ docs/_build/ | |
# Pyenv | ||
.python-version | ||
|
||
*.sh | ||
*.sh | ||
|
||
**/ipynb_checkpoints | ||
*.ipynb |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
pyobs_cloudcover/cloud_info_calculator/coverage_info_calculator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import datetime | ||
|
||
import numpy as np | ||
from cloudmap_rs import AltAzCoord, SkyPixelQuery | ||
import numpy.typing as npt | ||
from cloudmap_rs import SkyPixelQuery | ||
|
||
from pyobs_cloudcover.cloud_coverage_info import CloudCoverageInfo | ||
from pyobs_cloudcover.cloud_info_calculator.coverage_change_calculator import \ | ||
CoverageChangeCalculator | ||
from pyobs_cloudcover.measurement_log.field_evaluators.zenith_cloud_coverage_calculator import \ | ||
ZenithCloudCoverageCalculator | ||
|
||
|
||
class CoverageInfoCalculator: | ||
def __init__(self, coverage_change_calculator: CoverageChangeCalculator) -> None: | ||
self._coverage_change_calculator = coverage_change_calculator | ||
|
||
def __call__(self, sky_query: SkyPixelQuery, obs_time: datetime.datetime) -> CloudCoverageInfo: | ||
def __call__(self, sky_query: SkyPixelQuery, cloud_plot: bytes, obs_time: datetime.datetime) -> CloudCoverageInfo: | ||
change = self._coverage_change_calculator(sky_query.get_pixels()) | ||
|
||
return CloudCoverageInfo(sky_query, change, obs_time) | ||
return CloudCoverageInfo(sky_query, change, cloud_plot, obs_time) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import io | ||
from typing import List | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
from cloudmap_rs import AltAzCoord | ||
|
||
|
||
def plot_clouds(coordinates: List[AltAzCoord], clouds: List[bool]) -> bytes: | ||
''' | ||
z = 90 - np.rad2deg([coord.alt for coord in coordinates]) | ||
az = np.rad2deg([coord.az for coord in coordinates]) | ||
plt.polar() | ||
plt.scatter(az, z, c=clouds, s=1) | ||
plt.colorbar() | ||
''' | ||
|
||
lon, lat = [coord.az for coord in coordinates], [coord.alt for coord in coordinates] | ||
plt.polar() | ||
plt.scatter(lon, 90 - np.rad2deg(lat), c=clouds, s=1) | ||
plt.colorbar() | ||
|
||
return render_plot() | ||
|
||
def render_plot() -> bytes: | ||
buffer = io.BytesIO() | ||
plt.savefig(buffer, format='png') | ||
buffer.seek(0) | ||
plt.close() | ||
|
||
return buffer.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.