Skip to content

Commit

Permalink
commented out mask specific changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalvin committed Apr 11, 2024
1 parent a4b64a2 commit 9c3504f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
31 changes: 14 additions & 17 deletions flint/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,32 +215,29 @@ def get_options_from_strategy(
round = min(round, max(strategy["selfcal"].keys()))

# step one, get the defaults
options = (
dict(**strategy["defaults"][mode])
if mode in strategy["defaults"].keys()
else {}
)
options = dict(**strategy["defaults"][mode]) if mode in strategy["defaults"] else {}
logger.debug(f"Defaults for {mode=}, {options=}")

# Now get the updates
# A default empty dict
update_options = {}

# Now get the updates. When using the 'in' on dicts
# remember it is checking against the keys
if round == "initial":
# separate function to avoid a missing mode from raising valu error
if mode in strategy["initial"].keys():
if mode in strategy["initial"]:
update_options = dict(**strategy["initial"][mode])
logger.debug(f"Updating options with {update_options=}")
options.update(update_options)
elif isinstance(round, int):
# separate function to avoid a missing mode from raising valu error
if (
round in strategy["selfcal"].keys()
and mode in strategy["selfcal"][round].keys()
):
if round in strategy["selfcal"] and mode in strategy["selfcal"][round]:
update_options = dict(**strategy["selfcal"][round][mode])
logger.debug(f"Updating options with {update_options=}")
options.update(update_options)
else:
raise ValueError(f"{round=} not recognised.")

if update_options:
logger.debug(f"Updating options with {update_options=}")
options.update(update_options)

return options


Expand Down Expand Up @@ -284,14 +281,14 @@ def verify_configuration(input_strategy: Strategy, raise_on_error: bool = True)
f"{key} mode in initial round incorrectly formed. {typeerror} "
)

if "selfcal" in input_strategy.keys():
if "selfcal" in input_strategy:
round_keys = input_strategy["selfcal"].keys()

if not all([isinstance(i, int) for i in round_keys]):
errors.append("The keys into the self-calibration should be ints. ")

for round in round_keys:
for mode in input_strategy["selfcal"][round].keys():
for mode in input_strategy["selfcal"][round]:
options = get_options_from_strategy(
strategy=input_strategy, mode=mode, round=round
)
Expand Down
12 changes: 6 additions & 6 deletions flint/prefect/flows/continuum_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ def process_science_fields(
image_products=beam_aegean_outputs,
min_snr=3.5,
)
wsclean_options["auto_mask"] = 1.25
wsclean_options["auto_threshold"] = 1.0
wsclean_options["force_mask_rounds"] = 13
wsclean_options["local_rms"] = False
wsclean_options["niter"] = 1750000
wsclean_options["nmiter"] = 30
# wsclean_options["auto_mask"] = 1.25
# wsclean_options["auto_threshold"] = 1.0
# wsclean_options["force_mask_rounds"] = 13
# wsclean_options["local_rms"] = False
# wsclean_options["niter"] = 1750000
# wsclean_options["nmiter"] = 30

wsclean_cmds = task_wsclean_imager.map(
in_ms=cal_mss,
Expand Down

0 comments on commit 9c3504f

Please sign in to comment.