Skip to content

Commit

Permalink
Expose MWA coordinates as library constants.
Browse files Browse the repository at this point in the history
Also bump the version.
  • Loading branch information
cjordan committed Sep 17, 2020
1 parent d07aff8 commit 47cd333
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mwalib"
version = "0.4.0"
version = "0.4.1"
homepage = "https://github.com/MWATelescope/mwalib"
authors = ["Greg Sleap <greg.sleap@curtin.edu.au>",
"Christopher H. Jordan <christopherjordan87@gmail.com>"]
Expand Down
11 changes: 3 additions & 8 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::baseline::*;
use crate::coarse_channel::*;
use crate::convert::*;
use crate::gpubox::*;
use crate::misc::*;
use crate::rfinput::*;
use crate::timestep::*;
use crate::visibility_pol::*;
Expand Down Expand Up @@ -252,10 +251,6 @@ impl mwalibContext {
// Used to determine electrical lengths if EL_ not present in metafits for an rf_input
let coax_v_factor: f64 = 1.204;

let mwa_latitude_radians: f64 = dms_to_degrees(-26, 42, 11.94986).to_radians(); // -26d42m11.94986s
let mwa_longitude_radians: f64 = dms_to_degrees(116, 40, 14.93485).to_radians(); // 116d40m14.93485s
let mwa_altitude_metres: f64 = 377.827;

let integration_time_milliseconds: u64 = {
let it: f64 = get_required_fits_key!(&mut metafits_fptr, &metafits_hdu, "INTTIME")?;
(it * 1000.) as _
Expand Down Expand Up @@ -506,9 +501,9 @@ impl mwalibContext {
rf_inputs.sort_by_key(|k| k.subfile_order);

Ok(mwalibContext {
mwa_latitude_radians,
mwa_longitude_radians,
mwa_altitude_metres,
mwa_latitude_radians: MWA_LATITUDE_RADIANS,
mwa_longitude_radians: MWA_LONGITUDE_RADIANS,
mwa_altitude_metres: MWA_ALTITUDE_METRES,
coax_v_factor,
obsid,
scheduled_start_gpstime_milliseconds,
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ pub mod rfinput;
pub mod timestep;
pub mod visibility_pol;

/// The MWA's latitude on Earth in radians. This is -26d42m11.94986s.
pub const MWA_LATITUDE_RADIANS: f64 = -0.4660608448386394;
/// The MWA's longitude on Earth in radians. This is 116d40m14.93485s.
pub const MWA_LONGITUDE_RADIANS: f64 = 2.0362898668561042;
/// The MWA's altitude in metres.
pub const MWA_ALTITUDE_METRES: f64 = 377.827;

// Re-exports.
pub use antenna::*;
pub use context::{mwalibContext, CorrelatorVersion};
Expand Down

0 comments on commit 47cd333

Please sign in to comment.