示例#1
0
def superaverage(*args):
  """
  Average the scans in the designated tables

  The arguments may be a comma-separated supertable sequence or a list
  of supertables
  """
  supertables = get_supertables(args)
  if supertables:
    mylogger.debug("Calling asap.average_time for %s", str(supertables))
    new_scantable = average_time(supertables)
    mylogger.debug("New scantable is %s", str(new_scantable))
    if new_scantable:
      supertab = attach_hdu(supertables, new_scantable)
      mylogger.debug("New supertable is %s", str(supertab))
      return supertab
  return None
示例#2
0
#s.summary()				#summary info					# summary
											# fileout,'Orion-S-reduced.fits'
s.set_fluxunit('K')         		# make 'K' default unit

#scal = sd.calps(s, [20,21,22,23])		# Calibrate CH3OH scans				# for i=21,24,2 do begin getps,i,ifnum=2,plnum=0,units='Ta*',
scal = sd.calps(s, [21,22,23,24])		# Calibrate CH3OH scans				# for i=21,24,2 do begin getps,i,ifnum=2,plnum=0,units='Ta*',
del s                                   # remove s from memory
# recalculate az/el (NOT needed for GBT data)
antennaname = scal.get_antennaname()
if ( antennaname != 'GBT'): scal.recalc_azel()      # recalculate az/el to 		# tau=0.09 & accum & getps, i, ifnum=2,plnum=1,units='Ta*',
scal.opacity(0.09)			# do opacity correction				# tau=0.09 & accum & end & ave
sel = sd.selector()			# Prepare a selection
sel.set_ifs(2)				# select CH3OH IF
scal.set_selection(sel)			# get this IF
stave = sd.average_time(scal, weight='tintsys')	# average in time
spave = stave.average_pol(weight='tsys')	# average polarizations;Tsys-weighted (1/Tsys**2) average
sd.plotter.plot(spave)			# plot

# what is going on with autoscaling?

					# do some smoothing
spave.smooth('boxcar', 10)		# boxcar 10					# boxcar,10
#spave.auto_poly_baseline(order=5)	# baseline fit order=5				# nfit,5
					# you can also set the baseline region              or
basemask = spave.create_mask([350,2700],[3500,7500])                                      # nregion,[500,3500,5000,7500]
spave.poly_baseline(basemask, order=5)							# nfit,5
sd.plotter.plot(spave)			# plot						# baseline

spave.set_unit('GHz')									# freq
sd.plotter.plot(spave)
示例#3
0
#s.summary()				#summary info					# summary
											# fileout,'IRC+10216.reduced.fits'
s.set_fluxunit('K')         		# make 'K' default unit

#scal = sd.calnod(s, [236,237,238,239,248,249,250,251])	# Calibrate HC3N scans		# for i=237,240,2 do begin getps,i,ifnum=0,plnum=0,units='Ta*',
scal = sd.calnod(s, [237,238,239,240,249,250,251,252])	# Calibrate HC3N scans		# for i=237,240,2 do begin getps,i,ifnum=0,plnum=0,units='Ta*',
del s                                   # remove s from memory
# recalculate az/el (NOT needed for GBT data)
antennaname = scal.get_antennaname()
if ( antennaname != 'GBT'): scal.recalc_azel()      # recalculate az/el to 		# tau=0.09 & accum & getps, i, ifnum=0,plnum=1,units='Ta*',
scal.opacity(0.09)			# do opacity correction				# tau=0.09 & accum & end & ave
sel = sd.selector()			# Prepare a selection				# copy,0,9
sel.set_ifs(17)				# select HC3N IF				# for i=250,252,2 do begin getps,i,ifnum=0,plnum=0,units='Ta*',
scal.set_selection(sel)			# get this IF					# tau=0.09 & accum & getps, i, ifnum=0,plnum=1,units='Ta*',
stave = sd.average_time(scal, weight='tintsys')	# average in time			# tau=0.09 & accum & end & ave
spave = stave.average_pol(weight='tsys')	# average polarizations;Tsys-weighted average   # accum
sd.plotter.plot(spave)			# plot						# copy,9,0
											# accum
					# do some smoothing
spave.smooth('boxcar', 5)		# boxcar 5					# boxcar,5
spave.auto_poly_baseline(order=2, threshold=5, chan_avg_limit=4)	# baseline fit order=2	# nfit,2
sd.plotter.plot(spave)			# plot						# baseline

spave.set_unit('GHz')									# freq
sd.plotter.plot(spave)
sd.plotter.set_histogram(hist=True)     # draw spectrum using histogram                 # histogram
sd.plotter.axhline(color='r', linewidth=2) # zline                                       # zline
sd.plotter.save('irc_hc3n_reduced.eps')	  # save postscript spectrum			# write_ps,'irc_hc3n.ps'

spave.set_unit('channel')								# chan
示例#4
0
#scal = sd.calps(s, [20,21,22,23])		# Calibrate CH3OH scans				# for i=21,24,2 do begin getps,i,ifnum=2,plnum=0,units='Ta*',
scal = sd.calps(
    s, [21, 22, 23, 24]
)  # Calibrate CH3OH scans				# for i=21,24,2 do begin getps,i,ifnum=2,plnum=0,units='Ta*',
del s  # remove s from memory
# recalculate az/el (NOT needed for GBT data)
antennaname = scal.get_antennaname()
if (antennaname != 'GBT'):
    scal.recalc_azel(
    )  # recalculate az/el to 		# tau=0.09 & accum & getps, i, ifnum=2,plnum=1,units='Ta*',
scal.opacity(0.09)  # do opacity correction				# tau=0.09 & accum & end & ave
sel = sd.selector()  # Prepare a selection
sel.set_ifs(2)  # select CH3OH IF
scal.set_selection(sel)  # get this IF
stave = sd.average_time(scal, weight='tintsys')  # average in time
spave = stave.average_pol(
    weight='tsys')  # average polarizations;Tsys-weighted (1/Tsys**2) average
sd.plotter.plot(spave)  # plot

# what is going on with autoscaling?

# do some smoothing
spave.smooth('boxcar', 10)  # boxcar 10					# boxcar,10
#spave.auto_poly_baseline(order=5)	# baseline fit order=5				# nfit,5
# you can also set the baseline region              or
basemask = spave.create_mask([350, 2700],
                             [3500, 7500])  # nregion,[500,3500,5000,7500]
spave.poly_baseline(basemask, order=5)  # nfit,5
sd.plotter.plot(spave)  # plot						# baseline
示例#5
0
# scal = sd.calps(s, [20,21,22,23])		# Calibrate HC3N scans				# for i=21,24,2 do begin getps,i,ifnum=0,plnum=0,units='Ta*',
scal = sd.calps(
    s, [21, 22, 23, 24]
)  # Calibrate HC3N scans				# for i=21,24,2 do begin getps,i,ifnum=0,plnum=0,units='Ta*',
#
del s  # remove s from memory
antennaname = scal.get_antennaname()
# recalculate az/el (NOT needed for GBT data)
if antennaname != "GBT":
    scal.recalc_azel()  # recalculate az/el to 		# tau=0.09 & accum & getps, i, ifnum=0,plnum=1,units='Ta*',
scal.opacity(0.09)  # do opacity correction				# tau=0.09 & accum & end & ave
sel = sd.selector()  # Prepare a selection
sel.set_ifs(0)  # select HC3N IF
scal.set_selection(sel)  # get this IF
stave = sd.average_time(scal, weight="tintsys")  # average in time
spave = stave.average_pol(weight="tsys")  # average polarizations;Tsys-weighted (1/Tsys**2) average
sd.plotter.plot(spave)  # plot

# what is going on with autoscaling?

# do some smoothing
spave.smooth("boxcar", 5)  # boxcar 5					# boxcar,5
spave.auto_poly_baseline(
    edge=[50], order=2, threshold=5, chan_avg_limit=4
)  # baseline fit order=2	  # chan & nregion,[500,3000,5000,7500] & nfit,2
sd.plotter.plot(spave)  # plot						# baseline

spave.set_unit("GHz")  # freq
sd.plotter.plot(spave)
sd.plotter.set_histogram(hist=True)  # draw spectrum using histogram                 # histogram