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 Error on JUNOCAM image #5724

Open
AlexGHayes opened this issue Feb 6, 2025 · 5 comments
Open

SPICEINIT Error on JUNOCAM image #5724

AlexGHayes opened this issue Feb 6, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@AlexGHayes
Copy link

ISIS version(s) affected

isis 8.1.0 np126_0 usgs-astrogeology

Description

Receiving an error on using spiceinit that says "No instrument position available", ERROR Unable to intialize camera model.

Here is the SPICEINIT output:

(isis) Mac-Pro:JUno hayes$ spiceinit from=JNCE_2023364_57C00030_V01_GREEN_0005.cub attach=true

Group = Kernels
NaifFrameCode = -61500
LeapSecond = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape = $juno/kernels/pck/pck00010.tpc
TargetPosition = ($juno/kernels/tspk/de440s.bsp,
$juno/kernels/tspk/juno_struct_v04.bsp)
InstrumentPointing = ($juno/kernels/ck/juno_sc_rec_231224_231230_v01-
.bc, $juno/kernels/fk/juno_v12.tf)
Instrument = $juno/kernels/ik/juno_junocam_v03.ti
SpacecraftClock = $juno/kernels/sclk/jno_sclkscet_00128.tsc
InstrumentPosition = Null
InstrumentAddendum = $juno/kernels/iak/junoAddendum005.ti
ShapeModel = Null
InstrumentPositionQuality = Unknown
InstrumentPointingQuality = Reconstructed
CameraVersion = 1
Error = "No instrument position available"
End_Group
This function(PvlObject::addLogGroup) will be depreciated in ISIS3 v9.0 in favor of Application::appendLogGroup
ERROR Unable to initialize camera model.

How to reproduce
Commands:

conda activate isis
downloadIsisData juno $ISISDATA
junocam2isis from=JNCE_2023364_57C00030_V01.LBL to=JNCE_2023364_57C00030_V01.cub
spiceinit from=JNCE_2023364_57C00030_V01_GREEN_0005.cub attach=true

Framelets 5,6,7 are images of Io with Loki Patera in the frame. These images have been processed by previous authors using the above commands, presumable without error.

Possible Solution
Are their instrument pointing kernels missing from the downloaded repository?

Additional context
The specific image in question has been used to generate mosaic products in ISIS by collaborators who claim to have not run into this error.

Any help is appreciated!

Thanks!

@AlexGHayes AlexGHayes added the bug Something isn't working label Feb 6, 2025
@Kelvinrr
Copy link
Collaborator

Kelvinrr commented Feb 6, 2025

Looking at the steps to reproduce, did you also download the base data? downloadIsisData base $ISISDATA

@volcanopele
Copy link

Hi Alex, I maintain the kernel database on my end for Juno manually as IIRC for Juno ISIS pulls the PDS-archived kernels, not the operational kernels and I am typically needing to process the latest encounter data. So I update my kernels manually from https://naif.jpl.nasa.gov/pub/naif/JUNO/kernels/ after each Io encounter.

From looking at your error message, you seem to be missing the spacecraft position kernel for PJ57. The reconstructed spk kernel you need is spk_rec_231212_240118_240119.bsp. I'm not on the ISIS dev team so I can't help if that's not pulled when running downloadIsisData juno $ISISDATA but this can be manually added by putting it in $ISISDATA/juno/kernels/spk and changing the file name from spk_rec_231212_240118_240119.bsp to juno_rec_231212_240118_240119.bsp. Then you can update the kernel database using:

kerneldbgen to='$ISISDATA/juno/kernels/spk/kernels.????.db' \
type=SPK predictdir=$ISISDATA/juno/kernels/spk \
predictfilter='juno_pre_??????_??????_??????_jm????.bsp' \
recondir='$ISISDATA/juno/kernels/spk' \
reconfilter='juno_rec_??????_??????_??????.bsp;' \
lsk=$ISISDATA/juno/kernels/lsk/naif0012.tls'

@Madeline-Pettine
Copy link

Hi Alex, I maintain the kernel database on my end for Juno manually as IIRC for Juno ISIS pulls the PDS-archived kernels, not the operational kernels and I am typically needing to process the latest encounter data. So I update my kernels manually from https://naif.jpl.nasa.gov/pub/naif/JUNO/kernels/ after each Io encounter.

From looking at your error message, you seem to be missing the spacecraft position kernel for PJ57. The reconstructed spk kernel you need is spk_rec_231212_240118_240119.bsp. I'm not on the ISIS dev team so I can't help if that's not pulled when running downloadIsisData juno $ISISDATA but this can be manually added by putting it in $ISISDATA/juno/kernels/spk and changing the file name from spk_rec_231212_240118_240119.bsp to juno_rec_231212_240118_240119.bsp. Then you can update the kernel database using:

kerneldbgen to='$ISISDATA/juno/kernels/spk/kernels.????.db' \
type=SPK predictdir=$ISISDATA/juno/kernels/spk \
predictfilter='juno_pre_??????_??????_??????_jm????.bsp' \
recondir='$ISISDATA/juno/kernels/spk' \
reconfilter='juno_rec_??????_??????_??????.bsp;' \
lsk=$ISISDATA/juno/kernels/lsk/naif0012.tls'

Hi, Jason! This comment was really helpful for me, this seemed to be the issue and spiceinit is now working great. Thank you very much for figuring out the above issue!

I was hoping you could help with a related error that we're running into, an issue with cam2map-- just trying to produce a default equirectangular map with one of the .cub files that's been initialized, in this example JNCE_2023364_57C00031_V01_RED_0005.cub. It gives an error about "SunPosition," which from my poking around seems to indicate another kernel issue, but I'm not sure how to resolve it. Any recommendations?

Here's the line we're running and the error code:

cam2map from=JNCE_2023364_57C00031_V01_RED_0005.cub to=JNCE_2023364_57C00031_V01_RED_0005.cub
ERROR Unable to initialize camera model in Camera Factory.
I/O ERROR Unable to open Table [SunPosition] in file [JNCE_2023364_57C00031_V01_RED_0005.cub].
I/O ERROR Unable to read Table [SunPosition].
PROGRAMMER ERROR Unable to find Table [SunPosition].

@Kelvinrr
Copy link
Collaborator

@volcanopele Files are being downloaded from NAIF (https://naif.jpl.nasa.gov/pub/naif/JUNO/kernels/ ) and databases should be being updated, we can check if and why some files are missing. If there is some source we should add to the configuration

@volcanopele
Copy link

Hi Maddy!

Okay looking again at the spiceinit message Alex posted, it looks like you might be missing the target position kernel.

from spiceinit above:

TargetPosition = ($juno/kernels/tspk/de440s.bsp, $juno/kernels/tspk/juno_struct_v04.bsp)

The first one, de440s.bsp, covers the position of the sun, the solar system barycenter, the Earth, and the barycenters of the various planetary systems in the solar system. The second is a kernel covering the position of various components onboard Juno like the solar arrays and the high gain antenna, with respect to Juno.

You seem to be lacking the kernel defining the position of Io (and Jupiter and the other Galilean satellites). While the Juno spk kernels have that info, maybe ISIS doesn't use that information? Regardless, this can be fixed by downloading jup380s.bsp or jup388s.bsp from https://naif.jpl.nasa.gov/pub/naif/JUNO/kernels/ and placing it in $ISISDATA/juno/kernels/tspk. I would edit the file name to drop the "s" (so jup388s.bsp to jup388.bsp). The kernel database file in $ISISDATA/juno/kernels/tspk should then allow spiceinit to pick it up without a database update.

Then it is just a matter of rerunning spiceinit on your JunoCam framelets and trying cam2map again.

The sclk file also seems old. Not sure if that makes any difference... jno_sclkscet_00128.tsc is from March 2022. Latest file is 184.

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
Status: Todo
Development

No branches or pull requests

4 participants