F2TC $SSW/radio/ovsa/idl/support/f2tc.pro
[Previous] [Next]
 NAME:
     F2TC
 PURPOSE:
     Returns the tuning current corresponding to a given frequency,
     for a specified antenna, according to the current FCPARM.FTH
     file located in the !DEFAULTS.WORKDIR directory.
 CATEGORY:
     OVRO APC DIAGNOSTIC
 CALLING SEQUENCE:
     tc = f2tc(f,ant)
 INPUTS:
     f       Frequency, in MHz, at which tuning current is desired.
     ant     Antenna number for which the information is wanted.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     tc      Tuning current corresponding to F, for antenna ANT
 COMMENTS:
 SIDE EFFECTS:
 RESTRICTIONS:
     Assumes the latest FCPARM.FTH contains the current FCAL values.
 MODIFICATION HISTORY:
     Written 16-Jun-1998 by Dale E. Gary


F_COMPARE $SSW/radio/ovsa/idl/misc/f_compare.pro
[Previous] [Next]
 NAME:
     F_COMPARE
 PURPOSE:
     Find the indexes of one frequency array within another.  This is useful
     when two sets of data with different frequencies are to be compared.
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     idx = f_compare(f1,f2)
 INPUTS:
     f1     the object frequency array of length NF, whose values are to be found
              within F2.
     f2     the reference frequency array, which is searched for the values of F1.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     idx	 the output list of indexes to F2, for which the values in F2 match
              the values in F1.  If a value in F1 is not found in F2, an index
              flag of -1 is returned in that location.  IDX will have the same
              number of elementes as F1 (NF elements).
 COMMENTS:
     When two datasets DATA1 and DATA2 exist with different frequencies (frequency
     lists F1 and F2), one can compare the data at the common frequencies by calling
        idx = f_compare(F1,F2)
        igood = where(idx ne -1,ngood)
        if (ngood ne 0) then begin
           plot,F1[igood],DATA1[igood]
           oplot,F2[idx[igood]],DATA2[idx[igood]]
        endif else begin
           print,'No matches!'
        endelse
 SIDE EFFECTS:
 RESTRICTIONS:
     This routine can be used with any two arrays, not just frequencies, but
     beware that any values differing by less than 1.e-5 are considered to
     match.
 MODIFICATION HISTORY:
     Written 13-Jul-2004 by Dale Gary


FCAL_UPDATE $SSW/radio/ovsa/idl/support/fcal_update.pro
[Previous] [Next]
 NAME:
     FCAL_UPDATE
 PURPOSE:
     Spawned by Watcher on receipt of a MONITOR segment, this routine examines
     the contents of the last MONITOR segment in the file, and if certain
     timing criteria are met, it updates the current frequency calibration
     to bring the phase locks closer to the center of the range.
 CATEGORY:
     OVRO APC REALTIME CALIBRATION
 CALLING SEQUENCE:
     fcal_update, data
 INPUTS:
     data    The data record of the MONITOR segment
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     get_segments, openarc, getdata, tl_decode, sysdoy, write_fchist
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	NINT [1], NINT [2], SYSDOY, TL_DECODE, W2L, WRITE_FCHIST
 CALLED BY:
	WATCHER
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 25-Jul-1999 by Dale Gary
     16-Aug-1999  DG
       Change optimum V/F from 8 to a variable, VFOPT.  Currently set VFOPT=10,
       which seems to result in much better phase lock.
     18-Aug-1999  DG
       Write out a history of the phase lock changes (using new routine WRITE_FCHIST)
       in order to track changes.
     23-May-2000  DG
       Updated to work with 6 antennas.  A trivial change is needed when one more
       antenna is added.
     28-Jun-2000  DG
       Changed to avoid trying to update antennas that are not in service.
     01-Jul-2000  DG
       Now writes update to FCPARM.FTH, so that file now contains the current
       frequency calibration.  Thus, CPCINIT will automatically include the latest
       calibration when a CPC reboot is necessary.
     14-Jan-2001  DG
       Significant rewrite to use new FCAL scheme.
     16-Nov-2002  DG
       Add one to output fields of FCNEW.TMP and FCUPDT.FTH files to avoid
       columns running into each other, which crashes CPC.
     13-Feb-2004  DG
       Change optimum V/F to an array, so that individual oscillators can be
       adjusted separately.  Use optimum V/F of 11 for ant 5 & 7 mid oscillator
       (note that the indices are hard-coded and might change if antennas change).
     12-Jul-2004  DG
       Changed NANT to 7, to reflect new antenna 8 addition.
     25-Jul-2004  DG
       Changed setting of optimum V/F for ant 5 from 11 to 10, since adjustment
       of RCI communication in receiver may have fixed the problem that was supposed
       to solve.


FCALCHEK $SSW/radio/ovsa/idl/analysis/fcalchek.pro
[Previous] [Next]
 NAME:
     FCALCHEK
 PURPOSE:
     Main routine to analyze frequency calibration data.  Responds to
     scans of type FCAL (scan code 3) or TEST DATA (scan code 1).
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     fcalchek[,filename][,hrec | ,after=after][,/debug][,/cmdfile][,/lockmap]
 INPUTS:
     filename   the name of the file containing FCAL data.  If
                  omitted, the file DAILY.ARC in directory
                  !DEFAULTS.WORKDIR is assumed.
     hrec       the record number of the FCAL scan header.  Data
                  will be processed up to the next EOS segment.
                  If this argument is given, then AFTER keyword
                  is ignored.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     after      an optional time string of the standard form
                  [yyyy.ddd ]hh:mm[:ss]m after which to start
                  looking for a valid FCAL or TEST DATA scan.
     cmdfile    a switch that indicates that the routine was called
                  from a command file, so issue no modal messages, and
                  print any error messages to <WORKDIR>\FCAL.MSG
     debug      a switch that activates some debugging statements
                  for getting an indication of intermediate steps.
                  This switch is not compatible with /CMDFILE switch.
     lockmap    a switch that activates the LOKMAP widget routine.
                  NB: when this switch is set, no FCAL solution is
                  written!
 ROUTINES CALLED:
    openarc, lasthrec, getdata, decode, tl_decode, write_fcparm, tcfit
 OUTPUTS:
 COMMENTS:
     There will have to be modifications to this routine when
     additional antennas are available.
 CALLS: ***
	FTAB2TC, GETDATA, LASTHREC, MOMENT, NEWSCAN, NINT [1], NINT [2], OPENARC, SHOW_OSC, TCFIT2
	TL_DECODE, WLOKMAP, WRITE_FCPARM
 CALLED BY:
	WATCHER
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 23-Jan-1998 by Dale Gary
     15-Mar-1998  DG
       Added cmdfile switch for unattended operation.
       Inserted routine by JW Lee to do the work.
     15-Jun-1998  DG
       Slight change to print EPOCH correctly as dddhhmm in output.
     21-Jun-1998  DG
       Changed from reading a(rec) to getdata(rec,a) throughout,
       so that routine should work under UNIX.
     29-Jul-1998  DG
       Added LOKMAP switch to allow the routine to be used to show
       phase lock maps.
     25-Aug-1998  DG
       Added check for new TRAJECTORY segments (but contents ignored
       for now.)
     24-Nov-1998  DG
       I had added use of a file !DEFAULTS.DBDIR/NOMTUNE.FTH some time
       ago, but did not finish the code completely. Now reads from
       NOMTUNE.FTH but writes to !DEFAULTS.WORKDIR/FCPARM.FTH.
     04-Feb-1999  DG
       Converted to use NEWSCAN routine
     14-Mar-1999  DG
       Fixed long-standing bug--KOFF=2 was not used so all TC were too
       high by 2.  Agghh. I was also off by 33!  In introducing the
       NEWSCAN routine, I was off by one record.  I added a beautiful
       plot routine SHOW_OSC, to show a comparison of the nomtune locks
       and actual locks.
     03-Apr-1999  DG
       Implement early form of FCAL.DIAG file, to write out diagnostics
       for use by DIAGNOSE routine.
     11-Jan-2000  DG
       Eliminated hardwired directory locations.
     13-Mar-2000  DG
       Fixed to work with up to 8 antennas.  Required slight change to
       NOMTUNE.FTH file, which now much list all 8 antennas even if some
       entries (e.g. currently the last two) are not used.
     14-Jan-2000  DG
       Completely rewritten for new FCAL scheme.
     16-Nov-2002  DG
       Add one to output fields of FCPARM.FTH to avoid columns running into
       each other, which crashed the CPC.
     25-Jul-2004  DG
       Adjusted sigma cutoff for "Bad Fit" message from 1.0 to 1.5, to
       avoid spurious messages.


FCALHist $SSW/radio/ovsa/idl/support/fcalhist.pro
[Previous] [Next]
 NAME:
     FCALHist
 PURPOSE:
     Plot and examine the frequency calibration history files
 CATEGORY:
     OVRO APC SYSTEM MONITORING
 CALLING SEQUENCE:
     FCALHist
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
 COMMENTS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 07-Oct-1998 by Dale E. Gary


fft_uv2xy [2] $SSW/radio/ovsa/idl/mapping/fft_uv2xy.pro
[Previous] [Next]
 NAME:
       fft_uv2xy
 PURPOSE:
       calculate dirty map/beam and report information of scales
       set as a result of uv gridding
 CATEGORY:
   OVSA APC imaging
 CALLING SEQUENCE:
      fft_uv2xy,f_GHz, m, vis_ij, uv_ij, xyint, dbeam, dmap
 INPUTS:
       vis_ij : complex visibility as a fcn of time(i) & bsl(j)
       uv_ij  : complex (u,v) at the corresponding time & bsl
   m      : dimension of desired map = m x m
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       -
 ROUTINES CALLED:
       -
 OUTPUTS:
        xyint, dbeam, dmap

 COMMENTS:
    1. Why so named? This code would be similar to fftmap.f
       fft_uv2xy = fft (visibility in uv plane) to xy plane,
           in clear contrast to
   fft_xy2uv = fft (map in xy plane) to uv plane.
    2. uv gridding is done here.
   uvint is automatically set rather than user's choice
   convol. griid fcn is also fixed to one type: tr. gaussian.
   While dmap is mxm arrary, dbeam is double sized, i.e., 2mx2m
   to do better cleaning.
 CALLED BY:
	clean [2], clean [3], clean [4], slfcal [1], slfcal [2]
 SIDE EFFECTS: -
 RESTRICTIONS: see comments
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL
     15-Dec-2002  DG
       Changed the sign of the FFT from -1 to the correct +1.
       All the maps were coming out inverted in x and y.
     01-Mar-2003  DG
       Mask uv points that have zero visibilities (otherwise
       the beam was different than the map when there were
       missing data).
     06-Dec-2004  DG
       Added comment defining the factor 3.6e-5, which is correct!


fft_xy2uv $SSW/radio/ovsa/idl/mapping/fft_xy2uv.pro
[Previous] [Next]
 Modification History
    15-Dec-2002  DG
      Changed direction of FFT from +1 to -1, which is the
      correct direction.
 CALLED BY
	fwdfit [1], fwdfit [2], mem [1], mem [2], slfcal [1], slfcal [2], ssmem


FILEMENU $SSW/radio/ethz/idl/obsolete/filemenu.pro
[Previous] [Next]
 NAME:		FILEMENU
 PURPOSE:
	Creates a menu of files matching the type file
 	you ask for ie: *.pro.  Returns the name of the 
	file chosen by the user.
 CALLING SEQUENCE:
	selected_file = filemenu('*.pro',xpos=300,ypos=300)
	print,selected_file
 INPUTS:
	match-catagory of files to display
 KEYWORD PARAMETERS:
	xpos-x position of the menu
	ypos-y position of the menu
 OUTPUTS:
	Returns the name of the file chosen
 CALLS: ***
	General_Menu [1], General_Menu [2]
 CALLED BY:
	CONGRID [1], CONGRID [2], CONGRID [3], LASER8, Onedimensional files handling
	laser8ew
 RESTRICTIONS:
	Must be running on a windowing system
 TESTED ON THESE PLATFORMS:
	SUN 4 - DEC Station - DEC Alpha
 WARNING: THIS IS FOR IDL
 MODIFICATION HISTORY:
	SAL 2/92 , Precision Visuals, Inc.
	SME 2/92- Changed tvmenu to x_tvmenu , Precision Visuals, Inc.
	A.Csillaghy, Dec. 92, ETHZ
		added option to exit the menu without read
		added general_menu option for vt100 use
	1/95 Option to read also compressed ('.gz') file versions
	4/96 IDL version + ".z" compressed file versions read too


FILENAME2DATE $SSW/radio/ovsa/idl/time/filename2date.pro
[Previous] [Next]
 NAME:
     FILENAME2DATE
 PURPOSE:
     Routine to convert the 8.3 OVRO filename to a date string as YYYY/MM/DD
 CATEGORY:
     OVRO APC UTILITY
 CALLING SEQUENCE:
     datestr = filename2date(filename[,/nodelim])
 INPUTS
     filename   the filename to convert
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     nodelim    a switch that if set returns a string YYYYMMDD
 ROUTINES CALLED:
 OUTPUTS:
     datestr    a string as YYYY/MM/DD containing the converted date
                  unless NODELIM is set, in which case it is YYYYMMDD
 COMMENTS:
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CALDAT, CVDOY, break_file [4]
 CALLED BY:
	LAUNCHER, OVIEW2WEB, PLOT_ASC, QUICKLOOK, TOP20, TRUNCATE, WACAL
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 27-Oct-1999 by Dale E. Gary
     03-Mar-2002  DG
       Added NODELIM keyword
     22-Jun-2002  DG
       Made it work for DAILY.ARC--just returns today's date.


Files_Handling [1] $SSW/radio/ethz/idl/atest/files_handling.pro
[Previous] [Next]
 NAME:
 	Files_Handling
 PURPOSE:
	User Interface which handle image files. Makes use of
	a menu to select the file format. For more information
	about file formats, we refer to the "RagView User's
	Guide". The formats accepted are: ascii, fortran
	unformatted, fits, sb4, sc4, sca.
	Usually, FITS files are used. Therefore, for FITS files
	the following facilities are implemented:
		o reads also gzipped FITS files -- with extensions
		  ".gz" and ".z"
	Usually, this procedure is called from the system "RagView"
 CALLING SEQUENCE:
	Files_Handling, image [, xAxis, yAxis] [ ,totalFileName]
 INPUT:
	totalFileName: if given WITH EXTENTION, 
		the user interface 
		is not activated and the file is read directly. 
 OUTPUTS:
	image: the two-dimensional array. Its type determined
		from the file format.
	xAxis, yAxis: axes corresponding to the x- and y-direction
		of the image.
 KEYWORDS:
	STATUS: holds the value "Read" if a file was read,
		"Not Read" otherwise.
	FILENAME: holds the filename read, if status is "Read"
 CALLS: ***
	ASCII_Read, ASCII_WRITE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	FILE_EXIST [2], Fortran_Read, General_Menu [1], General_Menu [2], PUTHMS
	RAGFITSREAD, RAGFITSWRITE, REPSTR [1], REPSTR [2], REPSTR [3], SB4_Read, SB4_WRITE
	SCA_Read [1], SCA_Read [2], SETBOUNDS, Sca_Write, break_file [4], file_exist [1]
	file_exist [3]
 CALLED BY:
	Radio Astronomy Group View RAG View [1]
	Radio Astronomy Group View RAG View [2]
 SIDE EFFECTS:
	In the user interface mode, windows are opened to
	dialog with the user.
       The environment variable TMPDIR is used for help files. If
       TMPDIR is not defined, the current directory is used.
 MODIFICATION HISTORY:
	Created: A.Csillaghy, ETHZ, April 91, csillag@astro.phys.ethz.ch
	A.Csilaghy, Oct 92: fits format read/write added
	A.Cs, Dec. 92 FileMenu proc. used
	1994: added the option to read compressed files.
	Sept. 1995: added the mechanism to check links
		(for use with RAG image archive) ACs
	April 96: IDL version - ACS
       March 98: IDL5/Ragview/SSW Adaptation - ACS
       August 04- change the way to deal with directories. Now the
                  current dir remains the dir where the ragview
                  session was started. the file selectionis stored
                  separately (in the var confusingly called currentdir)


Files_Handling [2] $SSW/radio/ethz/idl/ragview/files_handling.pro
[Previous] [Next]
 NAME:
 	Files_Handling
 PURPOSE:
	User Interface which handle image files. Makes use of
	a menu to select the file format. For more information
	about file formats, we refer to the "RagView User's
	Guide". The formats accepted are: ascii, fortran
	unformatted, fits, sb4, sc4, sca.
	Usually, FITS files are used. Therefore, for FITS files
	the following facilities are implemented:
		o reads also gzipped FITS files -- with extensions
		  ".gz" and ".z"
	Usually, this procedure is called from the system "RagView"
 CALLING SEQUENCE:
	Files_Handling, image [, xAxis, yAxis] [ ,totalFileName]
 INPUT:
	totalFileName: if given WITH EXTENTION, 
		the user interface 
		is not activated and the file is read directly. 
 OUTPUTS:
	image: the two-dimensional array. Its type determined
		from the file format.
	xAxis, yAxis: axes corresponding to the x- and y-direction
		of the image.
 KEYWORDS:
	STATUS: holds the value "Read" if a file was read,
		"Not Read" otherwise.
	FILENAME: holds the filename read, if status is "Read"
 CALLS: ***
	ASCII_Read, ASCII_WRITE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	FILE_EXIST [2], Fortran_Read, General_Menu [1], General_Menu [2], PUTHMS
	RAGFITSREAD, RAGFITSWRITE, REPSTR [1], REPSTR [2], REPSTR [3], SB4_Read, SB4_WRITE
	SCA_Read [1], SCA_Read [2], SETBOUNDS, Sca_Write, break_file [4], file_exist [1]
	file_exist [3]
 CALLED BY:
	Radio Astronomy Group View RAG View [1]
	Radio Astronomy Group View RAG View [2]
 SIDE EFFECTS:
	In the user interface mode, windows are opened to
	dialog with the user.
       The environment variable TMPDIR is used for help files. If
       TMPDIR is not defined, the current directory is used.
 MODIFICATION HISTORY:
	Created: A.Csillaghy, ETHZ, April 91, csillag@astro.phys.ethz.ch
	A.Csilaghy, Oct 92: fits format read/write added
	A.Cs, Dec. 92 FileMenu proc. used
	1994: added the option to read compressed files.
	Sept. 1995: added the mechanism to check links
		(for use with RAG image archive) ACs
	April 96: IDL version - ACS
       March 98: IDL5/Ragview/SSW Adaptation - ACS


Find Breaks $SSW/radio/ethz/idl/gen/findbreaks.pro
[Previous] [Next]
 NAME: 
	Find Breaks 
 PURPOSE:
	Returns the index number of each break in the 
	regularity in the axis.
 CALLING SEQUENCE:
	result = FindBreaks( array )
 INPUT PARAMETERS:
	array: a 1D real array
 KEYWORD:
 	NOTREG: if set, only the first break is searched;
		if found, returns -1, else returns the first
		and last elements of the array
 RESULT OF FUNCTION:
	result of function: a 1D array with the indices number:
	[0... i, i+1, ... n-1] where i is the last pixel in the regular
	band left and i+1 the first in the regular band right.

 CALLS: ***
	FINDBREAKS
 MODIFICATION HISTORY:
	Created by A.Csillaghy in October 1991
		Inst. of Astronomy, ETH Zurich
	NOTREG in april, 1995
       Simplified in January 1998 ACs
       Reduced accuracy, Spring 2000 PM


find_axes $SSW/radio/ovsa/idl/mapping/find_axes.pro
[Previous] [Next]
 NAME:
     find_axes
 PURPOSE:
     Fit a 2D gaussian clean beam given the dirty beam image,
     and return the semi-major and semi-minor axes and tilt angle
 CATEGORY:
     OVSA MAPPING
 CALLING SEQUENCE:
     cbm = find_axes(dbeam)
 INPUTS:
     dbeam: dirty beam.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     none
 ROUTINES CALLED:
     elfit (internal routine), curvefit
 OUTPUTS:
     cbm[0]= a, semi-major/minor axis closer to x-axis in pixel units
     cbm[1]= b, semi-minor/major axis closer to y-axis
     cbm[2]= phi, angle of tilt of semi-major axis, relative to x-axis

 COMMENTS:
 CALLS: ***
	CURVEFIT, ELFIT, ROT
 CALLED BY:
	clean [2], clean [3], clean [4]
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 01-Mar-2003 by Dale E. Gary


FIND_INDEX $SSW/radio/ovsa/idl/index/find_index.pro
[Previous] [Next]
 NAME:
     FIND_INDEX
 PURPOSE:
     Locates the INDEX segment in the file, or returns -1 if none exists
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     rec = find_index(a,nrec)
 INPUTS:
     a        A file associated variable as returned from OPENARC.
     nrec     The number of records in the file, as returned from OPENARC
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     get_segments
 OUTPUTS:
     rec      The record number of the first record in the INDEX segment,
                or -1 if none exists.
 COMMENTS:
 CALLS: ***
	GETDATA, GET_SEGMENTS, TL_DECODE
 CALLED BY:
	CREATE_INDEX, INSERT_REC, OVSA_GET_INDEX, PUT_INDEX, WACAL, WANALYZE, WPOINT
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 27-Nov-1999 by Dale E. Gary
     03-Feb-2000  DG
       Added test of first record, where the INDEX record is supposed to be,
       to speed things up in the normal situation.
     14-Oct-2002  DG
       Return an error if the first record returns a -1


FINDLOCK $SSW/radio/ovsa/idl/support/findlock.pro
[Previous] [Next]
 NAME:
     FINDLOCK
 PURPOSE:
     Given a range of FCAL data around a nominal lock, finds the
     nearest lock and returns the index of the center of it relative
     to the nominal lock location.
 CATEGORY:
     OVRO APC DIAGNOSTIC
 CALLING SEQUENCE:
     tcmid = findlock(fcdata)
 INPUTS:
     fcdata   FCAL data within +/- DIDH/2 about a nominal lock, as
                given by the data in NOMTUNE.FTH, for a single antenna
                and oscillator.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     tcmid    The shift of the found lock nearest the nominal lock, or
                NaN if no lock exists in the range.  TCMID is typically
                a small integer value, but is returned as a float so
                that NaN can be returned to flag a missing lock.
 COMMENTS:
 CALLS: ***
	REVERSE
 CALLED BY:
	SHOW_OSC
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 14-Mar-1999 by Dale E. Gary
     17-Aug-1999  DG
       Changed IDIR from +/- 1/2 to +2/3, -1/3, to bias the solution
       to higher values of V/F.  For some reason, the locks are better
       at higher V/F.
     18-Aug-1999  DG
       Changed back to +/- 1/2 for the high oscillator, since the locks
       are too narrow to try offsetting


FINDSEG $SSW/radio/ovsa/idl/util/findseg.pro
[Previous] [Next]
 NAME:
     FINDSEG
 PURPOSE:
     Finds the record number of the first record of a specified type
     of segment within the current scan (determined as a record following
     the header record number provided).
 CATEGORY:
     OVRO APC UTILITY
 CALLING SEQUENCE:
     rec = findseg(a,hrec,segtyp[,idx=idx])
 INPUTS:
     a        A file associated variable corresponding to an open ARC file.
     hrec     The header record number corresponding to the desired scan.
     nrec     The number of records in the file, as returned by OPENARC.
     segtype  An integer constant defining the segment type--generally use
                the segment type structure !SEGM defined in DEFPARMS.PRO.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     idx      The start record number of the INDEX segment, if it exists,
                or -1 if it does not.
 ROUTINES CALLED:
 OUTPUTS:
     rec      The record number of the first record of the given segment
                type in the scan
 COMMENTS:
 CALLS: ***
	GETDATA, GET_SEGMENTS, GET_SEGTYP, TL_DECODE
 CALLED BY:
	ARLOCPLOT, CREATE_INDEX, DAILY, GET_SCANINFO, MOUNTCAL, NEWSCAN, SHOW_REGNS, SURVANAL
	TPCALCHEK2, WACAL, WANALYZE, WDUMPREC, WPOINT
 SIDE EFFECTS:
 RESTRICTIONS:
       When the desired segment is within a data scan, this code stops at
       the DATA segment, which is okay for now, but if desired segments
       are contained within or after the data begin, this code will not
       find them.
 MODIFICATION HISTORY:
     Written 01-Sep-1998 by Dale E. Gary
     14-Feb-1999  DG
       Added ephemeris segment type
     27-Jul-1999  DG
       Added TPCAL, AMPCAL, and PHZCAL segment types
     28-Nov-1999  DG
       Added optional use of INDEX segment information via keyword parameter
     27-Jul-2000  DG
       Use new SREC argument in GET_SEGMENTS call.
     25-Jan-2001  DG
       Changed to use the INDEX segment to find those segments in a
       data scan (previous code only used the INDEX segment to find
       segments in a HOUSEKEEPING scan).  This stops at the DATA
       segment, which is okay for now, but if desired segments are
       contained within or after the data begin, this code will not
       find them.


fit12phz $SSW/radio/ovsa/idl/fitting/fit12phz.pro
[Previous] [Next]
     16-Aug-2000  DG
       Renamed PLOTERR (IDL version) to OVSA_PLOTERR, and copied to
       OVSA tree, then changed PLOTERR calls to OVSA_PLOTERR, to avoid
       conflict with SSW's PLOTERR.
 CALLS:


Fitting $SSW/radio/ethz/idl/ragview/modify/fitting.pro
[Previous] [Next]
 NAME:
	Fitting
 PURPOSE:
	User Interface for accessing  a collection of algorithms
	for fitting curves to a data set.
 CALLING SEQUENCE
	Fitting, x, y [, length, nbSel, dim [, status, oper ]]
 INPUTS:
	x, y: the coordinates of the plots. If there are more than
		one plot to fit, the x and y array variables may
		be of dimension 2. In this case, "x(i,j)" or 
		"y(i,j)" is the i-th elements of the j-th plot.
	length: an array containing the relevant number of
		values in a line of "x" and "y".
	nbSel: the number of plots per (2D) array
 OUTPUTS:
	y: the fitted coordinates
	status : "Done" or "Not Done"
	oper: name of the operation done.

 CALLS: ***
	ADJUSTTABLE, GAUSSFIT [1], GAUSSFIT [2], GAUSSFIT [3], GAUSSFIT [4], GAUSSFIT [5]
	General_Menu [1], General_Menu [2], POLY, POLY_FIT, Read_Test, SPLINE, Selection
	error
 CALLED BY:
	Modification of 1D Plots
 MODIFICATION HISTORY:
	Created in January 1992 by A.Csillaghy
		Inst. of Astronomy, ETH Zurich
	Some modifs in March 95, ACs


FLAGARR $SSW/radio/ovsa/idl/support/flagarr.pro
[Previous] [Next]
 NAME:
     FLAGARR
 PURPOSE:
     Returns a "flag" array with 1's were the input array is finite, and
     0's where the input array is not finite, e.g. is NaN or Inf, etc.
     The flag array is useful where sums and averages are needed.
 CATEGORY:
     OVRO APC UTILITY
 CALLING SEQUENCE:
     flg = flagarr(in[,good=good,bad=bad][,/zeroset])
 INPUTS:
     in       The input array to be tested
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     zeroset  If this keyword is set, the non-finite values in the IN array are
                set to zero.
 ROUTINES CALLED:
 OUTPUTS:
     flg      The BYTE output "flag" array, of same dimensions as the IN array.
     good     The array of indexes where the IN array is finite.
     bad      The array of indexes where the IN array is not finite.
 COMMENTS:
 CALLED BY:
	HOCKEY
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 22-Jan-1999 by Dale E. Gary
     29-Jan-1999  DG
       Changed name of routine from FLAG to FLAGARR, to avoid conflicts with
       other routines where I used the variable FLAG.


FLAGGER $SSW/radio/ovsa/idl/util/flagger.pro
[Previous] [Next]
 NAME:
     FLAGGER
 PURPOSE:
     Routine to allow interactive flagging of data based on amplitude or
     phase, using the mouse.  Data selected for flagging are replaced with
     NaN.
 CATEGORY:
     OVRO APC DATA CALIBRATION
 CALLING SEQUENCE:
     out = flagger(frq,avg)
 INPUTS:
     frq      Array of frequencies contained in the data [GHz]
     avg      Data array of size (NCHAN,NFRQ,NMEAS), where NCHAN is the
                number of channels, NFRQ is the number of frequencies,
                and NMEAS is the number of measurements (times).
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     out      The output data array parallel to AVG, with flagged values set
                to NaN.
 COMMENTS:
     A plot is shown for each baseline/frequency.  Click on a point to
     flag it (the point is removed and the plot is redrawn).  Click at
     any level on the left side of the plot (outside the plot box) to
     flag all points above that level (amplitude).  Click outside the
     plot box on the right side of the plot to advance to the next frequency
     for the current baseline, or to the next baseline if at the last
     frequency.  The current baseline/frequency combination is shown in
     the title.
 CALLS: ***
	NINT [1], NINT [2]
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 25-Mar-2000 by Dale E. Gary


FLAGOOL $SSW/radio/ovsa/idl/util/flagool.pro
[Previous] [Next]
 NAME:
     FLAGOOL
 PURPOSE:
     Routine to flag one cycle of data for Out-Of-Lock (lack of phase lock),
     and for no-track.  Also flags the data where the observing sequence
     has entries that are expected to be invalid.
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     flagool,bigdata,header,obseq
 INPUTS:
     bigdata    an array of size (header.nws,obseq.nx) on input.  See below
                  for changes on output.  The array contains one observing
                  cycle of data.
     header     a header structure corresponding to the data in BIGDATA.
     obseq      the observing sequence structure corresponding to the data
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], get_logenv [1], get_logenv [2]
 CALLED BY:
	ACALCHEK, ANALYZE [1], APCALCHEK, CTRCALCHEK, DLASCAN, FLAREMETER, HIGHRES, PCALCHEK
	PNTCHEK, SATCALCHEK, SOLAID, SURVANAL, TOP20, TPANALYZE
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 06-Apr-1998 by Dale Gary
     13-Nov-1998  DG
       Add flagging for non-tracking antennas
     15-Dec-1998  DG
       Fix "bug" in code for antenna track flagging, since unused antennas
       have the flag set. (Actually, the flag should be unset for unused
       antennas, but this will have to be changed in FASAR.)
     16-Dec-1998  DG
       GH points out that unused antennas should be masked regardless of
       whether bits are set or unset, so regularize the code to do this.
     05-Jan-1999  DG
       Fixed header documentation for several errors.  No changes to code.
     16-Mar-1999  DG
       Added /NOTRACK switch.  Also, now sets correlated channels to NaN if
       one or both of the relevant antennas is saturated.
     14-Nov-1999  DG
       Made changes to allow the routine to work with any set of antennas (not
       limited to 5-element operation any more).
     27-Jul-2003  DG
       Made a change to work with CHANPHZCHEK, using an environment variable.
       This variable will be set within CHANPHZCHEK, and then unset on exit.


FLARE_SORT $SSW/radio/ovsa/idl/support/flare_sort.pro
[Previous] [Next]
 NAME:
     FLARE_SORT
 PURPOSE:
     Routine to read the flare database and return the sorted list
     removing any multiple entries.
 CATEGORY:
     OVRO APC DATA-ANALYSIS
 CALLING SEQUENCE:
     lines = flare_sort([database=database][,/write])
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     database   optional filename to read.  If omitted, the
                  standard database file, !defaults.dbdir+'flare.db'
                  is used.
     write      a switch that, if set, will write out the newly
                  ordered lines to the same file (overwriting the
                  existing file).
 ROUTINES CALLED:
 OUTPUTS:
     lines      the sorted, unique list of lines from the file
 COMMENTS:
     Note that multiple lines for the same flare may still exist,
     if any part of the line differs (e.g. magnitude, etc.)
 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3]
 SIDE EFFECTS:
     Overwrites the specified database file with the results if
     the WRITE keyword is set.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 03-Mar-2002 by Dale E. Gary


FLAREMETER $SSW/radio/ovsa/idl/widgets/flaremeter.pro
[Previous] [Next]
 NAME:
     FLAREMETER
 PURPOSE:
     Creates a lightcurve of OVSA solar data giving a sensitive
     measure of whether a flare is in progress.  Used as both a
     real-time flare monitor and a tool for quick look.
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     flaremeter,filename,hrec[,group=group][,on_flare=on_flare]
          [,off_flare=off_flare][,off_background=off_background]
          [,database=database][,/autodestroy]
 INPUTS:
     filename  the file and path of the data (.ARC) file to read from.
     hrec      the header record number of the scan to analyze.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     group             the group leader of the widget. If it is not
                         set, group=0 is assumed.
     on_flare          threshold value to go into flare mode.
                         Default is 1.2
     off_flare         threshold value to go out of flare mode.
                         Default is 1.0
     off_background    value above which the new data points are no
                         longer included in background history.
                         Default is 1.5
     database          name of the file used as database. If not
                         given, database=!defaults.dbdir+'flare.db'.
     autodestroy       set to force flaremeter to destroy the plot
                         window and exit on completion.
 ROUTINES CALLED:
     openarc, newscan, get_cycle, flagool, gaincor, freescan, utplot
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], EVENT__DEFINE, FLAGOOL
	FLAREMETER_EVENT, FREESCAN, FREESTATE, GAINCOR, GET_CYCLE, GET_SCREEN_SIZE, LASTHREC
	LOADCT, MOMENT, MSEC2STR, NEWSCAN, OPENARC, OUTPLOT [1], OUTPLOT [2], OUTPLOT [3]
	REVERSE, SOL2TXT, STR_SEP, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6], WRITE_DATABASE, XMANAGER, break_file [4]
 CALLED BY:
	SCAN4FLARE, WATCHER
 SIDE EFFECTS:
     Creates a plot, flare database entries, and creates file
     !defaults.workdir+'flarestat.txt' to interact with SCHEDULE.
     Also creates PNG and TXT files for web page if 'OVRO' enviroment is set.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 23-Feb-2002 by Gelu M. Nita
     24-Feb-2002  DG
       Cleaned up the code, fixed some bugs, and converted the
       output plot to a single plot with red line for data-quality.
     01-Mar-2002  GN
       Added interaction with database and Schedule
     01-Mar-2002  DG
       Cleaned up a couple of things like what to do with times if
       flare is in progress at start or at end of scan.  Added code
       to apply saved background only for current day, and in time
       order.  Also ignores SURVEY scans now.
     01-Mar-2002  GN
       Added keywords to allow user defined sensitivities,
       database filenames, and allow automatic program exit on
       completion.
     02-Mar-2002  DG
       Added writing out of SOLAR text file and PNG files for
       web page.
     03-Mar-2002  GN
       Added code to check if the number of active channels is changed over
       the same day, in order to assure background compatibility between scans.
     03-Mar-2002  DG
       Flipped output .PNG top to bottom due to peculiarity of IDL5.3.
       Line must be deleted when upgrade to version > 5.3.  Also added
       check for EOF return by get_cycle.
     10-Mar-2002  GN
       Changed the previous structure of STATE variable

       Added code to adjust automatically the on_flare and off_flare tresholds.
       If background history is larger than 20 points, the standard deviation from the smoothed
       background is computed and on_flare is set to 1+5*std, while off_flare is set to 1+1*std.
       Consequently the user defined tresholds are ignored.

       Added code to link togheter those events that start within 12 minutes from each other.
       The writing of a new record into the data base is now delayed 12 minutes from the start
       time, to be sure that there are no other events to be linked with it.

       Beside the text database, an IDL data base is also built. It contains all events stored
       in the EVENTS variable that is an aray of 'EVENT' structures describing each solar event.
       THE IDL database may be restored to be used by other IDL programs.
       The name of IDL database is implicitely set to 'IDL '+database.

       Two new columns were added to the database structure: start_q and end_q used as qualifiers that are
       set to 'B'(before), respectively 'A'(after), if the event started before the scan or is not
       finished when the scan ends.

       Write_database.pro was changed to accept only one input that is an {event} structure
     07-Nov-2003 DG
       New dual-polarization data confused FLAREMETER because it used only I for
       baselines involving the small antennas.  Now checks for I data, and if none,
       uses R and L.

     20-Jun-2004 GN
       Fixed bug that apparently made FLAREMETER fail in IDL 6.0 only. Now, if there is no good data in smalldata array,i.e.
       the warning level is a NaN, the warnig level is set to 0. The MAX(..) function calls where also replaced by MAX(\nan,..)
       to avoid scalling problems in the utplot.
     22-Jan-2005  DG
	    Change to reflect use of only R and L channels--eliminated use of I channel
       in calculating medians for small dishes.


FLUX_3C84 $SSW/radio/ovsa/idl/support/flux_3c84.pro
[Previous] [Next]
 NAME:
     FLUX_3C84
 PURPOSE:
     Reduce 3C84 and 3C286 observations from the 27 m antennas in order to
     determine the absolute flux spectrum of 3C84.
 CATEGORY:
     OVRO APC DATA CALIBRATION
 CALLING SEQUENCE:
     fit = flux_3c84([amf84][,amf286])
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     amf84    Filename of the .AMF file containing the 3C84 data (can have
                one or more sections, but if more than two, the first two
                are expected to be R and L, and are summed).  If omitted, the
                user is prompted for a file.
     amf286   Filename of the .AMF file containing the 3C286 data (same as
                above).
 ROUTINES CALLED:
 OUTPUTS:
     fit	   The list of flux densities, in Jy, corresponding to the
                frequencies in the .AMF files.
 COMMENTS:
     Note that this is based on an earlier routine of the same name,
     but rather hastily put together.  This routine is a bit better,
     but could stand improvement.

     After the initial plot, the user is expected to use the mouse to
     adjust the spline fit to fit the data points without strange
     oscillations.  The closest red diamond will move to the point
     where the mouse was clicked.  Click to right of box to exit.

     The VLA data points can be added, to appear as white open
     boxes on the plot.
 CALLS: ***
	ERRPLOT [1], ERRPLOT [2], SPLINE, readamf
 SIDE EFFECTS:
 RESTRICTIONS:
     The frequency list in the two .AMF files must match.
 MODIFICATION HISTORY:
     Written 08-Nov-2003 by Dale E. Gary


FLUX_NRH2 $SSW/radio/nrh/idl/2dnrh/flux/flux_nrh2.pro
[Previous] [Next]
 NAME:
	FLUX_NRH2

 PURPOSE:
	Procedure de calcul et de traitement du FLUX des images contenues 
 dans un fichier NRH2

 CATEGORY:
	WIDGET

 CALLING SEQUENCE:
 	FLUX_NRH2, GROUP=group

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 KEYWORD PARAMETERS:
	GROUP	Identification du widget appelant

 OUTPUTS:
	Describe any outputs here

 CALLS: ***
	CPT_FLUX_NRH2, CREATE_NRH_CFILE, CW_FIELD, CW_INFONRH, CW_PLOTSERIE, CW_SELFIELD
	CW_XTD_NRHF, FLUX_NRH2_EVENT, HEADFITS [1], HEADFITS [2], HEADFITS [3], IND_RS
	INIT_NRH_CFILE, MRDFITS [1], MRDFITS [2], MSH, NRH_FLUXASCI, NRH_FOPEN, NRH_PICKFILE
	OPEN_NRH_CFILE, READ_NRHIM, TR_TIME_NRH, WRITE_FLUXNRH, XMANAGER
 CALLED BY:
	NRH
 COMMON BLOCKS:
	FICRH	Contenant la structure STR_FIC (voir RH_2D)

	LIMIT	Contenant la structure STR_LIM (voir RH_@D)

	INFO2D	Contenant la structure STR_INF2D (voir RH_2D)

 PROCEDURE:
	Cette procedure calcule et trace le flux sur des images 2D contenues
 dans le fichier designe par STR_FIC.FILE.
	Elle permet de choisir une heure de debut et de fin ainsi qu'une
 region

 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin le 12/01/98 (bonmartin@obspm.fr)
		23/10/98 ajouter le controle et ouverture de fichier dans
			la selection de region ( JB)
		08/03/99 Corrige erreur dans OPLOT, suprime l'ouverture
			de fenetre a l'ouverture
		10/03/99 remis le calcul sur STOKESV (JB)
			return_event->all_events
		29/03/99 NRH_FOPEN enleve dans REGSEL
		20/04/99 Suprime le controle du type de fichiers
		26/10/00 Controle du Background et de la couleur (JB)
		19/01/01 Modification d'ouverture de fichiers (JB)


FNDWRD $SSW/radio/ovsa/idl/mapping/fndwrd.pro
[Previous] [Next]
 NAME:
       FNDWRD
 PURPOSE:
       Find number, locations, lengths of words in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       fndwrd, txt, nwds, loc, len
 INPUTS:
       txt = text string to examine.                    in
 KEYWORD PARAMETERS:
 OUTPUTS:
       nwds = number of words found in txt.             out
       loc = array of word start positions (0=first).   out
       len = array of word lengths.                     out
 COMMON BLOCKS:
 NOTES:
       Note: Words must be separated by spaces.
 MODIFICATION HISTORY:
       Ray. Sterner,  11 Dec, 1984.
       RES  Handle null strings better.   16 Feb, 1988.
       Johns Hopkins University Applied Physics Laboratory.
       RES 18 Sep, 1989 --- converted to SUN

 Copyright (C) 1984, 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.


FOLLOWPOS1D $SSW/radio/nrh/idl/1dnrh/positions/followpos1d.pro
[Previous] [Next]
 NAME:
	FOLLOWPOS1D

 PURPOSE:
  PROCEDURE DE DECOMPOSITION DES PROFILS RH UNIDIMENSIONNELS EN SOURCES 
  ELEMENTAIRES GAUSSIENNES (INTENSITE OU POLARISATION), 
  A PARTIR D'UN TABLEAU CONTENANT DES IMAGES EN FONCTION DU TEMPS PROVENANT
  DE LA FONCTION LEC1D (IMAGE 1D DU RH) (TABLEAUX DE 2D "INTENSITE/TEMPS" OU
  3D "INTENSITE+POLARISATION/TEMPS"). 	

 CATEGORY:
	NRH1 Positions

 CALLING SEQUENCE:
	FOLLOWPOS1D, Tabl, Unit, Gliss, Poids, Npos,
				Tabcoeff, Numd, Numf, Err

 INPUTS:
                     TABL..... Tableau issu de LEC1D contenant les images
                                  (2 dimensions) 
                           		tabl_X(num_Canal,Temps)
                                  		(3 Dim sinon )
                           		tabl_X(Num_Canal,Temps,type)
                                               type = 0 ---> Intensite
                                               type = 1 ---> Polarisation

                     UNIT .......  unite logique assignee au fichier

 KEYWORD PARAMETERS:

		      TEMPS .....  Temps du profil de reference [ms]


                     HEURES ...... Tableau une dimension, deux elements,
                                   format : chaine de caractere hh:mm:ss:ms
 
                                    si on est en mode animation
                     CANAUX ..... Tableau une dimension, deux elelments
				   contient les canaux de 
				   debut et de fin de visualisation 
		      DELTACAN ... Ecart tolere entre les canaux des sources
					de deux images successives
		      GLISS ...... Nombre de canaux sur lequel la moyenne
					glissante est calculee

		      POIDS ...... Multiple de sigma au-dessus duquel un signal
					est considere comme significatif

		      NPOS ........Nbre max d'iterations pour decomposer 1 image
                     POLAR........Trace d'un profil polarise

		      SIMPLE ..... Ajustement d'une Gaussienne
                     CONST, DROITE, PARABOLE ... Gaussienn + cst., droite 
				                  ou parabole

 OUTPUTS:
			TABCOEFF .... Tableau des coefficients ajustes
			NUMD, NUMF .. Nos. prem. et derniere images analysees
			ERR ........ Code d'erreur, =0 si pas d'erreur,
					-1 si pas de source trouvee dans
					l'intervalle initial

 CALLS: ***
	DECOMP1D, HMS, INDICE, LOADINTENS, LOADPOLAR
 CALLED BY:
	MENUTRACEISOPH
 COMMON BLOCKS:
	NRH1_GLOBAL

 PROCEDURE:
  METHODE: voir DECOMP1D.PRO.
  AJUSTEMENT D'UNE GAUSSIENNE (OU D'UNE SOMME D'UNE GAUSSIENNE ET D'UN
  POLYNOME D'ORDRE 0, 1 OU 2) A LA SOURCE AINSI IDENTIFIEE.

 MODIFICATION HISTORY:(bonmartin@obspm.fr)
	Ecrit par: Ludwig KLEIN
	20/11/98	adapte du logiciel XHELIO


FOPEN_GIF $SSW/radio/nrh/idl/2dnrh/fichier/fopen_gif.pro
[Previous] [Next]
 NAME:
	FOPEN_GIF

 PURPOSE:
	Lecture des donnees sous forme d'image GIF

 CATEGORY:
	Fichier

 CALLING SEQUENCE:
	 FOPEN_GIF,File, Str_inf2d


 INPUTS:
	File	chemin et nom du fichier a lire

 KEYWORD PARAMETERS:

 OUTPUTS:
	Str_inf2d	structure d'information de fichier (NRH_STR_INF2D)

 CALLED BY:
	NRH_FOPEN
 PROCEDURE:
	Cette procedure lit l'image contenue dans un fichier FITS GIF,
	l'affiche et demande de determiner le cercle optique, puis
	remplit la structure STR_INF2D
;			  Str_inf2d.Content est = 'GIF'

 CALLS: ***
	OPTIC_CIRC, READ_GIF
 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin (bonmartin@obspm.fr) le 09/09/98


FOPEN_NRH2 $SSW/radio/nrh/idl/2dnrh/fichier/fopen_nrh2.pro
[Previous] [Next]
 NAME:
	FOPEN_NRH2

 PURPOSE:
	Cette procedure ouvre un fichier FITS de type NRH2

 CATEGORY:
	Fichier

 CALLING SEQUENCE:
	FOPEN_NRH2, File, Str_inf, Physpar

 INPUTS:
	FILE Nom du fichier

 KEYWORD PARAMETERS:
	Non

 OUTPUTS:
	STR_INF	Structure d'information du fichier (NRH_STR_INFIC)
		Cette structure doit exister avant l'appel
	PHYSPAR	Tableau de chaine donnant les paramatres physiques
		existant dans le fichier ( STOKESI ou/et STOKESV)

 CALLS: ***
	FXBCOLNUM [1], FXBCOLNUM [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2]
	HEADFITS [3], NRH_FCLOSE, UPD_NRH2DFITS
 CALLED BY:
	NRH_FOPEN
 COMMON BLOCKS:
	Non

 PROCEDURE:
	Cette procedure remplit la structure STR_INF a partir du HEADER
	primaire ou du header d'extension, laisse le fichier ouvert.
	La fermeture du fichier est a la charge de l'utilisateur. Il doit
	etre ferme par FXBCLOSE

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par:J Bonmartin (obspm.fr) le 24/08/98


FOPEN_PNG $SSW/radio/nrh/idl/2dnrh/fichier/fopen_png.pro
[Previous] [Next]
 NAME:
	FOPEN_PNG

 PURPOSE:
	Lecture des donnees sous forme d'image PNG

 CATEGORY:
	Fichier

 CALLING SEQUENCE:
	 FOPEN_PNG,File, Str_inf2d


 INPUTS:
	File	chemin et nom du fichier a lire

 KEYWORD PARAMETERS:

 OUTPUTS:
	Str_inf2d	structure d'information de fichier (NRH_STR_INF2D)

 CALLED BY:
	NRH_FOPEN
 PROCEDURE:
	Cette procedure lit l'image contenue dans un fichier FITS PNG,
	l'affiche et demande de determiner le cercle optique, puis
	remplit la structure STR_INF2D
;			  Str_inf2d.Content est = 'PNG'

 CALLS: ***
	OPTIC_CIRC, READ_PNG
 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin (bonmartin@obspm.fr) le 09/09/98
       24/03/2005 A Bouteille :  Si l'image au format png est en 24
       bits avec 3 dimensions data(3,nx,ny), on suppose qu'on veut
       du noir et blanc donc on prend data(0,*,*) le rouge qui doit etre peu
       different de data(1,*,*)le vert et de (data(2,*,*) le bleu


FOPEN_STD_GMRT $SSW/radio/nrh/idl/2dnrh/fichier/fopen_std_gmrt.pro
[Previous] [Next]
 NAME:
	FOPEN_STD_GMRT

 PURPOSE:
	Cette procedure ouvre un fichier GMRT au standard FITS

 CATEGORY:
	Fichiers

 CALLING SEQUENCE:
	FOPEN_STD_GMRT, File, Str_fic

 INPUTS:
	FILE	Nom du fichier
	
 KEYWORD PARAMETERS:
	Rien

 OUTPUTS:
	STR_FIC	Structure de description du fichier (NRH_STR_INFIC). Cette
	structure doit etre declaree avant l'appel

 CALLS: ***
	FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2], HEADFITS [3], JULDAY
 CALLED BY:
	NRH_FOPEN
 COMMON BLOCKS:
	Rien

 PROCEDURE:
	Le STANDARD GMRT implique que 
		le fichier ne contient pas d'extensions
		il y a une seule image (NAXIS = 4) 
                - axe 3 frequence
                - axe 4 polar 
	Les mots cles traites sont: DATE-OBS, NAXIS1, NAXIS2, CDELT1
       l'image est supposee centree sur le centre du soleil
		

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par A Bouteille (obspm.fr) le: 05/12/02


FOPEN_STD_SOHO $SSW/radio/nrh/idl/2dnrh/fichier/fopen_std_soho.pro
[Previous] [Next]
 NAME:
	FOPEN_STD_SOHO

 PURPOSE:
	Cette procedure ouvre un fichier SOHO et de fichiers FITS au standard
	SOHO

 CATEGORY:
	Fichiers

 CALLING SEQUENCE:
	FOPEN_STD_SOHO, File, Str_fic

 INPUTS:
	FILE	Nom du fichier
	
 KEYWORD PARAMETERS:
	Rien

 OUTPUTS:
	STR_FIC	Structure de description du fichier (NRH_STR_INFIC). Cette
	structure doit etre declaree avant l'appel

 CALLS: ***
	FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2], HEADFITS [3], MRDFITS [1]
	MRDFITS [2], OPTIC_CIRC
 CALLED BY:
	NRH_FOPEN
 COMMON BLOCKS:
	Rien

 PROCEDURE:
	Le STANDARD SOHO implique que 
		le fichier ne contient pas d'extensions
		il y a une seule image (NAXIS = 2)
	Les mots cles traites sont: DATE-OBS, TIME-OBS, NAXIS1, NAXIS2
		EXPTIME, CRPIX1, CRPIX2, SOLAR_R
	Si ces mots cles ne sont pas presents les informations sont incorrectes
	sauf pour CRPIX1, CRPIX2, SOLAR_R. Si un de ces mots cles n'existe pas
	l'image est visualisee et il y a demande de determiner le soleil 
	optique
		

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin (obspm.fr) le: 24/08/98


FOPEN_YOHKOH $SSW/radio/nrh/idl/2dnrh/fichier/fopen_yohkoh.pro
[Previous] [Next]
 NAME:
	FOPEN_YOHKOH

 PURPOSE:
	Lecture des donnees YOHKOH au format FITS

 CATEGORY:
	Input, Output

 CALLING SEQUENCE:
	 FOPEN_YOHKOH,File, Str_inf2d


 INPUTS:
	File	chemin et nom du fichier a lire

 KEYWORD PARAMETERS:

 OUTPUTS:
	Str_inf2d	structure d'information de fichier (NRH_STR_INF2D)


 CALLED BY:
	NRH_FOPEN
 PROCEDURE:
	Cette procedure lit le contenu du Header d' un fichier FITS YOHKOH
 Les mots cles CRPIX1, CRPIX2, RADIUS doivent exister

 CALLS: ***
	FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2], HEADFITS [3], MRDFITS [1]
	MRDFITS [2], OPTIC_CIRC
 EXAMPLE:

 MODIFICATION HISTORY:
	Ecrit par: J Bonmartin (obspm.fr)le 24/11/9709/09/98


FORM_DATE $SSW/radio/nrh/idl/gen/form_date.pro
[Previous] [Next]
 NAME:
	FORM_DATE

 PURPOSE:
	This function pick the curent date en format it on the SOHO format

 CATEGORY:
       Time.

 CALLING SEQUENCE:
	DATE = FORM_DATE()

 INPUTS:
	No

 OUTPUTS:
	Describe any outputs here

 OPTIONAL OUTPUTS:
	DATE     String (YYYY-MM-DD)

 CALLS: ***
	BIN_DATE
 CALLED BY:
	COMP_DATE, CREATE_NRH_CFILE, CREATE_NRH_PFILE, INTGCOMP_NRH2, UPD_NRH2DFITS
 PROCEDURE:
	This function use SYSTIME to have the current date and convert it

 MODIFICATION HISTORY:
	Ecrit par:J Bonmartin le 06/08/98


Fortran_Read $SSW/radio/ethz/idl/io/fortran_read.pro
[Previous] [Next]
 NAME: 
	Fortran_Read
 PURPOSE:
	Read Fortran unformatted files, which contains a two-
	dimaensionnal array of data with an optional header. 
	The dimensions must be known and asked to the user.
 CATEGORY:
	Input/Output
 CALLING SEQUENCE:
	Fortran_Read, filename, image [, nx, ny ] [, header ]
 INPUT ARGUMENTS:
	filename: the complete filename.
	nx, ny: the dimensions of the data array. If not given,
		they will be asked interactively.
	header: if present, a header is assumed to be in the file.
 OUTPUT ARGUMENTS:
	image: The data array read.
	header: the file header.
 CALLS: ***
	CLEAR_SCREEN [1], CLEAR_SCREEN [2], PTO
 CALLED BY:
	Files_Handling [1], Files_Handling [2]
 SIDE EFFECTS:
	The terminal window is used to read the dimensions.


Fourrier $SSW/radio/ethz/idl/ragview/modify/fourier.pro
[Previous] [Next]
 NAME:
 	Fourrier
 PURPOSE:
	Performs fourrier transformation, forward or backward,
	and returns the result either in  a  real image
	and an imaginary image, or in a power-spectrum image
	(real) or in a magnitude image. With a keyword specified,
	the action will be done directly, else it will be
	asked interactively.
 CALLING SEQUENCE:
	result = Fourrier(image)
 INPUT ARGUMENT:
	image: a 2D array of any type, including complex type
		but string.
 OUTPUT ARGUMENT:
	image: a complex 2D array when normal forward fourrier-
		transformation is chosen real in the case
		of magnitude, backward and power spectrum.
 KEYWORDS:
	/POWER: power spectrum transformation is performed
	/BACKWARD: backward transformation is performed
	/FMAG: forward magnitude transformation performed
	/FORWARD: forward transformation is performed
	/BMAG: backward magnitude transformation is performed
 	/XY: two-dimensionnal transformation (default)
	/X: x-direction transformation
	/Y: y-direction transformation
	STATUS: "Done" or "Not Done"
 CALLS: ***
	FOURIER, General_Menu [1], General_Menu [2]
 PROCEDURE:
	The core of this function is the WAVE procedure FFT.
	Power spectrum:
		y' = Abs( FFT( image ) )^2. 
		a factor 1/N_Elements is applied.
 MODIFICATION HISTORY:
	Created by A.Csillaghy in September 1991
		Inst. of Astronomy, ETH Zurich
	Modified in Feb 93, A.Cs.


FREESCAN $SSW/radio/ovsa/idl/support/freescan.pro
[Previous] [Next]
 NAME:
     FREESCAN
 PURPOSE:
     Frees the memory (structures) allocated during a call to NEWSCAN.
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     freescan,obseq,traj,refcal,gparm[,geometry,pRecent,pOld,cycle])
 INPUTS:
     rec      The record number of the next data record, or -1 if an error.
     header
     cfg
     obseq
     gparm
     geometry
     pRecent
     pOld
     cycle
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     free_pointer
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	FREE_POINTER
 CALLED BY:
	ACALCHEK, ANALYZE [1], ARLOCPLOT, FLAREMETER, FST_MKPARM, Read_DriftData, SATCALCHEK
	TOP20, WFSURVEY
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 04-Dec-1999 by Dale E. Gary
     02-Jun-2006  DG
        Somehow forgot to put in code to free GEOMETRY structure.  Now added.


fst_gcal_attributes $SSW/radio/ovsa/idl/fst/fst_gcal_attributes.pro
[Previous] [Next]
 NAME:
     fst_gcal_attributes
 PURPOSE:
     To create the FST system attributes for a gain calibration (GCAL)
 CATEGORY:
     OVRO FST INSTRUMENT SETUP
 CALLING SEQUENCE:
     att=fst_gcal_attributes()
 INPUTS:
     None
 ROUTINES CALLED:
 OUTPUTS:
  return value: attributes structure for use in call to fst_dswrite()
 COMMENTS:
 CALLED BY:
	SCHEDULE
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 11 Jun 2006 by Dale E. Gary


FST_MKPARM $SSW/radio/ovsa/idl/fst/fst_mkparm.pro
[Previous] [Next]
 NAME:
     FST_MKPARM
 PURPOSE:
     Creates file for use by the FASR Subsystem Testbed that will contain various
     parameters needed for the header of FST files.  This is called by Watcher on
     receipt of a header, in order to help synchronize FST's information with the
     schedule.
 CATEGORY:
     OVRO APC REALTIME
 CALLING SEQUENCE:
     fst_mkparm,filename,hrec
 INPUTS:
     filename	The name of the input file to read from (usually DAILY.ARC)
     hrec		The record number of the header from which to obtain relevant FST
       		  parameters.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:

 OUTPUTS:
 COMMENTS:
 CALLS: ***
	FREESCAN, FST_DSWRITE, FST_IDL2LV, NEWSCAN, OPENARC
 CALLED BY:
	WATCHER
 SIDE EFFECTS:
     If the scan type is one of SOLAR, SATOBS, or PCAL, the file GEOMETRY.SAV is
     written to the working directory. Any existing file of that name is overwritten.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 08-Jan-2006 by Dale E. Gary
     10-Jan-2006  DG
       First tentative working version, simply writes out GEOMETRY structure
     04-Mar-2006  DG
       Now converts to LabVIEW format, for directly ingesting to LabVIEW.
     29-Jun-2006  DG
       Forgot to free the logical unit and close the DAILY.ARC file.


fst_solar_attributes $SSW/radio/ovsa/idl/fst/fst_solar_attributes.pro
[Previous] [Next]
 NAME:
     fst_solar_attributes
 PURPOSE:
     To create the FST system attributes for standard solar observations.  Different
     modes can be implemented in sections, and all but the desired section can be
     commented out.
 CATEGORY:
     OVRO FST INSTRUMENT SETUP
 CALLING SEQUENCE:
     att=fst_solar_attributes()
 INPUTS:
     None
 ROUTINES CALLED:
 OUTPUTS:
    return value: attributes structure for use in call to fst_dswrite()
 COMMENTS:
    Comment out all but one section, below, to change solar mode
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 31 Jul 2006 by Dale E. Gary
     13-Nov-2006  DG
       Added new solar mode, cycling among 1-5 GHz


FTAB2TC $SSW/radio/ovsa/idl/support/ftab2tc.pro
[Previous] [Next]
 NAME:
     FTAB2TC
 PURPOSE:
     Routine to take tuning current coefficients (from FCPARM.FTH)
     and return a list of frequencies and associated tuning currents for
     a given antenna and oscillator.
 CATEGORY:
     OVRO APC FCAL UTILITY
 CALLING SEQUENCE:
     ftab2tc,iant,iosc,tctab,f,tc
 INPUTS:
     iant     The antenna number of the antenna for which the output should
                be generated.  This is the ordinal (index) number 0-4.
     iosc     The oscillator number for which the output should be
                generated.  IOSC = 0,1,2 for Lo, Mid, Hi oscillator.
     tc_coef  The tuning current coefficients for the degree 4 polynomial fit.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     f        The frequency array corresponding to all harmonics in the
                range of the specified oscillator.
     tc       The tuning currents associated with the frequency list F.
 COMMENTS:
 CALLED BY:
	FCALCHEK, LOKMAP, SHOW_OSC, WFSURVEY
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 14-Mar-1999 by Dale E. Gary
     14-Jan-2001  DG
       Completely rewritten (simplified) for new FCAL scheme.


ftp_file $SSW/radio/ovsa/idl/web/ftp_file.pro
[Previous] [Next]
 Project     : OVSA

 Name        : ftp_file

 Purpose     : IDL ftp wrapper

 Category    : 

 Syntax      : ftp_file,site,directory(s),filename(s),username,password

 Inputs      : site = string containing the ftp site to connect to
               directory = string or string array contining the dir(s)
               filename = string or string array of filename(s)

 CALLED BY:
	get_ovsa_log
 Example     : ftp_file, 'sohoftp.nascom.nasa.gov', $
                         '/pub/data/summary/eit/1998/10', $
			  'seit_00304_fd_19981019_2059.fts', $
			  'anonymous', $
			  'ptg@bbso.njit.edu'

               or

               dirs  = ['/pub/data/summary/eit/1998/10', $
                        '/pub/data/summary/eit/2000/04']
               files = ['seit_00304_fd_19981019_2059.fts', $
                        'seit_00304_fd_20000428_1319.fts']
               ftp_file, 'sohoftp.nascom.nasa.gov', $
                         dirs, files,'anonymous','ptg@bbso.njit.edu'	

               or 

               dir   = '/pub/data/summary/eit/1998/10'
               files = ['seit_00304_fd_19981019_2059.fts', $
                        'seit_00304_fd_19981030_1919.fts']
               ftp_file, 'sohoftp.nascom.nasa.gov', $
                         dir, files,'anonymous', $
                        'ptg@bbso.njit.edu'	
		  

 Keywords    :

 Restrictions: CAN ONLY BE RUN IN UNIX 

 History     : Written 19 October 2000, P. Gallagher (BBSO)

 Contact     : ptg@bbso.njit.edu


FUSIONPOS1D $SSW/radio/nrh/idl/1dnrh/positions/fusionpos1d.pro
[Previous] [Next]
 NAME:
	FUSIONPOS1D
 PURPOSE:
	fusionne des positions nouvelles avec un fichier positions existant
	et reecrit le fichier resultat
 CALLING SEQUENCE:
	FUSIONPOS1D,xmin0,xmax0,idtms0,hdeb0,hfin0,date0, $
	valfreq0,valres0,valsto0, $
	nomfi,nposad,nbmaxad,itetadm,trpadm

 INPUTS:
    xmin0,xmax0	: min et max des amplitudes    		FLOAT
    idtms0	: delta t entre 2 images en ms          	LONG
    hdeb0,hfin0	: heure debut et fin en ms              LONG
    idate0	: date jr,m,an					INTARR(3)
    valfreq0	: issus du descripteur frequence 164.0 MHZ	STRING
    valres0	: EST-OUEST ou NORD-SUD				STRING
    nbrec0	: nb de records par position			INT
    chrec_cle0 : tableau de chaines decrivant le type de chacun des record
                 d'une position                        strarr(12,nbrec)
    nomfi0	: nom du fichier de position a reeecrire	STRING
    nposad	: nb de positions				INT
    nbmaxad	: nb de points de la position la plus longue	LONG
    itetadm(3,npos)	: entete de chaque enrgt		LONG(3)
			   1- num de la position
			   2- heure de debut de la position
			   3- nb points de la position 
    trpadm(5,nbmaxpt,npos): tableau des positions		FLOAT(5,*,*)
			  1- numero des images
			  2- canal
			  3- amplitude
			  4- flux
			  5- diametre
    (pour les positions comportant moins de nbmaxpt points, les 5 tableaux
     sont completes par des zeros) 
 OUTPUTS:
	
 CALLED BY:
	MENUCALCFLUX1D, MENUTRACEISOPH
 COMMON BLOCKS:
	NRH1_GLOBAL

 MODIFICATION HISTORY: (bonmartin@obspm.fr)
   adapte du logiciel XHELIO (20/11/98)
   ecrit par A.Bouteille (Juin 96)
   modif arguments : dec 1996
                  type de chaque record
                  et appel a ecrpos  (1D et 2D) 
 CALLS: ***
	ECRPOS, I2CDATE, LITENTETE, MOTCLE


fwdfit [1] $SSW/radio/ovsa/idl/mapping/fast_fwdfit.pro
[Previous] [Next]
 NAME:
     	fwdfit
 INPUTS:
 	 map(a CLEANed map), cln,uv_ij,vis_ij
 OUTPUTS:
 	map, misc
 CALLS: ***
	AMOEBA, BOX_CURSOR, CONGRID [1], CONGRID [2], CONGRID [3], FAST_FWDFIT, LOADCT
	PLOT_3MAPS, PLOT_VIS2VIS_SIMPL, RND_ELLIPSE, fft_xy2uv
 CALLED BY:
	imagr [1]
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL
 Comments to myself:
     Conversion of (TB to Flux) and (u to iu) should
     have been taken care of in the main pgm: fwdfit
     i.e. parm[0] here should be in flux units of obs.
        and u & v corresponds to u/du, v/dv in fact.


fwdfit [2] $SSW/radio/ovsa/idl/mapping/fwdfit.pro
[Previous] [Next]
 NAME:
     	fwdfit
 INPUTS:
 	 map(a CLEANed map), cln,uv_ij,vis_ij
 OUTPUTS:
 	map, misc
 CALLS: ***
	AMOEBA, BOX_CURSOR, CONGRID [1], CONGRID [2], CONGRID [3], CVD_ELLIPSE, LOADCT
	PLOT_3MAPS, PLOT_VIS2VIS_SIMPL, fft_xy2uv
 CALLED BY:
	imagr [1]
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL
 Comments to myself:
     Conversion of (TB to Flux) and (u to iu) should
     have been taken care of in the main pgm: fwdfit
     i.e. parm[0] here should be in flux units of obs.
        and u & v corresponds to u/du, v/dv in fact.


fwdfit_chi2 $SSW/radio/ovsa/idl/mapping/fwdfit_chi2.pro
[Previous] [Next]
 Modification History
    15-Dec-2002  DG
      Changed direction of FFT from +1 to -1, which is the
      correct direction for getting visibility from map
 CALLS: