section of routines in util_fr.i

functions in util_fr.i -

 
 
 
__clip


 __clip  
 
SEE clip  
 
 
 
__dist


 __dist  
 
SEE dist  
 
 
 
__eclat


 __eclat  
 
SEE eclat  
 
 
 
__mysinc


 __mysinc  
 
SEE sinc  
 
 
 
bin2


             bin2(image)  
 
  Returns the input image, binned by a factor of 2.  
  That is, a 512x512 image is transformed in a 256x256 image.  
  one output pixel is the average of the 4 corresponding input ones,  
  so that it conserves the total intensity.  
SEE ALSO: undersample  
 
 
 
clip


             func clip(arg, mini, maxi);  
 
  Returns the argument, which has been "clipped" to mini  
  and maxi, i.e. in which all elements lower than "mini"  
  have been replaced by "mini" and all elements greater  
  than "maxi" by "maxi". Array is converted to float.  
  Either "mini" and "maxi" can be ommited, in which case  
  the corresponding mini or maxi is not clipped.  
  Equivalent to the IDL ">" and "<" operators.  
  F.Rigaut, 2001/11/10.  
SEE ALSO:
 
 
 
colorbar


             colorbar  
             colorbar, cmin, cmax  
 
     draw a color bar to the right of the plot.  If CMIN and CMAX  
     are specified, label the top and bottom of the bar with those  
     numbers.  
     adjust: x adjust. typically +/- 0.01   
     levs: number of ticks in color bar (plus one)  
     upgraded 2007june02  
SEE ALSO: color_bar  
 
 
 
dist


             func dist(size,xc=,yc=)  
 
  Returns an array which elements contains the distance to (xc,yc). xc  
  and yc can be omitted, in which case they are defaulted to size/2+1.  
  F.Rigaut, 2001/11/10.  
SEE ALSO: indices,   radial_distance  
 
 
 
eclat


             func eclat(image)  
 
  Equivalent, but slightly faster (?) than roll. Transpose the four main  
  quadrants of a 2D array. Mostly used for FFT applications.  
  F.Rigaut, 2001/11/10.  
SEE ALSO: roll  
 
 
 
even


             even(arg)  
 
  returns 1 is argument is even, zero otherwise.   
  The argument should be an integer.  
  F.Rigaut, 2001/11/10.  
SEE ALSO: odd  
 
 
 
exist


             exist(arg)  
 
  Returns 0 if element is not set or is a , 1 otherwise  
  F.Rigaut 2002/04/03  
SEE ALSO: is_void,   where  
 
 
 
fileExist


             fileExist(filename)  
 
   Returns "1" if the file(s) exist(s), "0" if it does not.  
   filename can be an array, in which case the results is an array  
   of 0s and 1s.  
   F.Rigaut 2002/01  
SEE ALSO:
 
 
 
findfiles


             findfiles(filter)  
 
  This routines returns a list of files which satisfy the filter  
  argument. The list is a string vector. If no files were found,  
  the results is the empty string.  
  F.Rigaut, 2001/11/10.  
SEE ALSO: spawn  
 
 
 
indices


             indices(dim)  
 
  Return a dimxdimx2 array. First plane is the X indices of the pixels  
  in the dimxdim array. Second plane contains the Y indices.  
  Inspired by the Python scipy routine of the same name.  
  New (June 12 2002): dim can either be :  
    - a single number N (e.g. 128) in which case the returned array are  
      square (NxN)  
    - a Yorick array size, e.g. [#dimension,N1,N2], in which case  
      the returned array are N1xN2  
    - a vector [N1,N2], same result as previous case  
  F.Rigaut 2002/04/03  
SEE ALSO: span  
 
 
 
is_set


             is_set(arg)  
 
  Returns 0 if element is void or equal to zero, 1 otherwise  
  F.Rigaut 2002/06/03  
SEE ALSO: is_void,   where,   exist  
 
 
 
ls


             ls: system command ls   
 
  F.Rigaut, 2001/11/10.  
SEE ALSO: pwd,   system,   $  
 
 
 
makegaussian


             makegaussian(size,fwhm,xc=,yc=)  
 
  Returns a centered gaussian of specified size and fwhm.  
  F.Rigaut 2001/09  
  norm returns normalized 2d gaussian  
SEE ALSO:
 
 
 
minmax


             minmax(arg)  
 
  Returns a vector containing the min and the max of the argument  
  F.Rigaut 2001/09  
SEE ALSO:
 
 
 
nprint


             func nprint(var,sep=,format=)  
 
   Neat print of a 2d array.  
   example:  
   > nprint,optpos*pi/3.14e9,sep=", "  
      +0, -5.003e-07,       +0, -9.005e-08,       +0,       +0   
      +0, -4.002e-07,       +0, +9.005e-08,       +0,       +0   
      +0, -3.002e-07,       +0, +9.005e-08,       +0,       +0   
      +0, -2.001e-07,       +0, +9.005e-08,       +0,       +0   
      +0, -1.801e-07,       +0, +9.005e-08,       +0,       +0   
      +0, -1.001e-07,       +0, +9.005e-08,       +0,       +0   
      +0, +1.001e-07,       +0, +9.005e-08,       +0,       +0  
   sep= separator string. The default separator is two blanks ("  ").  
   format= swrite format  
   Restricted to 2D arrays  
SEE ALSO: pm  
 
 
 
odd


             odd(arg)  
 
  Returns 1 is argument is odd, zero otherwise.   
  The argument should be an integer.  
  F.Rigaut, 2001/11/10.  
SEE ALSO: even  
 
 
 
parsedate_fr


             parsedate(strdate,format,dec=)  
 
  Returns the date in integers as an array [[year],[month],[day]],  
  or in decimal if "dec" is set. The format has to be specified.  
  Does not yet accept dates in the form "2003jun05".  
  strdate = string array containing the date e.g. "2003/10/25"  
  format  = format in the form "yyyy/mm/dd"  
  Examples:  
  > parsedate(["2003/05/21","2003/02/15"],"yyyy/mm/dd",dec=1)  
  [2003.38,2003.12]  
  > parsedate(["2003/05/21","2003/02/15"],"yyyy/mm/dd")  
  [[2003,2003],[5,2],[21,15]]  
SEE ALSO: parsetime,   *****,   NEED,   TO,   UPGRADE,   THIS,  
FUNCTION,   FOR,   THE,   1,   6,   STR,   FUNCTIONS,   ****  
 
 
 
parsetime_fr


             parsetime(strtime,dec=)  
 
  Parse the input string array "strtime" and returns the time as a [hh,mm,ss]  
  vector (or array if strtime is an array of string) or returns the time  
  as a single decimal number (or vector if strtime is an array) if the  
  "dec" keyword is set.  
  Examples:  
  > parsetime(["22:30:25.792","22:20:33.852"],dec=1)  
  [22.5072,22.3427]  
  > parsetime(["22:30:25.792","22:20:33.852"])  
  [[22,22],[30,20],[25.792,33.852]]  
 ***** NEED TO UPGRADE THIS FUNCTION FOR THE 1.6 STR FUNCTIONS ****  
SEE ALSO: parsedate  
 
 
 
plot


             plot(vect,x,square=,histo=)  
 
  Short cut for a fma + plg  
  Set histo to get plh type plot  
  F.Rigaut 2001/10  
SEE ALSO: plg,   fma,   tv,   plh  
 
 
 
rdfile


             func rdfile(file)  
 
   Open, read, close and return the whole content of ascii file "file".  
   AUTHOR : F.Rigaut, Oct 2004.  
SEE ALSO: load_text,   dump_text  
 
 
 
round


             round(arg)  
 
  Returns the rounded version of a floating point argument  
  modified 2007dec06 to fix problem with negative numbers  
  F.Rigaut 2001/10  
SEE ALSO: ceil,   floor  
 
 
 
secToHMS


             secToHMS(time)  
 
  Convert from time (float in sec) to string in the form hh:mm:ss.s  
  AUTHOR : F.Rigaut, June 13 2002.  
SEE ALSO:
 
 
 
sinc


             func sinc(ar)  
 
  Return the sinus cardinal of the input array  
  F.Rigaut, 2002/04/03  
SEE ALSO: Eric,   Thiebault,   wrote,   a,   sinc,   which,   is,  
probably,   better  
 
 
 
spawn_fr


             spawn_fr(command)  
 
  This function tries to group in one call the :  
  - call to system  
  - read the file created by the system call  
  - returns it  
  Inspired from the IDL function of the same name  
  F.Rigaut 2002/04/04  
SEE ALSO: system,   popen,   exec,   in,   Eric/system,   i,  
DEPRECATED:,   Use,   spawn/sys,   instead  
 
 
 
tac


             tac(counter_number)  
 
  Marks the end of a time lapse  
  ex: tic ; do_something ; tac()  
  will print out the time ellapsed between tic and tac  
  a counter number can optionaly be specified if several  
  counters have to be used in parallel.  
  F.Rigaut 2001/10  
SEE ALSO: tic  
 
 
 
tic


             tic(counter_number)  
 
  Marks the beginning of a time lapse  
  ex: tic ; do_something ; tac()  
  will print out the time ellapsed between tic and tac  
  a counter number can optionaly be specified if several  
  counters have to be used in parallel.  
  F.Rigaut 2001/10  
SEE ALSO: tac  
 
 
 
tv


             tv(im,square=)   
 
  This routines does a frame advance, display the image  
  and set the limits to have the image full display.  
  Inspired from the IDL tvscl  
  F.Rigaut, 2001/11/10.  
SEE ALSO: fma,   pli,   plot  
 
 
 
typeReturn


             typeReturn(void)  
 
  A simple convenient function that does what is name says.  
SEE ALSO:
 
 
 
wheremax


 wheremax  
 
SEE wheremin  
 
 
 
wheremin


             func wheremin(ar)  
 
        and func wheremax(ar)  
   Short hand for where(array == min(array) or max(array)  
SEE ALSO: where,   where2,   min,   max