Skip to content

Comments

Kernels key#675

Merged
Kelvinrr merged 22 commits intoDOI-USGS:mainfrom
chkim-usgs:kernels_key
Feb 11, 2026
Merged

Kernels key#675
Kelvinrr merged 22 commits intoDOI-USGS:mainfrom
chkim-usgs:kernels_key

Conversation

@chkim-usgs
Copy link
Contributor

@chkim-usgs chkim-usgs commented Aug 29, 2025

Couple things

  • Adds kernels key to ISD
  • Adds remove_kernels key option to for the props dict in ale.loads()
  • Adds misc key if user enters their own kernels
  • Converts kernels json value to dict type if it is initially a list

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.

jrcain-usgs
jrcain-usgs previously approved these changes Sep 10, 2025
@chkim-usgs chkim-usgs requested a review from Kelvinrr September 11, 2025 12:27
Comment on lines 91 to 92
else:
self._kernels = self._props['kernels']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth checking if it's a dict formatted like a spiceQL kernel set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you envisioning something that checks the kernel keys against valid kernel type names (like [ck, pck, spk, etc.])?

Copy link
Collaborator

@Kelvinrr Kelvinrr Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, basically. The easiest thing is probably to try to load it as a kernel set? Might need a function in SpiceQL to check.

res.instrument_id
with res as driver:
isd = formatter(driver)
if 'remove_kernels' in props and props['remove_kernels'] is True and 'kernels' in isd:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be better for it to be "attach_kernels", having a flag being a often a bit odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm, we want kernels added to ISD as default? We can have attach_kernels be default True and users can explicitly set it to False is they want kernels removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, change to attach_kernels and default to true.

Comment on lines +213 to +220
kernels_dict = {}
for k in driver.kernels:
k_split = k.split('/')
k_type = k_split[2]
if k_type in kernels_dict and isinstance(kernels_dict[k_type], list):
kernels_dict[k_type].append(k)
else:
kernels_dict.update({k_type: [k]})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing this is to try to identify the kernel types? Might be best to make that a function in SpiceQL, since SpiceQL can use the Config to identify them more effectively. Short term I think it's fine to leave this here.

@Kelvinrr Kelvinrr merged commit c80453b into DOI-USGS:main Feb 11, 2026
13 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.

3 participants