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

Add points to an image with list of lat/long pairs #36

Closed
anikfal opened this issue Nov 3, 2019 · 3 comments · Fixed by #42
Closed

Add points to an image with list of lat/long pairs #36

anikfal opened this issue Nov 3, 2019 · 3 comments · Fixed by #42

Comments

@anikfal
Copy link

anikfal commented Nov 3, 2019

Although the add_cities function can overlay points on an image, but a Shapefile describing the points is required for this function.
Referring to Custom shapes and lines, is there any similar function to add_polygon which can overlay points on a PNG image simply by pairs of lat/long coordinates?

@djhoese
Copy link
Member

djhoese commented Nov 3, 2019

There is a hidden (not public) _draw_ellipse function (https://github.com/pytroll/pycoast/blob/master/pycoast/cw_agg.py#L70) that can probably do what you need. Since this function is not public there is no guarantee that it will exist in future versions.

Thinking about this (CC @mraspaud), I wonder if pycoast could/should provide a more aggdraw-like interface for drawing primitive types (points, lines, polygons, etc) but also include the helper functions for drawing shape files and their types. Like an add_cities that accepts a iterator of city names and locations. I think I attempted to do this a while back when refactoring some stuff but didn't finalize any design.

@anikfal
Copy link
Author

anikfal commented Nov 3, 2019

Maybe this was better to be discussed in a new issue. But in the RGB image below (generated by Satpy), I want to specify and extract those 'hot spots' with orange or red colors. I am seeking a color scheme as a single function of the RGB channels to extract red color hues as separate channel.
Moreover, I have to verify this color scheme by comparing the new channel with the RGB image to see if the extracted orange/red colors are spatially consistent with the orange/red colors in the RGB image. Is it possible to overlay such extra channel on its RGB image and compute their spatial pattern correlation?
More generally, I wonder if Pytroll provides capabilities to overlay channels (e.g. wind speed or temperature) from other data files (e.g. ECMWF) on the composite RGB images?

colorized_ir_clouds_20190331_120010

@pnuu
Copy link
Member

pnuu commented Nov 7, 2019

Indeed, those are points for other issues. But why do you want to have the colors? The colors just represent some brightness temperature values, which you could read directly from the channel data: scn[10.8].data[y_idx, x_idx]. At the moment we don't have readers for model data, nor do we have a way to plot wind barbs, as far as I know.

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 a pull request may close this issue.

3 participants