Skip to content

Commit

Permalink
Update fitsio to 0.21 and fitsio-sys to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gsleap committed Oct 18, 2024
1 parent 30a5235 commit a1f870d
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 172 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Changes in each release are listed below.

## 1.7.0 18-Oct-2024

* Update fitsio to 0.21 and fitsio-sys to 0.5

## 1.6.0 18-Oct-2024

* Updated ndarray to 0.16
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mwalib"
version = "1.6.0"
version = "1.7.0"
homepage = "https://github.com/MWATelescope/mwalib"
repository = "https://github.com/MWATelescope/mwalib"
readme = "README.md"
Expand Down Expand Up @@ -29,8 +29,8 @@ python = ["pyo3", "numpy", "ndarray"]

[dependencies]
chrono = "0.4.38"
fitsio = "~0.20"
fitsio-sys = "~0.4"
fitsio = "~0.21"
fitsio-sys = "~0.5"
lazy_static = "~1.5"
libc = "~0.2"
log = "~0.4"
Expand Down
4 changes: 2 additions & 2 deletions src/coarse_channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl CoarseChannel {
///
/// # Arguments
///
/// `metafits_fptr` - a reference to a metafits FitsFile object.
/// `metafits_fptr` - a reference to a metafits MWAFitsFile object.
///
/// `metafits_hdu` - a reference to a metafits primary HDU.
///
Expand All @@ -118,7 +118,7 @@ impl CoarseChannel {
/// The width in Hz of each coarse channel
///
pub(crate) fn get_metafits_coarse_channel_info(
metafits_fptr: &mut fitsio::FitsFile,
metafits_fptr: &mut MWAFitsFile,
hdu: &fitsio::hdu::FitsHdu,
observation_bandwidth_hz: u32,
) -> Result<(Vec<usize>, u32), FitsError> {
Expand Down
4 changes: 2 additions & 2 deletions src/correlator_context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ impl CorrelatorContext {
///
/// * `visibility_pols` - the number of pols produced by the correlator (always 4 for MWA)
///
/// * `gpubox_fptr` - FITSFile pointer to an MWA GPUbox file
/// * `gpubox_fptr` - MWAFITSFile pointer to an MWA GPUbox file
///
/// # Returns
///
Expand All @@ -794,7 +794,7 @@ impl CorrelatorContext {
metafits_fine_chans_per_coarse: usize,
metafits_baselines: usize,
visibility_pols: usize,
gpubox_fptr: &mut fitsio::FitsFile,
gpubox_fptr: &mut MWAFitsFile,
) -> Result<(), GpuboxError> {
// Get NAXIS1 and NAXIS2 from a gpubox file first image HDU
let hdu = fits_open_hdu!(gpubox_fptr, 1)?;
Expand Down
33 changes: 15 additions & 18 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,25 +1856,22 @@ pub unsafe extern "C" fn mwalib_metafits_metadata_get(
// Populate signal chain corrections
let mut signal_chain_corrections_vec: Vec<ffi::SignalChainCorrection> = Vec::new();

match &metafits_context.signal_chain_corrections {
Some(v) => {
for item in v.iter() {
let out_item = {
let metafits_context::SignalChainCorrection {
receiver_type,
whitening_filter,
corrections,
} = item;
ffi::SignalChainCorrection {
receiver_type: *receiver_type,
whitening_filter: *whitening_filter,
corrections: ffi_array_to_boxed_slice(corrections.clone()),
}
};
signal_chain_corrections_vec.push(out_item);
}
if let Some(v) = &metafits_context.signal_chain_corrections {
for item in v.iter() {
let out_item = {
let metafits_context::SignalChainCorrection {
receiver_type,
whitening_filter,
corrections,
} = item;
ffi::SignalChainCorrection {
receiver_type: *receiver_type,
whitening_filter: *whitening_filter,
corrections: ffi_array_to_boxed_slice(corrections.clone()),
}
};
signal_chain_corrections_vec.push(out_item);
}
None => {}
}

// Populate the outgoing structure with data from the metafits context
Expand Down
Loading

0 comments on commit a1f870d

Please sign in to comment.