-
Notifications
You must be signed in to change notification settings - Fork 14
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
Extend aeroval to plot satellite pixels maps #1347
Conversation
aerovaldb 0.1.1
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main-dev #1347 +/- ##
============================================
- Coverage 78.97% 78.68% -0.29%
============================================
Files 136 136
Lines 20817 20787 -30
============================================
- Hits 16440 16357 -83
- Misses 4377 4430 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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, with a few comments.
Use assert
only for debugging assumptions, not as exception shortcut.
Discuss with Thorbjørn if image-types should be stored as attribute of the blob.
return [fp_json, fp_geojson] | ||
with self.avdb.lock(): | ||
self.avdb.put_map_overlay( | ||
overlay_plot, |
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.
Does this mean that put_map_overlay has no knowledge of the overlay_plot image-type (png/jpeg,webp)? And the get_map_overlay does not have that knowledge either?
@thorbjoernl
I would feel better if the image-type were known..., e.g.
ROUTE_MAP_OVERLAY = "/v0/map-overlay/{project}/{experiment}/{source}/{variable}/{date}.{img_type}"
would even indicate that the files on dict in the jsonfiledb are images...
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.
Yes I think this could make sense as well. I will not stop this from merging as you have approved the PR, but perhaps something to pick up later.
fig, axis = plt.subplots( | ||
1, | ||
1, | ||
subplot_kw=dict(projection=ccrs.Mercator()), |
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.
Why are there two projections, Mercator and PlateCarree in this function? We should only have one output projection.
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 transform
argument tells cartopy which projection our data is in. The projection
argument tells cartopy which projection to project into. https://scitools.org.uk/cartopy/docs/latest/tutorials/understanding_transform.html
pyaerocom/aeroval/setup_classes.py
Outdated
for m in v: | ||
if not isinstance(v[m], set): | ||
v[m] = set([v[m]]) | ||
assert v[m] in PLOT_TYPE_OPTIONS |
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 python compiler may remove all assert
statements for optimized code. You want to have a real exception here.
Change Summary
json
file computations (incontour
directory)ranges.json
contains a unit for each variableModelMapsSetup
, and associated helper classes and methods, such asBoundingBox
andvalidate_plot_types
plot_overlay_pixel_maps
_process_map_var
to_process_contour_map_var
I have added some small tests for
modelmaps_opts
insetup_classes.py
but not for the actual processing of the pixel maps as analogous tests do not seem to exist for the contour plotting.Related issue number
closes #401, https://github.com/metno/AeroToolsIssues/issues/5
Checklist