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

Jigsaw "Unable to set coefficients vector" issue with 6.0.0 #4686

Closed
volcanopele opened this issue Nov 12, 2021 · 7 comments · Fixed by #4791
Closed

Jigsaw "Unable to set coefficients vector" issue with 6.0.0 #4686

volcanopele opened this issue Nov 12, 2021 · 7 comments · Fixed by #4791
Assignees
Labels
bug Something isn't working Missions Issues which are a priority for missions
Milestone

Comments

@volcanopele
Copy link

ISIS version(s) affected: 6.0.0

Description
Running jigsaw on CaSSIS images (could impact other spacecraft images but I haven't tested that) results in the following set of errors and bundle adjustment does not occur:

Group = Error
    Program = jigsaw
    Class   = "USER ERROR"
    Code    = 2
    Message = "Unable to bundle adjust network
               [MY36_016125_127_0_cnetextract_net.net]"
    File    = jigsaw.cpp
    Line    = 196
  End_Group

  Group = Error
    Program = jigsaw
    Code    = 1
    Message = "Could not solve bundle adjust"
    File    = BundleAdjust.cpp
    Line    = 1013
  End_Group

  Group = Error
    Program = jigsaw
    Code    = 1
    Message = "Unable to apply parameter corrections to IsisBundleObservation"
    File    = IsisBundleObservation.cpp
    Line    = 509
  End_Group

  Group = Error
    Program = jigsaw
    Class   = "PROGRAMMER ERROR"
    Code    = 3
    Message = "Unable to set coefficients vector. The size of the given vector
               [1] does not match number of coefficients in the basis equation
               [3]"
    File    = BasisFunction.cpp
    Line    = 48
  End_Group

Running jigsaw using the same observation with 5.0.2, using the same code shown below, does not produce this error and bundle adjustment proceeds correctly. So this seems to be a bug that has cropped up in 6.0.0.

Both 5.0.2 and 6.0.0 are installed on my MacBook Pro running macOS 12. Each installation has their own "base" data areas but they should be identical since they were pull via RSync within a day of each other. They use the same tgo data area. My CaSSIS scripts successfully outputs products with ISIS 6.0.0, and they look reasonable, just with color fringing due to the lack of bundle adjustment.

The output of the preceding steps in the jigsaw step of my code look identical between 5.0.2 and 6.0.

How to reproduce
The jigsaw step in my CaSSIS images processing script looks like this:

footprintinit from=\$1 -batchlist=../${IMAGE_NAME}_image.lis
autoseed fromlist=../${IMAGE_NAME}_image.lis overlaplist=${IMAGE_NAME}_overlaps.txt deffile=$AUTOSEEDDEF \
    onet=${IMAGE_NAME}_autoseed_strip.net errors=${IMAGE_NAME}_autoseed_grid.err networkid=$IMAGE_NAME.1 \
    pointid=$IMAGE_NAME.\?\?\?\?\?\?\? description="$IMAGE_NAME grid1"
pointreg fromlist=../${IMAGE_NAME}_image.lis cnet=${IMAGE_NAME}_autoseed_strip.net \
    onet=${IMAGE_NAME}_pointreg_net.net deffile=$AUTOREGDEF MEASURES=CANDIDATES \
    flatfile=${IMAGE_NAME}_pointreg_net.txt
cnetcheck fromlist=../${IMAGE_NAME}_image.lis cnet=${IMAGE_NAME}_pointreg_net.net \
    prefix=${IMAGE_NAME}_chk_
(some code to separate framelets with enough good points after pointreg from those that don't)
cnetextract fromlist=../${IMAGE_NAME}_image.lis cnet=${IMAGE_NAME}_pointreg_net.net prefix=new \
    tolist=${IMAGE_NAME}_newimage.lis onet=${IMAGE_NAME}_cnetextract_net.net \
    networkid=$IMAGE_NAME.new description="$IMAGE_NAME cnetextract" \
    cubelist=${IMAGE_NAME}_goodimages.txt cubes=yes cubemeasures=yes
jigsaw fromlist=${IMAGE_NAME}_newimage.lis cnet=${IMAGE_NAME}_cnetextract_net.net \
    onet=${IMAGE_NAME}_jigsaw_net.net model1=huber file_prefix=${IMAGE_NAME}.js \
    sigma0=1.0e-3 maxits=200 update=yes OBSERVATIONS=yes camera_angles_sigma=0.02

Here is how spiceinit is used, in case that helps

spiceinit from=\$1.cub attach=true spkpredict=true ckpredict=true -batchlist=../${IMAGE_NAME}_image_name.lis

Possible Solution

Additional context
Sorry to bringing this up so late. The CaSSIS team is now working to move from ISIS 4.4 to a more recent version of ISIS due to some label improvements. I have used 5.0.2 on my local system for the last few months with great success and started testing 6.0.0 this week. This testing was performed using my bash shell CaSSIS processing script. Testing with the production pipeline is on going.

@jessemapel jessemapel added the bug Something isn't working label Nov 15, 2021
@jessemapel
Copy link
Contributor

Looks like a bug in observation mode. When we append a new image to an ISIS observation we need to make sure that we properly initialize its SpicePosition and SpiceRotation members.

@volcanopele
Copy link
Author

thanks for taking a look at this bug. It looks like we will have to use 6.0.0 or greater for our reprocessing project due to recent CaSSIS label updates in tgocassisrdrgen showing up on 6.0.0.

@jessemapel jessemapel added the Missions Issues which are a priority for missions label Nov 18, 2021
@jessemapel
Copy link
Contributor

Can you let us know what type of images you had in your processing list? was this a full CaSSIS observation?

@volcanopele
Copy link
Author

We are processing full CaSSIS observations so the images that are going into jigsaw are the framelets that will, in later steps in the pipeline, be mosaicked together into color swaths.

@jessemapel
Copy link
Contributor

If someone else works this, CaSSIS data can be pulled from the ESA site:

https://archives.esac.esa.int/psa/#!Table%20View/CaSSIS=instrument

@AustinSanders AustinSanders self-assigned this Dec 9, 2021
@jlaura jlaura moved this from Todo to In Progress in ASC Software Support Dec 14, 2021
@jessemapel
Copy link
Contributor

Copying over here because I realize I sent this in a private chat:

Look at the code in BundleObservationVector and BundleObservation before #4537

Specifically, BundleObservationVector::addNew and where BundleObservation::initializeExteriorOrientation are being called

@jessemapel
Copy link
Contributor

This has also been encountered with JunoCam imagery, which is very similar to CaSSIS.

https://astrodiscuss.usgs.gov/t/should-junocam2isis-fullccd-yes-produced-single-band-cubes/797

@AustinSanders AustinSanders removed their assignment Jan 21, 2022
@AustinSanders AustinSanders added this to the 7.0.1 milestone Jan 21, 2022
@jlaura jlaura moved this from In Progress to Todo in ASC Software Support Jan 27, 2022
@acpaquette acpaquette self-assigned this Feb 4, 2022
@jlaura jlaura assigned jessemapel and unassigned acpaquette Feb 9, 2022
@jlaura jlaura moved this from Todo to In Progress in ASC Software Support Feb 9, 2022
@jessemapel jessemapel moved this from In Progress to Mergable in ASC Software Support Feb 11, 2022
Repository owner moved this from Mergable to Done in ASC Software Support Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Missions Issues which are a priority for missions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants