Skip to content

Commit

Permalink
fixes #152 , default pfb is cotter for legacy correlator data
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Jun 26, 2024
1 parent ddb8163 commit 924013f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use itertools::{izip, Itertools};
use log::{debug, info, trace, warn};
use mwalib::{
built_info::PKG_VERSION as MWALIB_PKG_VERSION, fitsio_sys::CFITSIO_VERSION, CableDelaysApplied,
CorrelatorContext, GeometricDelaysApplied,
CorrelatorContext, GeometricDelaysApplied, MWAVersion,
};
use prettytable::{format as prettyformat, row, table};

Expand Down Expand Up @@ -743,8 +743,10 @@ impl<'a> BirliContext<'a> {
),
PossibleValue::new("jake")
.help("see: PFB_JAKE_2022_200HZ in src/passband_gains.rs"),
PossibleValue::new("auto")
.help("MWAX => jake, legacy => cotter"),
])
.default_value("jake")
.default_value("auto")
.alias("pfb-gains")
.help_heading("CORRECTION"),

Expand Down Expand Up @@ -1303,6 +1305,16 @@ impl<'a> BirliContext<'a> {
None | Some("none") => None,
Some("jake") => Some(PFB_JAKE_2022_200HZ),
Some("cotter") => Some(PFB_COTTER_2014_10KHZ),
Some("auto") => match corr_ctx.mwa_version {
MWAVersion::CorrMWAXv2 => Some(PFB_JAKE_2022_200HZ),
MWAVersion::CorrLegacy | MWAVersion::CorrOldLegacy => Some(PFB_COTTER_2014_10KHZ),
ver => return Err(BirliError::BadMWAVersion {
message:
"could not determine automatic pfb gains from provided mwalib::MWAVersion."
.into(),
version: ver.to_string(),
}),
},
Some(option) => panic!("unknown option for --passband-gains: {option}"),
};
prep_ctx.correct_geometry = {
Expand Down

0 comments on commit 924013f

Please sign in to comment.