# Written by C. Borys (borys@caltech.edu) for the HIFI-DP Workshop # April 8-9 @ Estec # def setLvl2rowflag(obs,backend,index) : # This is for spectral scan deconvolution exercises. # It adds a 'spur' rowflag to the specified data index # at level 2 in both the LSB and USB. By doing this, the # spectrum is ignored by decon (unless the decon mask is changed). # # It will not work on level 1 data, nor will it work if 'doAverage' # was not run in the level 2 pipeline. It expects the default 1 spectra # per LO tuning. # # example: # obs=loadObsContext("1342181161",poolName="pool_1342181161") # setLvl2rowflag(obs,"WBS-V",35) # setLvl2rowflag(obs,"WBS-V",36) # # do LSB htp=obs.refs["level2"].product.refs[backend+"-LSB"].product ds=htp.get(index) ds.setRowFlag(Int1d([524288])) htp.set(index,ds,'science') obs.level['level2'].setProduct(backend+"-LSB", htp) # now do USB htp=obs.refs["level2"].product.refs[backend+"-USB"].product ds=htp.get(index) ds.setRowFlag(Int1d([524288])) htp.set(index,ds,'science') obs.level['level2'].setProduct(backend+"-USB", htp)