-
Notifications
You must be signed in to change notification settings - Fork 13
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
Isccpg ng #82
base: main
Are you sure you want to change the base?
Isccpg ng #82
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
==========================================
- Coverage 77.61% 74.88% -2.74%
==========================================
Files 21 22 +1
Lines 1452 1505 +53
Branches 107 110 +3
==========================================
Hits 1127 1127
- Misses 301 354 +53
Partials 24 24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 9806060353Details
💛 - Coveralls |
The homogenization and recalibration still needs to be done
Pull Request Test Coverage Report for Build 12372240369Details
💛 - Coveralls |
The calibration we want is there in satpy. But the calibration that was used. The nominal is saved with the original data. And it sometimes changes....
And make sure calculations are actually done!
# Conflicts: # level1c4pps/__init__.py
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.
Nice work. Adding some comments that you can consider for readability improvement.
@@ -568,7 +573,7 @@ def compose_filename(scene, out_path, instrument, band=None): | |||
end_time = band.attrs['end_time'] | |||
platform_name = scene.attrs['platform'] | |||
orbit_number = int(scene.attrs['orbit_number']) | |||
out_path_with_dates = start_time.strftime(out_path) | |||
out_path_with_dates = datetime.strftime(dt64_to_datetime(start_time), out_path) |
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.
Maybe worth mentioning in the command line interface help that the out_path can be reformatted in this way.
|
||
BANDNAMES = list(PPS_TAGNAMES.keys()) | ||
|
||
coef_slope_chan = ['refl_00_65um', 'refl_00_86um', 'refl_01_60um', |
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.
Maybe nicer to have put all coefficients related stuff in a yaml file with a format something like this:
coeffcients:
channels:
- refl_00_65um
- refl_00_86um
- refl_01_60um
- temp_03_80um
- temp_06_20um
- temp_07_30um
- temp_08_60um
- temp_09_70um
- temp_11_00um
- temp_12_00um
- temp_13_30um'
satellite:
GOES-16:
day:
slope: [1.00152, 0.946758, 1.00669, 0.926764, 0.991329, 0.999300, 1.01977, 1.03453, 0.996781, 1.02343, 0.863748]
offset: [0.000369844, 0.193868, 0.708022, 18.4795, 1.58729, -0.0312020, -4.93224, -7.83331, 1.13395, -5.51940, 30.5574]
night:
...
"""Nominal calibration is applied, redo with meirnik calibration.""" | ||
from satpy.readers.seviri_base import MeirinkCalibrationHandler | ||
start_time = dt64_to_datetime(scene["refl_00_65um"].attrs["start_time"]) | ||
channel_name = {"refl_00_65um": "VIS006", |
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.
I prefer to define constants like this and the ones below in the top of the module.
channel_name = {"refl_00_65um": "VIS006", | ||
"refl_00_86um": "VIS008", | ||
"refl_01_60um": "IR_016"} | ||
platform_id = {55: 321, |
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.
do you actually need the 321 and 324 ids?
"IR_016": 23.112} | ||
}} | ||
for wmo_id in platform_id: | ||
for band in channel_name: |
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.
you could do: for wmo_id, platform_id in PLATFORM_ID.items():
and for band, channel_name in CHANNEL_NAME.items():
to increase readability if you follow the advise above.
update = ((dwmo_id == wmo_id) & (data > 0) & (sol_zen < dn_discr)) | ||
scene[band].values = np.where(update, scene[band].values * k + c, scene[band].values) | ||
|
||
if (illum == '_nig'): |
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.
same as above
f" with respect to SEVIRI on MSG4 using y={k} * x + {c}") | ||
dn_discr = 90 | ||
if (illum == '_day'): | ||
update = ((dwmo_id == wmo_id) & (data > 0) & (sol_zen < dn_discr)) |
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 need for the outermost parenthesis
scene[band].values = np.where(update, scene[band].values * k + c, scene[band].values) | ||
|
||
if (illum == '_nig'): | ||
update = ((dwmo_id == wmo_id) & (data > 0) & (sol_zen >= dn_discr)) |
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.
same as above
"""Homogenize data to Meteosat-11.""" | ||
sol_zen = scene["sunzenith"] | ||
for band in BANDNAMES: | ||
for wmo_id in [270, 271, 173, 55]: |
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.
for wmo_id in satellite_names:
for illumination in ["_day", "_night"]:
homogenize_channel(scene, wmo_id, illumination, band, sol_zen)
|
||
def get_encoding_isccpng(scene): | ||
"""Get netcdf encoding for all datasets.""" | ||
return get_encoding(scene, |
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.
should fit on one line.
Converter for ISCCP-NG to seviri PPS level1c format
pytest level1c4pps
flake8