Commits

Takeshi Nakazato authored b5e3e28643d
continue running script even if tsdimaging fails
No tags

pipeline/hsdn/tasks/exportdata/template.txt

Modified
196 196
197 197 # Making Images
198 198 if Do_MakeImages:
199 199 antennalist = ${antennalist} # list of antennas (=list of beams)
200 200
201 201 for spwID, flag in enumerate(SPW_IDs):
202 202 if flag == True:
203 203 _prefix = os.path.join(working_directory, '${source}')
204 204 beamimagefiles = ['{}.NRO-BEAM{}.spw{}.I.sd.im'.format(_prefix, a, spwID) for a in antennalist]
205 205 for antenna in antennalist:
206 - tsdimaging(
207 - infiles=baseline_outputfile,
208 - outfile = beamimagefiles[antenna],
209 - field='0',
210 - spw='{}'.format(spwID),
211 - antenna='{}'.format(antenna),
212 - intent='OBSERVE_TARGET#ON_SOURCE',
213 - specmode='cube',
214 - mode=mode, outframe=outframe, veltype=veltype,
215 - nchan=nchan, start=start, width=width,
216 - gridfunction=gridfunction, convsupport=convsupport,
217 - truncate=truncate, gwidth=gwidth, jwidth=jwidth,
218 - imsize=imsize,
219 - cell=cell,
220 - phasecenter=phasecenter,
221 - restfreq=rest_frequencies[spwID],
222 - stokes='pseudoI',
223 - overwrite=Overwrite_Products,
224 - brightnessunit='K'
225 - )
226 - os.rename(beamimagefiles[antenna] + '.image', beamimagefiles[antenna])
206 + try:
207 + tsdimaging(
208 + infiles=baseline_outputfile,
209 + outfile = beamimagefiles[antenna],
210 + field='0',
211 + spw='{}'.format(spwID),
212 + antenna='{}'.format(antenna),
213 + intent='OBSERVE_TARGET#ON_SOURCE',
214 + specmode='cube',
215 + mode=mode, outframe=outframe, veltype=veltype,
216 + nchan=nchan, start=start, width=width,
217 + gridfunction=gridfunction, convsupport=convsupport,
218 + truncate=truncate, gwidth=gwidth, jwidth=jwidth,
219 + imsize=imsize,
220 + cell=cell,
221 + phasecenter=phasecenter,
222 + restfreq=rest_frequencies[spwID],
223 + stokes='pseudoI',
224 + overwrite=Overwrite_Products,
225 + brightnessunit='K'
226 + )
227 + except Exception:
228 + continue
229 + else:
230 + os.rename(beamimagefiles[antenna] + '.image', beamimagefiles[antenna])
227 231
228 232 weightimage = '{}.spw{}.I.sd.im.weight'.format(_prefix, spwID)
229 233
230 234 # overwrite weight image if desired
231 235 if Overwrite_Products is True and os.path.exists(weightimage):
232 236 shutil.rmtree(weightimage)
233 237
234 238 validimages = [_name for _name in beamimagefiles if os.path.exists(_name)]
235 239 num_images = len(validimages)
236 240 weightimages = ['{}.weight'.format(s) for s in validimages]

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut