-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from eta077/main
0.1.1
- Loading branch information
Showing
16 changed files
with
438 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
coverage: | ||
status: | ||
changes: false | ||
patch: false | ||
project: false | ||
|
||
ignore: | ||
- "tests" | ||
|
||
comment: | ||
layout: "reach,diff,files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: "weekly" | ||
interval: weekly | ||
- package-ecosystem: cargo | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: | ||
- "version-update:semver-patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
## [0.1.1] | ||
|
||
Set MSRV, stricter dependency versions, better workflows | ||
|
||
### Changed | ||
|
||
- Switched from chrono to hifitime | ||
- Switched from measurements to uom | ||
- Included `coordinates` feature by default | ||
|
||
## [0.1.0] | ||
|
||
Initial FITS feature release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,40 @@ | ||
use chrono::{DateTime, Utc}; | ||
use hifitime::Epoch; | ||
use thiserror::Error; | ||
|
||
use super::{EarthLocation, EquatorialCoord, HorizontalCoord}; | ||
use super::{EarthLocation, EquatorialCoord}; | ||
|
||
/// An enumeration of errors that can occur while converting coordinates from one frame to another. | ||
#[derive(Debug, Error)] | ||
pub enum AstroConversionError {} | ||
|
||
/// Coordinates in the International Celestial Reference System. | ||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] | ||
#[derive(Debug, Default, Clone, Copy, PartialEq)] | ||
pub struct Icrs { | ||
/// The coordinate value | ||
pub coords: EquatorialCoord, | ||
} | ||
|
||
impl Icrs { | ||
/// Converts coordinates from ICRS to AltAz | ||
pub fn as_alt_az(&self, _date_time: &DateTime<Utc>, _location: &EarthLocation) -> AltAz { | ||
AltAz::default() | ||
/// Creates a new Icrs with the coordinate values rounded to the specified decimal place. | ||
pub fn round(&self, dp: u32) -> Self { | ||
Self { | ||
coords: self.coords.round(dp), | ||
} | ||
} | ||
|
||
/// Converts coordinates from ICRS to observed AltAz coordinates. | ||
pub fn to_alt_az( | ||
&self, | ||
_date_time: &Epoch, | ||
_location: &EarthLocation, | ||
) -> Result<AltAz, AstroConversionError> { | ||
Ok(AltAz::default()) | ||
} | ||
} | ||
|
||
/// Coordinates | ||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] | ||
/// Coordinates with respect to the WGS84 ellipsoid. | ||
#[derive(Debug, Default, Clone, Copy, PartialEq)] | ||
pub struct AltAz { | ||
/// The coordinate value | ||
pub coords: HorizontalCoord, | ||
pub coords: EquatorialCoord, | ||
} |
Oops, something went wrong.