[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


cygx1_rmsflux.pro cygx1_rmsflux Source code in cygx1_rmsflux.pro

cygx1_rmsflux.pro

NAME: wheretomulti.pro FUNCTION: Convert WHERE output to 2d or 3d indices USAGE: WhereToMulti, Array, Indices, Col, Row, Frame
Input Parameters
   Array: the array that was WHERE'd
   Indices: the indices returned by WHERE
Output Parameters
   Col:     Indices to first dimension.
   Row:     Indices to second dimension.
   Frame:   Indices to third dimension. Returned only for 3-d array.
OPTIONAL ARGUMENTS:

Keyword Parameters

REQUIRED MODULES:

Side Effects

Error Handling
   If Array is not a vector or matrix, all return values are set to zero
   and a message is written to the screen.
Note

Revision History
 1998 Sept 15  J.L.Saba        Developed based on code from David Fanning's
                               web site.

cygx1_rmsflux

Name
          cygx1_rmsflux
Purpose
          calculate the rms variability sigma and the mean flux of
          1s-lightcurve segments, bin sigma as a function of segment
          flux and fit a linear function (according to Uttley, Ph. and
          McHardy, I.M., MNRAS 2001, 323, L26-L30)
FEATURES:
          rmsflux.pro can conveniently be called by allrmsflux.
          When binning sigma as a function of segment flux, each bin
          has to contain at least n_val measurements to ensure an
          accurate estimate of the standard error in the mean sigma.
          The linear fit has the form y=k*x+a (sigma=k*flux+a), so the fit
          results are slope k and offset a.
Category
          timing tools
Calling Sequence

Input Parameters
          id           : string containing the observation
                         (e.g.'28.all.14off')
          obspath      : string giving the directory path to the
                         proposal number
                         (e.g.'/xtescratch/katja/cygex/P30157')
Optional Input Parameters

Keyword Parameters
          eband        : energy band(s); in case you do not want to
                         limit yourself to one eband once, you define
                         in an array which ebands you want to sum up
                         e.g. eband=[1,2,3]
                         default: 1 (lowest energy band)
                         NB: lowest eband has number 1, not 0!
          freqlimits   : lower and upper frequency limits, the rms is
                         to calculated for, e.g. for [0.1,1.,10.] the
                         rms is calculated for three frequency bands
                         default: min/max Fourier frequency
          n_pts        : min. number of data points for the linear
                         fit. When this number is smaller than
                         n_pts, the program exits without result.
                         default: 6
          binnum       : number of bins the flux range is divided into
                         default: 20
          minnum       : min. number of data points in each time bin. When
                         this number is smaller than minnum, the bin is left
                         empty
                         default: 4
          fileoutput   : controls output of result files, written to
                         resultfile and plotfile
                         default: no output
                         to write result files, set fileoutput=1
          chatty       : controls screen output ;
                         default: no output;
                         to turn on screen output, set chatty=1
          seglength    : the length (in seconds) of a lightcurve
                         segment
                         default: 1 (s)
Output Parameters
          b            : slope b of the linear fit
          dev_b        : probable uncertainty sigma of b
          a            : offset a of the linear fit
          dev_a        : probable uncertainty sigma of a
Optional Output

Common Blocks

Side Effects
          the results of the linear fit are written to a file
          obspath+'/'+id+'/light/fourier/rmsflux/rmsfluxfit.txt'
          the linear fit plot is written to a file
          obspath+'/'+id+'/light/fourier/rmsflux/rmsfluxplot.ps'
Restrictions

Procedures Used
          xdrlc_r.pro
          fourierfreq.pro
          psd.pro
          dtcorr.pro
          rmsflux.pro
          rebinlc.pro
Example
          cygx1_rmsflux,'31.all.14off','/xtescratch/katja/cygex/P50110', $
          fileoutput='1'
Revision History
          Version 1.0, 2002/02/22 TG (IAAT)
          Version 1.1, 2002/02/26 TG
                 Use mpfitfun.pro to fit a linear function
                 instead of linfit.pro (uses igamma.pro) as I often received the
                 message "IGAMMA: failed to converge within given parameters"
          Version 1.2, 2002/03/12 JW optional keywords
                 fn=fn,sn=sn,errsn=errsn added
          2002/04/04 TG, JW
                 fundamental change in the binning procedure: does
                 not follow any more rebinlc.pro from the aitlib but
                 uses now the vector notation
          2002/04/23 TG
                 now y=B*X+A AND y=k*(x-c) are fitted and saved
          2003/03/07 TG, JW
                 computes the uncertainties at the 90 % confidence
                 level for the two interesting parameters k and C

Last modified by pro2html on 2005 January 04 at 16:44 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically