Changeset 937 for trunk/test


Ignore:
Timestamp:
03/27/06 19:36:17 (19 years ago)
Author:
mar637
Message:

asap2 version of test script

Location:
trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/mopra.py

    r751 r937  
    66s = scantable("data/mopra_dualif.rpf")
    77q = s.auto_quotient()
    8 q2 = quotient(s.get_scan("*_S"),s.get_scan("*_R"))
    9 del q2,s
     8del s
    109restfreqs = [110.201,86.243]     # 13CO-1/0, SiO the two IF
    1110q.set_restfreqs(restfreqs,"GHz") # set the restfrequencies, as not in data
     
    2120f = fitter()
    2221f.set_scan(q)
    23 q.set_cursor(IF=0)
     22selection = selector()
     23selection.setifs([1])
     24q.set_selection(selection)
    2425f.set_function(gauss=2) # fit two gaussians
    2526f.fit()
  • trunk/test/parkes-pol.py

    r744 r937  
    33
    44rcParams['verbose'] = 0
     5rcParams['plotter.ganged'] = 0
    56
    67# Don't plot to the screen...
     
    1617data_1665.set_freqframe('LSRK')
    1718
    18 # Make a copy for the 1667 transition
    19 data_1667 = data_1665.copy()
    20 data_1667.set_restfreqs(lines = ['OH1667'])
    21 data_1667.set_unit('km/s')
    22 data_1667.set_freqframe('LSRK')
     19# Look at the first scan
     20from asap._asap import selector
     21selection = selector()
     22selection._setscans([0])
     23data_1665._setselection(selection)
    2324
     25d1_5 = data_1665.copy()
     26d1_7 = data_1665.copy()
    2427
    25 # Look at the first scan
    26 d1_5 = data_1665.get_scan(0)
    27 d1_7 = data_1667.get_scan(0)
     28d1_7.set_restfreqs([1667.0],'MHz')
     29# merge the two scans back together into a new scantable
     30plotscans = merge(d1_5,d1_7)
     31print plotscans.summary()
     32del d1_5,d1_7
    2833
    2934# Baseline
    30 msk = d1_5.create_mask([-30,-25],[-5,0])
    31 d1_5.poly_baseline(msk,1)
    32 msk = d1_7.create_mask([-30,-25],[-5,0])
    33 d1_7.poly_baseline(msk,1)
    34 
     35msk = plotscans.create_mask([-30,-25],[-5,0])
     36plotscans.poly_baseline(msk,1)
    3537# Plot the results
    36 plotter.plot(d1_5,d1_7)
    3738plotter.set_mode('p','s')
    3839plotter.set_layout(2,1)
    3940plotter.set_range(-30,0)
    40 plotter.set_cursor(pol=['I','Q','U','V'])
    41 plotter.set_cursor(pol=['I','Plinear'])
    42 plotter.set_cursor(pol=['RR','LL'])
    43 plotter.save('output/parkes_rrll.png')
     41selection._reset()
     42selection._setpolstrings(['I','Q', 'U', 'V'])
     43#plotter.set_selection(selection)
     44#selection._setpolstrings(['I','Plinear'])
     45#plotter.set_selection(selection)
     46#selection._setpolstrings(['RR','LL'])
     47plotter.plot(plotscans)
     48plotter.set_selection(selection)
     49plotter.save('/nfs/wwwpeople/mmarquar/parkes.png', dpi=80)
     50#plotter.save('output/parkes_rrll.png')
    4451
    4552print "Parkes-Pol Test successful"
  • trunk/test/tid.py

    r794 r937  
    44rcParams['verbose'] = 0
    55
     6rcParams['plotter.ganged'] = 0
    67# Don't plot to the screen...
    78del plotter
     
    1213# Create the quotient spectra
    1314data = scantable('data/tid-t002.rpf')
    14 s = data.get_scan('*[^we]')
    15 r = data.get_scan('*[we]')
    16 q = quotient(s,r)
    17 
     15q = data.auto_quotient()
    1816# Set the restfreq for each IF
    1917q.set_restfreqs(freqs= [23694.4700e6,23722.6336e6])
    2018q.set_unit('km/s')
    2119q.set_freqframe('LSRK')
    22 
    2320# Align frequencies
    24 
    25 q.freq_align(perif=True)
    26 
     21qa = q.freq_align(insitu=False)
    2722# Recalculate the az/el
    28 
    29 q.recalc_azel()
    30 
     23qa.recalc_azel()
    3124# Correct for gain curve and opacity
    32 q.gain_el()
    33 q.opacity(0.075)
    34 
     25qa.gain_el()
     26qa.opacity(0.075)
    3527# Average in time
    36 av = average_time(q)
    37 
     28av = qa.average_time()
    3829# Baseline
    3930msk=av.create_mask([-70,-50],[40,60])
    4031av.poly_baseline(msk,1)
    41 
    42 plotter.set_mode('i')
     32plotter.set_mode('i','s')
    4333plotter.plot(av)
    44 plotter.save('output/tid.png')
     34plotter.save('output/tid.png', dpi=80)
    4535
    4636# Do some random processing, just to test these functions
Note: See TracChangeset for help on using the changeset viewer.