Skip to content

Conversation

@emc5ud
Copy link
Contributor

@emc5ud emc5ud commented Aug 14, 2019

Signed-off-by: Eric Culbertson eculbertson@astraea.io

Default tile rendering is now more like QGIS. By default, the 1st and 99th percentile are calculated for the image, and then the cell values are clipped to not go beyond this range.

Before:
image
After:
image

Signed-off-by: Eric Culbertson <eculbertson@astraea.io>
@emc5ud
Copy link
Contributor Author

emc5ud commented Aug 14, 2019

TODO: I'd like to have a show method that makes it easy to pass in rendering arguments

Eric Culbertson added 3 commits August 15, 2019 10:57
Signed-off-by: Eric Culbertson <eculbertson@astraea.io>
Signed-off-by: Eric Culbertson <eculbertson@astraea.io>
Signed-off-by: Eric Culbertson <eculbertson@astraea.io>
@emc5ud
Copy link
Contributor Author

emc5ud commented Aug 15, 2019

Ok so I changed my methodology a little bit and would love some feedback from @metasim @vpipkt and/or @courtney-whalen.

I added a method to the Tile class called show that normalizes the image and uses matplotlib.pyplot.imshow to display. This function will either create a new axis object to put the image onto or you can pass in a premade axis object you want to modify.

tile_to_png now calls the Tile.show method to create an image with a prespecified size and title.

The existing behavior of tile_to_png is unchanged, but this gives an easy way to do more custom tile plots. For example

image

tile.show has full flexibility to pass in any argument someone would pass into matplotlib.pyplot.imshow

@vpipkt
Copy link
Member

vpipkt commented Aug 15, 2019

Based on the quick look I like it and I think it's going to be a good contribution.

Can you take a look at possibly rebasing your work off of the branch in #284 as it also makes some changes in the same module?

@emc5ud emc5ud changed the title [WIP] Better tile rendering Better tile rendering Aug 15, 2019
@metasim
Copy link
Member

metasim commented Aug 15, 2019

So far I like it. I made some (not as good as) changes the same code, so there'll be a merge conflict when you update to the latest develop. I also may want to consider where show actually lives.

@metasim
Copy link
Member

metasim commented Aug 15, 2019

@emc5ud PS: definitely looks better!!! Thank you!!

@emc5ud
Copy link
Contributor Author

emc5ud commented Aug 16, 2019

Thanks for taking a look. I might need some help with rebasing this branch off the one you linked.

* develop: (26 commits)
  Set next development version.
  Tweaks to get .whl file under the default size limit on PyPi.
  Set version to 0.8.0.
  Removed tile display contrast fiddling.
  Quiet down pip; cache .local.
  Additional CI + Python dependency attempts.
  Final documentation tweaks.
  Move PegdownMarkdownFormatter to docs class
  Edits: languages.pymd & reference.pymd
  Fix setup.py dependency, fix rf_rasterize signature regression in unit test
  Edits: aggregation.pymd, supervised-learning.pymd, unsupervised-learning.pymd, time-series.pymd
  Edits: local-algebra.pymd, nodata-handling.pymd. Rendering tweaks.
  Edits: raster-write.pymd & vector-data.pymd.
  Python SetupTools + TravisCI == Painful Combo.
  Edits: raster-io.md, raster-catalogs.pymd, raster-read.pymd.
  Fixes to PDF generation code.
  Edits: concepts.md & getting-started.md.
  Edits: index.md & description.md
  Tweaks to time-series.pymd to lower memory pressure and remove SQL.
  Tweaked pweave markdown generator.
  ...

# Conflicts:
#	pyrasterframes/src/main/python/pyrasterframes/rf_ipython.py
@metasim metasim merged commit 3541cd6 into locationtech:develop Aug 16, 2019
@metasim metasim deleted the feature/tile-show branch August 16, 2019 18:27
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.

3 participants