Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
jurjen93 committed Nov 2, 2023
1 parent 2382d19 commit 58f0c78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion subtract/subtract_with_wsclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def run_DP3(self, phaseshift: str = None, freqavg: str = None,
parser.add_argument('--forwidefield', action='store_true',
help='will search for the polygon_info.csv file to extract information from')
parser.add_argument('--skip_predict', action='store_true', help='skip predict and do only subtract')
parser.add_argument('--even_time_avg', action='store_true', help='(only if --forwidefield) only allow even time averaging (in case of stacking nights with different averaging)')
args = parser.parse_args()

if not args.skip_predict:
Expand Down Expand Up @@ -629,9 +630,16 @@ def run_DP3(self, phaseshift: str = None, freqavg: str = None,

try:
# if there is pre averaging done on the ms, we need to take this into account
timeres = int(avg/get_time_preavg_factor(args.mslist[0])*dtime)
timeres = int(avg//get_time_preavg_factor(args.mslist[0])*dtime)

except:
timeres = int(avg*dtime)

# in case of widefield imaging and stacking multiple nights, you might want to have only even time resolutions
if args.even_time_avg and timeres % 2 != 0:
timeres -= 1
print(f"Time resolution from {timeres + 1} to {timeres}")

dirname = polygon['dir_name'].values[0]

else:
Expand Down

0 comments on commit 58f0c78

Please sign in to comment.