-
Notifications
You must be signed in to change notification settings - Fork 171
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
NAIF errors after initializing with ck/spk-writer kernels #4942
Comments
My first guess is an SPK issue as SURFPT is the routine that intersects a position and look vector with an ellipsoid. it is somehow being passed a 0 position vector. I'll do some more poking around. |
There were no errors after applying it to a copied version of the jigsaw input image. Errors on some input but not others is what's kind of concerning me, but maybe that's a red herring. Update: I ran the same tests using only the ckwriter generated kernel and I no longer get the NAIF error. So there is something going on with the spk kernel and perhaps I should create a version using the default type=13. That being said, the geometry information after running spice using the ck kernel on various versions of the same image (freshly ingested, copy of jigsaw input image, copy of jigsaw updated image) is not the same across the board. The ingested image and the copy of the jigsaw updated image produce the same geometry, but the copy of the jigsaw input image is different and has source=ale on the labels whereas the other two do not (also seeing FrameTypeCode=2 in BodyRotation table for ingested image and the copy of the jigsaw updated image, but FrameTypeCode=3 in the ale image). Is this a different problem? Note: the geometry output among the various spiced images produces different results even if I let spice default. The ingested image and the copy of the jigsaw updated image produce the same geometry, but the copy of the jigsaw input image is different and has source=ale on the labels whereas the other two do not. I don't understand. |
I created a type=13 spk kernel for my Titan network of images and that too is generating NAIF errors when applied to newly ingested images. |
I created ck and spk kernels for a small set of updated Kaguya TC images and performed tests similar to Titan. I encountered no issues using the new kernels on ingested images or copies of the pre-jigsaw images. In both cases, the resulting images matched the jigsaw updated images that the kernels were based upon. I was not able to create a single ck or spk kernel for my test images because the times the for the Kaguya images overlap (totally unexpected, but it is a widespread thing), so each image had its own set of kernels. Not sure that matters, but thought I'd mention it. Additionally, I noted that every image involved with the testing always maintained Source=isis unlike the Titan data which mysteriously switched to ale in one case. Again, not sure that has anything to do with the Titan issue, but thought I would mention it anyway. Not sure when to expect isis vs ale honestly. |
I realize there is lot to my messages above so I thought it might help to boil things down to a single image case. I created a ck and spk kernel for one of my updated images, then ingested a fresh version of the image and spiced applying the newly created image kernels. This is enough to create the noted errors when programs like qview or campt are used. I did all of this under isis7.0.0. The input/output data can be found under my work users area under Isis3Tests/Spiceinit/WriterKernels/SingleImage. I created both a camera and spacecraft kernel for the image, but as @jessemapel pointed out in reply, it appears the spacecraft kernel is generating the errors. |
This is what I have figured out so far. When running spiceinit the computed state through spkez_c results in nan positions. The input variables for spkez_c are:
with the following results:
When running spiceinit without the spkwriter kernel: The inputs for spkez_c were:
with the following results:
The only difference I see between the two input variables is abcorr but my understanding is that it is always set to NONE when using a spkwriter kernel. Since spkez_c is calculating the states using SPK files that have been loaded through furnsh_c, my guess is the problem lies in the kernel calculation itself. I am not sure why nan results are not causing any SPICE errors. I am also not sure how I could even troubleshoot this since I cannot see what spkez_c is doing on the backend. @jessemapel Do you have any suggestions for solving this or have seen spkez_c return nan results and know the reason? |
This is really strange. The only things I can think of are:
|
I reached out to NAIF and they ran @lwellerastro could you direct me to the images used to create the Titan_CISS_2022_spk.bsp kernel? |
Hi @amystamile-usgs the image list for the writer commands below can be found under /work/projects/titan/lweller/All_CB3_MT1/FindFeatures/
Notice that the images in the list points to an area on /scratch that houses the updated images. There are nearly 7000 images in the input list and each of the commands above took hours to run. That data have had to undergo a lot of reprocessing in order to use them including applying intermediate improved geometry by way of deltack. Here's the very condensed version of processing:
Please let me know if you have additional questions or need to have access to any of the other stages of processing. |
Hi @amystamile-usgs, this can all be reproduced without working with the kernel that was built upon 7000 images. It can be reproduced with a single CISS image. There is an example under my work users area Isis3Tests/Spiceinit/WriterKernels/SingleImage/ImageKernel/. See proc.scr for the simple processing details, but in a nutshell
Although this is not an identical error as produced by the larger kernel, this seems relevant to me and might help unearth the problem that seems to be coming from either spiceinit, spkwriter or how isis is intersecting bodies. Note that there is no shape model for Titan, only the ellipsoid information is loaded when spiced. I hope this helps some! |
@amystamile-usgs and I looked into this a bit more today. The problem, in the single image case, is that spkwriter is writing the position of Cassini relative to Titan (NAIF ID 606) but labeling it in the kernel as the position relative to the Saturn Barycenter (NAIF ID 6). There's a small bit of code in all of the Cassini camera models that tells spkwriter to do this (added in 31cda9f). We aren't 100% certain why this is done, but it appears to be an attempt to match the format of the original Cassini kernels which contain the position of Cassini relative to the Saturn Barycenter. There are two apparent fixes here:
The first option will be easier, but will result in smithed SPKs that are a slightly different format from the original kernel data set. The second option will be harder, but it will result in smithed SPKs that are the same format as the original kernel data set and they will need to be used with that same original kernel data set or we could encounter problems like #4922. So, the question is, @lwellerastro what do you want your smithed SPKs to look like? |
Additional question for @lwellerastro and possibly @blandoplanet: Have you used spkwriter to create smithed kernels of any other moons of Saturn with Cassini data? I'm surprised we didn't encounter this issue with Enceladus kernels. |
@jessemapel, I haven't a clue. Seems like option 2 makes more sense, but Brent will have to chime in since he understands the implications better. He is getting notifications for this post, but I will email him to bring this to his immediate attention. To be clear about some things (for everyone's benefit), the single image case image would have picked up the most recent/up to date (and hopefully last) Cassini spacecraft kernel that is now breaking Enceladus. I fully intend on reprocessing my Titan images to pick up this kernel to hopefully avoid the Enceladus kernel problem. The 7000 image kernels I created earlier this year had the previous version of the spk kernel. Though I don't think it matters either way since it seems more to do with kernels written relative to Saturn vs Titan, but I thought I'd mention it anyway.
I have created kernels in ISIS for Enceladus and now Titan. It's possible Tammy and/or others have worked with other bodies, but I'm not sure. Edit - I believe we only created a camera kernel for Enceladus and provided an updated tpc kernel. We are solving for spacecraft for Titan because we have ground points to RADAR mosaics. |
@KrisBecker I don't believe that is the root of this problem. I tried running spiceinit with the EXTRA parameter instead of the SPK parameter and we still see the same results. This is due to spkwriter writing the state positions based on the center body of Titan but also writing that the center body is Saturn Barycenter (due to the camera model hardcoding this center body). We speculate that the hardcoded center body is to match the original Cassini kernels. Therefore the spkwriter kernels are simply incorrect positions based on the center body. |
I can confirm @amystamile-usgs results - I still get intersection errors on the most simplest case.
campt produces the following error whether I include the ck kernel or not in the above command: "Requested position does not project in camera model; no surface intersection" |
I agree that the problem here is in spkwriter and not spiceinit. However, if we go with solution 2, we should follow Kris's recommendation of passing the kernels as extra on top of the existing kernel data set. Also, it sounds like we didn't write smithed SPKs for Enceladus so that explains why we didn't encounter this. My understanding is that ckwriter already has this type of functionality built into it. |
@jessemapel regarding option 1 above. What are the consequences of having a "slightly different format" for the kernels? Option 1 seems much easier, but I don't understand the ramifications. |
@amystamile-usgs Had some discussion with @blandoplanet @lwellerastro and Brent. We're going to move forward with solution 1, removing the explicit SPK center definitions. We need to check that all of the image geometry is still correct with this approach though. |
Hi - I continue to have problems with my data under isis7.1.0-RC1 while working with newly created kernels (spk in particular) based on my entire dataset. I am getting the same SPICE(ZEROVECTOR) errors as described in my original post. Note that this is also the case when I set extra=newSPKkernel instead of spk=newSPKkernel. I needed to reprocess all of my data to pick up the latest (and hopefully last) mission spk kernel and I did so under isis7.0.0 while awaiting these changes. My understanding was only the writer programs were being adjusted so I did not think this would be a problem, but could it be? Under isis7.0.0:
Under isis7.1.0-RC1
I noticed in the release notes " Removed SpkCenterId functions in Cassini camera models due to spkwriter writing positions of Cassini relative to Titan but labeling it in the kernel as the position relative to the Saturn Barycenter". That seems to indicate the change is to the camera model, not just the writer programs. Do I need to reprocess my images again under isis7.1.0 or is something else going on here? I need to know sooner than later if I have to reprocess my images under the latest version since I have other work to do with this data this fiscal year. Thank you. |
You shouldn't need to re-process your imagery. The camera model was updated, but not the parts that are persisted on Cube files, just some hard-coded labels that ckwriter and spkwriter look at. So, your processing should be correct. There could be multiple problems here and we only fixed one of them. |
Well, there might be something to doing everything under 7.1 because I repeated the single image test (ingest, spice, create kernel, apply new kernel to newly ingested image, campt) and it works without error. Camera information matches between ingested/spice and ingested/spice w/new kernel as well. |
it sounds like there may be some bad ephmerides on the images somehow. Very strange. |
Defaulting via spiceinit, but that is followed by a "direct" single location deltack then bundle, but I'm not sure that plays into it at all. |
This appears to be a problem specifically with the jigsaw updated images. I tested using a single deltack'd image (input into jigsaw):
Tested using a jigsaw output updated image:
All of this was done via isis7.1.0 but the kernels were based upon isis7.0.0 deltack and jigsaw. Is it worth running jigsaw/updating via isis7.1.0 and seeing if that makes some sort of difference? |
If it doesn't take very long that would be fine, but I don't expect things to just be fixed in 7.1. I think narrowing it down to jigsaw gives us plenty to go off of. |
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. |
This has not been resolved but is a high priority |
Nevermind, I was able to get to the folder. |
@lwellerastro So far I have pinned down that these jigsawed cubes have invalid velocity data for the instrument position and this is why we are seeing invalid values in the spkwriter that is carrying over to campt. Seems like I need to start debugging this in jigsaw. Do you happen to have the original jigsaw commands you used to create these cubes? |
Hi @amystamile-usgs, below is the jigsaw command I used when updating the images. Very standard command used for framing camera that I work with. When I bundle for line scan I would solve for camera accelerations. This is super normal and I have built good kernels on commands like this for years.
If you need to review the images before being updated by jigsaw, see the file list CISS_Titan_FFCombined7_Thin_PixReg_SubReg.lis in the same directory (titan project work area/lweller/All_CB3_MT1/NewMissionKernels). We can use chat if you need more details on locations. |
@amystamile-usgs I ran tabledump name=InstrumentPosition on one of my updated Titan images, and as you already confirmed via the kernels above, there is a bunch of information missing:
but it is there prior to being updated:
Clearly jigsaw is the culprit for the bad kernels, but it feels very Cassini ISS Titan specific because I've been running table dump on various other jigsaw updated datasets and they all seem to have valid output (well, no nan's). These are images that in some cases had spacecraft position solved for, but others did not. A mix of framers and line scanners. I'm not sure it's helpful at all, but I have jigsaw updated images of Enceladus acquired by Cassini ISS (same camera as the Titan data), that have good InstrumentPosition output, but I did not solve for spacecraft for those data. |
I agree there's something unique with Cassini ISS Titan and jigsaw going on here. |
While looking for other data to run tests on, it was determined that Galileo SSI images of Europa had similar problems where information was omitted (nan) after solving for spacecraft position and being updated by jigsaw. A spacecraft kernel generated for one of the updated images produced similar errors to the Titan data after applying the kernel to an image and running campt. See data under my user work area Isis3Tests/Jigsaw/Galileo/ |
After data loss and some other software issues, the full Titan dataset has been reprocessed and updated by jigsaw using isis8.0.0-RC2. Confirming here that jigsaw NAN InstrumentPosition velocities have been corrected and the image tested in this comment now produces valid output via tabledump:
Also have confirmed that kernels based on jigsaw updated images produce expected results. |
ISIS version(s) affected: 5.0.2, isis7.0.0-RC2
Description
Camera and Spacecraft kernels generated for Cassini ISS images of Titan early last month generate NAIF errors when applied to newly ingested images as well as certain types of existing images.
Spiceinit runs without errors, but programs like qview and campt produce the following NAIF error message:
How to reproduce
See data under /work/users/lweller/Isis3Tests/Spiceinit/WriterKernels/.
There is also a proc.scr file with information on source data for some of the tests.
Additional context
The images used in creating the ck and spk kernels were processed under isis4.x.x and isis5.0.2. They were originally ingested and spiced in June of 2020 under isis4.1.0. There were bundled and updated with jigsaw under isis5.0.2 in February 2022. The kernels were created under isis5.0.2 in early April 2022. I can supply the list of images and writer commands if that is useful. It took many hours for the writer programs to run on these 6000+ images.
I used type=9 for the spacecraft kernels only because it was used on past data sets (decision made by those more knowledgeable). Maybe this is part of the problem? I will create a type=13 version and see if that makes a difference and will report here after. But I did have success using the both kernels as noted below, but the input image seemed to matter, which is what I find odd. Plus the answer was not as expected.
I was originally testing the validity of the kernels when I ran into problems. The data have a long, somewhat complicated processing history so I initially made a copy of an existing, pre-jigsaw file and applied the kernels directly to it. See proc.scr and copy_N1509137653_2.cub. I did not encounter any errors using this method, but the geometry applied to this image using the kernels does not match that of the jigsaw updated image and is likely a result of new Cassini spacecraft kernels, a problem described in issue #4922.
As an additional test I decided to apply the kernels to a freshly ingested image and ran into the NAIF errors.
I encountered the same error when I made a copy of my jigsaw updated image and applied the kernels to it. See copy_jigsawed_N1509137653_2.cub and the source information in proc.scr.
I wonder if somehow the mixing of isis versus ale spice handling is playing any part in this.
Please let me know if more/different information is needed when this is pursued.
The text was updated successfully, but these errors were encountered: