Unverified Commit 8c522c6d authored by Austin Sanders's avatar Austin Sanders Committed by GitHub
Browse files

Allow ale formatter to proceed with no velocities specified for instrument/sun position (#614)

* Allow no velocities for instrument/sun position

* Removed velocities key from ISD if no velocities are present

* Moved position assignment out of velocity check statement

* Updated changelog
parent b644fd5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@ release.
- Apollo Metric drivers, tests, and data [#533](https://github.com/DOI-USGS/ale/pull/533)
- Apollo Metric drivers, tests, and data [#533](https://github.com/DOI-USGS/ale/pull/533)
- Rosetta Virtis drivers, tests, and data [#520](https://github.com/DOI-USGS/ale/pull/520)
- Rosetta Virtis drivers, tests, and data [#520](https://github.com/DOI-USGS/ale/pull/520)
- Added compress and decompress ISD functions and added --compress flag to isd_generate[#604](https://github.com/DOI-USGS/ale/issues/604)
- Added compress and decompress ISD functions and added --compress flag to isd_generate[#604](https://github.com/DOI-USGS/ale/issues/604)
- Added the ability to generate ISDs with no velocities specified for instrument/sun position [#614](https://github.com/DOI-USGS/ale/issues/614)


### Changed
### Changed
- Changed how push frame sensor drivers compute the `ephemeris_time` property [#595](https://github.com/DOI-USGS/ale/pull/595)
- Changed how push frame sensor drivers compute the `ephemeris_time` property [#595](https://github.com/DOI-USGS/ale/pull/595)
+9 −4
Original line number Original line Diff line number Diff line
@@ -176,10 +176,12 @@ def to_isd(driver):
    instrument_position['spk_table_original_size'] = len(times)
    instrument_position['spk_table_original_size'] = len(times)
    instrument_position['ephemeris_times'] = times
    instrument_position['ephemeris_times'] = times
    # Rotate positions and velocities into J2000 then scale into kilometers
    # Rotate positions and velocities into J2000 then scale into kilometers
    # If velocities are provided, then rotate and add to ISD
    if velocities is not None:
        velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000
        velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000
        instrument_position['velocities'] = velocities
    positions = j2000_rotation.apply_at(positions, times)/1000
    positions = j2000_rotation.apply_at(positions, times)/1000
    instrument_position['positions'] = positions
    instrument_position['positions'] = positions
    instrument_position['velocities'] = velocities
    instrument_position["reference_frame"] = j2000_rotation.dest
    instrument_position["reference_frame"] = j2000_rotation.dest


    meta_data['instrument_position'] = instrument_position
    meta_data['instrument_position'] = instrument_position
@@ -191,10 +193,13 @@ def to_isd(driver):
    sun_position['spk_table_original_size'] = len(times)
    sun_position['spk_table_original_size'] = len(times)
    sun_position['ephemeris_times'] = times
    sun_position['ephemeris_times'] = times
    # Rotate positions and velocities into J2000 then scale into kilometers
    # Rotate positions and velocities into J2000 then scale into kilometers
    # If velocities are provided, then rotate and add to ISD
    if velocities is not None:
        velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000
        velocities = j2000_rotation.rotate_velocity_at(positions, velocities, times)/1000
        sun_position['velocities'] = velocities
    
    positions = j2000_rotation.apply_at(positions, times)/1000
    positions = j2000_rotation.apply_at(positions, times)/1000
    sun_position['positions'] = positions
    sun_position['positions'] = positions
    sun_position['velocities'] = velocities
    sun_position["reference_frame"] = j2000_rotation.dest
    sun_position["reference_frame"] = j2000_rotation.dest


    meta_data['sun_position'] = sun_position
    meta_data['sun_position'] = sun_position