-
Notifications
You must be signed in to change notification settings - Fork 2
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
How Should We Import LANDSAT TIFF Images? #128
Comments
Ah the joys of dependency hell! I would personally opt for a separation between IronPython and (real) Python. Iron Python implementations will move some of the grunt work (data processing/visualisation) to Grasshopper from the outputs of Dragonfly but will bottleneck these operations. As such the workflow will be different in scope and scale from what could be achieved using vanilla python (by this I mean larger scale parsing/processing than with Grasshopper). Whichever way this project goes it's going to have to take on some technical dept be it by forking and home cooking image processing or managing differences in Python versions. I suspect that taking on some debt by segregating IronPython will be more beneficial/manageable in the long term if we add wrappers around image processing functions that abstract away the differences in implementation. There is a risk of diverging capabilities in the future (eg: new file formats that IronPython can't process but Python + PIL can process) but I reckon that's a bridge that can be crossed when we get there. A possible solution will be implementing a dragonfly version of honeybee-worker. |
Thanks for your thoughts, @AntoineDao . If I am understanding your suggestion, we could implement it similarly to how download_file works for the cPython ladybug core: This is going to be simpler to set up, though I worry about loosing control down the road if we have dependencies outside of the ladybug tools libraries. For the cPython core, I might still keep a copy of the relevant parts of the PIL library with the dragonfly core. However, I won't worry about trying to get PIL to work with ironPython since we will rely on DOTNET for this part. |
Hey guys, I think the wrapper solution for a DOTNET and cPython image processing library is a good one. For the sake of completeness, I've brainstormed 3 ways to achieve a cross-platform solution for image processing. In order of reducing dependencies:
Moving to a pure cPython solution like in 2 or 3 solves this problem for us in one go for all cross-compatibility issues. If you go the 1 route, you will always be creating dual DOTNET, cPython wrappers, and library calls whenever this problem crops up again. That being said, solution 1 is simpler, and faster. -S |
Actually, I forgot there's another option already mentioned.
-S |
I know that we eventually want to support importing publicly available thermal satellite images from LANDSAT. They are very useful for understanding the temperature variations across cities and are particularly good for understanding radiant temperature variation (completing the picture with the uwg, which is primarily meant to show air temperature variation).
In the legacy dragonfly, I did a proof of concept with this using DOT NET libraries to get the TIFF pixel values but this method is clearly not ideal if we want to build a cross-platform library that allows us to process these images on any operating system or interface.
From what I can tell, there does not seem to be a simple way of getting TIFF pixel values without using a 3rd party module, even though all that we need is the pixel values and aren't doing any fancy operations on the images like transforms or filters. We don't even need to save back to the image but it seems no one makes an imaging library that is import only.
So it seems like a shame to add a 3rd party module that could inhibit applications in ironPython just to be able to read TIFF image pixel values.
As such, I am thinking of trying to find the parts of the Python Imaging Library (PIL) that are specifically related to grabbing pixel values. I can then try to make those parts cross platform and make them a sub-library of dragonfly.
If anyone has any better suggestions, please let me know.
Another possible idea is to have separate code for importing values for TIFF depending on whether you are in ironPython (in which case, you use the DOT NET library) as opposed to cPython (in which case, we might use pip install PIL?)
The text was updated successfully, but these errors were encountered: