Skip to content

Commit

Permalink
FFI: MetafitsMetadata->ra_phase_center_deg and dec_phase_center_deg i…
Browse files Browse the repository at this point in the history
…s now NaN, not 0 when missing from metafits file
  • Loading branch information
gsleap committed Nov 22, 2022
1 parent 4b4099c commit 0aa028a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log

Changes in each release are listed below.
## 0.16.0 22-Nov-2022 (Pre-release)
* FFI/C: `MetafitsMetadata`->`ra_phase_center_deg` is now NaN not 0 when missing from metafits file
* FFI/C: `MetafitsMetadata`->`dec_phase_center_deg` is now NaN not 0 when missing from metafits file

## 0.15.0 23-Jun-2022 (Pre-release)
* Provide DUT1 in the metafits context
Expand Down
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.15.1"
version = "0.16.0"
homepage = "https://github.com/MWATelescope/mwalib"
repository = "https://github.com/MWATelescope/mwalib"
readme = "README.md"
Expand Down
7 changes: 5 additions & 2 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ pub unsafe extern "C" fn mwalib_metafits_context_display(
/// * `metafits_context_ptr` must point to a populated `MetafitsContext` object from the `mwalib_metafits_context_new` functions.
/// * `metafits_context_ptr` must not have already been freed.
#[no_mangle]
#[allow(unused_must_use)]
pub unsafe extern "C" fn mwalib_metafits_context_free(
metafits_context_ptr: *mut MetafitsContext,
) -> i32 {
Expand Down Expand Up @@ -945,6 +946,7 @@ pub unsafe extern "C" fn mwalib_voltage_context_get_fine_chan_freqs_hz_array(
/// * `correlator_context_ptr` must point to a populated `CorrelatorContext` object from the `mwalib_correlator_context_new` function.
/// * `correlator_context_ptr` must not have already been freed.
#[no_mangle]
#[allow(unused_must_use)]
pub unsafe extern "C" fn mwalib_correlator_context_free(
correlator_context_ptr: *mut CorrelatorContext,
) -> i32 {
Expand Down Expand Up @@ -1271,6 +1273,7 @@ pub unsafe extern "C" fn mwalib_voltage_context_read_second(
/// * `voltage_context_ptr` must point to a populated `VoltageContext` object from the `mwalib_voltage_context_new` function.
/// * `voltage_context_ptr` must not have already been freed.
#[no_mangle]
#[allow(unused_must_use)]
pub unsafe extern "C" fn mwalib_voltage_context_free(
voltage_context_ptr: *mut VoltageContext,
) -> i32 {
Expand Down Expand Up @@ -1733,8 +1736,8 @@ pub unsafe extern "C" fn mwalib_metafits_metadata_get(
global_analogue_attenuation_db: *global_analogue_attenuation_db,
ra_tile_pointing_deg: *ra_tile_pointing_degrees,
dec_tile_pointing_deg: *dec_tile_pointing_degrees,
ra_phase_center_deg: (*ra_phase_center_degrees).unwrap_or(0.),
dec_phase_center_deg: (*dec_phase_center_degrees).unwrap_or(0.),
ra_phase_center_deg: (*ra_phase_center_degrees).unwrap_or(f64::NAN),
dec_phase_center_deg: (*dec_phase_center_degrees).unwrap_or(f64::NAN),
az_deg: *az_deg,
alt_deg: *alt_deg,
za_deg: *za_deg,
Expand Down

0 comments on commit 0aa028a

Please sign in to comment.