NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Data > IDLDocumentation > IDLDocumentationV1pt2 > GBTIDLExampleAndSampleData
   Changes | Index | Contents | Search | Statistics | Jump to Topic

Sample Data Sets with Example Reduction Sessions

The purpose of this page is to provide a few sample data sets to users who may wish to experiment with GBTIDL but who do not yet have any data to play with. You may wish to experiment with GBTIDL before you have an appropriate data set of your own. Here we provide a few sample data sets. With each data set is an example of how the data might be reduced and analyzed in GBTIDL. The examples are simply guides, and there are many ways to reduce the data in each case.

If you are just getting started with GBTIDL, a good place to begin is the User's Guide for Getting Started.

Example 1: HI Position Switched Data

This is a strightforward observation of HI in a galaxy, observed using position switching. The data set is "clean", so all the data can be included in the averaging. The example data reduction is terse in this case, and aims just to produce an HI spectrum calibrated as antenna temperature (K). The RMS noise and integrated flux density of the HI source are measured.

    filein,'ngc5291.fits'
    summary

    ;
    ; Calibrate and accumulate the data for each scan, and
    ; for each polarization.
    ;

    for i=51,57,2 do begin getps,i,plnum=0 & accum & end
    for i=51,57,2 do begin getps,i,plnum=1 & accum & end
    ave

    ;
    ; set a baseline region and subtract the baseline
    ;

    chan
    nregion,[3300,14800,17900,31000]
    nfit,3
    sety, 0.2, 0.5
    bshape
    baseline
    unzoom

    ;
    ; apply some smoothing, then measure statistics
    ;

    hanning,/decimate
    bdrop,2500
    edrop,2500
    velo
    stats, 2000, 3000    ; this gives the RMS: 13.5 mJy
    stats, 3900, 4800    ; this gives the integrated area: 60.439 K km/s
    boxcar, 8            ; more smoothing

Example 2: OH/HI Frequency Switched Data

This is a slightly more involved data set than the previous one. In this case, there are 2 spectral windows, or "IFs". One records the 1665/1667 MHz OH masers and the other records the HI emission toward W3(OH). The data are frequency switched. This data includes some integrations in which there are bad data, and so the observer must be careful to inspect and average the data selectively.

   filein,'W3OH.fits'
   summary

   ;
   ; Begin by visually inspecting the data.  Note not all the data is
   ;       "good" so we will need to be selective in the averaging
   ;
   ; The "wait" command simply pauses to give the observer a chance to
   ;       look at the data.
   ;

   for i=79,83 do begin getfs,i,plnum=1,ifnum=0 & wait,2 & end

   ;
   ; Zoom in to the baseline and repeat
   ;

   sety, -2, 2
   for i=79,83 do begin getfs,i,plnum=1,ifnum=0 & wait,2 & end

   ;
   ; Inspect individual integrations within scan 83.
   ; Note, within a scan, some integrations are good and some bad.
   ;

   for i=0,5 do begin getfs,83,int=i,plnum=1,ifnum=0 & wait,2 & end

   ;
   ; We must average only the good integrations.  There are many ways
   ; to approach this problem.  The stack often comes in handy for cases
   ; such as this.  Here's another approach, which is terse but efficient.
   ; We loop through each integration of each scan, test the rms in the
   ; data, and accumulate only the good integrations.  The use of freeze
   ; before the loop and unfreeze after the loop speeds up the processing
   ; by turning off the automatic update of the plotter after each getfs
   ; call.
   ;

   velo
   freeze
   for i=79,83 do begin & $
   for j=0,5   do begin & $
   for k=0,1   do begin & $
    getfs,i,units='Jy',int=j,plnum=k,ifnum=0 & $
    stats,-3000,-2000,ret=a,/quiet & $
    if a.rms lt 0.5 then accum else print,'Skipping ',i,j,k & $
   end & end & end
   unfreeze
   ave

   ; This illustrates an alternative approach that you can use when you
   ; know exactly where the bad data is.  The bad integrations are first
   ; flagged and then the scans for ifnum=0 are averaged, using both
   ; polarizations.  Note that the loop over integrations can now be
   ; eliminated.  getfs averages all integrations and since the bad
   ; integrations are now flagged, they do not contribute to the average.

   flag,[80,82],intnum=[1,3],plnum=1,ifnum=0,idstring='corrupt'
   flag,83,intnum=[2,4],plnum=1,ifnum=0,idstring='corrupt'
   listflags,/summary
   freeze
   for i=79,83 do begin & $
   for k=0,1 do begin  & $
    getfs,i,units='Jy',plnum=k,ifnum=0 & $
    accum & $
   end & end
   unfreeze
   ave

   ;
   ; Extract a region of interest
   ;

   chan
   my_spec = dcextract(!g.s[0],7500,9500)
   bdrop,0
   edrop,0
   show,my_spec
   !g.s[0] = my_spec
   show

   ;
   ; Set the baseline regions using the mouse cursor and subtract
   ; a baseline.
   ;

   sety, -0.2,0.4  ; zoom in a bit
   setregion
   nfit,7
   bshape
   baseline

   ;
   ; Fit Gaussians to one of the maser complexes.  Use fitgauss to specify a 3-component fit.
   ;

   velo
   setx, -60, -30
   freey
   fitgauss

   ;
   ;  Follow the instructions for fitgauss.  Results are:
   ; (results are very slightly dependent on the selected fitting region)
   ;
   ;***** Fitted Gaussians
   ;        Height                    Center (km/s)               FWHM (km/s)
   ; 1       17.98 (   0.09090)    -44.425996 (  0.003274)       1.301 (  0.008033)
   ; 2       5.851 (   0.09489)    -42.228172 (  0.009651)       1.186 (   0.02346)
   ; 3       1.119 (   0.09345)    -47.647915 (   0.04959)       1.218 (    0.1182)

Example 3: H2O Total Power Nod Data

This data set contains an observation of a maser line, observed in total power nod mode. In the first example below we show the simplest (but verbose) method to average and reduce the data. The second example is more involved. We use the stack to gather the scans for averaging. We store the individual scans in internal buffers, and display them all overlaid. Finally we average the data and write the final spectrum to disk.

   filein,'IC1481.fits'
   getnod, 182, plnum=0
   accum
   getnod, 182, plnum=1
   accum
   getnod, 184, plnum=0
   accum
   getnod, 184, plnum=1
   accum

   ;
   ; the other scans can be accumulated similarly
   ;

   ave
   setregion
   nfit, 3
   baseline

   filein,'IC1481.fits'
   summary

   ;
   ; clear the stack, then fill it with even scan numbers in the range 182-188.
   ;

   emptystack
   sclear
   addstack,182,188,2
   tellstack

   ;
   ; Now loop through each scan pair, retrieve the calibrated spectrum,
   ;     accumulate it and also store it in a memory buffer.
   ; The use of freeze and unfreeze before and after the loop speeds
   ; up the processing by disabling the automatic update of the plotter
   ; after each getnod.

   freeze
   for i = 0,!g.acount-1 do begin & $
       getnod, astack(i), plnum=0, units='Jy', tsys=60 & accum & $
       copy,0,i*2+2 & $
       getnod, astack(i), plnum=1, units='Jy', tsys=60 & accum & $
       copy,0,i*2+3 & $
   end
   unfreeze
   ave

   ;
   ; Fit a baseline
   ;

   setregion
   nfit, 3
   bshape
   baseline

   ;
   ; Smooth the spectrum, then save it to disk.
   ;

   hanning, /decimate
   fileout,'saved.fits'
   keep

   ;
   ; Create a plot showing each individual spectrum (2 polarizations per
   ; scan pair) on a single plot, with offsets to make it easier to see
   ; the spectra
   ;

   copy, 2, 0
   baseline
   show
   copy, 0, 2
   freeze
   for i=3,9 do begin copy,i,0 & baseline & bias, float(i-2)*0.2 & copy, 0, i & end
   show, 2
   unfreeze
   for i=3,9 do oshow, i, color=!red

-- JimBraatz - 10 Aug 2005

Attachment: sort Action: Size: Date: Who: Comment:
IC1481.fits action 16994880 11 Aug 2005 - 12:41 JimBraatz  
W3OH.fits action 31659840 11 Aug 2005 - 12:54 JimBraatz  
ngc5291.fits action 46293120 11 Aug 2005 - 13:04 JimBraatz  

Topic GBTIDLExampleAndSampleData . { Edit | Attach | Ref-By | Printable | Diffs | r1.12 | > | r1.11 | > | r1.10 | More }
Revision r1.12 - 12 Jul 2006 - 15:51 GMT - BobGarwood
Parents: IDLDocumentation > IDLDocumentationV1pt2
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.