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
199 stars 168 forks source link

Jigsaw parameter spksolvedegree and spkdegree not functioning #3554

Closed AaronBoyd closed 2 months ago

AaronBoyd commented 4 years ago

ISIS version(s) affected: 3.5.1 to current (3.9.1)

Description
The spksolvedegree option appears to mis-calculating if it can fit a spline to the data. Jigsaw breaks before trying to fit the data (i.e. it says it cannot fit a 4th degree polynomial to 200+ data points. Max spksolvedegree is 2

The spkdegree option appears to mis-calculating if it can fit a spline to the data. Jigsaw breaks before trying to fit the data (i.e. it says it cannot fit a 4th degree polynomial to 200+ data points. Max spkdegree is 1

CURRENT PARAMETER CONSTRAINTS: SPKSOLVEDEGREE can only be <=2 SPKDEGREE must be < 2

How to reproduce

jigsaw fromlist=level1cubes.lis cnet=ground_pts.net onet=jigsaw_final.net observations=yes radius=no update=no outlier_rejection=yes rejection_multiplier=3.0 errorpropagation=no sigma0=1.0e-10 maxits=50 ckdegree=100 cksolvedegree=0 camsolve=all twist=Yes overexisting=true spsolve=all solvetargetbody=false spacecraft_position_sigma=0 camera_angles_sigma=0.01 file_prefix=mask_testing bundleout_txt=yes imagescsv=no output_csv=no residuals_csv=yes overhermite=yes spkdegree=2 spksolvedegree=1

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

jigsaw fromlist=level1cubes.lis cnet=ground_pts.net onet=jigsaw_final.net observations=yes radius=no update=no outlier_rejection=yes rejection_multiplier=3.0 errorpropagation=no sigma0=1.0e-10 maxits=50 ckdegree=100 cksolvedegree=0 camsolve=all twist=Yes overexisting=true spsolve=all solvetargetbody=false spacecraft_position_sigma=0 camera_angles_sigma=0.01 file_prefix=mask_testing bundleout_txt=yes imagescsv=no output_csv=no residuals_csv=yes overhermite=yes spkdegree=3 spksolvedegree=2

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

Possible Solution

Additional context

lwellerastro commented 4 years ago

Hi @AaronBoyd, this caught my eye in your jigsaw command:

ckdegree=100 cksolvedegree=0

I am not going to try and explain the ck/spk degree options as I have used them minimally and under the guidance of a photogrammatrist, but I recognize that your value of 100 is unusual. We have applied these settings only for very long line scan images (nearly pole to pole) or radar images. In both cases we have not exceeded 3 (maybe 4 for radar tests) for any of the degree settings.

Another thing that caught my eye is:

spacecraft_position_sigma=0

This implies there is no uncertainty on the spacecraft position. If that is the case, then do not solve for it, otherwise you should use a value greater than zero and probably something in the hundreds of meters range or kilometers.

Also, if you might want to add uncertainties (sigmas) to all parameters you are solving for (camera_angular_velocity_sigma, camera_angular_acceleration_sigma as well as the appropriate parameters for spacecraft).

What data are you attempting to apply this to?

jessemapel commented 4 years ago

This may be an issue with observation mode. Can you try this with observation mode disabled? Can you also enable the full stack trace in your IsisPreferences file:

########################################################
# Customize how errors are reported
#
# FileLine = On | Off
# Format = Standard | Pvl
# StackTrace = On | Off
########################################################

Group = ErrorFacility
  FileLine = Off
  Format = Standard
  StackTrace = On
EndGroup
jessemapel commented 4 years ago

a couple other comments:

First, this is a rather complex combination of settings which may be exposing some conflicts that we didn't anticipate.

Second, using overhermite with spkdegree is redundant (same with overexisting and ckdegree). What spkdegree does is set the degree of the initial polynomial that is fit over the data is set to. Then, spksolvedegree sets the degree of the polynomial that is solved for. If the spksolvedegree is greater than the spkdegree, then 0 coefficients are used for the initial higher degree terms. Conversely, if the spksolvedegree is less than the spkdegree, then the higher degree coefficients are truncated. With overhermite, though, the initial polynomial has all 0 coefficients. So, no matter what your spkdegree is set to, your initial polynomial will always end up with spksolvedegree+1 0 coefficients. overexisting and cksolvedegree work the same way except for the sensor pointing. Here's a concrete explanation:

overhermite=no spkdegree=1 spksolvedegree=2

  1. A first degree polynomial is fit over the position. Coefficients are now 0.3, 2.1 (i.e. f(t) = 0.3 + 2.1t).
  2. Polynomial degree is adjusted to second degree. Coefficients are now 0.3, 2.1, 0.0 (i.e. f(t) = 0.3 + 2.1t + 0.0t^2).
  3. Bundle Adjust runs. Coefficients are now 0.35, 2.2, 0.004 (i.e. f(t) = 0.35 + 2.2t + 0.004t^2).

overhermite=no spkdegree=2 spksolvedegree=1

  1. A second degree polynomial is fit over the position. Coefficients are now 0.3, 2.0, 0.001 (i.e. f(t) = 0.3 + 2.0t + 0.001t^2).
  2. Polynomial degree is adjusted to first degree. Coefficients are now 0.3, 2.0 (i.e. f(t) = 0.3 + 2.0t).
  3. Bundle Adjust runs. Coefficients are now 0.35, 2.3 (i.e. f(t) = 0.35 + 2.3t).

overhermite=yes spkdegree=1 spksolvedegree=2

  1. A first degree zero polynomial is created. Coefficients are now 0.0, 0.0 (i.e. f(t) = 0.0 + 0.0t).
  2. Polynomial degree is adjusted to second degree. Coefficients are now 0.0, 0.0, 0.0 (i.e. f(t) = 0.0 + 0.0t + 0.0t^2).
  3. Bundle Adjust runs. Coefficients are now 0.05, 1.2, 0.001 (i.e. f(t) = 0.05 + 1.2t + 0.001t^2).

overhermite=yes spkdegree=2 spksolvedegree=1

  1. A second degree zero polynomial is created. Coefficients are now 0.0, 0.0, 0.0 (i.e. f(t) = 0.0 + 0.0t + 0.0t^2).
  2. Polynomial degree is adjusted to first degree. Coefficients are now 0.0, 0.0 (i.e. f(t) = 0.0 + 0.0t).
  3. Bundle Adjust runs. Coefficients are now 0.02, 0.2 (i.e. f(t) = 0.02 + 0.2t).
jlaura commented 4 years ago

@AaronBoyd We need additional information in order to be able to address this ticket.

jlaura commented 4 years ago

Jigsaw parameter spksolvedegree and spkdegree not functioning

ascbot commented 4 years ago

I am a bot that cleans up old issues that do not have activity.

This issue has not received feedback in the last six months. I am going to add the inactive label to this issue. If this is still a pertinent issue, please add a comment or add an emoji to an existing comment.

I will post again in five months with another reminder and will close this issue on it's birthday unless it has some activity.

AaronBoyd commented 3 years ago

Thank you for the testing suggestions, we will be testing more extensively coming up this , but we have not done this yet as we have a few work-arounds.

github-actions[bot] commented 3 years ago

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.

victoronline commented 3 years ago

Working on getting needed information to proceed. Will update issue with information.

github-actions[bot] commented 2 years ago

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.

acpaquette commented 2 years ago

Still active

github-actions[bot] commented 11 months ago

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.