ryanhausen / fitsmap

FitsMap: A Simple, Lightweight Tool For Displaying Interactive Astronomical Image and Catalog Data
MIT License
46 stars 9 forks source link

Problem with PNG files in 0.10.2? #70

Closed hjmcc closed 1 year ago

hjmcc commented 1 year ago

Hi @ryanhausen, sorry it's me again :-). I was testing 0.10.2, and it seems to be producing no output for my PNG files. I have tried the same file with 0.9.1 and it works fine. In both cases, fitsmap is a new conda environment with python 3.9.

convert.dir_to_map("./forfitsmap-cosmos-png/", \
                   out_dir="/n07data/hjmcc/exchg/COSMOS/tests-png/", \
                   procs_per_task = 2,\
                   task_procs = 32)

In that directory there is only one file, and it is linked here: [https://exchg.calet.org/hjmcc/tests/RGB.png]. I am doing something wrong?

ryanhausen commented 1 year ago

Hi @hjmcc thanks for reporting the issue! I'll look into the issue this weekend. I tried pulling the image at the link you provided, but the connection hangs. Can you double check it?

Thanks!

[EDIT] I have tested a pip installed version of fitsmap v0.10.2 (fresh python 3.9 environment) on a 30431 x 9049 PNG and it seemed to work fine. I'll try again on your image to debug.

Something to try is to set the following environment variable:

FITSMAP_DEBUG=true

This will tell ray (the parallelization library) to print all worker logs to the terminal. If there are issues saving the tiles they should be printed out when you run fitsmap.

hjmcc commented 1 year ago

@ryanhausen thanks! Yes, I actually have noticed that some PNG files seem to be okay. This particular PNG file was created by convert from the TIFF file. Try the link again, otherwise: https://www.icloud.com/iclouddrive/086OmlGOVKbsthmWEOzGjDkNw#RGB ! I will try the test you propose... cheers!

ryanhausen commented 1 year ago

@hjmcc The links still didn't work for me, but I was able to pull/convert a NASA tiff image and reproduced your error.

I'll take a look at it and post here when I have a fix. Thanks!

ryanhausen commented 1 year ago

@hjmcc I have a found fix. I will follow-up here when it's been pushed to pypi.

Thanks for reporting!

hjmcc commented 1 year ago

@ryanhausen great! I will test when it's ready.

ryanhausen commented 1 year ago

@hjmcc I have pushed version 0.10.3 to pypi which includes a fix for the issue here.

Please let me know if you run into any issues

hjmcc commented 1 year ago

Great @ryanhausen! I confirm that my 'problematic' PNG file now works correctly with 10.3.

ryanhausen commented 1 year ago

@hjmcc Wonderful! Thanks for testing. Let me know if anything else comes up!