Skip to content

Commit

Permalink
Move Condon errors warning to earlier in the process
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobie committed Jan 29, 2025
1 parent 61406d5 commit 2df0c6e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
15 changes: 2 additions & 13 deletions vast_pipeline/image/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,8 @@ def read_selavy(self, dj_image: models.Image) -> pd.DataFrame:
df['compactness'] = df['flux_int'].values / df['flux_peak'].values

if self.config["condon_errors"]:
logger.warning("Calculating Condon '97 errors...")
logger.warning(
"Using the Condon uncertainties will overwrite those provide "
"by the input catalogue and should not be used if you have "
"applied any corrections to the input catalogues, or if you "
"trust their uncertainties."
)
logger.warning(
"The Condon uncertainties only account for the statistical "
"component of the uncertainty - any systematic uncertainty"
"should be taken into account using the ra_uncertainty and "
"dec_uncertainty parameters in the config file."
)
logger.debug("Calculating Condon '97 errors...")

theta_B = dj_image.beam_bmaj
theta_b = dj_image.beam_bmin

Expand Down
14 changes: 14 additions & 0 deletions vast_pipeline/management/commands/ingestimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ def handle(self, *args, **options) -> None:
except PipelineConfigError as e:
raise CommandError(e)

if image_config.image_opts()['condon_errors']:
logger.warning(
"You have selected condon_errors=True. "
"Using the Condon uncertainties will overwrite those provide "
"by the input catalogue and should not be used if you have "
"applied any corrections to the input catalogues, or if you "
"trust their uncertainties."
)
logger.warning(
"The Condon uncertainties only account for the statistical "
"component of the uncertainty - any systematic uncertainty"
"should be taken into account using the ra_uncertainty and "
"dec_uncertainty parameters in the config file."
)
# Create a dummy Pipeline instance using the given image ingestion configuration options
d = _DummyPipeline(image_config)

Expand Down
15 changes: 15 additions & 0 deletions vast_pipeline/management/commands/runpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,21 @@ def run_pipe(
"Source monitoring: %s",
pipeline.config["source_monitoring"]["monitor"]
)

if pipeline.config["condon_errors"]:
logger.warning(
"You have selected condon_errors=True. "
"Using the Condon uncertainties will overwrite those provide "
"by the input catalogue and should not be used if you have "
"applied any corrections to the input catalogues, or if you "
"trust their uncertainties."
)
logger.warning(
"The Condon uncertainties only account for the statistical "
"component of the uncertainty - any systematic uncertainty"
"should be taken into account using the ra_uncertainty and "
"dec_uncertainty parameters in the config file."
)

# log the list of input data files for posterity
inputs = pipeline.config["inputs"]
Expand Down

0 comments on commit 2df0c6e

Please sign in to comment.