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

Spiceinit exits on Error "Unable to initialize camera model" on MRO CRISM TRDR IR sensor data, but works for the VNIR sensor. #5730

Open
afrigeri opened this issue Feb 14, 2025 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@afrigeri
Copy link
Contributor

afrigeri commented Feb 14, 2025

ISIS version(s) affected: 8.0.3

Description
While discussing #5728 I've found that spiceinit works correctly on CRISM Targeted Reduced Data Record (TRDR) VNIR sensor (S code) cube but exits and returns error on the IR (L code) sensor file.

How to reproduce

  1. get the CRISM IR sensor PDS data FRT0001C558_07_IF165L_TRR3
  2. get the CRISM VNIR sensor PDS data FRT0001C558_07_IF165S_TRR3
  3. crism2isis both
  4. spiceinit from=frt0001c558_07_if165s_trr3.cub gets through and no errors.
  5. spiceinit from=frt0001c558_07_if165l_trr3.cub exits with **ERROR** Unable to initialize camera model. and returns:
Group = Kernels
  NaifIkCode                = -74018
  LeapSecond                = $base/kernels/lsk/naif0012.tls
  TargetAttitudeShape       = $mro/kernels/pck/pck00008.tpc
  TargetPosition            = ($base/kernels/spk/de430.bsp,
                               $base/kernels/spk/mar097.bsp)
  InstrumentPointing        = ($mro/kernels/ck/mro_crm_psp_101201_101231.bc,
                               $mro/kernels/ck/mro_sc_psp_101207_101213.bc,
                               $mro/kernels/fk/mro_v16.tf)
  Instrument                = $mro/kernels/ik/mro_crism_v10.ti
  SpacecraftClock           = $mro/kernels/sclk/MRO_SCLKSCET.00113.65536.tsc
  InstrumentPosition        = $mro/kernels/spk/mro_psp17_ssd_mro110c.bsp
  InstrumentAddendum        = $mro/kernels/iak/crismAddendum001.ti
  ShapeModel                = $base/dems/molaMarsPlanetaryRadius0005.cub
  InstrumentPositionQuality = Reconstructed
  InstrumentPointingQuality = Reconstructed
  CameraVersion             = 1
  Error                     = "The camera is requesting spice data
                               [INS-74018_FOCAL_LENGTH] that was not attached,
                               please re-run spiceinit"
End_Group
**ERROR** Unable to initialize camera model.

the error persists also after re-running spiceinit as reported in the error message.

Possible Solution

Somehow the INS-74018_FOCAL_LENGTH key/value (which is available in $mro/kernels/iak/crismAddendum001.ti) is not being attached into the IR channel cube (L sensor, ID 74018) by spiceinit.

For the VNIR case (S sensor, ID 74017), the INS-74017_FOCAL_LENGTH is read and attached to the ISIS cube by spiceinit:

Object = NaifKeywords
...
INS-74017_FOCAL_LENGTH                       = 441

Additional context

I have checked and verified the same behavior on the frt0000810d_07_if166[s/l]_trr3 cubes, did not do other tests yet.

Did not check previous data versions (< 3)

@afrigeri afrigeri added the bug Something isn't working label Feb 14, 2025
@emresezer
Copy link

I get this error while I used CRISM IR sensor PDS data too:

Group = Kernels
NaifIkCode                = -74018
LeapSecond                = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape       = $mro/kernels/pck/pck00008.tpc
TargetPosition            = Null
InstrumentPointing        = ($mro/kernels/ck/mro_crm_psp_101201_101231.bc,
                             $mro/kernels/ck/mro_sc_psp_101207_101213.bc,
                             $mro/kernels/fk/mro_v16.tf)
Instrument                = $mro/kernels/ik/mro_crism_v10.ti
SpacecraftClock           = $mro/kernels/sclk/MRO_SCLKSCET.00113.65536.tsc
InstrumentPosition        = $mro/kernels/spk/mro_psp17_ssd_mro110c.bsp
InstrumentAddendum        = $mro/kernels/iak/crismAddendum001.ti
ShapeModel                = $base/dems/molaMarsPlanetaryRadius0005.cub
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion             = 1
Error                     = "Array subscript [0] is out of array boundsfor
                             Keyword [TargetPosition]"
End_Group
This function(PvlObject::addLogGroup) will be depreciated in ISIS3 v9.0 in favor of Application::appendLogGroup
**ERROR** Unable to initialize camera model.

"Array subscript [0] is out of array boundsfor Keyword [TargetPosition]" , what could this be related to? Any ideas? Is it due to the same problem?

@afrigeri
Copy link
Contributor Author

@emresezer that the same issue reported in #5728, in your case, spiceinit Error refers to Targetposition = Null where it should contain pointers to one or more spk spice kernels (like $base/kernels/spk/de430.bsp, $base/kernels/spk/mar097.bsp )

@acpaquette
Copy link
Collaborator

Hi @afrigeri, I found this issue as well. The problem is another library, ALE. I can get a change in and get a new build out the door

@acpaquette acpaquette self-assigned this Mar 3, 2025
@acpaquette
Copy link
Collaborator

Fix is up and just waiting on tests to come back.

DOI-USGS/ale#634

@acpaquette
Copy link
Collaborator

@afrigeri You should be able to run the following while your ISIS 8.X.X environment is active:

mamba update ale

And that should fix the problem with the CRISM TRDR data

@afrigeri
Copy link
Contributor Author

afrigeri commented Mar 4, 2025

I confirm that now also CRISM TRDR IR sensor data gets through spiceinit without errors:

spiceinit from=frt0001c558_07_if165l_trr3.cub

Group = Kernels
  NaifIkCode                = -74018
  LeapSecond                = $base/kernels/lsk/naif0012.tls
  TargetAttitudeShape       = $mro/kernels/pck/pck00008.tpc
  TargetPosition            = ($base/kernels/spk/de430.bsp,
                               $base/kernels/spk/mar097.bsp)
  InstrumentPointing        = ($mro/kernels/ck/mro_crm_psp_101201_101231.bc,
                               $mro/kernels/ck/mro_sc_psp_101207_101213.bc,
                               $mro/kernels/fk/mro_v16.tf)
  Instrument                = $mro/kernels/ik/mro_crism_v10.ti
  SpacecraftClock           = $mro/kernels/sclk/MRO_SCLKSCET.00113.65536.tsc
  InstrumentPosition        = $mro/kernels/spk/mro_psp17_ssd_mro110c.bsp
  InstrumentAddendum        = $mro/kernels/iak/crismAddendum001.ti
  ShapeModel                = $base/dems/molaMarsPlanetaryRadius0005.cub
  InstrumentPositionQuality = Reconstructed
  InstrumentPointingQuality = Reconstructed
  CameraVersion             = 1
  Source                    = ale
End_Group
This function(PvlObject::addLogGroup) will be depreciated in ISIS3 v9.0 in favor of Application::appendLogGroup

Thanks, @acpaquette + ISIS dev team!

@acpaquette
Copy link
Collaborator

@afrigeri Can we close this issue and see if more progress has been made on #5728?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants