-
Notifications
You must be signed in to change notification settings - Fork 33
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
Allow ale formatter to proceed with no velocities specified for instrument/sun position #614
Conversation
@AustinSanders What issues are you seeing w.r.t. "deserializing from JSON / ISD". I think we could change this to only write the velocities out if they exist. Basically moving |
Since USGSCSM uses ALE for reading, and ALE already has code to adjust for missing velocities (https://github.com/DOI-USGS/ale/blob/main/src/Util.cpp#L582), I think this isn't API breaking. |
Specifying an empty array for velocities results in a json error along the lines of "requires data type of 'array,' but got 'null.'" The driver succeeds and prints an ISD (with verbose on), but the camera instantiation fails later in the process. I think excluding velocities from the ISD will work (by removing the 'else' as you suggested), I just wasn't sure what would be a better solution to represent "no velocities." -- edit -- Tested with no velocities key written, and it works fine with the Apollo Pan driver, which was the test case that was failing previously. |
That makes sense! Most of the cases for "no velocities" in ISIS and USGSCSM/ALE expects there to be no "velocities" keyword in the ISD |
@AustinSanders Could this also get a changelog entry? |
c47c249
to
5f6a7c0
Compare
Overview
ISIS allows states to be created with no velocities. This can be seen in InstrumentPosition and SunPosition tables, and there exists a "hasVelocity" function to test if velocities are present.
The ALE formatter does not currently allow states without velocities. This precludes the creation of drivers for ApolloPan, because ApolloPanInit creates tables that do not contain velocities.
Potential Issue
Ideally, the velocities that are written to the ISD would be empty lists, but this causes issues when deserializing from JSON / ISD. The current workaround is to create np.zeros arrays that match the shape of the positions in the table. I'm not sure if specifying velocity of 0 will have side effects. I suspect that, since this was not previously supported, it won't break anything that exists, but I'm not sure of the validity of any results using the new output.
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: