| Last change
 on this file since 1714 was             1038, checked in by mar637, 20 years ago | 
        
          | 
have to check if output dir is there
 | 
        
          | 
              
Property                 svn:eol-style
 set to                 native
Property                 svn:executable
 set to                 *
Property                 svn:keywords
 set to                 Author Date Id Revision | 
        
          | File size:
            985 bytes | 
      
      
| Line |  | 
|---|
| 1 | #!/usr/bin/env python | 
|---|
| 2 | from asap import * | 
|---|
| 3 |  | 
|---|
| 4 | import os | 
|---|
| 5 | outdir = "./output" | 
|---|
| 6 | if not os.path.exists(outdir): | 
|---|
| 7 | os.mkdir(outdir) | 
|---|
| 8 |  | 
|---|
| 9 | rcParams['verbose'] = 0 | 
|---|
| 10 |  | 
|---|
| 11 | rcParams['plotter.ganged'] = 0 | 
|---|
| 12 | # Don't plot to the screen... | 
|---|
| 13 | del plotter | 
|---|
| 14 | plotter = asapplotter(False) | 
|---|
| 15 |  | 
|---|
| 16 | print "Test of Tidbinbilla" | 
|---|
| 17 |  | 
|---|
| 18 | # Create the quotient spectra | 
|---|
| 19 | data = scantable('data/tid-t002.rpf') | 
|---|
| 20 | q = data.auto_quotient() | 
|---|
| 21 | # Set the restfreq for each IF | 
|---|
| 22 | q.set_restfreqs(freqs= [23694.4700e6,23722.6336e6]) | 
|---|
| 23 | q.set_unit('km/s') | 
|---|
| 24 | q.set_freqframe('LSRK') | 
|---|
| 25 | # Align frequencies | 
|---|
| 26 | q.freq_align() | 
|---|
| 27 | # Recalculate the az/el | 
|---|
| 28 | q.recalc_azel() | 
|---|
| 29 | # Correct for gain curve and opacity | 
|---|
| 30 | q.gain_el() | 
|---|
| 31 | q.opacity(0.075) | 
|---|
| 32 | # Average in time | 
|---|
| 33 | av = q.average_time() | 
|---|
| 34 | # Baseline | 
|---|
| 35 | msk=av.create_mask([-70,-50],[40,60]) | 
|---|
| 36 | av.poly_baseline(msk,1) | 
|---|
| 37 | plotter.set_mode('i','s') | 
|---|
| 38 | plotter.plot(av) | 
|---|
| 39 | plotter.save('output/tid.png', dpi=80) | 
|---|
| 40 |  | 
|---|
| 41 | # Do some random processing, just to test these functions | 
|---|
| 42 | av.smooth('gauss',5) | 
|---|
| 43 | av.scale(1.05) | 
|---|
| 44 | av.add(0.05) | 
|---|
| 45 |  | 
|---|
| 46 | print "Tid test finished successfully" | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.