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

Calling spiceinit twice in a row fails #4933

Closed
oleg-alexandrov opened this issue Apr 28, 2022 · 9 comments
Closed

Calling spiceinit twice in a row fails #4933

oleg-alexandrov opened this issue Apr 28, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@oleg-alexandrov
Copy link
Contributor

ISIS version(s) affected: 6.0.0

Description

Calling spiceinit twice in a row fails.

How to reproduce

I have ISIS 6.0.0, then I set ISISDATA and ISISROOT correctly, and fetched latest ISIS data.

Run:

wget https://pds-geosciences.wustl.edu/lro/lro-l-mrflro-4-cdr-v1/lromrf_0002/data/sar/03800_03899/level1/lsz_03821_1cd_xku_16n196_v1.img
wget https://pds-geosciences.wustl.edu/lro/lro-l-mrflro-4-cdr-v1/lromrf_0002/data/sar/03800_03899/level1/lsz_03821_1cd_xku_16n196_v1.lbl

mrf2isis from = lsz_03821_1cd_xku_16n196_v1.lbl to = lsz_03821_1cd_xku_16n196_v1.cub

First application of spiceinit:

spiceinit from = lsz_03821_1cd_xku_16n196_v1.cub

Group = Kernels
NaifFrameCode = -85700
LeapSecond = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape = ($base/kernels/pck/pck00009.tpc,
$lro/kernels/pck/moon_080317.tf,
$lro/kernels/pck/moon_assoc_me.tf)
TargetPosition = ($lro/kernels/tspk/moon_pa_de421_1900-2050.bpc,
$lro/kernels/tspk/de421.bsp)
InstrumentPointing = ($lro/kernels/ck/moc42r_2010090_2010121_v03.bc,
$lro/kernels/fk/lro_frames_2014049_v01.tf)
Instrument = Null
SpacecraftClock = $lro/kernels/sclk/lro_clkcor_2022117_v00.tsc
InstrumentPosition = $lro/kernels/spk/fdf29r_2010091_2010121_v01.bsp
InstrumentAddendum = $lro/kernels/iak/mrflroAddendum002.ti
ShapeModel = $base/dems/ldem_128ppd_Mar2011_clon180_radius_p-
ad.cub
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion = 1
Source = isis
End_Group

Second application of spiceinit:

spiceinit from = lsz_03821_1cd_xku_16n196_v1.cub

Group = Kernels
NaifFrameCode = -85700
LeapSecond = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape = ($base/kernels/pck/pck00009.tpc,
$lro/kernels/pck/moon_080317.tf,
$lro/kernels/pck/moon_assoc_me.tf)
TargetPosition = ($lro/kernels/tspk/moon_pa_de421_1900-2050.bpc,
$lro/kernels/tspk/de421.bsp)
InstrumentPointing = ($lro/kernels/ck/moc42r_2010090_2010121_v03.bc,
$lro/kernels/fk/lro_frames_2014049_v01.tf)
Instrument = Null
SpacecraftClock = $lro/kernels/sclk/lro_clkcor_2022117_v00.tsc
InstrumentPosition = $lro/kernels/spk/fdf29r_2010091_2010121_v01.bsp
InstrumentAddendum = $lro/kernels/iak/mrflroAddendum002.ti
ShapeModel = $base/dems/ldem_128ppd_Mar2011_clon180_radius_p-
ad.cub
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion = 1
Error = "The camera is requesting spice data
[BODY301_RADII] that was not attached, please
re-run spiceinit"
End_Group
ERROR Unable to initialize camera model.

@oleg-alexandrov oleg-alexandrov added the bug Something isn't working label Apr 28, 2022
@ladoramkershner
Copy link
Contributor

I am able to spiceinit when I try and reproduce.

> spiceinit from= lsz_03821_1cd_xku_16n196_v1.cub 

Group = Kernels
  NaifFrameCode             = -85700
  LeapSecond                = $base/kernels/lsk/naif0012.tls
  TargetAttitudeShape       = ($base/kernels/pck/pck00009.tpc,
                               $lro/kernels/pck/moon_080317.tf,
                               $lro/kernels/pck/moon_assoc_me.tf)
  TargetPosition            = ($lro/kernels/tspk/moon_pa_de421_1900-2050.bpc,
                               $lro/kernels/tspk/de421.bsp)
  InstrumentPointing        = ($lro/kernels/ck/moc42r_2010090_2010121_v03.bc,
                               $lro/kernels/fk/lro_frames_2014049_v01.tf)
  Instrument                = Null
  SpacecraftClock           = $lro/kernels/sclk/lro_clkcor_2022124_v00.tsc
  InstrumentPosition        = $lro/kernels/spk/fdf29r_2010091_2010121_v01.bsp
  InstrumentAddendum        = $lro/kernels/iak/mrflroAddendum002.ti
  ShapeModel                = $base/dems/ldem_128ppd_Mar2011_clon180_radius_p-
                              ad.cub
  InstrumentPositionQuality = Reconstructed
  InstrumentPointingQuality = Reconstructed
  CameraVersion             = 1
  Source                    = isis
End_Group

The only difference I am seeing in our outputs is our SpacecraftClock. I have $lro/kernels/sclk/lro_clkcor_2022124_v00.tsc, which I presume is a newer version of what your spiceinit is listing $lro/kernels/sclk/lro_clkcor_2022117_v00.tsc. I am not sure if this is causing the issue or not. I am just trying to provide more information.

I am running this on one of the Astro VMs, so I am using a shared / maintained data area. I am going to try and replicate on my local matching using a run of the mill partial download of the LRO data area.

@oleg-alexandrov
Copy link
Contributor Author

Is this after doing spiceinit once or twice?

@ladoramkershner
Copy link
Contributor

The output is repeated after a second run of spiceinit

@lwellerastro
Copy link
Contributor

I can reproduce the error as stated by @oleg-alexandrov on astrovm5 using isis6.0.0 by doing the following:

mrf2isis from=lsz_03821_1cd_xku_16n196_v1.lbl to=lsz_03821_1cd_xku_16n196_v1.cub
spiceinit from=lsz_03821_1cd_xku_16n196_v1.cub
spiceinit from=lsz_03821_1cd_xku_16n196_v1.cub

   Group = Kernels
    NaifFrameCode             = -85700
    LeapSecond                = $base/kernels/lsk/naif0012.tls
    TargetAttitudeShape       = ($base/kernels/pck/pck00009.tpc,
                                 $lro/kernels/pck/moon_080317.tf,
                                 $lro/kernels/pck/moon_assoc_me.tf)
    TargetPosition            = ($lro/kernels/tspk/moon_pa_de421_1900-2050.bp-
                                 c, $lro/kernels/tspk/de421.bsp)
    InstrumentPointing        = ($lro/kernels/ck/moc42r_2010090_2010121_v03.b-
                                 c, $lro/kernels/fk/lro_frames_2014049_v01.tf)
    Instrument                = Null
    SpacecraftClock           = $lro/kernels/sclk/lro_clkcor_2022124_v00.tsc
    InstrumentPosition        = $lro/kernels/spk/fdf29r_2010091_2010121_v01.b-
                                sp
    InstrumentAddendum        = $lro/kernels/iak/mrflroAddendum002.ti
    ShapeModel                = $base/dems/ldem_128ppd_Mar2011_clon180_radius-
                                _pad.cub
    InstrumentPositionQuality = Reconstructed
    InstrumentPointingQuality = Reconstructed
    CameraVersion             = 1
    Error                     = "The camera is requesting spice data
                                 [BODY301_RADII] that was not attached, please
                                 re-run spiceinit"
  End_Group

  Group = Error
    Program = spiceinit
    Code    = 1
    Message = "Unable to initialize camera model"
    File    = spiceinit.cpp
    Line    = 262
  End_Group

Let me know if further information is needed.

@AustinSanders
Copy link
Contributor

I was able to reproduce this on astrovm5 with isis6.0.0. I copied the environment and configured ale to produce verbose output.

On the first pass, the LroMiniRfIsisLabelNaifSpiceDriver (in ALE) fails because the kernels group is missing the CameraVersion. Spiceinit seems to populate this keyword on the first pass, so the second pass results in the use of LroMiniRfIsisLabelNaifSpiceDriver. We might need to modify the naif_keywords function to explicitly copy over the radii info?

@ladoramkershner
Copy link
Contributor

I had an IsisPreference file in my home which overrode the shared IsisPreference and did not contain CSM information, so my ALE ingestion consistently failed and ISIS can ingest this all day long. I think this indicates an issue in the ALE drivers for this (as @AustinSanders indicated) but now that I can replicate I will look more into it!

@ladoramkershner ladoramkershner self-assigned this May 16, 2022
@ladoramkershner
Copy link
Contributor

Both runs of spiceinit on the MiniRF data are failing.
The first failure happens in ALE because the original label does not contain ISIS Camera Version information. This causes ALE to fail and it passes to ISIS to handle the spice attachment. I do not think this should be the expected behavior because not having an ISIS camera version reasonable thing for a none ISIS label to contain, so I opened tickets here and here

The second failure is being caused in the formatting stage. ALE is able to initiate the driver, but when it goes to format, since it is not a LineScanner, Framer, or PushFrame it cannot get into this area of the formatter code to set the naif keywords on line 147 (which contains the body radii values).

@ladoramkershner
Copy link
Contributor

I would like to talk to someone with a better "big picture perspective" of the ALE architecture before I implement a fix, but I just want to give an update!

@AustinSanders
Copy link
Contributor

Closed by #473

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

4 participants