This page was created by the IDL library routine
mk_html_help
. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Mon Mar 24 10:25:42 2014.
============================================================================ function : analytger purpose : calculate linear regression line to data calls : length.pro written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: erg = analytger(x,y)" print print, " Calculate linear regression line to data." print, " Returns vector(2), [slope,offset], corresponding to " print, " y = erg(0) * x + erg(1)." print print, " Arguments" print, " Input :" print, " x : independent variable" print, " y : dependent variable, y = m*x + b" print print, " Output :" print, " erg = [slope,offset]" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/analytger.pro)
============================================================================ function : associate purpose : read unformatted data of given size opens and closes file unit (contrary to assoc) written : cbeck@KIS 2003 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 3) then begin print print, "usage: erg = associate(file,array_structure,number," print, " offset = offset)" print print, " Opens file unit to file, points in file, reads" print, " data structure of given format, close file unit." print print, " Arguments" print, " Input :" print, " file : filename" print, " array_structure : 2-d- array with same" print, " size and type as data." print, " number : number of image to be read." print print, " Keywords:" print, " offset : offset of first image in bytes" print, " from start of file to read, e.g." print, " fits-files." print, " Output :" print, " erg = matrix with dimension of array_structure" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/associate.pro)
============================================================================ procedure : average2bins purpose : average data of two dependent variables (a,b) in a for reduction of scatter written : cbeck@KIS 2005 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 5) then begin print print, "usage: average2bins,a,b,binning,aa,bb,rms = rms" print, " ,do_rms = do_rms" print print, " Average data of a and b. Takes average of" print, " #binning values of a, calculates mean for" print, " the corresponding values of b." print print, " Arguments" print, " Input :" print, " a,b : two dependent variables" print, " binning : number of values to be" print, " averaged over." print, " aa,bb : mean values of a and b after averaging." print print, " Keywords:" print, " rms : named variable that contains the" print, " standard deviation of b in each bin." print, " /do_rms : calculate the rms values." print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/average2bins.pro)
============================================================================ function : byte2int purpose : transform data in byte format into two-dimensional unsigned integer array. Range of values 0:65535. calls : uintarr.pro (idl-implemented) written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 3) then begin print print, "usage: i = byte2int(array,xdim,ydim,/swap)" print print, " Transform byte array of 2 x N size into 2-d matrix" print, " (xdim x ydim) with unsigned integer entries." print, " xdim*ydim must be gt N." print print, " Arguments" print, " array : byte array of size 2 x N" print, " xdim,ydim : dimensions of resulting matrix" print print, " Output:" print, " 2-dim matrix of size (xdim x ydim)," print, " unsigned integer entries." print print, " Keywords:" print, " /swap : exchange low and high byte" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/byte2int.pro)
============================================================================ function : byte2int purpose : transform data in byte format into two-dimensional signed integer array. Range of values -32768 +32767. written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 3) then begin print print, "usage: i = byte2signedint(array,xdim,ydim,/swap)" print print, " Transform byte array of 2 x N size into 2-d matrix" print, " (numx x numy) with signed integer entries." print, " xdim*ydim must be gt N." print print, " Arguments" print, " Input :" print, " array : byte array of size 2 x N" print, " xdim,ydim : dimensions of resulting matrix" print print, " Output:" print, " 2-dim matrix of size (xdim x ydim), signed" print, " integer entries." print print, " Keywords:" print, " /swap : exchange low and high byte" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/byte2signedint.pro)
============================================================================== function: calculate_mirrors purpose : return the reflectivities and retardance of a single mirror written : cbeck@KIS, 10/01 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 5 then begin print print, "usage: mir_par = calculate_mirrors(n,k,eta,d_lambda,nu)" print print, " Calculate mirror reflectivities from refractive" print, " indices and incidence angle." print print, " Arguments" print, " n : refraction index" print, " k : absorption coefficient" print, " d_lambda : thickness of coating in wave-length" print, " fractions d/lambda" print, " nu : refraction index of substrat" print, " eta : incidence angle on mirror [degree]" print print, " Output" print, " vector(3),[rp,rs,ret]" print print, " rs : reflectivity perpendicular to plain" print, " of incidence" print, " rp : reflectivity in the plain of" print, " incidence" print, " ret : retardance of mirror in degrees" print print, " Keywords:" print, " opticthick : calculation as in Cap. 1989" print, " d_lambda and nu are ignored" print print, " Calculation as in the appendix of Skumanich et al.," print, " 1997" return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/calculate_mirrors.pro)
============================================================================ function : check_existence purpose : check if file exist (read) or can be modified (write) calls : spawn, size (idl-implemented), read_keyboard.pro written : cbeck@KIS 3/03 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: erg = check_existence(infile,change=change,read_file =" print, " read_file,write_file=write_file," print, " ,verbose = verbose)" print print, " Check if infile exists (read) or exists and can be" print, " modified (write). Default is check read and write." print print, " Arguments" print, " Input :" print, " infile : filename as string" print print, " Output:" print, " vector(2), [read = 0 or 1 ,write = 0 or 1 ]" print, " read = 1 : exist" print, " write = 1 : can be created" print print, " Keywords:" print, " /change : query user if negative result" print, " abort with" print, " /read_file, /write_file : check if file is" print, " read-/writeable" print, " /verbose : print run-time info" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/check_existence.pro)
Calling sequence: constructTmatrix,tt,angles,lam,Tmat Inputs: tt -> Array with 5+7*nw elements containing the telescope parameters (see below, nw=number of wavelengths). All angles in tt are in deg. angles -> 3-element vector containing the VTT angles (AZ,EL,TB) (degrees) lam -> Wavelength in Angstroms for which the T-matrix is desired Outputs: Tmat -> 4x4 Mueller matrix of the VTT NOTE: All matrices returned by this procedure are in the form A(column,row) This means that the usual matrix multiplication operation should be done with the ## operator. For instance, if we want to apply Tmat to an unpolarized vector, we should do: Out = Tmat##[1,0,0,0] Optional keywords: pol_angle -> If this keyword is present, a perfect linear polarizer is placed on top of the telescope. The value of pol_angle should be the angle in degrees of the polarizer axis. NOTE: The WPOL angle in the ASP file headers has the wrong sign!! polM -> If pol_angle is present, polM returns a 4x4 Mueller matrix of the entrance window polarizer. Otherwise, the identity matrix is returned nonorm -> Do not normalize Tmat to its first element Telescope parameters (tt): tt(0)=Number of wavelengths tt(1)=Entrance Window (EW) retarder orientation tt(2)=Exit Window (XW) retarder orientation tt(3)=Polarimeter-Telescope reference frame rotation tt(4)=Entrance window polarizer angle offset Let i denote the wavelength index, starting with 0 running up to tt(0)-1 tt(5+i*7)=Wavelength (A) tt(6+i*7)=EW retardance tt(7+i*7)=XW retardance tt(8+i*7)=Coelostat rs/rp tt(9+i*7)=Coelostat retardance tt(10+i*7)=Primary mirror rs/rp tt(11+i*7)=Primary mirror retardance
(See /home/cbeck/firs_soft2/constructtmatrix_new.pro)
============================================================================ procedure : convert_time purpose : convert time from seconds to hour,min,sec written : cbeck@KIS 10/01 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 4) then begin print print, "usage: convert_time,time,hour,min,sec print print, " Convert time from seconds to hour,min,sec." print print, " Arguments" print, " Input :" print, " time : time in seconds to be converted" print, " Output :" print, " hour,min,sec : converted time" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/convert_time.pro)
============================================================================== procedure : create_gaintables_firs_630 purpose : build the pixel-by-pixel gain table from averaged dark and flat for FIRS 630 nm data calls : deskew1.pro, shift_frac.pro, lpff.pro written : cbeck@KIS 3/03 ============================================================================== Check number of parameters. ============================================================================== f (n_params() lt 10) or n_elements(help) ne 0 then begin print print, "usage: create_gaintables_firs_630,ilo,ihi,lastx,firsty,lasty,iref,dc,gainsave,gaincoarse,posref,plt=plt,verbose=verbose,long = long,wave_lim = wave_lim,rows = rows,rem_scratch = rem_scratch,help = help" print print, " Calculate the pixel-by-pixel gain table from averaged" print, " dark and flat for FIRS 630 nm data." print, " " print print, " Arguments" print, " ilo,ihi: range around telluric spectral line" print, " lastx: dimension in x" print, " firsty,lasty: dimension in y" print, " iref: average dc-corrected flat field data" print, " dc: dark current image" print, " gainsave: variable for gain table" print, " gaincoarse: variable for coarse gaintable" print," posref: reference position for spectral line" print print, " Keywords :" print, " plt: do plotting" print, " verbose: print additional info on terminal" print, " long: obsolete switch" print, " wave_lim: wavelength range used in iteration" print, " of gaintable" print, " rows: location of subdivisions along the slit" print, " rem_scratch: obsolete keyword" print, " /help : switch to active the help text above." print top eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/create_gaintables_firs_630.pro)
============================================================================ function : crossprod purpose : crossproduct between 3-dimensional vectors written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: erg = crossprod(x,y) print print, " Calculate crossproduct between 3-dim vectors, z=x x y." print print, " Arguments" print, " Input :" print, " x,y : input vectors" print print, " Output:" print, " z = fltarr(3)" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/crossprod.pro)
NAME: DAYCNV PURPOSE: Converts Julian dates to Gregorian calendar dates CALLING SEQUENCE: DAYCNV, XJD, YR, MN, DAY, HR INPUTS: XJD = Julian date, positive double precision scalar or vector OUTPUTS: YR = Year (Integer) MN = Month (Integer) DAY = Day (Integer) HR = Hours and fractional hours (Real). If XJD is a vector, then YR,MN,DAY and HR will be vectors of the same length. EXAMPLE: IDL> DAYCNV, 2440000.D, yr, mn, day, hr yields yr = 1968, mn =5, day = 23, hr =12. WARNING: Be sure that the Julian date is specified as double precision to maintain accuracy at the fractional hour level. METHOD: Uses the algorithm of Fliegel and Van Flandern (1968) as reported in the "Explanatory Supplement to the Astronomical Almanac" (1992), p. 604 Works for all Gregorian calendar dates with XJD > 0, i.e., dates after -4713 November 23. REVISION HISTORY: Converted to IDL from Yeoman's Comet Ephemeris Generator, B. Pfarr, STX, 6/16/88 Converted to IDL V5.0 W. Landsman September 1997
(See /home/cbeck/firs_soft2/daycnv.pro)
============================================================================ procedure : deskew1 purpose : calculate position of line cores for image. Fit polynomial on course, shift all images to line core at slit height /4 . calls : sshift_img.pro, lpff.pro written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 11) then begin print print, "usage: deskew1,icorr,qcorr,ucorr,vcorr,ilo,ihi,firsty,lasty$" print, " ,y1,y2,repetitions,/plt,straight = straight" print print, " Deskew spectral images. Reference value is line core" print, " of spectral line at 1/4 slit height." print print, " Arguments" print, " Input :" print, " icorr,qcorr,ucorr,vcorr : polarization images" print, " ilo,ihi : range of spectral line to be" print, " used in aligning" print, " firsty,lasty : useable range along slit" print, " y1,y2 : full data range" print, " repetitions : number of iterative repetitions" print, " to improve accuracy" print, " Keywords" print, " plt : plot line cores before and" print, " after shift" print, " straight : use only 1st degree polynomial" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/deskew1.pro)
============================================================================ procedure : draw_poly purpose : draw (filled) polygon given by x_i,y_i (z_i) vertices written : cbeck@KIS2004 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: draw_poly,x1,y1,index,normal = normal,device = device" print, " ,data = data,line_fill = line_fill" print, " ,orientation = orientation,spacing = spacing" print, " ,invisible = invisible,t3d = t3d,z1 = z1" print print, " Draw polygon to the vertices [x1_i,y1_i]. Polygon may" print, " completely filled, filled with line of a certain" print, " spacing, or only the contours are plotted." print, " In 3-D mode, z1 is the third coordinate." print print, " Arguments" print, " Input :" print, " x1,y1 : vectors of the same length, containing" print, " the position of the corners." print, " index : color of polygon or lines." print print, " Keywords:" print, " normal,device,data : as usual" print, " line_fill : fill with lines instead of solid" print, " orientation : orientation of the lines in deg" print, " spacing : distance between two lines" print, " invisible : draw only outlines of polygon" print, " /t3d : activate 3-D perspective" print, " z1 : z-coordinate, same size as x1,y1" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/draw_poly.pro)
============================================================================ procedure : draw_rec purpose : draw rectangle in plot written : bingert@KIS ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: draw_rec,x,y,color=color,data=data,thick=thick," print, " normal = normal,device = device" print print, " Draw rectangle [x1,y1] to [x2,y2] in plot." print print, " Arguments" print, " Input :" print, " x = [x1,x2] : left and right corner" print, " y = [y1,y2] : lower and upper corner" print print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/draw_rec.pro)
============================================================================ function : extrapolate_xmat purpose : linearly interpolate the fitted X-matrices for choosen rows to all rows along slit author : cbeck@kis 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 3) then begin print print, "usage: result = extrapolate_xmat(rows,xmats,yend,/plot)" print print, " Linearly interpolate along slit the fitted" print, " Xmatrices for choosen rows." print print, " Arguments" print, " Input :" print, " rows : vector(n), containing choosen rows" print, " xmats : fitted X-matrices for single rows," print, " array(n,4,4)" print, " yend : last row of data, starts at 0" print, " Keywords :" print, " /plt : do plotting if set" print print, " returns array(yend,4,4) containg Xmatrices for all" print, " positions along slit from (0:yend-1)" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/extrapolate_xmat.pro)
NAME: FFXREAD Purpose : Read basic FITS files. Explanation : Read an image array from a disk FITS file. Optionally allows the user to read in only a subarray and/or every Nth pixel. Use : FXREAD, FILENAME, DATA [, HEADER [, I1, I2 [, J1, J2 ]] [, STEP]] Inputs : FILENAME = String containing the name of the file to be read. Opt. Inputs : I1,I2 = Data range to read in the first dimension. If passed, then HEADER must also be passed. If not passed, or set to -1,-1, then the entire range is read. J1,J2 = Data range to read in the second dimension. If passed, then HEADER and I1,J2 must also be passed. If not passed, or set to -1,-1, then the entire range is read. STEP = Step size to use in reading the data. If passed, then HEADER must also be passed. Default value is 1. Ignored if less than 1. Outputs : DATA = Data array to be read from the file. Opt. Outputs: HEADER = String array containing the header for the FITS file. Keywords : /COMPRESS - If this keyword is set and non-zero, then then treat the file as gzip compressed. By default FXREAD assumes the file is gzip compressed if it ends in ".gz" NANVALUE = Value signalling data dropout. All points corresponding to IEEE NaN (not-a-number) are set to this value. Ignored unless DATA is of type float or double-precision. EXTENSION = FITS extension. It can be a scalar integer, indicating the extension number (extension number 0 is the primary HDU). It can also be a scalar string, indicating the extension name (EXTNAME keyword). Default: 0 (primary HDU) PROMPT = If set, then the optional parameters are prompted for at the keyboard. AVERAGE = If set, then the array size is reduced by averaging pixels together rather than by subselecting pixels. Ignored unless STEP is nontrivial. Note: this is much slower. YSTEP = If passed, then STEP is the step size in the 1st dimension, and YSTEP is the step size in the 2nd dimension. Otherwise, STEP applies to both directions. NOSCALE = If set, then the output data will not be scaled using the optional BSCALE and BZERO keywords in the FITS header. Default is to scale, if and only if BSCALE and BZERO are present and nontrivial. NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the optional HEADER array will not be changed. The default is to reset these keywords to BSCALE=1, BZERO=0. Ignored if NOSCALE is set. ERRMSG = If defined and passed, then any error messages will be returned to the user in this parameter rather than depending on the MESSAGE routine in IDL. If no errors are encountered, then a null string is returned. In order to use this feature, ERRMSG must be defined first, e.g. ERRMSG = '' FXREAD, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... NODATA = If set, then the array is not read in, but the primary header is read. Calls : GET_DATE, IEEE_TO_HOST, FXADDPAR, FXHREAD, FXPAR, WHERENAN Common : None. Restrictions: Groups are not supported. The optional parameters I1, I2, and STEP only work with one or two-dimensional arrays. J1 and J2 only work with two-dimensional arrays. Use of the AVERAGE keyword is not compatible with arrays with missing pixels. Side effects: If the keywords BSCALE and BZERO are present in the FITS header, and have non-trivial values, then the returned array DATA is formed by the equation DATA = BSCALE*original + BZERO However, this behavior can overridden by using the /NOSCALE keyword. If the data is scaled, then the optional HEADER array is changed so that BSCALE=1 and BZERO=0. This is so that these scaling parameters are not applied to the data a second time by another routine. Also, history records are added storing the original values of these constants. Note that only the returned array is modified--the header in the FITS file itself is untouched. If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO keywords are not changed. It is then the user's responsibility to ensure that these parameters are not reapplied to the data. In particular, these keywords should not be present in any header when writing another FITS file, unless the user wants their values to be applied when the file is read back in. Otherwise, FITS readers will read in the wrong values for the data array. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, May 1992, based in part on READFITS by W. Landsman, and STSUB by M. Greason and K. Venkatakrishna. W. Thompson, Jun 1992, added code to interpret BSCALE and BZERO records, and added NOSCALE and NOUPDATE keywords. W. Thompson, Aug 1992, changed to call FXHREAD, and to add history records for BZERO, BSCALE. Minimium IDL Version: V5.3 (uses COMPRESS keyword to OPEN) Written : William Thompson, GSFC, May 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 17 November 1993. Corrected bug with AVERAGE keyword on non-IEEE compatible machines. Corrected bug with subsampling on VAX machines. Version 3, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 5, Zarro (SAC/GSFC), 14 Feb 1997 Added I/O error checking Version 6, 20-May-1998, David Schlegel/W. Thompson Allow a single pixel to be read in. Change the signal to read in the entire array to be -1 Version 7 C. Markwardt 22 Sep 2003 If the image is empty (NAXIS EQ 0), or NODATA is set, then return only the header. Version 8 W. Landsman 29 June 2004 Added COMPRESS keyword, check for .gz extension Version 9, William Thompson, 19-Aug-2004 Make sure COMPRESS is treated as a scalar Version 10, Craig Markwardt, 01 Mar 2004 Add EXTENSION keyword and ability to read different extensions than the primary one. Version 11, W. Landsamn September 2006 Assume since V5.5, remove VMS support Version 11.1, W. Landsamn November 2007 Allow for possibility number of bytes requires 64 bit integer Version 12, William Thompson, 18-Jun-2010, update BLANK value.
(See /home/cbeck/firs_soft2/ffxread.pro)
============================================================================ procedure : firs_1083_ff purpose : calculate gain table for FIRS IR data author : cbeck@nso Apr 2013 ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_1083_ff,input_dir=input_dir,output_dir=output_dir,no_av = no_av,beam_ang = beam_ang,plt = plt, verbose = verbose, int_limit = int_limit,fringes = fringes,filepath = filepath,flat_file = flat_file,dark_file = dark_file,avdc_only = avdc_only,sspeed = sspeed,change_save = change_save,swap = swap,quit_column = quit_column,yyrange = yyrange,pickx = pickx,sshift = sshift,shifts_manual = shifts_manual,help = help" print print, " Calculate gain table for FIRS data of the IR channel." print, " " print print, " Arguments" print, " input_dir: source directory with raw data." print, " output_dir: destination directory for reduced data." print print, " Keywords :" print, " /no_av: switch to not averaging raw data, but use previously" print, " created save files." print, " beam_angle: fltarr(1). Rotation of beams, overrules" print, " value determined in the routine." print, " /plt : switch on plotting (recommended)" print, " /verbose : switch to activate extensive verbal" print, " output on the terminal." print, " int_limit: fltarr(1). Intensity threshold to" print, " localize the beams/slits. Fraction of" print, " maximal intensity." print, " fringes, filepath: correction of fringes with SIR" print, " obsolete/ignore" print, " flat_file: number of flat field file to be reduced" print, " in the source directory." print, " dark_file: number of dark current file to be used" print, " in the source directory." print, " /avdc_only: switch to only average the DC file." print, " sspeed : speeds up the convergence in iterate_gain." print, " > 0 < ~ 10. Too high value leaves line" print, " residuals." print, " change_save: directory where the file information" print, " on the source directory was saved to." print, " /swap : do a swap endian of the raw data." print, " /check_shift: switch to enforce the manual" print, " check of the shift between beams." print, " Needs to be set if offset between upper/" print, " lower beam is too large to be catched" print, " by correlation." print, " /quit_column: remove missing column at middle of" print, " CCD by interpolation." print, " yyrange : fltarr(4). Height of the two beams along the slit." print, " [y0,y1,y2,y3] = lower (y0,y1) and upper" print, " beam (y3,y4)" print, " /pickx : manually select slits in x direction" print, " /check_lines: manually select spectral lines" print, " /nopause: ignore all stop/pause commands." print, " sshift: fltarr(2). Additional shift to be added" print, " to shifts in all beams. sshift(0) = x" print, " sshift(1) = y" print, " /shifts_manual: overrule of shifts derived from" print, " correlation. Some 2013 data had a dead" print, " pixel that screwed up the correlation" print, " in one beam. Follow instructions on the" print, " terminal." print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_1083_ff.pro)
============================================================================ procedure : firs_1565_obs purpose : reduce FIRS IR (1083 or 1565 nm) data author : cbeck@nso Apr 2013 ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_1565_obs,plt = plt,cont_wl = cont_wl,v2q = v2q, v2u = v2u,beta = beta,obsindex = obsindex,gainindex = gainindex,scan_range = scan_range,verbose = verbose,angle = angle,darkindex = darkindex,cal_file = cal_file,change_save = change_save,tel_cal = tel_cal,input_dir = input_dir,output_dir = output_dir,check_lines = check_lines,ccal_file = ccal_file,flat_file = flat_file,swap = swap,tmat_save = tmat_save,ooutfile = ooutfile,wavelength = wavelength,notelcor = notelcor,pos_lines = pos_lines,offang = offang ,no_align = no_align, quit_column = quit_column,hair_up = hair_up, hair_down = hair_down,check_hairlines = check_hairlines,average_cal = average_cal,catch_dead = catch_dead,smooth_width = smooth_width,disp_scale = disp_scale,help = help" print print, " Reduce FIRS data of the IR channel." print, " " print print, " Arguments" print, " none" print print, " Keywords :" print, " /plt : switch on plotting (recommended)" print, " cont_wl : fltarr(2), [l0,l1] : wavelength pixel" print, " range to use for I->QUV cross-talk" print, " correction. If not provided, it will" print, " be set to the range between the two" print, " solar lines (1082.7/1083)" print, " v2q, v2u: fltarr(1) each. Additional cross-talk" print, " correction coefficient for V->Q, V->U." print, " Q = Q - v2q * V" print, " beta : parasitic light correction;" print, " I = I-beta*. Can remove false " print, " polarisation signal in the telluric lines" print, " obsindex: number of observation file to be reduced" print, " in the source directory." print, " gainindex:number of gain table to be used for the" print, " reduction in the target directory" print, " scan_range: fltarr(2), [s0,s1]; scan steps to be" print, " reduced. If not provided, all steps" print, " will be reduced." print, " /verbose : switch to activate extensive verbal" print, " output on the terminal." print, " angle : fltarr(1). Rotation angle for the beams." print, " Overrules value determined in gain table" print, " calculation." print, " darkindex:number of dark current to be used for the" print, " reduction in the target directory" print, " cal_file: number of calibration file to be used" print, " in the source directory." print, " change_save: directory where the file information" print, " on the source directory was saved to." print, " /tel_cal : switch to de-activate telescope correction" print, " and I -> QUV correction." print, " input_dir: source directory with raw data." print, " output_dir: destination directory for reduced data." print, " /check_lines: switch to enforce the manual selection" print, " of the spectral lines." print, " ccal_file: use a different response function." print, " String with the complete filepath and" print, " filename of the xmat....sav file." print, " flat_file: use a different gain table." print, " String with the complete filepath and" print, " filename of the gain.....sav file." print, " /swap : do a swap endian of the raw data." print, " tmat_save: String with the complete filepath and" print, " filename of the T-matrix parameter file." print, " ooutfile: use different filename for output file." print, " Must include file path." print, " wavelength: wavelength of data in AA" print, " /notelcor: do not apply telescope correction." print, " pos_lines:fltarr(2), location of spectral lines in pixel. " print, " offang: offset angle between telescope and instrument calibration." print, " /no_align: do not use hairline for spatial alignment." print, " /quit_column:switch to replace missing column at" print, " middle of IR CCD chip. Cosmetics." print, " hair_up: fltarr(2), upper and lower range in pixels" print, " around position of hairline." print, " hair_down: fltarr(2), upper and lower range in pixels" print, " around position of 2nd hairline." print, " Ignore, currently not used." print, " /check_hairlines: switch to enforce the manual selection" print, " of the hair lines location." print, " /average_cal: use only the polarimetric response" print, " from upper half of the spectrum" print, " (beam vignetting in calibration unit)" print, " /catch_dead: try to remove dead pixels" print, " smooth_width: fltarr(1). Width in pixels along" print, " the slit over which will be smoothed" print, " to remove spikes from flat field residuals." print, " disp_scale: fltarr(1), change size of display" print, " windows on small screens, standard size" print, " is divided by / disp_scale" print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_1565_obs.pro)
============================================================================ procedure : firs_630_ff purpose : calculate gain table for FIRS 630 nm data author : cbeck@nso Apr 2013 ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_630_ff,input_dir=input_dir,output_dir=output_dir,no_av = no_av,beam_ang = beam_ang,plt = plt, verbose = verbose, int_limit = int_limit,flat_file = flat_file,dark_file = dark_file,avdc_only = avdc_only,sspeed = sspeed,change_save = change_save,swap = swap,check_shift = check_shift,yyrange = yyrange,help = help" print print, " Calculate gain table for FIRS data of the 630 nm channel." print, " " print print, " Arguments" print, " none" print print, " Keywords :" print, " input_dir: source directory with raw data." print, " output_dir: destination directory for reduced data." print, " /no_av: switch to not averaging raw data, but use previously" print, " created save files." print, " beam_angle: fltarr(1). Rotation of beams, overrules" print, " value determined in the routine." print, " /plt : switch on plotting (recommended)" print, " /verbose : switch to activate extensive verbal" print, " output on the terminal." print, " int_limit: fltarr(1). Intensity threshold to" print, " localize the beams/slits. Fraction of" print, " maximal intensity." print, " flat_file: number of flat field file to be reduced" print, " in the source directory." print, " dark_file: number of dark current file to be used" print, " in the source directory." print, " /avdc_only: switch to only average the DC file." print, " sspeed : speeds up the convergence in iterate_gain." print, " > 0 < ~ 10. Too high value leaves line" print, " residuals." print, " change_save: directory where the file information" print, " on the source directory was saved to." print, " /swap : do a swap endian of the raw data." print, " /check_shift: switch to enforce the manual" print, " check of the shift between beams." print, " Needs to be set if offset between upper/" print, " lower beam is too large to be catched" print, " by correlation." print, " yyrange : fltarr(4). Height of the two beams along the slit." print, " [y0,y1,y2,y3] = lower (y0,y1) and upper" print, " beam (y3,y4)" print, " /pickx : manually select slits in x direction" print, " /check_lines: manually select spectral lines" print, " /nopause: ignore all stop/pause commands." print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_630_ff.pro)
============================================================================ procedure : firs_630_obs purpose : reduce FIRS 630 nm data author : cbeck@nso Apr 2013 ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_630_obs,plt = plt,v2q = v2q, v2u = v2u,beta = beta,obsindex = obsindex,gainindex = gainindex ,scan_range = scan_range,smooth_width = smooth_width,spec_grad = spec_grad,verbose = verbose,angle = angle,darkindex = darkindex,cal_file = cal_file,change_save = change_save,tel_cal = tel_cal,input_dir = input_dir,output_dir = output_dir,check_lines = check_lines,ccal_file = ccal_file,flat_file = flat_file,swap = swap,tmat_save = tmat_save,ooutfile = ooutfile,wavelength = wavelength,notelcor = notelcor,pos_lines = pos_lines,cont_wl = cont_wl,offang = offang,hair_up = hair_up, hair_down = hair_down,check_hairlines = check_hairlines,no_align = no_align,help = help" print print, " Reduce FIRS data of the 630 nm channel." print, " " print print, " Arguments" print, " none" print print, " Keywords :" print, " /plt : switch on plotting (recommended)" print, " cont_wl : fltarr(2), [l0,l1] : wavelength pixel" print, " range to use for I->QUV cross-talk" print, " correction. If not provided, it will" print, " be set to the range around the telluric" print, " 630.27 nm line." print, " v2q, v2u: fltarr(1) each. Additional cross-talk" print, " correction coefficient for V->Q, V->U." print, " Q = Q - v2q * V" print, " pos_lines:fltarr(4),location of spectral lines in pixel" print, " beta : parasitic light correction;" print, " I = I-beta*. Can remove false " print, " polarisation signal in the telluric lines" print, " obsindex: number of observation file to be reduced" print, " in the source directory." print, " gainindex:number of gain table to be used for the" print, " reduction in the target directory" print, " scan_range: fltarr(2), [s0,s1]; scan steps to be" print, " reduced. If not provided, all steps" print, " will be reduced." print, " smooth_width: fltarr(1). Width in pixels along" print, " the slit over which will be smoothed" print, " to remove spikes from flat field residuals." print, " /spec_grad: switch to activate the removal of" print, " wavelength gradients. Attention: hard-" print, " wired range. Use not recommended." print, " /verbose : switch to activate extensive verbal" print, " output on the terminal." print, " angle : fltarr(1). Rotation angle for the beams." print, " Overrules value determined in gain table" print, " calculation." print, " darkindex:number of dark current to be used for the" print, " reduction in the target directory" print, " cal_file: number of calibration file to be used" print, " in the source directory." print, " change_save: directory where the file information" print, " on the source directory was saved to." print, " /tel_cal : switch to de-activate telescope correction" print, " and I -> QUV correction." print, " input_dir: source directory with raw data." print, " output_dir: destination directory for reduced data." print, " smooth_width: ignore, deactivated." print, " /check_lines: switch to enforce the manual selection" print, " of the spectral lines." print, " ccal_file: use a different response function." print, " String with the complete filepath and" print, " filename of the xmat....sav file." print, " flat_file: use a different gain table." print, " String with the complete filepath and" print, " filename of the gain.....sav file." print, " /swap : do a swap endian of the raw data." print, " tmat_save: String with the complete filepath and" print, " filename of the T-matrix parameter file." print, " ooutfile: use different filename for output file." print, " Must include file path." print, " offang: offset angle between telescope and instrument calibration." print, " /notelcor: do not apply telescope correction." print, " pos_lines:fltarr(2), location of spectral lines in pixel. " print, " hair_up: fltarr(2), upper and lower range in pixels" print, " around position of hairline." print, " hair_down: fltarr(2), upper and lower range in pixels" print, " around position of 2nd hairline." print, " Ignore, currently not used." print, " /check_hairlines: switch to enforce the manual selection" print, " /no_align: do not use hairline for spatial alignment." print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_630_obs.pro)
============================================================================ procedure : firs_cal purpose : calculate FIRS instrument response author : cbeck@nso Apr 2013 ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_cal,spat_res =spat_res ,no_av = no_av,plt =plt,ilimit = ilimit,retard = retard,theta_err = theta_err,theta_pol = theta_pol,gainindex = gainindex,darkindex = darkindex,cal_file = cal_file,change_save = change_save,input_dir = input_dir,output_dir = output_dir,flat_file = flat_file,swap = swap,add_cal = add_cal,nverbose = nverbose,cchi = cchi,n_separations = n_separations,nopause = nopause,quit_column = quit_column,help = help" print print, " Calculate FIRS polarimetric instrument response." print, " " print print, " Arguments" print, " none" print print, " Keywords :" print, " /plt : switch on plotting (recommended)" print, " spat_res: use subfields in spectra to get" print, " spatially resolved X matrices" print, " spat_res=[nx,by]; nx,ny number of subfields" print, " in x, y dimension. For tests only." print, " /no_av: do not average the measurements, use" print, " previously saved polarization vectors" print, " ilimit: required intensity limit to use pixels" print, " in the calculation, fraction of imean" print, " retard: retardance value to be used in degree" print, " theta_err: offset angle between retarder and" print, " polarizer, in degree" print, " theta_pol: position angle of polarizer during" print, " the calibration, in degree" print, " add_cal: number of additional +-QU calibration" print, " files to be used in the source directory." print, " /nverbose: suppress terminal output" print, " cchi : chi square value of additional +-QU" print, " vectors, measures reproduction of input" print, " gainindex:number of gain table to be used for the" print, " reduction in the target directory" print, " darkindex:number of dark current to be used for the" print, " reduction in the target directory" print, " cal_file: number of calibration file to be used" print, " in the source directory." print, " change_save: directory where the file information" print, " on the source directory was saved to." print, " input_dir: source directory with raw data." print, " output_dir: destination directory for reduced data." print, " flat_file: use a different gain table." print, " String with the complete filepath and" print, " filename of the gain.....sav file." print, " /swap : do a swap endian of the raw data." print, " n_separations: number of subdivisions along the slit." print, " /nopause: ignore all stop/pause commands." print, " /quit_column:switch to replace missing column at" print, " middle of IR CCD chip. Cosmetics." print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_cal.pro)
============================================================================ procedure : create_html purpose : Create Overview html-page for contents of a directory in the POLIS data archive. written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: create_html,filepath = filepath,target = target," print, " comments = comments, help = help" print print, " Create Overview html-page from all ps/gif/text files" print, " in a directory of the POLIS archive. Call " print, " generate_archive_files before. Filename of html page" print, " is generated from name of last subdirectory of" print, " filepath. All gif files are linked with corresponding" print, " ps-files. The text in the .txt file is included as" print, " it is in the text file." print print, " Arguments" print, " None." print print, " Keywords:" print, " filepath : path to input directory. Either" print, " .gif,.txt. and .ps or only .ps files" print, " must exist." print, " target='text' : will be added in html page." print, " comments='text' : will be added in html page." print, " Warning: target and comments are only added" print, " to the html file, not the text file. This is" print, " not recommended, use edit_archive_txt.pro." print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_create_html.pro)
============================================================================ procedure : firs_create_mainhtml purpose : Create Overview archive written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: firs_create_mainhtml,inpath =inpath,outfile = outfile," print, " help = help" print print, " Create Overview archive page from all subdirectories" print, " in a directory that contains the archive. Call " print, " generate_archive_files and creat_html before. Filename is" print, " hardwired in daily pages." print print, " Arguments" print, " None." print print, " Keywords:" print, " inpath : path to input directory of the archive" print, " outfile: string(1), name of final html file, should" print, " be changed." print, " /help : display this help text" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/firs_create_mainhtml.pro)
============================================================================ procedure : firs_view purpose : display spectra of raw and merged data files written : cbeck@KIS 06/02 ============================================================================== Check number of parameters. ====================================== f n_params() lt 1 then begin print print, "usage: firs_view, infile,swap = swap" print print, " Display spectra of reduced FIRS data files." print, " Plot row or column profiles, save single images as" print, " ps-files. Raw data are squeezed to fit on the display" print, " pixel positions of features have to be derived from" print, " the values printed above the column or row plots." print print, " Arguments" print, " infile : input data file" print print, " Keywords" print, " swap : if running IDL on a Sun you have" print, " to set /swap" print return ndif ============================================================================
(See /home/cbeck/firs_soft2/firs_view.pro)
============================================================================ function : float2int purpose : transform data array in floating format into integer array. calls : round.pro, fix.pro (idl-implemented) written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: i = float2int(array,unsigned) print print, " Transform floating array into integer array," print, " either signed or unsigned." print print, " Arguments" print, " Input :" print, " array : floating array print print, " Output:" print, " (un)signed integer array, rounded" print print, " Keywords:" print, " /unsigned : transform to unsigned integer" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/float2int.pro)
NAME: FXHREAD Purpose : Reads a FITS header from an opened disk file. Explanation : Reads a FITS header from an opened disk file. Use : FXHREAD, UNIT, HEADER [, STATUS ] Inputs : UNIT = Logical unit number. Opt. Inputs : Outputs : HEADER = String array containing the FITS header. Opt. Outputs: STATUS = Condition code giving the status of the read. Normally, this is zero, but is set to !ERR if an error occurs, or if the first byte of the header is zero (ASCII null). Keywords : None. Calls : None. Common : None. Restrictions: The file must already be positioned at the start of the header. It must be a proper FITS file. Side effects: The file ends by being positioned at the end of the FITS header, unless an error occurs. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Feb 1992, from READFITS by J. Woffard and W. Landsman. W. Thompson, Aug 1992, added test for SIMPLE keyword. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997
(See /home/cbeck/firs_soft2/fxhread.pro)
NAME: FXPAR() PURPOSE: Obtain the value of a parameter in a FITS header. EXPLANATION: The first 8 chacters of each element of HDR are searched for a match to NAME. If the keyword is one of those allowed to take multiple values ("HISTORY", "COMMENT", or " " (blank)), then the value is taken as the next 72 characters. Otherwise, it is assumed that the next character is "=", and the value (and optional comment) is then parsed from the last 71 characters. An error occurs if there is no parameter with the given name. If the value is too long for one line, it may be continued on to the the next input card, using the CONTINUE Long String Keyword convention. For more info, http://fits.gsfc.nasa.gov/registry/continue_keyword.html Complex numbers are recognized as two numbers separated by one or more space characters. If a numeric value has no decimal point (or E or D) it is returned as type LONG. If it contains more than 8 numerals, or contains the character 'D', then it is returned as type DOUBLE. Otherwise it is returned as type FLOAT. If an integer is too large to be stored as type LONG, then it is returned as DOUBLE. CALLING SEQUENCE: Result = FXPAR( HDR, NAME [, ABORT, COUNT=, COMMENT=, /NOCONTINUE ] ) Result = FXPAR(HEADER,'DATE') ;Finds the value of DATE Result = FXPAR(HEADER,'NAXIS*') ;Returns array dimensions as ;vector REQUIRED INPUTS: HDR = FITS header string array (e.g. as returned by FXREAD). Each element should have a length of 80 characters NAME = String name of the parameter to return. If NAME is of the form 'keyword*' then an array is returned containing values of keywordN where N is an integer. The value of keywordN will be placed in RESULT(N-1). The data type of RESULT will be the type of the first valid match of keywordN found, unless DATATYPE is given. OPTIONAL INPUT: ABORT = String specifying that FXPAR should do a RETALL if a parameter is not found. ABORT should contain a string to be printed if the keyword parameter is not found. If not supplied, FXPAR will return with a negative !err if a keyword is not found. DATATYPE = A scalar value, indicating the type of vector data. All keywords will be cast to this type. Default: based on first keyword. Example: DATATYPE=0.0D (cast data to double precision) START = A best-guess starting position of the sought-after keyword in the header. If specified, then FXPAR first searches for scalar keywords in the header in the index range bounded by START-PRECHECK and START+POSTCHECK. This can speed up keyword searches in large headers. If the keyword is not found, then FXPAR searches the entire header. If not specified then the entire header is searched. Searches of the form 'keyword*' also search the entire header and ignore START. Upon return START is changed to be the position of the newly found keyword. Thus the best way to search for a series of keywords is to search for them in the order they appear in the header like this: START = 0L P1 = FXPAR('P1', START=START) P2 = FXPAR('P2', START=START) PRECHECK = If START is specified, then PRECHECK is the number of keywords preceding START to be searched. Default: 5 POSTCHECK = If START is specified, then POSTCHECK is the number of keywords after START to be searched. Default: 20 OUTPUT: The returned value of the function is the value(s) associated with the requested keyword in the header array. If the parameter is complex, double precision, floating point, long or string, then the result is of that type. Apostrophes are stripped from strings. If the parameter is logical, 1 is returned for T, and 0 is returned for F. If NAME was of form 'keyword*' then a vector of values are returned. OPTIONAL INPUT KEYWORDS: /NOCONTINUE = If set, then continuation lines will not be read, even if present in the header OPTIONAL OUTPUT KEYWORD: COUNT = Optional keyword to return a value equal to the number of parameters found by FXPAR. COMMENTS= Array of comments associated with the returned values. PROCEDURE CALLS: GETTOK(), VALID_NUM SIDE EFFECTS: The system variable !err is set to -1 if parameter not found, 0 for a scalar value returned. If a vector is returned it is set to the number of keyword matches found. If a keyword occurs more than once in a header, a warning is given, and the first occurence is used. However, if the keyword is "HISTORY", "COMMENT", or " " (blank), then multiple values are returned. NOTES: The functions SXPAR() and FXPAR() are nearly identical, although FXPAR() has slightly more sophisticated parsing. There is no particular reason for having two nearly identical procedures, but both are too widely used to drop either one. REVISION HISTORY: Version 1, William Thompson, GSFC, 12 April 1993. Adapted from SXPAR Version 2, William Thompson, GSFC, 14 October 1994 Modified to use VALID_NUM instead of STRNUMBER. Inserted additional call to VALID_NUM to trap cases where character strings did not contain quotation marks. Version 3, William Thompson, GSFC, 22 December 1994 Fixed bug with blank keywords, following suggestion by Wayne Landsman. Version 4, Mons Morrison, LMSAL, 9-Jan-98 Made non-trailing ' for string tag just be a warning (not a fatal error). It was needed because "sxaddpar" had an error which did not write tags properly for long strings (over 68 characters) Version 5, Wayne Landsman GSFC, 29 May 1998 Fixed potential problem with overflow of LONG values Version 6, Craig Markwardt, GSFC, 28 Jan 1998, Added CONTINUE parsing Version 7, Craig Markwardt, GSFC, 18 Nov 1999, Added START, PRE/POSTCHECK keywords for better performance Version 8, Craig Markwardt, GSFC, 08 Oct 2003, Added DATATYPE keyword to cast vector keywords type Version 9, Paul Hick, 22 Oct 2003, Corrected bug (NHEADER-1)
(See /home/cbeck/firs_soft2/fxpar.pro)
NAME: FXREAD Purpose : Read basic FITS files. Explanation : Read an image array from a disk FITS file. Optionally allows the user to read in only a subarray and/or every Nth pixel. Use : FXREAD, FILENAME, DATA [, HEADER [, I1, I2 [, J1, J2 ]] [, STEP]] Inputs : FILENAME = String containing the name of the file to be read. Opt. Inputs : I1,I2 = Data range to read in the first dimension. If passed, then HEADER must also be passed. If not passed, or set to -1,-1, then the entire range is read. J1,J2 = Data range to read in the second dimension. If passed, then HEADER and I1,J2 must also be passed. If not passed, or set to -1,-1, then the entire range is read. STEP = Step size to use in reading the data. If passed, then HEADER must also be passed. Default value is 1. Ignored if less than 1. Outputs : DATA = Data array to be read from the file. Opt. Outputs: HEADER = String array containing the header for the FITS file. Keywords : /COMPRESS - If this keyword is set and non-zero, then then treat the file as gzip compressed. By default FXREAD assumes the file is gzip compressed if it ends in ".gz" NANVALUE = Value signalling data dropout. All points corresponding to IEEE NaN (not-a-number) are set to this value. Ignored unless DATA is of type float or double-precision. EXTENSION = FITS extension. It can be a scalar integer, indicating the extension number (extension number 0 is the primary HDU). It can also be a scalar string, indicating the extension name (EXTNAME keyword). Default: 0 (primary HDU) PROMPT = If set, then the optional parameters are prompted for at the keyboard. AVERAGE = If set, then the array size is reduced by averaging pixels together rather than by subselecting pixels. Ignored unless STEP is nontrivial. Note: this is much slower. YSTEP = If passed, then STEP is the step size in the 1st dimension, and YSTEP is the step size in the 2nd dimension. Otherwise, STEP applies to both directions. NOSCALE = If set, then the output data will not be scaled using the optional BSCALE and BZERO keywords in the FITS header. Default is to scale, if and only if BSCALE and BZERO are present and nontrivial. NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the optional HEADER array will not be changed. The default is to reset these keywords to BSCALE=1, BZERO=0. Ignored if NOSCALE is set. ERRMSG = If defined and passed, then any error messages will be returned to the user in this parameter rather than depending on the MESSAGE routine in IDL. If no errors are encountered, then a null string is returned. In order to use this feature, ERRMSG must be defined first, e.g. ERRMSG = '' FXREAD, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... NODATA = If set, then the array is not read in, but the primary header is read. Calls : GET_DATE, IEEE_TO_HOST, FXADDPAR, FXHREAD, FXPAR, WHERENAN Common : None. Restrictions: Groups are not supported. The optional parameters I1, I2, and STEP only work with one or two-dimensional arrays. J1 and J2 only work with two-dimensional arrays. Use of the AVERAGE keyword is not compatible with arrays with missing pixels. Side effects: If the keywords BSCALE and BZERO are present in the FITS header, and have non-trivial values, then the returned array DATA is formed by the equation DATA = BSCALE*original + BZERO However, this behavior can overridden by using the /NOSCALE keyword. If the data is scaled, then the optional HEADER array is changed so that BSCALE=1 and BZERO=0. This is so that these scaling parameters are not applied to the data a second time by another routine. Also, history records are added storing the original values of these constants. Note that only the returned array is modified--the header in the FITS file itself is untouched. If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO keywords are not changed. It is then the user's responsibility to ensure that these parameters are not reapplied to the data. In particular, these keywords should not be present in any header when writing another FITS file, unless the user wants their values to be applied when the file is read back in. Otherwise, FITS readers will read in the wrong values for the data array. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, May 1992, based in part on READFITS by W. Landsman, and STSUB by M. Greason and K. Venkatakrishna. W. Thompson, Jun 1992, added code to interpret BSCALE and BZERO records, and added NOSCALE and NOUPDATE keywords. W. Thompson, Aug 1992, changed to call FXHREAD, and to add history records for BZERO, BSCALE. Minimium IDL Version: V5.3 (uses COMPRESS keyword to OPEN) Written : William Thompson, GSFC, May 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 17 November 1993. Corrected bug with AVERAGE keyword on non-IEEE compatible machines. Corrected bug with subsampling on VAX machines. Version 3, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 5, Zarro (SAC/GSFC), 14 Feb 1997 Added I/O error checking Version 6, 20-May-1998, David Schlegel/W. Thompson Allow a single pixel to be read in. Change the signal to read in the entire array to be -1 Version 7 C. Markwardt 22 Sep 2003 If the image is empty (NAXIS EQ 0), or NODATA is set, then return only the header. Version 8 W. Landsman 29 June 2004 Added COMPRESS keyword, check for .gz extension Version 9, William Thompson, 19-Aug-2004 Make sure COMPRESS is treated as a scalar Version 10, Craig Markwardt, 01 Mar 2004 Add EXTENSION keyword and ability to read different extensions than the primary one. Version 11, W. Landsamn September 2006 Assume since V5.5, remove VMS support Version 11.1, W. Landsamn November 2007 Allow for possibility number of bytes requires 64 bit integer Version 12, William Thompson, 18-Jun-2010, update BLANK value.
(See /home/cbeck/firs_soft2/fxread.pro)
NAME: GETTOK PURPOSE: Retrieve the first part of a (vector) string up to a specified character EXPLANATION: GET TOKen - Retrieve first part of string until the character char is encountered. CALLING SEQUENCE: token = gettok( st, char, [ /EXACT ] ) INPUT: char - character separating tokens, scalar string INPUT-OUTPUT: st - string to get token from (on output token is removed), scalar or vector OUTPUT: token - extracted string value is returned, same dimensions as st OPTIONAL INPUT KEYWORD: /EXACT - The default behaviour of GETTOK is to remove any leading blanks and (if the token is a blank) convert tabs to blanks. Set the /EXACT keyword to skip these steps and leave the input string unchanged before searching for the character tokens. EXAMPLE: If ST is ['abc=999','x=3.4234'] then gettok(ST,'=') would return ['abc','x'] and ST would be left as ['999','3.4234'] PROCEDURE CALLS: REPCHR() HISTORY version 1 by D. Lindler APR,86 Remove leading blanks W. Landsman (from JKF) Aug. 1991 Converted to IDL V5.0 W. Landsman September 1997 V5.3 version, accept vector input W. Landsman February 2000 Slightly faster implementation W. Landsman February 2001 Added EXACT keyword W. Landsman March 2004 Assume since V5.4, Use COMPLEMENT keyword to WHERE W. Landsman Apr 2006
(See /home/cbeck/firs_soft2/gettok.pro)
============================================================================== function: get_angles purpose : return the incidence and rotation angles for the choosen azimuth of first mirror and date, Cap. equations written : manolo collados@iac edited : cbeck@KIS, 12/01 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 5 then begin print print, "usage: angles = get_angles(azi,yy,mm,dd,hh)" print print, " Calculate all needed angles from coelostat settings." print, " Return i1,th1,i2,th2,i3,th3,i4 in degrees." print print, " Arguments" print, " azi : azimuth of first mirror, positive values" print, " towards east" print, " yy,mm,dd,hh : date and time in the form" print, " 01,06,12,12.345 UT" print print, " Output angles are in degrees." print, " Output" print, " vector(7),[i1,th1,i2,th2,i3,th3,i4]" print, " i1,i2,i3=i4 : incidence angles on C1, C2, main" print, " th1 : rotation between sun and C1" print, " th2 : rotation between C1 nad C2" print, " th3 : rotation between C2 and main" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/get_angles.pro)
============================================================================== function: get_angles_final purpose : return the incidence and rotation angles for the choosen azimuth of first mirror and date Additionally polarizer rotation for tel.cal.data written : cbeck@KIS, 11/01 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 5 then begin print print, "usage: angles = get_angles_final(azi,yy,mm,dd,hh)" print print, " Calculate all needed angles from coelostat settings." print, " Return i1,th1,i2,th2,i3,th3,i4 as in get_angles.pro." print, " Also returned : th_pol_C1,th_C1_pol,th_pol_C2." print, " Needed only for polarizer on C1." print, " Calculation is partly analytically/numerically." print print, " Arguments" print, " azi : azimuth of first mirror, positive values" print, " towards east" print, " yy,mm,dd,hh : date and time in the form" print, " 01,06,12,12.345 UT" print print, " Keywords" print, " /earth : RF0 fixed on earth" print print, " Output angles are in degrees." print, " Output" print, " vector(10),[i1,th1,i2,th2,i3,th3,i4,$" print, " th_pol_C1,th_C1_pol,th_pol_C2]" print, " i1,i2,i3 : incidence angles on C1, C2, main" print, " th1 : rotation between RF0 and C1" print, " th2 : rotation between C1 nad C2" print, " th3 : rotation between C2 and main" print, " th_pol_C1 : rotation between polarizer and C1" print, " th_C1_pol : rotation between reflected beam of" print, " C1 and polarizer" print, " th_pol_C2 : rotation between polarizer and C2" print return, 0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/get_angles_final.pro)
NAME: GET_DATE PURPOSE: Return the (current) UTC date in CCYY-MM-DD format for FITS headers EXPLANATION: This is the format required by the DATE and DATE-OBS keywords in a FITS header. CALLING SEQUENCE: GET_DATE, FITS_date, [ in_date, /OLD, /TIMETAG ] OPTIONAL INPUTS: in_date - string (scalar or vector) containing dates in IDL systime() format (e.g. 'Tue Sep 25 14:56:14 2001') OUTPUTS: FITS_date = A scalar character string giving the current date. Actual appearance of dte depends on which keywords are supplied. No Keywords supplied - dte is a 10 character string with the format CCYY-MM-DD whererepresents a calendar year, the ordinal number of a calendar month within the calendar year, and the ordinal number of a day within the calendar month. /TIMETAG set - dte is a 19 character string with the format CCYY-MM-DDThh:mm:ss where represents the hour in the day, the minutes, the seconds, and the literal 'T' the ISO 8601 time designator /OLD set - dte is an 8 character string in DD/MM/YY format INPUT KEYWORDS: /TIMETAG - Specify the time to the nearest second in the DATE format /OLD - Return the DATE format formerly (pre-1997) recommended for FITS Note that this format is now deprecated because it uses only a 2 digit representation of the year. EXAMPLE: Add the current date to the DATE keyword in a FITS header,h IDL> GET_DATE,dte IDL> sxaddpar, h, 'DATE', dte, 'Date header was created' NOTES: (1) A discussion of the DATExxx syntax in FITS headers can be found in http://www.cv.nrao.edu/fits/documents/standards/year2000.txt (2) Those who wish to use need further flexibility in their date formats (e.g. to use TAI time) should look at Bill Thompson's time routines in http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/time PROCEDURES USED: DAYCNV - Convert Julian date to Gregorian calendar date REVISION HISTORY: Written W. Landsman March 1991 Major rewrite to write new DATExxx syntax W. Landsman August 1997 Converted to IDL V5.0 W. Landsman September 1997 Work after year 2000 even with /OLD keyword W. Landsman January 2000 Don't need to worry about TIME_DIFF since V5.4 W. Landsman July 2001 Assume since V5.4, remove LOCAL_DIFF keyword W. Landsman April 2006
(See /home/cbeck/firs_soft2/get_date.pro)
============================================================================ procedure : get_firs_dataprop purpose : get settings of observations on one day author : cbeck@nso Apr 2013 ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: get_firs_dataprop, input_dir,change_save = change_save,help= help" print print, " Get settings of all FIRS observations in one directory." print, " " print print, " Arguments" print, " input_dir" print print, " Keywords :" print, " change_save: directory where the file information" print, " on the source directory will be saved to." print, " To be used if you do not have write" print, " permission in source directory." print, " /help : switch to active the help text above." print eturn ndif ==============================================================================
(See /home/cbeck/firs_soft2/get_firs_dataprop.pro)
============================================================================== function: get_mirrors purpose : return the reflectivities and retardance of all mirrors calls : calculate_mirrors.pro edited : cbeck@KIS, 12/01 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 9 then begin print print, "usage: mir = get_mirrors(n_coel,k_coel,n_vac,k_vac,d_lambda" print, " ,nu,i1,i2,i3)" print print, " Calculate mirror reflectivities from refractive" print, " indices and incidence angles." print print, " Arguments" print, " n_coel : refraction index coelostat" print, " k_coel : absorption coefficient coel." print, " n_vac : refraction index main/defl." print, " k_vac : absoption coefficient main/defl." print, " d_lambda : thickness of coating in wave-length" print, " fractions d/lambda" print, " nu : refraction index of substrat" print, " i1,i2,i3 : incidence angle on C1, C2, main" print print, " Output" print, " vector(9),[coel1rp,coel1rs,coel1ret,coel2rp$" print, " ,coel2rs,coel2ret,prirp,prirs,priret]" print print, " coel1rs : reflectivity perpendicular to plain" print, " of incidence, C1" print, " coel1rp : reflectivity in the plain of" print, " incidence, C1" print, " coel1ret: retardance of first mirror C1" print, " coel2rs : reflectivity perpendicular to plain" print, " of incidence, C2" print, " coel2rp : reflectivity in the plain of" print, " incidence, C2" print, " coel2ret: retardance of second mirror C2" print, " prirs : reflectivity perpendicular to plain" print, " of incidence, main and deflection" print, " prirp : reflectivity in the plain of" print, " incidence, main and deflection" print, " priret : retardance of main and deflection" print, " mirror" print print, " Keywords:" print, " opticthick : calculation as in Cap. 1989" print, " d_lambda and nu are ignored" print print, " Calculation as in the appendix of Skumanich et al.," print, " 1997" return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/get_mirrors.pro)
============================================================================ function : get_tmatrix purpose : return normalized telescope matrix written : cbeck@kis 12/01 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 6) then begin print print, "usage: T = get_tmatrix(date,mirrorparam,fitparam,azimuth," print, " xswitch1,xi,(alpha,beta),/ideal, /earth," print, " /polarizer, /unnormalized)" print print, " Use date and azimuth to construct geometry of VTT" print, " coelostat and beam path. Calculate rotation and" print, " incidence angles. Calculate mirror properties from" print, " refraction indices. Use the fit values for the exit" print, " and entry windows." print print, " Arguments" print, " date : vector(4),[year,month,day,hour] in UT" print, " mirrorparam : vector(4), [n,k,d_lambda,nu]" print, " fitparam : vector(5), [offout,winang,$" print, " winret,exang,exret]" print, " azimuth : position of C1, positive to E" print, " xswitch1 : Capitani (0) or Beck (1) angles." print, " If the \polarizer or \earth is to" print," be used, xswitch1 must be set to 1" print, " xi : position angle of linear polarizer" print, " On C1: Positive from N to E" print, " On window: Positive from W to N" print, " alpha,beta : properties of tel.cal.polarizer" print, " see vtt_ten.pro for meaning" print print, " Keywords" print, " /ideal : use ideal mirrors" print, " /earth : fix RF0 on earth" print, " polarizer =1 : put linear polarizer on C1" print, " polarizer =2 : put polarizer on window" print, " /opticthick : use thick coatings" print, " /unnormalized : no intensity normalization" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/get_tmatrix.pro)
============================================================================ function : histogra purpose : calculate histogram of vector into n equidistant bins written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: erg = histogra(x,bins)" print print, " Calculate histogram of values in x into #bins, which" print, " are equidistant between max and min of x." print print, " Arguments" print, " Input :" print, " x : vector of values" print, " bins : number of bins to use" print print, " Output :" print, " erg(0:bins-1) = histogram values in bins" print, " erg(bins:bins*2-1) = central position of bins" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/histogra.pro)
============================================================================ function : histogra2d purpose : calculate histogram of vector x into n equidistant bins. Additionally averages values of dependent variable y1 in the bins. written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 3) then begin print print, "usage: erg = histogra(x,y1,bins)" print print, " Calculate histogram of values in x into #bins, which" print, " are equidistant between max and min of x." print, " Additionally calculate the average value of the" print, " dependent variable y1 = f(x) in the bins." print print, " Arguments" print, " Input :" print, " x : vector of values" print, " bins : number of bins to use" print print, " Output :" print, " erg(0:bins-1) = histogram values in bins" print, " erg(bins:bins*2-1) = central position of bins" print, " erg(bins*2:bins*3-1) = average values of y1" print, " erg(bins*3:bins*4-1) = rms of y1" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/histogra2d.pro)
NAME: ibis_tmxt.pro PURPOSE: Calculate T-matrix for Dunn Solar Telescope CATEGORY: CALLING SEQUENCE: ibis_tmtx, tparams, lambda, tp_azim, tp_elev, tp_table INPUTS: tparams, lambda, tp_azim, tp_elev, tp_table KEYWORD PARAMETERS: none OUTPUTS: 4x4 Mueller matrix of telescope OPTIONAL OUTPUTS: EXAMPLE: MODIFICATION HISTORY:
(See /home/cbeck/firs_soft2/ibis_tmtx.pro)
NAME: IEEE_TO_HOST PURPOSE: Translate an IDL variable from IEEE-754 to host representation EXPLANATION: The variable is translated from IEEE-754 ("big-endian" as used, for example, in FITS data ), into the host machine architecture. Duplicates most of the functionality of the SWAP_ENDIAN_INPLACE procedure introduced in V5.6, with the addition of the IDLTYPE keyword. CALLING SEQUENCE: IEEE_TO_HOST, data, [ IDLTYPE = , ] INPUT-OUTPUT PARAMETERS: data - any IDL variable, scalar or vector. It will be modified by IEEE_TO_HOST to convert from IEEE to host representation. Byte and string variables are returned by IEEE_TO_HOST unchanged OPTIONAL KEYWORD INPUTS: IDLTYPE - scalar integer (1-15) specifying the IDL datatype according to the code given by the SIZE function. This keyword is usually when DATA is a byte array to be interpreted as another datatype (e.g. FLOAT). EXAMPLE: A 2880 byte array (named FITARR) from a FITS record is to be interpreted as floating and converted to the host representaton: IDL> IEEE_TO_HOST, fitarr, IDLTYPE = 4 METHOD: The BYTEORDER procedure is called with the appropriate keyword MODIFICATION HISTORY: Written, W. Landsman Hughes/STX May, 1992 Converted to IDL V5.0 W. Landsman September 1997 Under VMS check for IEEE -0.0 values January 1998 VMS now handle -0.0 values under IDL V5.1 July 1998 Added new integer datatypes C. Markwardt/W. Landsman July 2000 Post-V5.1 version, no VMS negative zero check W. Landsman July 2001 Use size(/type) W. Landsman December 2002 Use /SWAP_IF_LITTLE_ENDIAN keyword for 64bit types W. Landsman Feb 2003 Do not use XDR keywords to BYTEORDER for much improved speed W. Landsman April 2006 Update cosmetic typo for structures W. Landsman October 2006
(See /home/cbeck/firs_soft2/ieee_to_host.pro)
============================================================================ function : integrator purpose : calculate integral of curve by linear interpolation written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: erg = integrator(x)" print print, " Calculate integral of 1-D vector by linear interpolation." print print, " Arguments" print, " Input :" print, " x : curve values" print print, " Output :" print, " erg = integral of x" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/integrator.pro)
============================================================================ function : invert_svd purpose : invert n x m matrix using singular value decomposition uses : svdc IDL-implemented written : MCV ? ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: erg = invert_svd(mat,tol = tol)" print print, " Invert matrix mat using singular value decomposition." print print, " Arguments" print, " Input :" print, " mat : n x m matrix" print print, " Keywords:" print, " tol : limit for disregarding Eigenvalues" print print, " Output :" print, " erg = inverse of matrix mat" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/invert_svd.pro)
============================================================================== procedure : iterate_gain purpose : find optimal shift vale by least-square-fit to minimize deviation of gaintable line from straight line calls : analytger.pro written : cbeck@KIS 3/03 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 6 then begin print print, "usage: iterate_gain,shift_val,i_line,mean_line,gain_line," print, " xswitch,wave_lim,plt = plt," print, " err_index = err_index" print print, " Find the optimal shift value for mean profile by" print, " minimizing deviation of gaintable line from a" print, " straight line." print print, " Arguments" print, " Input:" print, " i_line : line of flat field image" print, " mean_line : mean profile" print, " gain_line : rough gainline by division" print, " xswitch : switch to modify speed" print, " wave_lim : wave_lim = [low,high] fixes spectral" print, " range for least-square fit to shift." print, " wave_lim = [low,high,speed], speed" print, " controls convergence of fit," print, " 0.5 < speed < 4." print, " Output:" print, " shift_val : iterated shift value" print print, " Keywords" print, " verbose : give run-time info" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/iterate_gain.pro)
============================================================================ procedure : legend1 purpose : add legend to a plot. written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f n_elements(help) ne 0 then begin print print, "usage: legend1,text =text,psym = psym,linestyle = linestyle," print, " pos = pos,charsize=charsize,color = color," print, " data = data,normal = normal,ppsym2 = ppsym2," print, " llinestyle2 = llinestyle2,ccolor2 = ccolor2," print, " ccharsize2 = ccharsize2,no_box = no_box," print, " thick = thick,charthick = charthick," print, " ttextcolor = ttextcolor,long = long," print, " help = help" print print, " Overplot legend to a graph. legend1 can do" print, " symbols and lines with variable colors." print, " 2 symbols and/or lines may be combined in one row." print print, " Keywords:" print, " text : text for each row, may be empty string" print, " psym,ppsym2 : symbol type of symbol 1/2" print, " linestyle, llinestyle2 : same for lines" print, " data,normal: as usual" print, " pos : position of legend, either" print, " pos = 0 left upper corner" print, " pos = 1 right upper corner" print, " pos = 2 right lower corner" print, " pos = 3 left lower corner" print, " or pos = [x0,y0] lower left corner of text" print, " no_box : omit borderline around text" print, " charsize : size of text characters" print, " ccharsize2 : size of symbols" print, " color, ccolor2 : color of first or second" print, " symbol or line" print, " ttextcolor : color of text" print, " /long : extend lines if necessary (e.g. dashed)" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/legend1.pro)
============================================================================ function : length purpose : return length of vector calls : size.pro (idl-implemented) written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: N = length(x)" print print, " Return length of 1-dimensional vector." print print, " Arguments" print, " Input :" print, " x : vector" print print, " Output:" print, " N = number of entries" eturn,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/length.pro)
Procedure: LPFF Purpose: Measures the position of a spectral line (absorption or emission within the interval specified. Category: Spectral Analysis Calling sequence: LPFF,interval,pos[,wl=wl,pix=pix,vel=vel,plot=plot] Input: arr: 1-dim array containing the line profile optional Input: wl: Wavelength in nm pix: pixel size in pm optional keyword: plot: ... Output: pos: position of line at subpixel accuracy, measured from left boundary of 'arr' [pos=1 means: line core is located at arr(1)] optional output: vel: Doppler velocity in m/s, measured from center of interval, Redshift is positive Restrictions: The interval may be much wider than the line or contain only the line core. The routine works for odd and even numbers of elements of 'arr'. the line core intensity is NOT measured. Procedure: The Fourier phase method is used. This method is very insensitive to noise and is very fast.
(See /home/cbeck/firs_soft2/lpff.pro)
============================================================================ procedure : makecontplot purpose : Overplot contours of image array. Additional options: remove short contours, fill contours, create separate mask of contours, overplot contours somewhere in graph. written : cbeck@KIS ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 2) then begin print print, "usage: makecontplot,image,levels,xy,xy_info,index_do," print, " offsset = offsset, scale = scale," print, " color = color, thick = thick,gband = gband," print," filled = filled,mask = mask,up_lim = up_lim," print," noplot = noplot,ps = ps,noshort = noshort," print, " no_edge=no_edge,close = close" print print, " Plot contour lines of image either filled or unfilled." print, " Omit short contour lines or create mask of contours." print print, " Arguments" print, " Input :" print, " image : 2-D matrix" print, " levels : contour levels to be drawn" print, " xy,xy_info: same as for contour" print, " index_do : cf. line 217, can be used to" print, " manually remove some contours" print print, " Keywords:" print, " offsset : offset [x0,y0] of lower left corner" print, " in normal coordinates." print, " scale : [nx,ny] number of images in x/y" print, " dimension." print, " E.g., to overplot contours of image to" print, " a set of other images, set scale = [2,1]" print, " (2 images in one row), and offsset to" print, " [.5,.0] to overplot on the right image." print, " color,thick : as usual" print, " gband : lower limit of length of contours" print, " to be excluded. E.g.: all contours" print, " with < gband vertex points will be" print, " omitted." print, " /filled : fill contours using draw_poly." print, " mask : named variable of same dimensions" print, " as image, will contain a mask of the" print, " contours." print, " up_lim : too short contours will be taken" print, " if their mean intensity is larger" print, " than up_lim * I_surroundings" print, " /no_plot : suppress plotting" print, " /ps : prevents errors using device in ps-mode" print, " /noshort : throw out too short contours" print, " no_edge,close : see contour." print print, " To create a mask of the contours use" print, " ...,gband = 15,/filled,mask = mask" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/makecontplot.pro)
============================================================================ function : mamultsymb purpose : Perform matrix multiplication of 2 symbolic matrices. written : cbeck@KIS ============================================================================= Check number of arguments. ============================================================================= f (n_params() lt 3) then begin print print, "usage: erg = mamultsymb(a,b,xswitch)" print print, " Perform standard matrix multiplication of two" print, " string matrices with symbolic entries." print, " Entries equal to zero will be set to zero." print print, " Arguments" print, " Input :" print, " a : n x m string matrix" print, " b : m x k string matrix" print, " xswich : 1 put parentheses around result" print, " 0 no parentheses" print return,0 ndif =============================================================================
(See /home/cbeck/firs_soft2/mamultsymb.pro)
============================================================================ procedure : matrix_inversion purpose : solve linear problem out = M * in by matrix inversion. Result is equivalent to least square fit. written : cbeck@kis 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 4) then begin print print, "usage: matrix_inversion,in,out,M,errors" print print, " Solve linear problem out = M * in. out and in must" print, " have suited dimensions. Size is not checked before" print, " calculations, errors may cause break." print, " Example : in = rows x columns," print, " = 37x4, out = 37x4 -> M = 4x4." print, " in = 37 x 4, out = 37 x 1 -> M = 4x1." print, " Errors are identical for each column of M." print print, " Arguments" print, " Input :" print, " in, out : Input and output of system, suited" print, " dimensions." print, " Output : print, " M : columns_1 x columns_2 matrix M print, " errors : vec(columns_1), error of columns of M" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/matrix_inversion.pro)
calculates Mueller matrix of a mirror given rs/rp and retardance
(See /home/cbeck/firs_soft2/mirror.pro)
============================================================================ function : mittelung purpose : floating average over 3 pixel range on vector calls : length.pro written : cbeck@KIS 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: erg = mittelung(x) print print, " Perform average over 3 pixel according to" print, " x_av(k) = 1/3 * (x(k-1)+x(k)+x(k+1))" print print, " Input:" print, " x : 1-dimensional vector" print print, " Output:" print, " erg = averaged vector of same dimensions." print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/mittelung.pro)
============================================================================== function : num2string purpose : return the value as a string without whitespaces calls : strtrim.pro, strcompress.pro, string.pro (idl-implemented) writen : cbeck@kis, 06/02 ============================================================================== Check number of parameters. ============================================================================== f n_params() ne 1 then begin print print, "usage: str = num2string(value)" print print, " Return 'value' as a string vector without whitespaces" print print, " Arguments" print, " Input :" print, " value : number/vector to be converted" print print, " Output:" print, " str : string/vector of strings" print return, '' ndif ==============================================================================
(See /home/cbeck/firs_soft2/num2string.pro)
============================================================================ procedure : paused purpose : stop until user confirms with return calls : read_keyboard.pro keyword : \notext : do not print standard text 'Paused. Hit return to continue.' written : cbeck@KIS 06/02 ============================================================================
(See /home/cbeck/firs_soft2/paused.pro)
=========================================================================== procedure : pillarheight purpose : calculate pillar height for given date and azimuth calls : r_frame_asp_mod.pro with some subroutines from ASP-lib written : cbeck@kis 07/02 =========================================================================== program call: pillarheight,azimuth,day,month,year parameters: azimuth: position of first coelostat mirror, east = positive day,month,year: date of observation dd,mm,yy output : screen, declination of sun, pillarheight =========================================================================== f n_params() lt 4 then begin print print, "usage: pillarheight,az,dd,mm,yy" print print, " Calculate needed pillar height for given azimuth of" print, " first mirror and date, solar observations." print, " If you want to observe another target, copy the lines" print, " below line 70 and simply change declination." print print, " Output is printed on screen." print print, " Arguments" print, " Input:" print, " az : azimuth of first coelostat mirror, deg." print, " dd,mm,yy : date of observation, e.g. 2,10,2" print print, " Output:" print, " screen, pillar height and sun declination" print return ndif ===========================================================================
(See /home/cbeck/firs_soft2/pillarheight.pro)
============================================================================ procedure : plot_hist purpose : Plot histogram of vector. written : cbeck@KIS ============================================================================= Check number of arguments. ============================================================================= f (n_params() lt 1) then begin print print, "usage: plot_hist,param,xtitle= xtitle,ytitle= ytitle," print, " title= title,nbins = nbins,xrange = xrange," print, " yrange = yrange,charsize= charsize," print, " oplott = color,plot_range = plot_range," print, " thick = thick,position = position," print, " device = device" print print, " Plot histogram of vector in nbins equidistant bins." print, " Output is in percent. Allows overplot of other" print, " histograms." print print, " Arguments" print, " Input :" print, " param : vector of values" print print, " Keywords:" print, " xtitle,ytitle,title,thick,position: as usual" print, " nbins : number of bins" print, " xrange : xrange of plot" print," yrange : range [low,high] of values in param" print, " to be considered, values outside will" print, " be neglected for the histogram." print, " plot_range : range of y-axis for plot" print, " oplott : number of color for an overplotted" print, " histogram. Uses oplot over existing" print, " graph." print return ndif =============================================================================
(See /home/cbeck/firs_soft2/plot_hist.pro)
============================================================================ function : read_directory purpose : list files in a directory. Set additional flag, if filename is a directory. calls : filepath.pro, fstat.pro, spawn (idl-implemented) written : cbeck@KIS 06/03 ============================================================================= Check number of arguments. ============================================================================= f n_params() gt 1 or n_elements(help) ne 0 then begin print print, "usage: erg = read_directory(inpath,help = help), or" print, " erg = read_directory()" print print, " Return entries of a directory as structure." print, " If argument inpath is omitted the current directory" print, " is taken." print, " If filenames are subdirectories, additional" print, " flag is set. erg is a structure of the following" print, " shape: erg = {files:strarr(n),types:strarr(n)," print, " success:fltarr(1)}. types = '0': file" print, " types ='1': directory." print, " if erg.success = 0 temporary file" print, " could not be created, or inpath was" print, " no directory." print, " Only the first 2000 entries are processed." print, " Number could be changed if necessary, see line 89ff." print print, " Arguments" print, " Input :" print, " inpath : string of filepath to list entries" print, " of. May be omitted, current" print, " directory is taken as default in" print, " this case." print listing_inf = {files:'',types:'',success:fltarr(1)} return,listing_inf ndif =============================================================================
(See /home/cbeck/firs_soft2/read_directory.pro)
============================================================================ function : read_keyboard purpose : read user input from keyboard calls : read.pro (idl-implemented), string2num.pro written : cbeck@KIS 06/02 ============================================================================ Check number of arguments. ============================================================================== f (n_elements(help) ne 0) then begin print print, "usage: ans = read_keyboard(text,/number,/help)" print print, " Read user input from terminal. Default output: string." print, " See string2num for details on conversion if /number" print, " is set." print print, " Arguments" print, " Input :" print, " text : string to be printed, may be" print, " completely omitted " print print, " Output:" print, " ans : user input from terminal" print print, " Keywords:" print, " /number : convert input to floating number" print, " multiple input '1,2,42' allowed" print, " see string2num.pro for details" print, " /help : print this text print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/read_keyboard.pro)
function retarder,axis_angle,retardance calculates Mueller matrix of a rotated ideal retarder
(See /home/cbeck/firs_soft2/retarder.pro)
function rotat,phi calculates rotation Mueller matrix given the physical rotation angle
(See /home/cbeck/firs_soft2/rotat.pro)
procedure: r_frame_asp purpose: translate magnetic field vector from telescope frame to local solar frame. author: paul@ncar ============================================================================= Check number of parameters. f n_params() eq 0 then begin print print, "usage: r_frame_asp $" print, " , psi, azm $ ;Input" print, " , year, month, day, utime $ ;Input" print, " , west_arcsec, north_arcsec $ ;Input" print, " , local_incline, local_azimuth [ $ ;Output" print, " , ambig_incline, ambig_azimuth $ ;Output" print, " , mu_value $ ;Output" print, " , longitude, latitude, carlong $ ;Output" print, " , right_ascen, declination, gsdt $ ;Output" print, " , b0_angle, p_angle $ ;Output" print, " , cen_long, radius_arcsec $ ;Output" print, " , parallactic, hour_angle ] ;Output" print print, " Translate magnetic field vector from observers" print, " frame to local solar frame." print pause, "(return to continue)" print print, "Arguments (input):" print, "(all angles in radians)" print, "(all are scalars)" print print, " psi - inclination angle of field from" print, " line-of-sight" print, " azm - field azimuth counter clockwise" print, " plane of incidence of VTT elevation" print, " mirror" print, " year - year of observation" print, " (1900 added for 50 < year < 101 )" print, " (2000 added for year < 51 )" print, " month - month of year" print, " day - day of month" print, " utime - universal time in hours" print, " west_arcsec - Arc seconds helio centric west of" print, " disk center" print, " north_arcsec - Arc seconds helio centric north of" print, " disk center" print pause, "(return to continue)" print print, "Arguments (output):" print, "(all angles in radians)" print, "(all are scalars)" print print, " local_incline - field inclination in local frame" print, " local_azimuth - field azimuth in local frame" print, " (CCW from solar west)" print, " ambig_incline - ambiguous field inclination" print, " ambig_azimuth - ambiguous field azimuth print, " mu_value - mu value of observation" print, " longitude - longitude of observation" print, " from meridian positive west" print, " latitude - latitude of observation" print, " from equator positive north" print, " carlong - carrington longitude of observation" print, " right_ascen - right ascension of disk center" print, " declination - declination of disk center" print, " gsdt - right ascension from central" print, " meridian" print, " b0_angle - b0 angle" print, " p_angle - p angle" print, " cen_long - carrington longitude of disk center" print, " radius_arcsec - solar radius in arc seconds" print, " parallactic - parallactic angle CCW from earth" print, " north to telescope plus elevation" print, " hour_angle - hour angle at observatory" print pause, "(return to continue)" print print, "Keyword:" print print, " inst_az_el - input two valued vector with" print, " azimuth and elevation at telescope print, " site (def: use ephemeris)" print, " lapalma - set if La Palma telescope" return ndif
(See /home/cbeck/firs_soft2/r_frame_asp.pro)
procedure: r_frame_asp purpose: translate magnetic field vector from telescope frame to local solar frame. author: paul@ncar ============================================================================= Check number of parameters. f n_params() eq 0 then begin print print, "usage: r_frame_asp $" print, " , psi, azm $ ;Input" print, " , year, month, day, utime $ ;Input" print, " , west_arcsec, north_arcsec $ ;Input" print, " , local_incline, local_azimuth [ $ ;Output" print, " , ambig_incline, ambig_azimuth $ ;Output" print, " , mu_value $ ;Output" print, " , longitude, latitude, carlong $ ;Output" print, " , right_ascen, declination, gsdt $ ;Output" print, " , b0_angle, p_angle $ ;Output" print, " , cen_long, radius_arcsec $ ;Output" print, " , parallactic, hour_angle ] ;Output" print print, " Translate magnetic field vector from observers" print, " frame to local solar frame." print pause, "(return to continue)" print print, "Arguments (input):" print, "(all angles in radians)" print, "(all are scalars)" print print, " psi - inclination angle of field from" print, " line-of-sight" print, " azm - field azimuth counter clockwise" print, " plane of incidence of VTT elevation" print, " mirror" print, " year - year of observation" print, " (1900 added for 50 < year < 101 )" print, " (2000 added for year < 51 )" print, " month - month of year" print, " day - day of month" print, " utime - universal time in hours" print, " west_arcsec - Arc seconds helio centric west of" print, " disk center" print, " north_arcsec - Arc seconds helio centric north of" print, " disk center" print pause, "(return to continue)" print print, "Arguments (output):" print, "(all angles in radians)" print, "(all are scalars)" print print, " local_incline - field inclination in local frame" print, " local_azimuth - field azimuth in local frame" print, " (CCW from solar west)" print, " ambig_incline - ambiguous field inclination" print, " ambig_azimuth - ambiguous field azimuth print, " mu_value - mu value of observation" print, " longitude - longitude of observation" print, " from meridian positive west" print, " latitude - latitude of observation" print, " from equator positive north" print, " carlong - carrington longitude of observation" print, " right_ascen - right ascension of disk center" print, " declination - declination of disk center" print, " gsdt - right ascension from central" print, " meridian" print, " b0_angle - b0 angle" print, " p_angle - p angle" print, " cen_long - carrington longitude of disk center" print, " radius_arcsec - solar radius in arc seconds" print, " parallactic - parallactic angle CCW from earth" print, " north to telescope plus elevation" print, " hour_angle - hour angle at observatory" print pause, "(return to continue)" print print, "Keyword:" print print, " inst_az_el - input two valued vector with" print, " azimuth and elevation at telescope print, " site (def: use ephemeris)" print, " lapalma - set if La Palma telescope" print, " azimuth - returned solar azimuth" print, " elevation - returned solar elevation" return ndif
(See /home/cbeck/firs_soft2/r_frame_asp_mod.pro)
function: r_frame_julian purpose: compute Julian time including fraction of day. author: paul@ncar ============================================================================= Check number of parameters. f n_params() eq 0 then begin print print, "usage: djd = r_frame_julian( year, month, day, utime )" print print, " Return double precision Julian time including" print, " fraction of day." print print, " Arguments:" print, " year - year of observation" print, " (1900 added for 50 < year < 101 )" print, " (2000 added for year < 51 )" print, " month - month of year" print, " day - day of month" print, " utime - universal time in hours" return, 0 ndif
(See /home/cbeck/firs_soft2/r_frame_julian.pro)
procedure: r_frame_solcor purpose: do solar ephemeris authors: unknown@somewhere paul@ncar ============================================================================= Check number of parameters. f n_params() eq 0 then begin print print, "usage: r_frame_solcor" print, " , julian_time [$ ;Input" print, " , right_ascen [, declination [$ ;Output" print, " , gsdt [, b0_angle [$ ;Output" print, " , p_angle [, cen_long [$ ;Output" print, " , radius_arcsec ]]]]]]] ;Output" print print, " Do solar ephereris" print print, "Arguments:" print, "(all angles in radians)" print, "(all are scalars)" print print, " julian_time - julain time in days including print, " fraction of days. print, " (Recommend double precision). print, " right_ascen - right ascension of disk center" print, " declination - declination of disk center" print, " gsdt - right ascension from central" print, " meridian" print, " b0_angle - b0 angle" print, " p_angle - p angle" print, " cen_long - carrington longitude of disk center" print, " radius_arcsec - solar radius in arc seconds" return ndif
(See /home/cbeck/firs_soft2/r_frame_solcor.pro)
procedure: r_frame_sphduo purpose: translate unit vector form one local longitude,latitude frame to another local longitude,latitude frame. author: paul@ncar ============================================================================== Check number of parameters. f n_params() eq 0 then begin print print, "usage: r_frame_sphduo $" print, " , lng0, lat0, az0, el0 $" print, " , lng3, lat3, az3, el3 print print, " Translate unit vector form one local longitude," print, " latitude frame to another local longitude,latitude" print, " frame." print print, " Input:" print, " print, " lng0 - longitude of input reference frame" print, " (right handed (increasing to right" print, " if north is up))" print, " lat0 - latitude of input reference frame" print, " (positive to north)" print, " az0 - azimuth of input unit vector" print, " (right handed (CCW from north))" print, " el0 - elevation of input unit vector" print, " (positive to increasing az0 axis)" print print, " lng3 - longitude of output reference frame" print, " (right handed (increasing to right" print, " if north is up))" print, " lat3 - latitude of output reference frame" print, " (positive to north)" print print, " Output:" print, " print, " az3 - azimuth of output unit vector" print, " (right handed (CCW from north))" print, " el3 - elevation of output unit vector" print, " (positive to increasing az3 axis)" print return ndif
(See /home/cbeck/firs_soft2/r_frame_sphduo.pro)
procedure: r_frame_sphtri purpose: Transform a unit vector between two spherical reference points. reference: Fundamental spherical trigonometry equations from Smart: Text-Book on Spherical Astronomy, eq. A, B, C, and D. authors: kcjones@sunspot.noao.edu (Phil Wiborg), paul@ncar ============================================================================= Check number of parameters. f n_params() lt 5 then begin print print, "usage: r_frame_sphtri0 $" print, " , olat $ ;Input" print, " , az0, el0 $ ;Input" print, " , az1, el1 [ $ ;Output" print, " , para ] ;Output" print print, " Transform a unit vector between two spherical" print, " reference points." print print, " Definition:" print print, " sct0 ~ The great circle sector that" print, " connects the two reference points" print, " on the sphere" print print, " Arguments (all in radians):" print print, " olat - !pi/2.-abs(sct0)" print, " az0 - The azimuth about first reference" print, " - point, from sector sct0" print, " el0 - The elevation at first reference" print, " point, positive away from surface" print, " az1 - The azimuth about second reference" print, " point, from sector sct0" print, " el1 - The elevation at second reference" print, " point, positive away from surface" print, " para - In dircetion of the unit vector" print, " in a plane perpendicular to" print, " the unit vector, the angle CCW from" print, " projected axis of first reference" print, " point to projected axis of the" print, " second reference point" print print, " Note: If az0 is positive CCW, the az1 is positive CCW" print, " If az0 is positive CW, the az1 is positive CW" print print, "The routine can be used to convert between coordinate" print, "systems as follows:" print print, "(1) Let: az0 = hour angle (2) Let: az0 = azimuth" print, " el0 = declination el0 = elevation" print, " olat = earth latitude olat = earth latitude" print print, " Then: az1 = azimuth Then: az1 = hour angle" print, " el1 = elevation el1 = declination" print, " para = parallatic para = neg. parallatic" print, " (positive counter" print, " clockwise from" print, " earth north)" print return ndif
(See /home/cbeck/firs_soft2/r_frame_sphtri.pro)
procedure: r_frame_sphtri0 purpose: Transform a unit vector between two spherical reference points. (Same effect as r_frame_sphtri but does not do parallactic angle). reference: Fundamental spherical trigonometry equations from Smart: Text-Book on Spherical Astronomy, eq. A, B, C, and D. authors: kcjones@sunspot.noao.edu (Phil Wiborg), paul@ncar ============================================================================= Check number of parameters. f n_params() lt 5 then begin print print, "usage: r_frame_sphtri0 $" print, " , olat $ ;Input" print, " , az0, el0 $ ;Input" print, " , az1, el1 ;Output" print print, " Transform a unit vector between two spherical" print, " reference points." print, " (Same effect as r_frame_sphtri but does not do" print, " parallactic angle)." print print, " Definition:" print print, " sct0 ~ The great circle sector that" print, " connects the two reference points" print, " on the sphere" print print, " Arguments (all in radians):" print print, " olat ~ !pi/2.-abs(sct0)" print, " az0 ~ The azimuth about first reference" print, " point, from sector sct0" print, " el0 ~ The elevation at first reference" print, " point, positive away from surface" print, " az1 ~ The azimuth about second reference" print, " point, from sector sct0" print, " el1 ~ The elevation at second reference" print, " point, positive away from surface" print print, " Note: If az0 is positive CCW, the az1 is positive CCW." print, " If az0 is positive CW, the az1 is positive CW." print print, "The routine can be used to convert between coordinate" print, "systems as follows:" print print, "(1) Let: az0 = hour angle (2) Let: az0 = azimuth" print, " el0 = declination el0 = elevation" print, " olat = earth latitude olat = earth latitude" print print, " Then: az1 = azimuth Then: az1 = hour angle" print, " el1 = elevation el1 = declination" print return ndif
(See /home/cbeck/firs_soft2/r_frame_sphtri0.pro)
procedure: r_frame_sun purpose: From time, hilio centric (west,north) arc seconds on sun find solar longitude and latitude. author: paul@ncar ============================================================================= Check number of parameters. f n_params() eq 0 then begin print print, "usage: r_frame_sun $" print, " , year, month, day, utime $ ;Input" print, " , west_arcsec, north_arcsec $ ;Input" print, " , longitude, latitude $ ;Output" print, " , mu_value [ $ ;Output" print, " , right_ascen, declination $ ;Output" print, " , gsdt, b0_angle, p_angle $ ;Output" print, " , cen_long, radius_arcsec ] ;Output" print print, " From time, hilio centric (west,north) arc seconds on" print, " sun find solar longitude and latitude. print print, " Arguments:" print print, " year - year of observation" print, " (1900 added for 50 < year < 101 )" print, " (2000 added for year < 51 )" print, " month - month of year" print, " day - day of month" print, " utime - universal time in hours" print, " west_arcsec - Arc seconds helio centric west of" print, " disk center" print, " north_arcsec - Arc seconds helio centric north of" print, " disk center" print, " longitude - longitude positive west of solar" print, " line of sight meridian" print, " latitude - latitude positive north of solar" print, " equator" print, " mu_value - observation mu value" print, " right_ascen - right ascension of disk center" print, " declination - declination of disk center" print, " gsdt - right ascension from central" print, " meridian" print, " b0_angle - b0 angle" print, " p_angle - p angle" print, " cen_long - carrington longitude of disk center" print, " radius_arcsec - solar radius in arc seconds" return ndif
(See /home/cbeck/firs_soft2/r_frame_sun.pro)
function: setmtxright purpose: Return 4x4 matrix set with argument list. Note a transpose is done to get matrix operations to work as one would expect. author: paul seagraves 92.09.03 edited : cbeck 2001 ============================================================================== Check number of parameters. f n_params() ne 16 then begin print print, "usage: m = setmtxright (e00, e01, e02, e03, $" print, " e10, e11, e12, e13, $" print, " e20, e21, e22, e23, $" print, " e30, e31, e32, e33)" print print, " Return 4x4 matrix set with argument list." print return, 0 ndif
(See /home/cbeck/firs_soft2/setmtxright.pro)
NAME: SHC PURPOSE: Find the linear shift between two 2-d images using the forier crosscorrelation method and optional interpolation for sub-pixel shifts. CATEGORY: CALLING SEQUENCE: RESULT = SHC ( IMG1, IMG2 ) INPUTS: IMG1,IMG2 : 2-d arrays of same size KEYWORDS: FILTER : (Flag) if set and not zero, an edge filter is used for the fft. INTERPOLATE: (Flag) If set and not zero, interpolate the position of the maximum of the cross correlation function to sub-pixel accuracy. OUTPUTS: RESULT : 2-element vector with the shift of IMG2 relative to IMG1. RESULT(0) is shift in X-direction, RESULT(1) is shift in Y-direction. PROCEDURE: Compute the crosscorrelation function using FFT and locate the maximum. MODIFICATION HISTORY: 13-Aug-1992 P.Suetterlin, KIS 29-Aug-1995 PS Added Edge filter 30-Aug-1995 PS Add Subpix interpolation. Slight rewrite of normal maximum finding (Use shift) 11-Sep-1995 PS: Forgot the 1-d case. Re-implemented.
(See /home/cbeck/firs_soft2/shc.pro)
NAME SHIFT_FRAC PURPOSE: Shift an 2-d image by fractional pixels in x and y direction, either by bilinear or bicubic interpolation. *CATEGORY: @CAT-# 16 18@ Image Processing , Interpolation CALLING SEQUENCE: result = SHIFT_FRAC (image, dx,dy [, {'L' | 'C'} ] [,MISSING=missing] ) INPUTS: image: the 2-dim image array to be shifted. dx, dy: the shift to be done in 1st ("x") and 2nd ("y") dimension of the image. If positive, the shift is done towards right or upper direction. OPTIONAL INPUT: method: string specifying the interpolation method; either = 'L': bilinear interpolation (the default) or = 'C': cubic interpolation. KEYWORD PARAMETERS: MISSING=missing: The value to return for elements outside the bounds of array image. Default: Interpolated positions that fall outside the bounds of the image, are set to the value of the nearest image pixel. OUTPUTS: Array with the shifted image. Same size as input image array. PROCEDURE: Calls IDL-function INTERPOLATE. MODIFICATION HISTORY: nlte&kis, 2000-Jul-05
(See /home/cbeck/firs_soft2/shift_frac.pro)
============================================================================ procedure : shift_img purpose : shift image row by row for amount in shift_vec calls : shift_frac.pro written : cbeck@kis 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 4) then begin print print, "usage: shift_img,img,shift_vec,firsty,lasty print print, " Shift image row by row for amount in shift_vec." print print, " Arguments" print, " Input :" print, " img : image to be shifted" print, " shift_vec : amount to be shifted in pixel," print, " length must correspond with" print, " firsty,lasty" print, " firsty,lasty : useable range along slit" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/shift_img.pro)
============================================================================ procedure : sshift_img purpose : shift image row by row for amount in shift_vec calls : shift_frac.pro written : cbeck@kis 06/02 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 4) then begin print print, "usage: sshift_img,img,shift_vec,firsty,lasty print print, " Shift image row by row for amount in shift_vec." print print, " Arguments" print, " Input :" print, " img : image to be shifted" print, " shift_vec : amount to be shifted in pixel," print, " length must correspond with" print, " firsty,lasty" print, " firsty,lasty : useable range along slit" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/sshift_img.pro)
============================================================================== function : string2num purpose : return the value of a string as double if possible takes whitespace, '/', ',' or ':' as separator calls : strsplit.pro, strtrim.pro, strcompress.pro, double.pro, where.pro (idl-implemented), length.pro, num2string.pro written : cbeck@KIS 06/02 ============================================================================== Check number of parameters. ============================================================================== f n_params() ne 1 then begin print print, "usage: num = string2num(str, /verbose )" print print, " Return content of a string as double precision floating." print, " Returns vector, if more than one number seperated" print, " by blanks or /,;: is found." print, " Attention : The number 42424242424242.42 will be cut" print, " out of the string, so be careful with that number !!" print, " If no number or ONLY '42424242424242.42' is found, the" print, " the output is the string 'nonumber' ." print print, " Arguments" print, " Input :" print, " str : string, may contain more than one" print, " number." print print, " Output:" print, " num : number/vector of numbers." print print, " Keywords:" print, " /verbose : give additional run time info" print print, " Example: str = '12,324:55.34,abcd76 45' gives" print, " res=[12,324,55.34,45]" print, " while str = '12,324:55.34,76abcd 45' gives" print, " res=[12,324,55.34,76,45]" print return,0 ndif ==============================================================================
(See /home/cbeck/firs_soft2/string2num.pro)
NAME: UNIQUE PURPOSE: Return the unique elements of an array. CATEGORY: CALLING SEQUENCE: out = unique(in, count) INPUTS: in = input array to process. in KEYWORD PARAMETERS: Keywords: /SORT means sort array before selecting unique elements. OUTPUTS: out = returned unique elements from in. out count = cw# occurances of each unique element. out COMMON BLOCKS: NOTES: Notes: unsorted arrays only have repeated elements dropped, use /SORT to drop all extra repeated elements. MODIFICATION HISTORY: R. Sterner, 4 Oct, 1993 R. Sterner, 5 Oct, 1993 --- added count. Copyright (C) 1993, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
(See /home/cbeck/firs_soft2/unique.pro)
NAME: VALID_NUM() PURPOSE: Check if a string is a valid number representation. EXPLANATION: The input string is parsed for characters that may possibly form a valid number. It is more robust than simply checking for an IDL conversion error because that allows strings such as '22.3qwert' to be returned as the valid number 22.3 This function had a major rewrite in August 2008 to use STREGEX and allow vector input. It should be backwards compatible. CALLING SEQUENCE: IDL> status = valid_num(string [,value] [,/integer]) INPUTS: string - the string to be tested, scalar or array RETURNS status - byte scalar or array, same size as the input string set to 1 where the string is a valid number, 0 for invalid OPTIONAL OUTPUT: value - The value the string decodes to, same size as input string. This will be returned as a double precision number unless /INTEGER is present, in which case a long integer is returned. OPTIONAL INPUT KEYWORD: /INTEGER - if present code checks specifically for an integer. EXAMPLES: (1) IDL> print,valid_num(3.2,/integer) --> 0 ;Since 3.2 is not an integer (2) IDL> str =['-0.03','2.3g', '3.2e12'] IDL> test = valid_num(str,val) test = [1,0,1] & val = [-0.030000000 ,NaN ,3.2000000e+12] REVISION HISTORY: Version 1, C D Pike, RAL, 24-May-93 Version 2, William Thompson, GSFC, 14 October 1994 Added optional output parameter VALUE to allow VALID_NUM to replace STRNUMBER in FITS routines. Version 3 Wayne Landsman rewrite to use STREGEX, vectorize Version 4 W.L. (fix from C. Markwardt) Better Stregex expression, was missing numbers like '134.' before Jan 1 2010
(See /home/cbeck/firs_soft2/valid_num.pro)
============================================================================ function : vecnorm purpose : calculate absolute length of 3-D vector written : cbeck@KIS ============================================================================= Check number of arguments. ============================================================================= f (n_params() lt 1) then begin print print, "usage: erg = vecnorm(x)" print print, " Calculate length of 3-D vector." print print, " Arguments" print, " Input :" print, " x : vector with [x1,x2,x3]" print return,0 ndif =============================================================================
(See /home/cbeck/firs_soft2/vecnorm.pro)
============================================================================== function : vtt_ten purpose : return the unnormalized telescope matrix for the vacuum tower telescope Teneriffa written : cbeck@kis, 12/01 ============================================================================== Check number of parameters. ============================================================================== f n_params() lt 24 then begin print print, "usage: T = vtt_ten( th1, th2, th3 $" print, " , winret, winang $" print, " , exret, exang $" print, " , offout $" print, " , coel1rs,coel1rp,coel1ret$" print, " , coel2rs,coel2rp,coel2ret$" print, " , prirs, prirp, priret,xi$" print, " , th_pol_C1,th_C1_pol,th_pol_C2," print, " , /polarizer, /ideal )" print print, " Return the 4x4 vacuum tower telescope matrix." print print, " Arguments" print, " th1 : rotation angle between RF0 and first" print, " coelostat mirror" print, " th2 : rotation angle between C1 and C2" print, " th3 : rotation angle between C2 and main" print, " winret : retardance of entry window" print, " winang : position angle of entry window" print, " exret : retardance of exit window" print, " exang : position angle of exit window" print, " offout : rotation between deflection mirror" print, " and polarimeter fiducial axis" print, " coel1rs : reflectivity perpendicular to plain" print, " of incidence, C1" print, " coel1rp : reflectivity in the plain of" print, " incidence, C1" print, " coel1ret: retardance of first mirror C1" print, " coel2rs : reflectivity perpendicular to plain" print, " of incidence, C2" print, " coel2rp : reflectivity in the plain of" print, " incidence, C2" print, " coel2ret: retardance of second mirror C2" print, " prirs : reflectivity perpendicular to plain" print, " of incidence, main and deflection" print, " prirp : reflectivity in the plain of" print, " incidence, main and deflection" print, " priret : retardance of main and deflection" print, " mirror" print, " xi : position angle of polarizer" print, " on window: W to N, on C1: N to E" print, " th_pol_C1 : rotation between polarizer and C1" print, " th_C1_pol : rotation between reflected C1 and" print, " linear polarizer" print, " th_pol_C2 : rotation between polarizer and C2" print print, " Keywords" print, " /ideal : use ideal mirrors diag(1,1,-1,-1)" print, " polarizer = 1 : put polarizer on C1" print, " polarizer = 2 : put polarizer on window" print print, " Important : all angles have to be given in degrees !" print return,0 endif =============================================================================
(See /home/cbeck/firs_soft2/vtt_ten.pro)
============================================================================ procedure : wave_shift purpose : calculate position of line cores for images ia and ib, fit polynomial of 2nd order on curve, shift all images of ib,qb,ub,vb for differences of the polynomials, repeat procedure calls : lpff.pro, sshift_img.pro Hardwired: offsets of CA spectrally and spatially, line 64f. This has to be modified, if CA data is 'good', i.e. hairline can be detected and spectral lines in the part beams are not far displaced. written : cbeck@kis 4/03 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 10) then begin print print, "usage: wave_shift,ia,ib,qb,ub,vb,ilo,ihi,firsty,lasty" print, " ,repetitions,plt=plt" print print, " Shift all images (I,Q,U,V) to minimal difference of" print, " line core postions of spectral line in I." print print, " Arguments" print, " Input :" print, " ia,ib : Stokes I intensity images A/B" print, " qb,ub,vb : polarization images of B" print, " ilo,ihi : range of spectral line to be" print, " used in aligning" print, " firsty,lasty : useable range along slit" print, " repetitions : number of iterative repetitions" print, " to improve accuracy" print print, " Keywords" print, " plt : plot line cores before and" print, " after shift" print, " hairs : if set, shift only once by the" print, " value of hairs(CA data)" print, " straight : use straight line instead of" print, " polynomial of 2nd degree" print print, " Additional : for CA first shift in spectral dimension" print, " is value of filt_stepsz from op. header" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/wave_shift_firs.pro)
============================================================================ procedure : wave_shift purpose : calculate position of line cores for images ia and ib, fit polynomial of 2nd order on curve, shift all images of ib,qb,ub,vb for differences of the polynomials, repeat procedure calls : lpff.pro, sshift_img.pro Hardwired: offsets of CA spectrally and spatially, line 64f. This has to be modified, if CA data is 'good', i.e. hairline can be detected and spectral lines in the part beams are not far displaced. written : cbeck@kis 4/03 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 10) then begin print print, "usage: wave_shift,ia,ib,qb,ub,vb,ilo,ihi,firsty,lasty" print, " ,repetitions,plt=plt" print print, " Shift all images (I,Q,U,V) to minimal difference of" print, " line core postions of spectral line in I." print print, " Arguments" print, " Input :" print, " ia,ib : Stokes I intensity images A/B" print, " qb,ub,vb : polarization images of B" print, " ilo,ihi : range of spectral line to be" print, " used in aligning" print, " firsty,lasty : useable range along slit" print, " repetitions : number of iterative repetitions" print, " to improve accuracy" print print, " Keywords" print, " plt : plot line cores before and" print, " after shift" print, " hairs : if set, shift only once by the" print, " value of hairs(CA data)" print, " straight : use straight line instead of" print, " polynomial of 2nd degree" print print, " Additional : for CA first shift in spectral dimension" print, " is value of filt_stepsz from op. header" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/wave_shift_spinor.pro)
============================================================================ procedure : window_pos purpose : return coordinates in 2-d array written : cbeck@KIS 03/04 ============================================================================== Check number of arguments. ============================================================================== f (n_params() lt 1) then begin print print, "usage: window_pos,image,winindex = winindex,no_del = no_del" print print, " Display 2-d array in window, print cursor" print, " position, give position on terminal if" print, " left mouse button is pressed. Right" print, " mouse button finishes." print print, " Arguments" print, " Input :" print, " image: 2-d array" print print, " Keywords:" print, " windex : number of window, default: 0" print, " no_del : keep window" print return ndif ==============================================================================
(See /home/cbeck/firs_soft2/window_pos.pro)