Skip to content

Commit

Permalink
Catch the badness
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed May 21, 2024
1 parent c82c2dd commit 3e8d6f0
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions arrakis/rmclean_oncuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,26 @@ def rmclean1d(
)

# Run RM-CLEAN on the spectrum
outdict, arrdict = do_RMclean_1D.run_rmclean(
mDict=mDict,
aDict=aDict,
cutoff=cutoff,
maxIter=maxIter,
gain=gain,
nBits=nBits,
showPlots=False,
verbose=rm_verbose,
prefixOut=prefix,
saveFigures=False,
window=window,
)
try:
outdict, arrdict = do_RMclean_1D.run_rmclean(
mDict=mDict,
aDict=aDict,
cutoff=cutoff,
maxIter=maxIter,
gain=gain,
nBits=nBits,
showPlots=False,
verbose=rm_verbose,
prefixOut=prefix,
saveFigures=False,
window=window,
)
except Exception as e:
logger.error(f"Error running RM-CLEAN on {cname}: {e}")
myquery = {"Gaussian_ID": cname, "rm_outputs_1d.field": save_name}
operation = {"$set": {"rm_outputs_1d.$.rmclean1d": False}}
return pymongo.UpdateOne(myquery, operation, upsert=True)

# Ensure JSON serializable
for k, v in outdict.items():
if isinstance(v, np.float_):
Expand Down

0 comments on commit 3e8d6f0

Please sign in to comment.