DOI-USGS / ISIS3

Integrated Software for Imagers and Spectrometers v3. ISIS3 is a digital image processing software package to manipulate imagery collected by current and past NASA and International planetary missions.
https://isis.astrogeology.usgs.gov
Other
197 stars 167 forks source link

Caminfo - new polygon failures under latest isis on Kaguya TC images #5520

Closed lwellerastro closed 2 months ago

lwellerastro commented 3 months ago

ISIS version(s) affected: isis8.2.0-RC1 This is a very recent bug. All other versions of isis work with the same input image and same command line arguments. This includes isis8.0.3 which I thought was the same as 8.2.0-RC1 based on the changelog, but apparently they differ.

The one difference I have noted is isis8.2.0-RC1 uses a newer version of ale whereas 8.0.3 and others uses an older/different version (leading path info stripped):

conda list | egrep 'isis|ale'
# packages in environment at /anaconda3_linux/envs/isis8.0.3:
ale                       0.9.1            py39h7633fee_1    conda-forge
isis                      8.0.3                   np126_0    usgs-astrogeology

vs

conda list | egrep 'isis|ale'
# packages in environment at /anaconda3_linux/envs/isis8.2.0-RC1:
ale                       0.10.0          py312h8572e83_1    conda-forge
isis                      8.2.0_RC1                     0    usgs-astrogeology/label/RC

So perhaps there is something about the latest ale helping to generate the error I'm seeing?

Description
Most Kaguya images that cross the 0/360 longitude boundary fail caminfo polygon=true (uselabel=true or when calculated on the fly) with the following error:

  Group = Error
    Program = caminfo
    Class   = "PROGRAMMER ERROR"
    Code    = 3
    Message = "Unable to convert polygon from Lat/Lon to X/Y"
    File    = PolygonTools.cpp
    Line    = 132
  End_Group

All of my images failed that have the 0/360 lon boundary and lat>+/-65 (polar quads) and about half of the images between lat 65S to 65N and 0/360 lon failed. All of these had previously been processed under isis5.0.2 and ran through caminfo without error.

How to reproduce

See my user work area Isis3Tests/Caminfo/isis8.2.0RC1/ for an example image. The image was processed in the following way under isis8.2.0-RC1 (shape model is under a work directory):

kaguyatc2isis from=TC1W2B0_01_00849N757E0018.lbl to=TC1W2B0_01_00849N757E0018.lev0.cub setnullrange=yes nullmin=-32768 nullmax=-0.00001
spiceinit from=TC1W2B0_01_00849N757E0018.lev0.cub attach=TRUE spksmithed=true spkrecon=TRUE shape=user model=LRO_LOLA_NPole60N_LDEM_512ppd_mar2014_radius_demprep.cub 
camstats from=TC1W2B0_01_00849N757E0018.lev0.cub attach=true format=PVL append=FALSE linc=100 sinc=100 
footprintinit from=TC1W2B0_01_00849N757E0018.lev0.cub increaseprecision=FALSE inctype=vertices numvertices=40
caminfo from=TC1W2B0_01_00849N757E0018.lev0.cub to=TC1W2B0_01_00849N757E0018.lev0.pvl isislabel=true geometry=true originallabel=true statistics=true camstats=true linc=100 sinc=100 uselabel=true

Successful caminfo output run on this via isis8.0.3 is in the same directory and named TC1W2B0_01_00849N757E0018.isis803.pvl

My Kaguya data are currently processed under 5.0.2, but I wanted to re-process everything under a more recent version of isis/ale prior to jigsaw updates and kernel creation. I chose the latest version because it picked up changes to camstats that haven't been available since isis7.0 or earlier which contains important information for a database which will be used for mosaic creation.

Possible Solution
I don't see anything in the changelog for isis8.2.0-RC1 or in the ale changelog that would explain the change.

Additional context
Only images having the 0/360 boundary fail (thousands), though there are several hundred that don't (have no idea what's special about them). The version of ale has changed and it is only under this version that the data fail.

lwellerastro commented 3 months ago

Based on some chats that transpired this week, I'm wondering if updates to geos is causing the problem:

 conda list | egrep "isis|geos|ale"
# packages in environment at /anaconda3_linux/envs/isis8.2.0-RC1:
ale                       0.10.0          py312h8572e83_1    conda-forge
geos                      3.12.1               h59595ed_0    conda-forge
isis                      8.2.0_RC1                     0    usgs-astrogeology/label/RC
conda list | egrep "isis|geos|ale"
# packages in environment at /anaconda3_linux/envs/isis8.0.3:
ale                       0.9.1            py39h7633fee_1    conda-forge
geos                      3.11.1               h27087fc_0    conda-forge
isis                      8.0.3                   np126_0    usgs-astrogeology

geos version varies across isis versions tested, but PolygonTools.cpp (from caminfo failure message) uses geos so I thought it worth mentioning.

Kelvinrr commented 2 months ago

PR merged, re-open if fix doesn't work.