Skip to content

Commit

Permalink
Adding several new columns to horizons query (#151)
Browse files Browse the repository at this point in the history
* Add more columns to horizons query

* PCK unused values, and enforcing frame

* changelog typo
  • Loading branch information
dahlend authored Nov 7, 2024
1 parent 72b86ff commit ff7ab41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added support for saving and loading `SimultaneousStates` as Parquet files.

### Changed

- Horizons orbit table query now includes, M1/2, K1/2, PC, and rotation period.


## [v1.0.3]

Expand Down
2 changes: 1 addition & 1 deletion src/kete/horizons.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def fetch_known_orbit_data(update_cache=False):
res = requests.get(
(
"https://ssd-api.jpl.nasa.gov/sbdb_query.api?fields="
"pdes,spkid,orbit_id,rms,H,diameter,epoch,e,i,q,w,tp,om,A1,A2,A3,DT"
"pdes,spkid,orbit_id,rms,H,diameter,epoch,e,i,q,w,tp,om,A1,A2,A3,DT,M1,M2,K1,K2,PC,rot_per"
"&full-prec=1&sb-xfrag=1"
),
timeout=120,
Expand Down
9 changes: 5 additions & 4 deletions src/kete_core/src/spice/pck_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ pub struct PckSegment {
/// End time of the segment.
pub jd_end: f64,

/// Type of the segment
pub segment_type: i32,

/// Internal data representation.
segment: PckSegmentType,
}
Expand Down Expand Up @@ -94,7 +91,6 @@ impl TryFrom<DafArray> for PckSegment {
jd_end,
center_id,
ref_frame,
segment_type,
segment,
})
}
Expand All @@ -113,6 +109,11 @@ impl PckSegment {
"JD is not present in this record.".to_string(),
))?;
}
if self.ref_frame != Frame::Ecliptic {
Err(Error::ValueError(
"Non ecltiptic frames are not supported for PCK queries.".into(),
))?;
}

match &self.segment {
PckSegmentType::Type2(v) => v.try_get_orientation(self, jd),
Expand Down

0 comments on commit ff7ab41

Please sign in to comment.