rfi idl routines

Last modified: Tue Apr 2 12:18:04 2013.


List of Routines


Routine Descriptions

FINDRDRIPP - THE THE IPPS OF A RADAR FROM TOTAL POWER DATA

[Next Routine] [List of Routines]
NAME:
findrdripp - the the ipps of a radar from total power data
SYNTAX:nipps=findrdripp(d,minipp,maxipp,maxNumipp,onval,ipps,offset,
                   ipplen=ipplen,ipppos=ipppos
ARGS:
   d[npts]: total power time series for radar.
   minipp : float minium ipp to allow. units = sample rate
   maxipp : float maximum ipp to allow. units = sample rate
maxNumipp : int   max number of distinct ipps to allow
     onval: float The value of d that --> radar is on.
 KEYWORDS:
   nippcor: long number of ipps to use for correlation to find offset.
                 default is 40

RETURNS:
 nipps    : long  number of ipps found.
  ipps[m] : float The ipps that were found.
offset    : long  the offset to start of first ipp.
KEYWORDS:
   ipplen[]: int  the length of each ipp found for all the data
   ipppos[]: long  index into d for each ipp found

DESCRIPTION:
   Given a total power times series for a radar try and find the 
ipps that the radar uses. The user specifies a threhold above which the
radar is determined on (this does not have to be 100% accurate). The 
routine then finds the indices for all points above this value. It then
looks for all indices that have at least minipp samples before it less than
this threshould values. These indices are then marked as ipp starts. 
The difference between ipp starts are then computed and all ipplens greater
than the maximum ipp are discarded (since we may have missed some of the
ipps). The ipplen is then sorted and the transitions are marked. The 
median value between transistions is then taken as the ipps. 

The total ipp (length before ipp repeats) is computed. Each ipp that is
then crosscorrelated with 40 ipptot worth of data looking for where this
ipp starts. The order of the ipps is set to reflect the data order and the
offset in the dataset for the first ipp is also returnd.

NOTES:
   1. You need at least 40 complete cycles of the data.
   2. you may need to play with minipp,maxipp and maxnumipp a little.
   3. if you supply the key ipplen you can see the ipps that the
      routine is catching ipp per ipp.
   4. This returns the ipptot to within 1 sample. You then need to 
      look far down the dataset using ipptot and find the fractional
      value:
EXAMPLES:
   1. To check that it worked.
      eg.  
      ippcum=total(ipps,/cum)  
      hor,0,ipptot*1.5
      plot,d[0:ipptot*1.5]
      flag,ippcum+offset,color=2
   2. to figure out what eps should be.
      eps=0.
      l=offset+nipptot*(ipptot+eps) 
   plot,t[l:l+ipptot*1.5]
   flag,ippcum+offset;
   loop adjusting eps till the flags overlap the data.

(See /pkg/rsi/local/libao/phil/rfi/findrdripp.pro)


MKAEROSTATROT - MAKE COMPLETE AEROSTAT MODEL (1 ROTATION)

[Previous Routine] [Next Routine] [List of Routines]
NAME:
mkaerostatrot - make complete aerostat model (1 rotation)
SYNTAX: buf=mkaerostatrot(nosdlb=nosdlb,noblank=noblank,rotFudge=rotFudge,$
                          nogauss=nogauss,ippsused=ippsused)
ARGS:
   NONE
KEYWORDS:
  noblank: if set then don't include the 42 degrees of blanking about
              the observatory azimuth position.
  nogauss: if set then don't include the gaussian beam as it sweeps
               by the observatory. This leaves the amplitude constant. The
               default is to have main beam and sidelobes by gaussians
               with amplitudes 50db/38db above the noise floor. If nogauss
               is set, then nosdlb is assumed.
   nosdlb: if set then do not include the two sidelobes at +/- 110 degrees.
               nogauss implies nosdlb.
 rotFudge: float change the default rotational width of the beam as it
               passed in front of the observatory. By default the
               fwhm of the gaussian is set so that the edge of the 
               blanking region (.7 secs from bore sight) is 12 db down from
               the peak. rotFudge multiples the fwhm of the beam.
               If nogauss then rotFudge is ignored.
RETURNS:
   buf[1200000]: float  buffer holding 1 12 second rotation of the
                        aerostat at 1 usec sampling (in the time domain). 
DESCRIPTION:
   create a model of the aerostat radar output for 1 12 second rotation
at 1 usecond resolution. The default parameters are:
1. pulsewidth 320 usecs
2. 7 ipps: [3771.,3504.,3076,2809.,2903.5,3289.,3676] inusecs
3. rotation period 12 seconds.
4. Start with gaussian noise with a 1 sigma level of 5 counts
5. For each radar pulse increase the level by 10 counts.
6. place a gaussian at the center of the buf of amplitude 1e6 for when
   the radar points at ao.
7. Add two sidelobe gaussian of the same width at -108 degrees and 115
   degrees from ao boresight. This should be 12db down from the boresight
   amplitude.
8. blank the boresight signal for +/- 21 degrees from ao boresight.
9. arrange the width of the gaussian so that the edge of the blanking
   is 12 db down from the peak (so it is equal to the sidelobes).
   This turns out to be 12db down at the edge of the blanking region.

   On return there will 12000000 samples with a 1 sigme level of 5 counts.
added to this is the aerostat values that increase the noise by 10 counts
on each pulse. The blanking region will be included. On gaussian (with 
fwhm of .7 secs and amplitude 1e6) is centered at the middle of the buffer
(boresight to ao) and two sidelobes (12db down) are positioned at 
azimuths -108 and +115 degrees from boresight.
   The keywords allow you to remove some of these options.
Note:
   when matching the results to pulsar data it lookes like rotFudge
needs to be set to about 1.8.  This implies that the rotation width
needs to be wider. This may be because the amplitude of the main peak
is selected incorrectly (since it is never measured).

(See /pkg/rsi/local/libao/phil/rfi/mkaerostatrot.pro)


MKFAAROT - MAKE COMPLETE FAA MODEL (1 ROTATION)

[Previous Routine] [Next Routine] [List of Routines]
NAME:
mkfaarot - make complete faa model (1 rotation)
SYNTAX: buf=mkfaarot(rotFudge=rotFudge,$
                     nogauss=nogauss,ippsused=ippsused)
ARGS:
   NONE
KEYWORDS:
  nogauss: if set then don't include the gaussian beam as it sweeps
               by the observatory. This leaves the amplitude constant. The
               default is to have main beam and sidelobes by gaussians
               with amplitudes 50db/38db above the noise floor. If nogauss
               is set, then nosdlb is assumed.
 rotFudge: float change the default rotational width of the beam as it
               passed in front of the observatory. By default the
               fwhm of the gaussian is set so that the edge of the 
               blanking region (.7 secs from bore sight) is 12 db down from
               the peak. rotFudge multiples the fwhm of the beam.
               If nogauss then rotFudge is ignored.
RETURNS:
   buf[1200000]: float  buffer holding 1 12 second rotation of the
                        faa at 1 usec sampling (in the time domain). 
DESCRIPTION:
   create a model of the faa radar output for 1 12 second rotation
at 1 usecond resolution. The default parameters are:
1. pulsewidth 5 usecs
2. 5 ipps: [2633.,2821.,2746.,2595.,3310.]
3. rotation period 12 seconds.
4. Start with gaussian noise with a 1 sigma level of 5 counts
5. For each radar pulse increase the level by 10 counts.
6. place a gaussian at the center of the buf of amplitude 1e5 for when
   the radar points at ao.
7. set the gaussian fwhm width to be 50 milliseconds.

   On return there will 12000000 samples with a 1 sigme level of 5 counts.
added to this is the faa values that increase the noise by 10 counts
on each pulse. The blanking region will be included. On gaussian (with 
fwhm of .7 secs and amplitude 1e6) is centered at the middle of the buffer
(boresight to ao) and two sidelobes (12db down) are positioned at 
azimuths -108 and +115 degrees from boresight.
   The keywords allow you to remove some of these options.
Note:
   when matching the results to pulsar data it lookes like rotFudge
needs to be set to about 1.8.  This implies that the rotation width
needs to be wider. This may be because the amplitude of the main peak
is selected incorrectly (since it is never measured).

(See /pkg/rsi/local/libao/phil/rfi/mkfaarot.pro)


RDRIMG - MAKE AN IMAGE FROM A RADAR TIME SERIES.

[Previous Routine] [Next Routine] [List of Routines]
NAME:
rdrimg - make an image from a radar time series.
SYNTAX: img=rdrimg,d,smptosue,ipps,ipptot,first=first
ARGS:
    d[npts]: float  radar total power time series
   smptouse: long   number samples in each ipp to plot starting from first
ipps[nipps]: long   ipp length in ipps for each ipp.
     ipptot: double the sum of ipps[] with any measured fractional values.
KEYWORDS:
 
      first: long    index first sample to plot (def 0)
DESCRIPTION:
   Make a image of a radar dataset. The left side of the image will
be at the same phase of the radar ipp. Take a subset of the points
(smptouse) for each row. Use ipptot to move from one set of ipps to the
next. With a set use the individual ipps to move from 1 ipp to the next.
When specifying first be careful the first ipp found is the first one in
ipps[].

EXAMPLE:
   findrdripp,d,minipp,maxipp,10,radonminval,ipps,offset
; compute eps fractional offset by looking farther down in the dataset.
   ipptot=total(ipps)
   ipptouse=ipptot + eps 
   smptouse=800
   img=rdrimg(d,smptouse,ipps,ipptotuse,first=30)
   imgdisp,img,zy=-5

(See /pkg/rsi/local/libao/phil/rfi/rdrimg.pro)


RFIPUNTASALINASFREQ - RETURN PUNTA SALINAS RADAR FREQ

[Previous Routine] [List of Routines]
NAME:
rfipuntasalinasfreq - return punta salinas radar freq
SYNTAX:rfipuntasalinasfreq,rinfo 
ARGS: none

RETURNS:
 rinfo[20]: struct array holding 20 channels
                   each channel has two freq

DESCRIPTION:
   Return frequency info for the punta salinas radar
rinfo[n] is an array with n channels. A channel is the set of 
frequencies that can be transmitted in 1 ipp 

 rfinfo[0].channum  = channel number 1...20
 rfinfo[0].name     = " " or  'modeA', 'modeB','modeC' 
 rfinfo[0].freq[2]= two freq centers
 rfinfo[0].bwlist   = [.625,1.25] long,shortrange bandwidths

Example
1. flag the puntasalins freq in an corrlator plot:
   @corinit  (or @wasinit)
   @rfininit
   .. input correlator data
   rfipuntasalinasfreq,rdrinfo
   fl=reform(rdrinfo.freq,2*20)
   corplot,b,fl=fl,lnsfl=1
2. flag each radar chan in a different color:
   x=....
   y=...
   plot,x,y
	nchan=20
   for i=0,nchan-1 do flag,rdrinfo[i].freq,col=colph[(i mod 11) + 1],linest=2
   

(See /pkg/rsi/local/libao/phil/rfi/rfipuntasalinasfreq.pro)