Skip to content

Adds getKernelIntervals - #166

Merged
Kelvinrr merged 7 commits into
DOI-USGS:mainfrom
chkim-usgs:get_ivls
Nov 5, 2026
Merged

Kelvinrr merged 7 commits into
DOI-USGS:mainfrom
chkim-usgs:get_ivls

Conversation

@chkim-usgs

@chkim-usgs chkim-usgs commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

In addition to the intervals being recorded in the spiceqldb.hdf (PR#165), added getKernelIntervals and updated the searchForKernelsets function with the getIntervals bool param to be able to retrieve intervals for a list of kernels.

Also updated the kernel query to include interval filtering for more precise outputs. This addresses an issue where running ALE's isd_generate with SpiceQL 1.8.0 on an LRO image returned four smithed polar CKs even though the image fell between those CKs' coverage windows because SpiceQL 1.8.0 accepts only the highest tier quality within the start/stop time. The kernel quality bug squash searches through all the quality tiers and unionizes the smithed and reconstructed CKs in this example. The additional interval filtering in this PR removes the smithed polar CKs since they do not provide true coverage and retains the correct reconstructed CKs. The outputted ISD that was generated from isd_generate was then tested with usgscsm_cam_test with a --sample-rate 1000:

Norm of pixel errors after projecting from camera to ground and back.
Min:    1.72804e-11
Median: 3.73709e-08
Max:    8.74814e-05
Count:  318

Desired precision: 0.001
Max achieved precision: 0.000198438

getKernelIntervals example:

http://127.0.0.1:8080/getKernelIntervals?kernels=tgo/ck/reconstructed/em16_tgo_sc_ssm_20250101_20250817_s20250731_v01.bc&kernels=em16_tgo_fap_039_01_20160314_20170522_v01.bsp

returns

{
  "statusCode": 200,
  "body": {
    "return": {
      "/cassis/spk/predicted/em16_tgo_fap_039_01_20160314_20170522_v01.bsp": [
        {
          "body_code": -143,
          "start": 511215249,
          "stop": 548724384.7770848
        }
      ],
      "/tgo/ck/reconstructed/em16_tgo_sc_ssm_20250101_20250817_s20250731_v01.bc": [
        {
          "body_code": -143000,
          "start": 788961672.2482144,
          "stop": 802526469.141991
        },
        {
          "body_code": -143000,
          "start": 802526473.141994,
          "stop": 805032066.9861194
        },
        {
          "body_code": -143000,
          "start": 805032070.9861224,
          "stop": 806587266.1583343
        },
        {
          "body_code": -143000,
          "start": 806587270.1583374,
          "stop": 806673666.2237052
        },
        {
          "body_code": -143000,
          "start": 806673670.2237083,
          "stop": 807053842.5113506
        },
        {
          "body_code": -143000,
          "start": 807063886.5189501,
          "stop": 807236550.6457744
        },
        {
          "body_code": -143000,
          "start": 807278470.6769971,
          "stop": 808747267.771013
        }
      ],
      "/tgo/spk/predicted/em16_tgo_fap_039_01_20160314_20170522_v01.bsp": [
        {
          "body_code": -143,
          "start": 511215249,
          "stop": 548724384.7770848
        }
      ]
    },
    "kernels": {}
  }
}

searchForKernelsets with getIntervals=true response adds the intervals key within the kernels object:

{
  "statusCode": 200,
  "body": {
    "return": "",
    "kernels": {
      "cassis_ck_quality": "reconstructed",
      "ck": [
        "tgo/kernels/ck/em16_tgo_sc_ssm_20170228_20190331_s20190401_v01.bc",
        "tgo/kernels/ck/em16_tgo_sc_sam_20170228_20180311_s20190401_v01.bc",
        ...
      ],
      "fk": [
        "tgo/kernels/fk/em16_tgo_v27.tf",
        "tgo/kernels/fk/em16_tgo_ops_v02.tf",
        "tgo/kernels/fk/rssd0002.tf"
      ],
      "iak": [
        "tgo/kernels/iak/tgoAddendum001.ti",
        "tgo/kernels/iak/tgoCassisAddendum007.ti"
      ],
      "ik": [
        "tgo/kernels/ik/em16_tgo_cassis_v09.ti"
      ],
      "intervals": {
        "/cassis/ck/reconstructed/cassis_ck_p_160312_181231_180507.bc": [
          {
            "body_code": -143410,
            "start": 513282162.18489903,
            "stop": 599572868.3144339
          }
        ],
        "/cassis/ck/reconstructed/cassis_ck_p_160312_181231_180511.bc": [
          {
            "body_code": -143410,
            "start": 513282162.18489903,
            "stop": 599572868.3144339
          }
        ],
        ...
      }
    }
  }
}

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

Comment thread SpiceQL/src/inventoryimpl.cpp Resolved
Comment thread SpiceQL/src/inventoryimpl.cpp Resolved
@Kelvinrr
Kelvinrr merged commit 7ec2ed2 into DOI-USGS:main Nov 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants