PANDB $SSW/radio/ovsa/idl/solar/pandb.pro
[Previous] [Next]
 NAME:
     PANDB
 PURPOSE:
     Given the date and time as a decimal Modified Julian Date, return
     the solar P angle, B angle, and solar radius.
 CATEGORY:
 CALLING SEQUENCE:
     pandb,mjd,p,b,r
 INPUTS:
     mjd        modified Julian Date including hour as fractional date.
                   For example, the Julian Date for 0 UT on 1 July 1996 is
                   2450265.5, and the corresponding MJD is 50265.5.  At
                   0800 UT on the same date the MJD is 50265.83333.
                   A convenient way to get MJD is to call DATE2MJD
                   and add 0.5 for the non-integer part at 0 UT.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     p          Position angle (degrees) of the northern extremity of
                   the solar axis of rotation, measured eastward from the
                   north point of the disk.
     b          B angle (degrees) positive for solar north pole pointing
                   toward the Earth.
     r          Apparent solar disk radius (arcsec)

 COMMENTS:
     Calculates solar parameters based on formulas in the Astronomical
     Almanac, pages C1 and C24 of the 1996 edition.  Formulas to
     convert solar equatorial plane coordinates to ecliptic coordinates
     were taken from the PANDB Fortran code written by Margaret Liggett,
     which in turn I think were taken from Newcomb (1895), Tables of
     the Sun, Astr. Pap. Amer. Eph., Vol VI.  Spot checks against the
     Astronomical Almanac indicate a typical error in radius of 0.1"
     and errors in the angles of less than about 0.01 degree
 CALLED BY:
	ARLOCPLOT, GET_SOLEPH, RSTN2ANT, SCHEDULE, SHOW_REGNS, SOL2TXT, WREGION, get_ovsa_log
 SIDE EFFECTS:
 RESTRICTIONS:
     Values should be accurate for dates from 1950-2050.
 MODIFICATION HISTORY:
     Written 12 Dec 1996 by Dale E. Gary


pcal $SSW/radio/ovsa/idl/misc/pcal.pro
[Previous] [Next]
 NAME:
     pcal
 PURPOSE:
     Phase calibration data fitting as a linear function of frequency.
 CATEGORY:
     scbong OVRO
 CALLING SEQUENCE:
     pcal, files, savefile[, pfold = pfold][, /pclose]
 INPUTS:
     files     String vector of file names to be read. If not set, the user is prompted for files.
     savefile  File name to be saved. If not set, "pcal.sav" is used.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     antset    Antenna numbers of sets to be shown.
               This is [3, nset] dimensional array where nset is the number of sets.
               A set consists of three antennas which should satisfy the phase closure condition.
               The default value is [[1, 2, 4], [1, 2, 5], [1, 2, 6]].
     chisq     If pclose keyword is set, chi square value is returned.
     nowin     Set this keyword if plotting is not wanted.
     pclose    If set, fit will satisfy the phase closure condition so that,
               for any three antennas a, b, c in increasing antenna number order,
               ab - ac + bc = 0 where ab is the phase of baseline a-b and so on.
               If pfold keyword is not given properly, fitting line is found in the whole range.
               If pfold keyword is given with the right dimension, the fitting line
               is found in the vicinity of given points.
     pfold     Phase fold factors. This should have [nbl, nfrq, nfl] dimension,
               where nbl = nant * (nant - 1) / 2 and nant is the number of antennas,
               nfrq is the number of frequencies observed and nfl is the number of files to be read.
               The fit will be done with the phases to which pfold times 360 degrees is added.
               The default value is 0 for all the elements.
               If this has a wrong dimension and pclose is not set, default value is returned to this.
               If pclose is set, the values found in phase closure is returned to this.
     zero      If set, fit will be done with zero offset which is what it should be.
 ROUTINES CALLED:
     plot_pcal
 OUTPUTS:

 COMMENTS:
     plot_pcal will show the same number of windows as that of files used in pcal.
     A window has 0 marked points which are the points of 0 phase fold.
     In the last row plots, three dashed lines are fitted lines of
     each labeled baseline index and the solid line is the sum of them.
     dashed lines and the data points are flipped if the sign next to the label is '-',
     so that the sum of them becomes 0 according to the phase closure condition.
 CALLS: ***
	AMOEBA, FREE_POINTER, MOMENT, PCAL_LINFUNC, PCAL_PCFUNC, PROGMETER, SVDFIT, plot_pcal
 SIDE EFFECTS:
     Common block named pcal_pcfunc_data is set.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 22-Jan-2000 by Su-Chan Bong


PCALCHEK $SSW/radio/ovsa/idl/analysis/pcalchek.pro
[Previous] [Next]
 NAME:
     PCALCHEK
 PURPOSE:
     Main routine to analyze phase calibration data.  Responds to scans of type
     PCAL (scan code 5).
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     pcalchek[,filename][,hrec,erec | ,after=after][,debug][,/cmdfile]
 INPUTS:
     filename   the name of the file containing SOLAR data.  If
                  omitted, the file DAILY.ARC in directory
                  !DEFAULTS.WORKDIR is assumed.
     hrec       the record number of the PCAL 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:
     erec       the end record number.  This is only needed as a
                  convenience for the PROGRESS Meter, and may be omitted.
     after      an optional time string of the standard form
                  [yyyy.ddd ]hh:mm[:ss]m after which to start
                  looking for a valid PCAL 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>\PCAL.MSG.
     debug      a switch that activates some debugging statements
                  for getting an indication of intermediate steps.
                  This switch is not compatible with /CMDFILE switch.
 ROUTINES CALLED:
     openarc, getdata, lasthrec, tl_decode, decode, get_centim, pldinit,
     gaincor, pldout
 OUTPUTS:
 COMMENTS:
     There will have to be modifications to this routine when
     additional antennas are available.
 CALLS: ***
	DECODE, FLAGOOL, GAINCOR, GETDATA, GETPARMS, LASTHREC, OPENARC, POLY_FIT, PROGMETER
	TL_DECODE, WSTR
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 26-Jul-1998 by Dale Gary
     22-Aug-1998  DG
       Changed wait time (for real-time data) to 1 s to make the program
       more responsive.
     23-Aug-1998  DG
       Fixed bug in polarization code determination.
     25-Aug-1998  DG
       Added check for new TRAJECTORY segments (but contents ignored
       for now.)
     05-Feb-2000  DG
       Removed now unnecessary sin and cos lookup tables in GAINCOR call.


PCLOSE $SSW/radio/ovsa/idl/support/pclose.pro
[Previous] [Next]
 NAME:
     PCLOSE
 PURPOSE:
     Force phase closure in general case.
 CATEGORY:
     OVRO APC CALIBRATION
 CALLING SEQUENCE:
     pout = pclose(pin,wts[,cor=cor][,/nolobe])
 INPUTS:
     pin   A float array of phases of size (nb) where NB=7 is the number of
             baselines for which the phase closure is to be calculated.
     wts   A float array of weight factors (basically 1/sn where sn = signal
             to noise ratio), that indicates how accurately the phases were
             determined.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     cor   A keyword to be set to a named variable, which will on output
             contain the nb-element phase correction array.
     nolobe  A switch that, if set, causes lobe adjustment (forcing
               closure result between -180 and 180) to be skipped.  This is
               necessary when phase closure for phase slope is desired,
               since a closure to 360 degrees is very different from a
               closure to 0 degrees for phase slope!
 ROUTINES CALLED:
 OUTPUTS:
     pout  An array of the same size as pin, but with phases corrected
             for phase closure.
 COMMENTS:
     The algorithm for phase closure is a bit complex.  The task is to
     adjust the phases within the errors to take advantage of the fact
     that we know the phases on each triad of baselines must close.  Since
     the large-large baseline is much more sensitive that the large-small,
     and the small-small baselines are not used, the algorithm needs to
     first adjust the large-large (one baseline of each triad) to be
     mutually consistent, then adjust each of the large-small according
     to their errors.

     Define:
        closure phase:
           c_1  =  p_14 - p_24 - p_12 - 225   (124 triad)
           c_2  =  p_15 - p_25 - p_12 - 225   (125 triad)
           c_3  =  p_16 - p_26 - p_12 - 225   (126 triad)
        weights:
           w_12 =  1/sn_12 (inverse of S/N in amplitude, baseline 12)
           w_2j =  1/sn_2j (BC baseline for triad j)
           w_3j =  1/sn_3j (CA baseline for triad j)
        fractions:
           f_1j =  w_12 / (w_12 + w_2j + w_3j)  (triad j = 1, 3)

     Then we can calculate three phase corrections for baseline 12:
           C12_j = f_1j*c_j                   (triad j = 1, 3)
     but we only want one, so take the average
           C12 = Sum(C12_j) / 3               (triad j = 1, 3)
     and correct the closure phase accordingly
           c_j' = c_j + C12                   (triad j = 1, 3)

     Now determine fractions:
           f_2j = w_2j / (w_2j + w_3j)
           f_3j = w_3j / (w_2j + w_3j)
     and determine final phase corrections
           C14 = f_21*c_1'
           C15 = f_22*c_2'
           C16 = f_23*c_3'
           C24 = f_31*c_1'
           C25 = f_32*c_2'
           C26 = f_33*c_3'

     Finally, adjust all of the input phases according to these
     corrections, applying the appropriate signs
           p12' = p12-C12
           p1j' = p1j-C1j
           p2j' = p2j+C2j

 CALLS: ***
	LOBE
 CALLED BY:
	ADJ_PCLOSE, BASLIN_PCLOSE, CAL_PCLOSE, CLOSE_ANT, DAILY, WAMPHIT, WPHZFIT
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 01-Jul-1999 by Dale E. Gary
     08-Jul-1999  DG
       Attempt to deal with missing data (indicated by NaN) by artificially
       setting the weight to a large value.
     06-Apr-2000  DG
       Treat case of phase being non-NaN, but weight being NaN.
     09-May-2000  DG
       Added NOLOBE keyword, so skip lobe adjustment (used when the closure
       is sought for phase slope).
     16-Jun-2000  DG
       Made the code general for 5, 6, or 7 antennas.  May work with 4, but
       probably not for 3 antennas.
     27-Sep-2000  DG
       Changed routine to reflect new, simplified definition of BC baselines.
       The sign of the BCsin component is reversed in GAINCOR, which allows
       us to not worry about special treatment of BC baselines here.


phoenix_despike $SSW/radio/ethz/idl/util/phoenix_despike.pro
[Previous] [Next]
NAME:    phoenix_despike.pro    

PURPOSE: despike an image using a median filter (default) that eliminates
         spikes exceeding `threshold' percent (detault = 15%), or using a
         statistical correction that corrects pixels diviating by more than
         `statistics' sigma from the expected noise given the photon
         statistics and electron-to-DN amplifiction.
SUBROUTINES: none

CALLING SEQUENCE: image=tracedespike(image)

OUTPUT: returns despiked image array

 CALLED BY:
	edit [1], edit [2], phoenix_spg_autoimprove, rapp_get_spectrogram
EXAMPLE: 
  imout=tracedespike(readfits('file'))        simple correction
  imout=tracedespike(despike(image))          double correct. for faint fields
  imout=tracedespike(image,statistics=6)      correct > 6sigma outliers
  imout=tracedespike(image,minimum=100,ri=3)  low-quartile corr. above I=100
  imout=tracedespike(image,nspikes=nspikes,imap=imap) to return the number of
                                              spikes removed and a pixel map
OPTIONAL KEYWORD INPUT:
  nspikes	       number of spikes removed
  imap                map of corrected pixels
  ri                  replacement index: ri=7 or 8 for median filter
  threshold           fractional threshold for brightness
  minimum             do not correct pixels dimmer than minimum
  statistics          use statistical correction beyond stat.. sigma
  ampl                amplification of CCD signal
HISTORY:
 Karel Schrijver, 20 May 1998.
 Revised: CJS     27 May 1998: changed loop counter to long word
 Revised: CJS     09 Mar 1999: changed to return repair mask
          SLF     09 Mar 1999: added LOUD keyword (no function but interface
                               compatible with earlier version)

 CPU time scales roughly linearly with the size of the array

 Note that there are two mutually exlusive keyword sets:
  for criterion of relative intensity: threshold, minimum
  for statistical correction:          statistics, ampl

 Pascal Saint-Hilaire (shilaire@astro.phys.ethz.ch), 2003/10/23: 
	renamed phoenix_despike.pro, and put in radio/ethz part of SSW.


phoenix_filedb_get $SSW/radio/ethz/idl/util/phoenix_filedb_get.pro
[Previous] [Next]
NAME:
 phoenix_filedb_get

PROJECT:
  PHOENIX-2, ETHZ

CATEGORY:
 Phoenix-2 filedb access

PURPOSE:
 This routine , when given a time interval, will look into the proper Phoenix filedb fits files, and retrieve the information stored there.
 The default is to return the whole db structure, unless some keywords are set (see below).

CALLING SEQUENCE:
	dblist=phoenix_filedb_get(time_intv, POL=POL, QUIET=QUIET, START_TIME=START_TIME, ...)

INPUT:
 	time_intv: a 1-element or 2-element anytim-compatible time.

OUTPUT:
 	A structure with start_time, end_time, filename and type (I, L1, L2, or P) of each Phoenix fits file
	If some keywords are set, only those elements are returned.

KEYWORDS:
	/START_TIME: if set, routine will return start_time of each file, instead of default output.
	/END_TIME: if set, routine will return end_time of each file, instead of default output.
	/FILENAME: if set, routine will return filename of each file, instead of default output.
	/TYPE: if set, routine will return stype of each file, instead of default output.

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], MRDFITS [1], MRDFITS [2], UNIQ [1]
	UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	int2str
 CALLED BY:
	phoenix_spg_get
HISTORY:
 	2003/10/07: Pascal Saint-Hilaire, shilaire@astro.phys.ethz.ch
	


phoenix_spg_autoimprove $SSW/radio/ethz/idl/util/phoenix_spg_improve_basic.pro
[Previous] [Next]
NAME:
 	phoenix_spg_autoimprove.pro
PROJECT:
 	ETHZ Radio Astronomy
CATEGORY:
 	Utility
PURPOSE:
	Most of this data processing was designed for I/L1/L2, not polarization data...

CALLING SEQUENCE:

INPUT:


OPTIONAL INPUT:
	

KEYWORD INPUT:
	/STD:
	/ELIM: if set, will automatically remove bad channels
	/DESPIKE : if set, will use phoenix_despike.pro on the spectrogram. CAUTION: radio 'spikes' would surely be removed...
	BACK: if set, will automatically remove background 
			if set to 1 (/BACK): will take the least 3% of the data as background
			if set to a single number (ex: 0.05): is the least fraction of the data to be considered as background (/BACK or BACK=0.03 does the same)
			if set to a 2-element array, assumes those are ANYTIM time intervals to be taken as background
	/LOG: it is conceptually better to work on linear SFU data for most of the data processing, THEN `log' it via this keyword.
	/RECALIBRATE: will use phoenix_spg_recalibrate.pro on the data...

OUTPUT:

KEYWORD OUTPUT:
	avgback: array of averaged background values for each frequencies. Useful only if the BACK keyword has also been used!

 CALLS: ***
	AVG [1], AVG [2], ELIMWRONGCHANNELS, EXIST, HAVE_TAG, PHOENIX_ELIMWRONG
	PHOENIX_SPG_IMPROVE_BASIC, constbacksub [1], constbacksub [2], phoenix_despike
	phoenix_spg_get, phoenix_spg_recalibrate
RESTRICTIONS:

EXAMPLES:
	time_intv='2003/09/03 '+['10:16','10:20']
	spg_o=phoenix_spg_get(time_intv,/DECOMPRESS)
	new_spg_o=phoenix_spg_improve_basic(spg_o,/ELIM,/BACK,/DESPIKE,/LOG)
	LOADCT,5
	spectro_plot,new_spg_o.spg,new_spg_o.time,new_spg_o.freq

HISTORY:
+
NAME:
	phoenix_spg_improve_basic.pro

PROJECT:
	PHOENIX-2, ETHZ

CATEGORY:
	Spectrogram data processing

PURPOSE:
	Radio spectrogram basic improvement routine. 
	Not really suited for polarization data.

CALLING SEQUENCE:
	new_spg_struct=phoenix_spg_improve_basic(spg_struct, ELIM=ELIM, BACK=BACK, DESPIKE=DESPIKE, LOG=LOG, avgbackgnd=backavg)

INPUT:
 	spg_struct: spectrogram structure (as ouput by phoenix_spg_get.pro)
		Should be in linear scale (although this routine's basic data processing seem to work well enough on LOG data...).

OUTPUT:
	The processed spectrogram structure.

KEYWORDS:
	/STD: will do all the standard processing: /ELIM, /BACK, /DESPIKE, and /RECALIBRATE
	/ELIM: automatically eliminates bad channels (i.e. frequencies)

	BACK: background subtraction.
		If single float (ex: 0.05): takes this fraction of the whole spectrogram as background. The least values of each channel are taken.
		If set to 1: same as using 0.03
		If a 2-d array: assumes this is an anytim-compatible time interval which will be used as background time.

	/DESPIKE: uses phoenix_despike.pro routine (originally same as tracedespike.pro).

	/LOG: will LOG the output in a manner consistant with the way Phoenix data is usually compressed.
	/RECALIBRATE

 OUTPUT KEYWORDS:
	avgbackgnd: an array (with same dimension as the number of channels/frequencies) containing the background values.
			Only use if the BACK keyword was also used!

 EXAMPLE:
	spg=phoenix_spg_get('2003/01/01 '+['10:05','10:20'],/DECOMPRESS)
	spg1=phoenix_spg_improve_basic(spg_stc, /ELIM, /BACK, /DESPIKE, /LOG,/RECALIBRATE)
	LOADCT,5
	spectro_plot,spg1


HISTORY:
 	2003/10/08: Pascal Saint-Hilaire, shilaire@astro.phys.ethz.ch
	


phoenix_spg_get $SSW/radio/ethz/idl/util/phoenix_spg_get.pro
[Previous] [Next]
NAME:
 	phoenix_spg_get.pro

PROJECT:
 	ETHZ Radio Astronomy
CATEGORY:
 	Utility
PURPOSE:
 This routine, given a time interval (anytim format) returns the associated Phoenix data array, 
 or a string if a problem occured (such as no data available). 
 The routine may also do basic data processing to improve data visualization, as well as 
 downloading the necessary Phoenix fits files (starting in June 1998) and installing them in 
 a local archive.

CALLING SEQUENCE:
	spg_struct=phoenix_get_spg(time_interval, spg, time_axis, freq_axis, POL=POL, DECOMPRESS=DECOMPRESS, ...)

INPUT:
 	time_interval : a 2-element array,in a format accepted by ANYTIM

KEYWORD INPUT:
	data_dir: Directory, or root directory path to Phoenix fits files. If not set, will look for ENV variable 'PHOENIX_DATA_ARCHIVE' to replace it. If 'PHOENIX_DATA_ARCHIVE' also does not exist, will use current work directory.

	/SINGLE: If not set, will assume that data_dir is a standard archive root pathname, with yyyy/mm/dd sub-directories. 
		If set, simply looks into data_dir for the proper files.

	/ALLOW_DOWNLOAD: if set, and the proper files were not found under data_dir, then the fits file(s) is(are) downloaded from ETHZ.
		Unless /SINGLE_DIR was also set, will try to put the downloaded files in a standard archive organization under data_dir, with yyyy/mm/dd sub-directories.
	
	/POL: to get polarization data instead of I/L1/L2 data.

	/DECOMPRESS: to obtain data in linear SFU scale (if not already in that format). This keyword has no influence for polarization data.
	If this keyword is set and the encoding format is not recognized, the routine returns a string array (fail).
	This keyword is set automatically if keyword /PROCESS is used.

	/PROCESS: will run the spectrogram into the routine phoenix_spg_improve_basic.pro, which does basic data processing to improve
		the spectrogram: automatic background subtraction, automatic removal of bad channels, and despiking. 
		The output spectrogram is also LOGed.

	+KEYWORDS from routine phoenix_spg_improve_basic.pro....


OUTPUT:
	spg_struct: 
	 	spg: a Phoenix-2 spectrogram image, in (encoded)  SFU (for intensities, L1, and L2) or % circular polarization (negative = left)
		time_axis: anytim time array
		freq_axis: frequency array
		type: L1, L2, I(ntensity) or P(olarization) (as given by first file in time interval...)

KEYWORD OUTPUT:
	None

 CALLS: ***
	Congrid1d, DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FILE2TIME
	FILE_EXIST [2], PHOENIX_MERGE, PHOENIX_SPG_IMPROVE_BASIC
	RADIO_SPECTRO_FITS_READ, SOCK_COPY, TEST_DIR, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], file_exist [1], file_exist [3], int2str
	phoenix_filedb_get
 CALLED BY:
	phoenix_spg_autoimprove
RESTRICTIONS:
	None ?

EXAMPLES:
	1) Standard way, with a local archive, and env variable 'PHOENIX_DATA_ARCHIVE' properly set:
	spg=phoenix_spg_get('2003/09/03 '+['11:29:00','11:55:00'],/PROCESS)
	spectro_plot,spg

	2) For casual users (outside ETH) wishing to have all Phoenix fits files in same directory:
	spg=phoenix_spg_get('2003/09/03 '+['11:29:00','11:55:00'],/SINGLE_DIR,/ALLOW_DOWNLOAD)

	;3) Self-building archive, for users outside ETH:
	spg=phoenix_spg_get('2003/09/03 '+['11:29:00','11:55:00'], data_dir='/my/phoenix/data/archive/rootpath',/ALLOW_DOWNLOAD)
	;(keyword data_dir need not be used, if an env variable 'PHOENIX_DATA_ARCHIVE' was already properly defined.)

HISTORY:
	Pascal Saint-Hilaire, 2003/10/07 written, inspired heavily by rapp_get_spectrogram.pro
		shilaire@astro.phys.ethz.ch
	PSH 2004/04/18: modified to accept any keywords for phoenix_spg_improve_basic.pro


phoenix_spg_recalibrate $SSW/radio/ethz/idl/util/phoenix_spg_recalibrate.pro
[Previous] [Next]
NAME:
 	phoenix_spg_recalibrate.pro

PROJECT:
 	ETHZ Radio Astronomy
CATEGORY:
 	Utility
PURPOSE:
	This routine, given a Phoenix spectrogram in LINEAR SCALE, will recalibrate its values to have closer to reality SFU values.
	Recalibration data is in the file phoenix_recalibrate.fits in the dbase section of the ETH SSW software.
	phoenix_recalibrate.fits was derived by H. Perret from comparision with Trieste and RSTN radiometry data.


CALLING SEQUENCE:
	newspg=phoenix_spg_recalibrate(spg)
	-OR-
	newdata=phoenix_spg_recalibrate(data,freq_axis)

INPUT:
 	spg: an Phoenix spectrogram structure 
		-OR-
	data,freq : the data array and the frequency axis.

KEYWORD INPUT:


OUTPUT:
	newspg: the newly calibrated spectrogram structure
	-OR-
	newdata

KEYWORD OUTPUT:


 CALLS: ***
	INTERPOL, MRDFITS [1], MRDFITS [2]
 CALLED BY:
	Modify Image Pixels, RAG Exponentiation, RAG Log, phoenix_spg_autoimprove
RESTRICTIONS:
	Because we use the INTERPOL IDL routine, the values in the freq array must be monotonic (increasing or decreasing).

EXAMPLES:



HISTORY:
	Pascal Saint-Hilaire, 2004/04/06 written.
		shilaire@astro.phys.ethz.ch


PHZFIT $SSW/radio/ovsa/idl/fitting/phzfit.pro
[Previous] [Next]
 NAME:
     PHZFIT
 PURPOSE:
     Main workhorse routine called by WPHZFIT, to adjust phases for lobe
     ambiguities for a single baseline.
 CATEGORY:
     OVRO APC PHASE CALIBRATION
 CALLING SEQUENCE:
     phzfit,transfr,ap,calout,ibl,phz,res,sigma
 INPUTS:
     transfr   a simple structure containing DX (an index giving which
                 frequency is to be adjusted) and IX, a value that is +1
                 to adjust upward by 1 lobe, -1 to adjust downward by 1 lobe,
                 and -2 is a flag to indicate that the adjustments should
                 be done automatically.  A new entry SN has been added, to
                 allow lowering of the Signal to Noise ratio from the default
                 value of 2.0, if desired.
     ap        an array of size NF (number of frequencies) that keeps track
                 of the total phase adjustment for each frequency, in units
                 of lobes.
     calout    output of AMPHIT, an array of scan-averaged amplitudes and
                 phases, of size CALOUT(NCOL,NF,NBL) where NCOL=6 is the
                 number of columns, with the contents:
                       f_GHz  amp  damp  pha  dpha  sigma
                 NF=6 is the number of frequencies in standard PCAL observing
                 sequence, and NBL=7 is the current number of baselines not
                 including small-small baselines.  Only one baseline is actually
                 used at a time.
     ibl       an index (0 ... NBL-1) to indicate which baseline is to be
                 adjusted.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     linfit, ploterr
 OUTPUTS:
     phz       an array of size NF giving the current phase, after adjustment.
     res       a two-element array giving the linear fit parameters,
                 res[0]=offset and res[1]=slope.
     sigma     a two-element array giving the standard deviation in the
                 current fit parameters.
 COMMENTS:
 CALLS: ***
	LINFIT, LOBE, NINT [1], NINT [2], OVSA_PLOTERR
 CALLED BY:
	DAILY, MAKE_APCAL, WPHZFIT
 SIDE EFFECTS:
 RESTRICTIONS:
     This routine will likely have to be modified when additional baselines
     are added.
 MODIFICATION HISTORY:
     Written 09-Sep-1999 by Dale E. Gary
     02-Oct-1999  DG
       Added capability to survive missing data.
     10-May-2000  DG
       Changed plotting to plot multiple lobe phases (+/- 360*n) as dots,
       and maintain fixed yaxis scaling.  This much improves the search for
       the best phase slope.
     29-May-2000  DG
       Changed to return SIGMA rather that CHI-SQUARE of fit
     16-Jun-2000  DG
       Quick and dirty change to work with 5 or 6 antennas--not general
     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.
     11-Jul-2002  DG
       Change code to force the fit to go through zero phase at zero
       frequency, which forces the phase offsets to zero.  In this
       case, the sigma of the phase offset is set to 0.1 to keep
       subsequent routines from blowing up.
     15-Oct-2002  DG
       Was getting stuck in an infinite loop when there were no good
       data.  Now skips adjustment of SN when there are no good data.
     18-Jan-2006  DG
       Had to increase BL array to include baselines 18 and 28.  Also added
       SN to TRANSFR structure, to allow lowering of Signal to Noise if needed.
       Default (enforced in WPHZFIT and/or DAILY) is 2.0.


Pixel_Read $SSW/radio/ethz/idl/ragview/display/pixel_read.pro
[Previous] [Next]
 NAME:
	Pixel_Read
 PURPOSE:
	Reads the x- y- and z-value of an image pixel 
	clicked with the mouse
 	on a window produced with Show_Image. 
 CALLING SEQUENCE:
 	Pixel_Read,image [ ,xAxis ,yAxis [ ,imageValue
		 ,xValue ,yValue ] ] 
 CATEGORY:
	Image processing
 INPUTS:
	image: the image actually displayed on the screen
	xAxis,yAxis: the corresponding Axes
 OUTPUTS:
	imageValue, xValue, yValue: the values read. When
		not present, the values are displayed
		on the screen
 KEYWORDS:
	WINNR: must be set to the correct window number if the
		image window is not the currently
		selected window.
	TEXT: If another text as the default is wanted.
	PIXELX, PIXELY: the pixel numbers in the image.
 SIDE EFFECT:
 	When the values read are displayed on the screen, a 
	window is opened, and closed when exiting the
	procedure.
 RESTRICTION:
	The procedure works only  on X-windows.

 CALLS: ***
	GETBREAKS, GETHMS, GETIMAGESIZES, GETOFFSETS, HMSCONVERT, WMESG, devtopix
 CALLED BY:
	Display 2D Image, edit [1], edit [2]
 MODIFICATION HISTORY:
	Created 4/91, A.Csillaghy
	Keywords PIXELn added in Jan 93, A.Cs
	ERROR routine eliminated and replaced by MESSAGE, 
		Aug. 93, A.Cs.
 NON STANDARD PROCS USED:
 	Get_Winsize, Get_ImageSizes, GetBreaks,
	Round, ElimBreaks, GetOffsets


PKFIT [2] $SSW/radio/ovsa/idl/fitting/pkfit.pro
[Previous] [Next]
 NAME:
     PKFIT
 PURPOSE:
     PKUPCHEK support routine.  Fits PEAKUP data to find the
     pointing offset of an active region from the current pointing
     position for the 27 antennas.
 CATEGORY:
     OVRO APC PKUPCHEK SUPPORT ROUTINE
 CALLING SEQUENCE:
     pkfit,avdat,obseq,traj,pk,po,rmserr[,/debug]
 INPUTS:
     avdat   the PEAKUP data array, of size (nant,nf,nblk), where
                the first index is the number of antennas (5--only
                the first two [27 m] are used), second index is the
                number of frequencies (8), and the third index is
                the number of "blocks" (pointings--8)
                in the PEAKUP Trajectory.
     obseq   the observing sequence structure associated with the
                PEAKUP data.
     traj    the trajectory segment structure associated with the
                PEAKUP data.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     debug    a switch to enable plotting of some intermediate
                results.
 ROUTINES CALLED:
 OUTPUTS:
     pk      an array of size (nant,nf,2) containing the percent
                peak level above the minimum data value at each frequency
                for each of the two axes (0 = HO, 1 = DO).
     po      an array of size (nant,nf,2) containing the pointing
                offsets in degrees for each of the two axes, HO and DO.
     rmserr  an array of size (nant,nf,2) containing the rms error of the
                fit for the two axes, HO and DO.
 COMMENTS:
 CALLS: ***
	DAO_VALUE, REMOVE [1], REMOVE [2]
 CALLED BY:
	GETPSF
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 20-Dec-1998 by Dale E. Gary
     23-Dec-1998  DG
       Some cleanup, including placing GFUNCT function within this file.
     11-Dec-1999  DG
       Fixed problem with fitting negative "peaks" and cleaned up the
       /debug plotting.
     15-Jan-2000  DG
       Fixed bug that swapped HO and DO values!
     09-Sep-2005  DG
       Fixed problem in which a short scan would hang the system, due to
       trying to plot the fit, when no fit was found.  Now checks the
       number of good points in the fit, and does something sensible when
       the number is too few to plot.


PKUPCHEK $SSW/radio/ovsa/idl/analysis/pkupchek.pro
[Previous] [Next]
 NAME:
     PKUPCHEK
 PURPOSE:
     Main routine to analyze PEAKUP data.  Responds to scans
     of type PNTCAL (scan code 8) or TEST DATA (scan code 1).
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     pkupchek[,filename][,hrec | ,after=after][,debug][,/cmdfile]
 INPUTS:
     filename   the name of the file containing PEAKUP data.  If
                  omitted, the file DAILY.ARC in directory
                  !DEFAULTS.WORKDIR is assumed.
     hrec       the record number of the PEAKUP 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] after which to start
                  looking for a valid PNTCAL 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>\PKUP.MSG.
     debug      a switch that activates some debugging statements
                  for getting an indication of intermediate steps.
                  This switch is not compatible with /CMDFILE switch.
 ROUTINES CALLED:
     openarc, getdata, lasthrec, tl_decode, decode, pkfit
 OUTPUTS:
 COMMENTS:
     There will have to be modifications to this routine when
     additional antennas are available.
 CALLS: ***
	GETDATA, LASTHREC, NEWSCAN, OPENARC, OVSA_PKFIT, TL_DECODE, W2L, WRITE_LOG
 CALLED BY:
	WATCHER
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 20-Dec-1998 by Dale Gary
     23-Dec-1998  DG
       General cleanup, including correct application of gain
       and nonlinearity corrections as in LIMCHEK routine.
     15-Jan-2000  DG
       Added printout of Peak %, suitably weighted over frequency.
     14-Jan-2001  DG
       Fixed some bugs (NTOL and NACQ were badly set, and zeroes
       were not replaced with NaN as they should have been in AVDAT).
       Also added writing of results to LOG file.
     02-Mar-2001  DG
       Replace bad fit values (those greater than 3 arcmin, or NaN)
       with zeroes so that nominal pointing is used.
     09-Sep-2005  DG
       Fixed spot where potentially the data processing could end early
       due to DILOGHIST segment.
     07-Apr-2006  DG
       Somehow lost earlier change, now reinstituted, to call OVSA_PKFIT
       instead of PKFIT.


PLMONITOR $SSW/radio/ovsa/idl/widgets/plmonitor.pro
[Previous] [Next]
 NAME:
     PLMONITOR
 PURPOSE:
     Gives graphical indication of phase lock status for each antenna,
     and allows access to more information by clicking on the appropriate
     LED.
 CATEGORY:
     OVRO APC DIAGNOSTIC
 CALLING SEQUENCE:
     id     = PLMonitor(/INIT,[GROUP=group])
     status = PLMonitor(id,plock)
     status = PLMonitor(id,/DESTROY)
 INPUTS:
     id        the widget ID returned by a previous, initializing
                  call to PROGMETER (that used the /INIT switch).
                  This input is ignored if INIT keyword is set.
     plock     The phase lock status for a single cycle of data (the
                  routine accumulates its own statistics)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     init      a keyword switch that governs which of two calling
                  sequences is being used.  If set, a new widget is
                  created.  If not set, an existing widget is to be
                  updated.
     destroy   a keyword switch that destroys the widget created by
                  a previous call to PROGMETER (that used the /INIT switch)
     group     the top base id of the calling program, so that the widget
                  will be destroyed if the calling program exits.
                  This input is ignored if INIT keyword is not set.
 ROUTINES CALLED:
 OUTPUTS:
     id        the widget id of the compound widget (only when INIT
                  keyword is set).
     status    the status of the cancel button (only when INIT keyword
                  is not set).  If the cancel button has been pressed,
                  status='Cancel' and if not an empty string ('') is returned.
                  If an error in calling sequence occurs (ID or VALUE
                  is not supplied) then status='Cancel' also.
 COMMENTS:
     To use the routine, call it with the /INIT switch to create the
     widget, then call it repeatedly without the /INIT switch to update
     it.  When done with the widget, it should be destroyed.  Action is
     similar to the PROGMETER routine.  Here is an example:

          id = PLMonitor(/INIT,Group=GroupID,label='Progress Meter')
          ; Loop over data cycles
          for i = 0, ncycles do begin
             <Get a cycle of data, strip off phaselock into array plock>
             if (id NE 0) then status = PLMonitor(id,plock)
             if (status EQ 'Quit') then status = PLMonitor(id,/DESTROY)
          endfor

 CALLS: ***
	PLMONITOR_GETVALUE, PLMONITOR_SETVALUE, XKILL
 SIDE EFFECTS:
 RESTRICTIONS:
     The Phase Lock Monitor widget must be explicitly destroyed.
 MODIFICATION HISTORY:
     Written 29-Jul-1998 by Dale E. Gary
     20-Aug-1998  DG
       Change to display an LED for each oscillator, and make phase lock
       history show one oscillator at a time.  Also update the
       phase lock history window each sample instead of just in response
       to a mouse click.
     11-Jan-2000  DG
       Eliminated !UNIX variable by using !DEFAULTS.FONT


PLOT_ASC $SSW/radio/ovsa/idl/web/plot_asc.pro
[Previous] [Next]
 NAME:
     PLOT_ASC
 PURPOSE:
     Routine to plot ascii files generated by the Top20 routine,
     to show the baseline 12 overview for an entire day/file.
 CATEGORY:
     OVRO APC OVERVIEW
 CALLING SEQUENCE:
     plot_asc,filename
 INPUTS:
     filename The name of the data file (.ARC) for which the overview
                is wanted.  The overview files associated with this
                data file are assumed to already exist.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     break_file, cvdoy, utplot, outplot, ovsa_get_color
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	FILENAME2DATE, LOADCT, OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], OVSA_GET_COLOR
	STR_SEP, UTPLOT_IO [1], UTPLOT_IO [2], UTPLOT_IO [3], WRITE_GIF
 CALLED BY:
	QUICKLOOK
 SIDE EFFECTS:
     A GIF file is created in !defaults.workdir
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 23-Jun-1999 by Dale E. Gary
     23-Jul-1999  DG
       Changed output directory for q.gif file to !DEFAULTS.WEBDIR
     27-Oct-1999  DG
       Changed input and output file names to reflect new format
       containing YYYYMMDD instead of the esoteric .ARC filenames.
     11-Jan-2000  DG
       ELiminated hardwired directory locations.
     23-Jul-2003  DG
       Changed GET_COLOR to OVSA_GET_COLOR to avoid conflict
       with routine of the same name in SMM tree.


PLOT_DRIFTSCAN $SSW/radio/ovsa/idl/misc/plot_driftscan.pro
[Previous] [Next]
 NAME:
     PLOT_DRIFTSCAN
 PURPOSE:
     Plots the results of DRIFTSCAN observations of the two 27 m antennas.
     This routine can plot change of pointing of either antenna relative
     to itself or the other antenna.
 CATEGORY:
     OVRO APC DATA CALIBRATION
 CALLING SEQUENCE:
     plot_driftscan,ant1,ant2[,frq=frq][,ref=ref]
 INPUTS:
     ant1     Either 1 or 2, to indicate which 27 m antenna to use as the
                reference antenna.
     ant2     Either 1 or 2, to indicate which antenna position to plot
                relative to reference antenna.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     frq      Gives the frequency index of the frequency to use for the
                frequency-specific plot.  Other plots are generated that are
                independent of frequency, but the frequency-specific plot
                is useful as a check for problems.  If omitted, index 1
                (the second lowest frequency) is used.
     ref      Specifies which measurement to use as the reference position.
                For example, if N measurements are contained in the file,
                and a reference near the middle of the observation is
                wanted, specify N/2.  If omitted, the first measurement
                is used.
 ROUTINES CALLED:
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	CROSS_IDL, LOADCT
 SIDE EFFECTS:
     A plot file named DRIFTSCAN.PS is generated in the current directory,
     containing 4 or more pages.  Some information is printed to the
     screen as well.
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 08-Apr-2002 by Dale E. Gary


PLOT_GCPARM $SSW/radio/ovsa/idl/support/plot_gcparm.pro
[Previous] [Next]
 NAME:
     PLOT_GCPARM
 PURPOSE:
     Plots the gain parameters (nonlinearity and atten factors) as
     a function of time for the current and preceding month.  The
     plot is saved into GCAL_DIAG_R.SAV or GCAL_DIAG_L.SAV (according
     to value of POL keyword) in !DEFAULTS.DBDIR
 CATEGORY:
     OVRO APC DIAGNOSTICS GCALCHEK
 CALLING SEQUENCE:
     plot_gcparm,tls,nant,gcstat,pol=pol
 INPUTS:
     tls      a standard time/label structure from the scan header
                segment record of the GCAL scan.
     nant     the number of antennas used in GCAL scan.
     gcstat   the gain status string array, defined in GCALCHEK.  It
                is a string array of size STRARR(NLINES,NTYPE,NANT)
                where NLINES = 3 is the number of lines for each
                button in the DIAGNOSE screen, NTYPE = 5 is the number
                of buttons in the DIAGNOSE screen for each antenna,
                and NANT is the number of antennas.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     pol	   single char string, 'r' or 'l', specifies whether the
                data in GCSTAT are R or L data.  Resulting SAVE file
                name has POL string appended to its name.
 ROUTINES CALLED:
 OUTPUTS:
 COMMENTS:
     The results are written in the form of a plot to file GCAL_DIAG_R.SAV
     or GCAL_DIAG_L.SAV in directory !DEFAULTS.DBDIR.  This plot is displayed
     in pieces in DIAGNOSE.
 CALLS: ***
	CVDOY, MOMENT, OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], PROGMETER, UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
 CALLED BY:
	GCALCHEK
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 18-Apr-1999 by Dale E. Gary
     11-Jan-2000  DG
       Eliminated hardwired directory locations.
     12-Mar-2000  DG
       Fixed to allow use with any number of antennas up to 8
     11-Nov-2000  DG
       Fixed a bug involving data arrays not being declaring in some
       cases.
     09-Jan-2004  DG
       Added POL keyword to allow both R and L output


PLOT_HG_MAN $SSW/radio/nrh/idl/1dnrh/trace/plot_hg_man.pro
[Previous] [Next]
 NAME:
	PLOT_HG_MAN

 PURPOSE:
 Compute and plot the heliographic positions corresponding to the NRH
 channels canew, cansn.	

 CATEGORY:
	NRH1 trace

 CALLING SEQUENCE:
	PLOT_HG_MAN, canew, cansn, fwhmew, fwhmsn, number, idate, $
			frequence, heurms

 INPUTS:
		canew		EW channel
		cansn		SN channel
		fwhmew		EW width of the source
		fwhmsn		SN width
		number		Running number of plotted positions
		idate		Array (day, month, year - 1900)
		frequence	Frequency [MHz]
		heurms		Time [ms afterr 0 UT]
	
 KEYWORD PARAMETERS:

		CORSTAT		Compute correction for static ionosphere
		CORPOIT		Compute correction using Poitiers dens. meas.
		SHADE		Embed plotted position within shaded region
		PSYM		Number of symbol used for plotting (cf. IDL)
		LABEL		Label plotted positions by a running number,
				time and frequency
		DATE		Write date in the lower left corner of the plot
		FREQUENCY	Write frequency and symbol at bottom of plot
 		FIGURE
		FILL=fill
		SYMSIZE
		LINESTYLE
		MESSAGE		Contains computed heliographic centr. position

 OUTPUTS:
	Non

 CALLS: ***
	CALCPOS, I2CDATE, INIT_MALAX, MSH, SYMBTRACE
 COMMON BLOCKS:
	Non

 MODIFICATION HISTORY:
	Adapte de XHELIO (bonmartin@obspm.fr)

	31/3/99	ajout du Keyword DATE pur ecrire (ou non) la date
	1/9/00  ajout  du Keyword MESSAGE
		(Ludwig.klein@obspm.fr)


PLOT_MAXPOS $SSW/radio/nrh/idl/2dnrh/position/plot_maxpos.pro
[Previous] [Next]
 NAME:
	PLOT_MAXPOS

 PURPOSE:
	Cette procedure affiche l'image au moment de son flux maximum +
	toutes les positions trouvees sous forme de contours au moment de leur
	flux maximum	

 CATEGORY:
	RH_2D, recherche de positions

 CALLING SEQUENCE:
	PLOT_MAXPOS, Fichpos, Fichimg, IDWIN=IdW

 INPUTS:
	Fichpos:	Fichier contenant les positions
	Fichimg:	Fichier contenant les images associees

 KEYWORD:
	IDWIN:	numero de la fenetre (defaut: nouvelle fenetre)

 CALLS: ***
	CALC_VOLGAUSS, ECH_RS, FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2]
	HEADFITS [3], IND_RS, MSH, OPLOT_CIRCLE, RDFILEPOS, RDLINE_FPOS, READ_NRHIM
	TIME_IND_NRH
 CALLED BY:
	CW_POS
 COMMON BLOCKS:
	INFO2D, str_inf2d:	pour les coordonnees helio
	VISU_2D,str_visu:	pour dimension de l'image
	LIMIT,str_lim:		pour la region selectionnee

 MODIFICATION HISTORY:
	Ecrit par: 	C Renie decembre 1997
	mars 1998:	Affichage de la region seulement
	juillet,1998:	Passage du nom de fichier en parametre au lieu du tableau
	16/10/1998: ajout du keyword IDWIN
	3/5/1999: utilisation READ_NRHIM au lieu de mrdfits


PLOT_MED $SSW/radio/ovsa/idl/util/plot_med.pro
[Previous] [Next]
 NAME:
     PLOT_MED
 PURPOSE:
     Plot dynamic spectrum contained in a "MED" file output by
     OVSA_EXPLORER
 CATEGORY:
     OVRO APC DATA ANALYSIS
 CALLING SEQUENCE:
     plot_med,filename[,maxdat=maxdat][,mindat=mindat][,fluxlim=fluxlim][,/rcp][,/lcp][,/p][,/log]
 INPUTS:
     filename   the name of the MED file containing the data.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     LOG        a keyword to specify that the flux density should be log-scaled
     maxdat     the maximum value to use to scale the plot
     mindat     the minimum value to use to scale the plot
     RCP          plot only the RCP flux density
     LCP          plot only the LCP flux density
     P          plot percent polarization (if set, maxdat and mindat are taken
                  to be range of polarization, or range -100 to 100 is assumed)
     FLUXLIM    flux limit above which to determine percent polarization.
 ROUTINES CALLED:
     utplot, get_ovsa_image
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], GET_OVSA_IMAGE, LOADCT, UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
 CALLED BY:
	W_HISTOGRAM, psk_correlate
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 29-Dec-2003 by Dale Gary
     31-Dec-2003  DG
       Added a labeled color bar to show the flux density in sfu.
     06-Jan-2004  GN
       Made use of get_ovsa_image to emulate the freq-log scale.
     27-Aug-2005  GN
       Added R,L, and P keywords to allow plotting RCP , LCP and polarization
       data if ldata and rdata are present in the med files as saved by the
       updated version of ovsa_explorer using "Save median data" menu item,
       which replaced the old "Save TP and Movie" item.
     28-Aug-2005  DG
       Added FLUXLIM keyword, and set default flux limit of 20 sfu for
       calculation of polarization.  Added gray color at center of color
       scale for polarization plot.  Changed FIX to LONG for color bar
       labeling, since large fluxes were overflowing 2-byte signed integer.
     15-Apr-2006  DG
       Added LOG keyword to allow plotting of log flux density (ignored for poln)
     09-Dec-2006  DG
       Had to change R and L keywords to RCP and LCP in order to distinguish
       old keyword L from LOG.


PLOT_NL_TEST $SSW/radio/ovsa/idl/misc/plot_nl_test.pro
[Previous] [Next]
 NAME:
     PLOT_NL_TEST
 PURPOSE:
     Routine to plot 5 DB attenuation factor for various values of NL
     (nonlinearity parameter), assuming nominal offset.
 CATEGORY:
     OVRO APC DIAGNOSTIC TEST
 CALLING SEQUENCE:
     plot_nl_test,gcdata
 INPUTS:
     gcdata   the GCAL data array, of size (2,7,5,86), where
                the first index is ND off/on, second index is the
                attenuation state (0,5,10,15,20,35,20*DB), the
                third index is the total power channel, and the
                last index is the frequency
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
 COMMENTS:
 SIDE EFFECTS:
     A plot is produced
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 08-Mar-1998 by Dale E. Gary


plot_pcal $SSW/radio/ovsa/idl/misc/plot_pcal.pro
[Previous] [Next]
 NAME:
     plot_pcal
 PURPOSE:
     Plot the results of pcal.pro.
 CATEGORY:
     scbong OVRO
 CALLING SEQUENCE:
     plot_pcal, filename[, antset = antset]
 INPUTS:
     filename   File name saved by pcal.pro. If not given, 'pcal.sav' will be used.
     antset     Antenna numbers of sets to be shown.
                This is [3, nset] dimensional array where nset is the number of sets.
                A set consists of three antennas which should satisfy the phase closure condition
                In the phase closure condition, for any three antennas a, b, c
                in increasing antenna number order, ab - ac + bc = 0
                where ab is the phase of baseline a-b and so on.
                The default value is [[1, 2, 4], [1, 2, 5], [1, 2, 6]].
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     combine    Set this keyword to combine each baseline data over time.
                A new window is opened and each plot contains fitting lines or summed lines.
 ROUTINES CALLED:
     sec2hms
 OUTPUTS:

 COMMENTS:
     plot_pcal will show the same number of windows as that of files used in pcal.
     A window has 0 marked points which are the points of 0 phase fold.
     In the last row plots, three dashed lines are fitted lines of
     each labeled baseline index and the solid line is the sum of them.
     dashed lines and the data points are flipped if the sign next to the label is '-',
     so that the sum of them becomes 0 according to the phase closure condition.
     If time keyword is set, a window is opened and
 CALLS: ***
	SEC2HMS, UNIQ [1], UNIQ [2], UNIQ [3]
 CALLED BY:
	pcal
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 24-Jan-2000 by Su-Chan Bong


PLOT_SOURCES $SSW/radio/nrh/idl/2dnrh/position/plot_sources.pro
[Previous] [Next]
 NAME:
	PLOT_SOURCES

 PURPOSE:
	Cette procedure affiche toutes les sources trouvees lors d'une recherche
	de positions. Les sources sont classees par position.	

 CATEGORY:
	RH_2D, recherche de positions

 CALLING SEQUENCE:
	PLOT_SOURCES, Fichposi, IDWIN=IdW

 INPUTS:
	Fichposi:	Fichier fits contenant les positions

 KEYWORD:
	IDWIN:	numero de la fenetre (defaut: nouvelle fenetre)

 CALLS: ***
	FXPAR [1], FXPAR [2], HEADFITS [1], HEADFITS [2], HEADFITS [3], IND_RS, LEGEND [1]
	LEGEND [2], LEGEND [3], OPLOT_CIRCLE, RDFILEPOS
 CALLED BY:
	CW_POS
 COMMON BLOCKS:
	INFO2D, str_inf2d:	pour les coordonnees helio
	VISU_2D,str_visu:	pour dimension de l'image
	LIMIT,str_lim:		pour la region selectionnee

 MODIFICATION HISTORY:
	Ecrit par: C Renie 17/03/1998
	19/08/1998: on passe le nom d'un fichier fits de positions en parametre
	16/10/1998: ajout du keyword IDWIN


PLOT_TPCAL $SSW/radio/ovsa/idl/support/plot_tpcal.pro
[Previous] [Next]
 NAME:
     PLOT_TPCAL
 PURPOSE:
     Plot new total power calibration factors, and overplot old
     factors for a check on data quality.
 CATEGORY:
     OVRO APC DATA CALIBRATION
 CALLING SEQUENCE:
     plot_tpcal,newtp,oldtp
 INPUTS:
     newtp   an array of size [1024,2] containing the two records
               of a newly determined TPCAL segment, as the result
               of total power calibration analysis.
     oldtp   an array of size [1024,2] containing the two records
               of the old TPCAL segment, as indicated in the INDEX
               record for the REF-TPCAL segment.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     get_screen, decode
 OUTPUTS:
 COMMENTS:
     I anticipate further changes to make this suitable for automation.
 CALLS: ***
	DECODE, GET_SCREEN_SIZE, LOADCT, OPLOTERR
 CALLED BY:
	TPCALCHEK2
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 28-Aug-2000 by Dale E. Gary
     25-Nov-2000  DG
       Major changes to input total power calibration segment records
       rather than the TPCAL factors themselves.  This change simplifies
       things considerably, since the noise diode factors are already
       applied properly, and the TLS is included in the records.


PLOTERR [2] $SSW/radio/ovsa/idl/misc/ovsa_ploterr.pro
[Previous] [Next]
 NAME:
   PLOTERR
 PURPOSE:
   Plot data points with accompanying X or Y error bars.
   This is a greatly enhanced version of a standard IDL Library routine.

 CALLING SEQUENCE:
   ploterr, [ x,]  y, [xerr], yerr [, TYPE =, /NOHAT, HATLENGTH= ,
        ERRTHICK=, ERRSTYLE=, ERRCOLOR = ]

 INPUTS:
   X = array of abcissae.
   Y = array of Y values.
   XERR = array of error bar values (along X)
   YERR = array of error bar values (along Y)

 OPTIONAL INPUT KEYWORD PARAMETERS:
   TYPE = type of plot produced.  The possible types are:
       TYPE = 0 :  X Linear - Y Linear  (default)
       TYPE = 1 :  X Linear - Y Log
       TYPE = 2 :  X Log    - Y Linear
       TYPE = 3 :  X Log    - Y Log
          Actually, if 0 is specified, the XLOG and YLOG keywords
          are used.  If these aren't specified, then a linear-linear
          plot is produced.  This keyword is available to maintain
          compatibility with the previous version of PLOTERR.
   NOHAT     = if specified and non-zero, the error bars are drawn
               without hats.
   HATLENGTH = the length of the hat lines used to cap the error bars.
               Defaults to !D.X_VSIZE / 100).
   ERRTHICK  = the thickness of the error bar lines.  Defaults to the
               THICK plotting keyword.
   ERRSTYLE  = the line style to use when drawing the error bars.  Uses
               the same codes as LINESTYLE.
   ERRCOLOR =  scalar integer (0 - !D.N_TABLE) specifying the color to
           use for the error bars
   NSKIP = Integer specifying the error bars to be plotted.   For example,
       if NSKIP = 2 then every other error bar is plotted; if NSKIP=3
       then every third error bar is plotted.   Default is to plot
       every error bar (NSKIP = 1)


 CALLS: ***
	OVSA_PLOTERR
 RESTRICTIONS:
   Arrays must not be of type string.  There must be enough points to plot.
   If only three parameters are input, they will be taken as X, Y and
   YERR respectively.

 EXAMPLE:
       Suppose one has X and Y vectors with associated errors XERR and YERR

       (1) Plot Y vs. X with both X and Y errors and no lines connecting
           the points
                  IDL> ploterr, x, y, xerr, yerr, psym=3

       (2) Like (1) but plot only the Y errors bars and omits "hats"
                  IDL> ploterr, x, y, yerr, psym=3, /NOHAT

 WARNING:
   This an enhanced version of a procedure that already exists in the
   standard IDL V4.0 distribution.   Any call to the standard IDL version
   should also work with this version, but the reverse is not true.

 PROCEDURE:
   A plot of X versus Y with error bars drawn from Y - YERR to Y + YERR
   and optionally from X - XERR to X + XERR is written to the output device

 MODIFICATION HISTORY:
   William Thompson    Applied Research Corporation  July, 1986
   DMS, April, 1989    Modified for Unix
   Michael R. Greason  ST Systems
   May, 1991       Added most of the plotting keywords, put hats
               on the error bars.
   K. Venkatakrishna       Added option to plot xerr, May, 1992
   Michael R. Greason  Corrected handling of reversed axes.  Aug. 1992.
   W. Landsman             Removed CHAN keyword for V4.0 compat. June 1995
   W. Landsman             Use _EXTRA keyword                    July 1995
   W. Landsman             Plot more than 32767 points           Feb 1996
   W. Landsman Fix Y scaling when only XRANGE supplied       Nov 1996
   W. Landsman     Added NSKIP keyword                           Dec 1996
   W. Landsman     Use XLOG, YLOG instead of XTYPE, YTYPE        Jan 1998


PLOTPOS2D $SSW/radio/nrh/idl/1dnrh/trace/plotpos2d.pro
[Previous] [Next]
 NAME:
	PLOTPOS2D

 PURPOSE:
 	Plot the heliographic positions contained in a 2D "position"
	file derived from 1D NRH scans

 CATEGORY:
	NRH1 trace

 CALLING SEQUENCE:
	PLOTPOS2D,  tabpos, posinfo, pastempo, frequence, chdate

 INPUTS:
	tabpos		Array read by LECP1D containing source parameters: 
			tabpos(numero, type, indice temporel)
	posinfo		2D array giving for each source: 
				(i) start time [ms] (posinfo(0, numero))
				(ii) number of points (posinfo(1, numero))
	pastempo 	Integration time [ms]
	frequence	Frequency [MHz]
	chdate		Date (string)

 KEYWORD PARAMETERS:
		HEURES		Start, end time of plot
		NUMPOS		Number of source to be plotted 
				(default: all; first source: numero=1),
				set to -1 if the requested source is not in
				the file
		SHADE		Plot line upon stripe in background colour
		DATE		Write date in the lower left corner of the plot
		SYMBOL		Plots symbols 
 		FIGURE		Type of figure used for the symbols
		FILL		Use filled figures as symbols
		SYMSIZE		Size of the symbol

 OUTPUTS:
	None

 CALLS: ***
	SYMBTRACE
 COMMON BLOCKS:
	None

 MODIFICATION HISTORY:
	Adapte de XHELIO (bonmartin@obspm.fr)
	20/5/99: Introduction of keywords for plotting symbols 
			(Ludwig.klein@obspm.fr)


Plots_Selection $SSW/radio/ethz/idl/ragview/datatype/plots_selection.pro
[Previous] [Next]
 PROJECT:
       Phoenix 2 solar radio spectrometer

 NAME:
	Plots_Selection

 PURPOSE:

	User interface, to select and remove plots from the
       plot table. The plots selected by this routine must have
       been stored in the plot table by store_plot.pro
       The selected plots may be displayd with data_display.

 CATEGORY:
	Radio (/ssw/radio)

 CALLING SEQUENCE:
	Plots_Selection

 SIDE EFFECT:
 	Windows are opened.

 RESTRICTION:
	Use only in interactive mode
       Tested only on Unix
       Requires windows capabilities

 CALLED BY:
	MDisp
 MODIFICATION HISTORY:
	Created in June 1991 by A.Csillaghy
		Inst. of Astronomy, ETH Zurich
       Version IDL 5.1 in November 1998, csillag@ssl.berkeley.edu
               Adaptation to ssw (XMenu_Sel and xAck)


PNTCHEK $SSW/radio/ovsa/idl/analysis/pntchek.pro
[Previous] [Next]
 NAME:
     PNTCHEK
 PURPOSE:
     Main routine to analyze antenna pointing data.  Responds to scans
     of type POINT (scan code 16) or TEST DATA (scan code 1).
 CATEGORY:
     OVRO APC INSTRUMENT CALIBRATION
 CALLING SEQUENCE:
     pntchek[,filename][,hrec | ,after=after],output[,debug][,/cmdfile]
 INPUTS:
     filename   the name of the file containing POINT data.  If
                  omitted, the file DAILY.ARC in directory
                  !DEFAULTS.WORKDIR is assumed.
     hrec       the record number of the POINT 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] after which to start
                  looking for a valid POINT 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>\POINT.MSG.
     debug      a switch that activates some debugging statements
                  for getting an indication of intermediate steps.
                  This switch is not compatible with /CMDFILE switch.
 ROUTINES CALLED:
     openarc, getdata, lasthrec, tl_decode, decode, pntfit, nint
 OUTPUTS:
     output     a 4-element string array containing formatted lines of
                  output of the following form.  The two header lines are
                  not included.  These lines are also appended to
                  the file boresite.pnt in the directory !DEFAULTS.DBDIR.

      Source Name     Date      Time   Rec#  HA(deg)  DEC(deg) Ant Axis Offset
      ------------ ---------- -------- ----- -------- -------- --- ---- ------
      3C454.3      1999/12/27 00:06:00    23   -5.236   16.147  1    HO   0.110
      3C454.3      1999/12/27 00:06:00    23   -5.236   16.147  1    DO  -0.008
      3C454.3      1999/12/27 00:15:36    23   -2.830   16.147  2    HO  -0.004
      3C454.3      1999/12/27 00:15:36    23   -2.830   16.147  2    DO  -0.028

 COMMENTS:
 CALLS: ***
	FLAGOOL, GAINCOR, GET_CYCLE, LASTHREC, LST, MOMENT, MSEC2STR, NEWSCAN, NINT [1], NINT [2]
	OPENARC, PNTFIT, PROGMETER
 CALLED BY:
	WPOINT
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 13-Jun-1999 by Dale E. Gary
     20-Jul-1999  DG
       Convert to work for either POINT or ENCODER ZERO data (NCODRZERO).
       Now senses trajectory offsets and frequency used, through changes
       to arguments to PNTFIT routine
     30-Dec-1999  DG
       Extensive changes to output format, to enable combining with
       MOUNTCAL and WPOINT routines
     05-Feb-2000  DG
       Removed now unnecessary sin and cos lookup tables in GAINCOR call.
     23-May-2000  DG
       Changed to work with 6 or 2 elements.  The standard mode should
       be two elements from now on, since that gives the best S/N.
     10-Mar-2000  DG
       Added check for short scans, so that routine can exit gracefully
       without crashing.
     13-Oct-2006  DG
       Changed polarization channel from 2 (I) to 0 (R), due to new RL
       polarization scheme.  Analyzing old data will now no longer work,
       but there seems no reason to do that anyway.


PNTFIT $SSW/radio/ovsa/idl/fitting/pntfit.pro
[Previous] [Next]
 NAME:
     PNTFIT
 PURPOSE:
     PNTCHEK support routine.  Fits Antenna POINT data to find
     the peak flux, pointing offset, and rmserr of the fit.
 CATEGORY:
     OVRO APC PNTCHEK SUPPORT ROUTINE
 CALLING SEQUENCE:
     pntfit,avdat,po,rmserr,traj[,/debug]
 INPUTS:
     avdat   the POINT data array, of size (nblk), where
                NBLK is the number of "blocks" (pointings--18)
                in the POINT Trajectory.
     traj    the TRAJECTORY structure from the file
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     debug    a switch to enable plotting of some intermediate
                results.
 ROUTINES CALLED:
 OUTPUTS:
     po      an array of size (2,2) containing the pointing offsets
                in degrees for each of the two axes, HA and DEC,
                for the two antennas.
     rmserr  an array of size (2,2) containing the rms error of the
                fit for the two axes, HA and DEC, for the two ants.
 COMMENTS:
 CALLS: ***
	CURVEFIT, ERRPLOT [1], ERRPLOT [2], GFUNCT
 CALLED BY:
	PNTCHEK
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 14-Jun-1999 by Dale E. Gary
     13-May-2000  DG
       Fixed crazy problem with initial guess for amplitude of fit.
       I had the completely wrong guess--due to misinterpretation of
       what the variable meant.
     16-May-2000  DG
       Found another major problem, that the beam width was off by
       a factor of 13.5!  Ah, this was because I was trying to do
       interferometric point on large/small combinations, and forgot
       to change it back.
     10-Mar-2001  DG
       Added error bars and correct weighting to plots.


POSTOFITS $SSW/radio/nrh/idl/2dnrh/position/postofits.pro
[Previous] [Next]
 NAME:
	POSTOFITS

 PURPOSE:
	Transforme un fichier de positions genere par TRI_CENTRES en fichier FITS.
	Ne retient que les positions dont le nombre de sources est superieur a nbhit.

 CATEGORY:
	RH_2D, Recherche de position

 CALLING SEQUENCE:
	POSTOFITS, Fich1, Fich2, Fich3, Nbposi, Nbhit

 OPTIONAL INPUTS:
	Fich1:	nom du fichier binaire dans lequel est stocke la description
		des volumes gaussiens tries en positions
	Fich2:	nom du fichier fits de positions
	Fich3:	nom du fichier images qui a servi pour la recherche des positions
	Nbposi: nombre de positions contenues dans Fich1
	Nbhit:	nombre de sources minimum a retenir par position

 CALLS: ***
	CP_FLUXPOS_NRH2, CREATE_NRH_PFILE, WRITE_POSINRH
 CALLED BY:
	CW_POS
 MODIFICATION HISTORY:
	Ecrit par: C. Renié 07/1998
		Le 13/09/00 Rajout BUFSIZE=0 pour OPENR


PRINT_DATE $SSW/radio/ovsa/idl/time/print_date.pro
[Previous] [Next]
 NAME:
     PRINT_DATE
 PURPOSE:
     Reads all records within a range specified from a file, and prints
     the date and time from the Time/Label field.  This is an example
     routine to show how a simple task can be added to LAUNCHER's task list
 CATEGORY:
     EXAMPLE
 CALLING SEQUENCE:
     print_date,filename,srec,erec
 INPUTS:
     filename   the name of the file
     srec       the start record of the range
     erec       the end record of the range
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     tl_decode
 OUTPUTS:
 COMMENTS:
 CALLS: ***
	TL_DECODE
 SIDE EFFECTS:
     Dates/times are written to the terminal
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 26-Sep-1997 by Dale Gary


PrintInterface $SSW/radio/ethz/idl/ragview/printinterface.pro
[Previous] [Next]
 NAME:
       PrintInterface
 PURPOSE:
       Interface for generating postscript files from ragview.
 CALLING SEQUENCE:
       PrintInterface, status
       ... commands such as plot, etc...
       PrintInterface, status, /PRINT
 OUTPUT:
       status:  the number of the printer that has been chosen
                in the menu. status is output parameter if the 
                keyword PRINT is not set
 INPUT:
       status:  the number of the printer that has been chosen
                in the menu in the previous call of printinterface.
                status is input parameter if the 
                keyword PRINT is set
       file: the file to print (only whith association with the PRINT
             keyword). 
 NOTICE:
       This interface is extendable. If you have more than one
       printer, you can add it by assigning it to LPDEST1, lPDEST2,
       ... LPDEST6 (up to 7 printers can be declared)
 KEYWORDS:
       PRINT: Sends the file to the printer
              If not set, the menu interface is displayed
 CALLS: ***
	GETPRINTPARAMS, General_Menu [1], General_Menu [2]
 CALLED BY:
	Customize_1D, Display 2D Image, Display_1D, Histogram Facility
 MODIFICATION HISTORY:
       Created in 1991 by A.Csillaghy, csillag@astro.phys,ethz.ch
       Modified for IDL5/ssw/Ragview ACs, March 1998
       Modified for Advanced Printing System, P.Messmer, July 2000


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

 PURPOSE:
  PROCEDURE DE TRACE D'UN PROFIL RH UNIDIMENSIONNEL ET DE SA DECOMPOSITION 
  EN SOURCES ELEMENTAIRES (INTENSITE OU POLARISATION) A UN TEMPS DONNE
  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:
	PROFDECOMP1D, Tabl_X, Lun, Gliss, Poids, Npos

 INPUTS:
      TABL_X ..... Tableau issu de LEC1D contenant les images(2 dimensions) 
                   tabl_X(num_Canal,Temps)(3 Dim sinon )
                           		tabl_X(Num_Canal,Temps,I:V)
      LUN .......  unite logique assignee au fichier
	 GLISS ...... Nombre de canaux sur lequel la moyenne
					glissante est calculee

	 POIDS ...... Poids minimum d'une source a retenir (->
					SIGRMN)
        NPOS ....... Nombre maximum d'iterations sur 1 image
	
 KEYWORD PARAMETERS:
       HEURE ...... heure du profil à tracer,
                                   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
	NOERASE .... Permet de forcer le passage au mode 
				   NOERASE si on veut visualiser un ou
				   plusieurs profils ne se suivants pas 
				   dans la meme fenetre
	WIN ........ Specifie le numero de fenetre dans lequel a

       LASER ...... Permet de rediriger la sortie graphique sur
                                   l'imprimante laser
       INTENSITE .. Trace d'un profil d''intensite
       POLAR........Trace d'un profil polarise
       SIMPLE ..... Ajustement d'une Gaussienne
       CONST, DROITE, PARABOLE ... Gaussienn + cst., droite 

 OUTPUTS:
	Trace

 CALLS: ***
	DECOMP1D, HMS, INDICE, LOADINTENS, LOADPOLAR, MOTCLE, MSH, NRH1_POSTSCRIPT
 CALLED BY:
	MENUTRACEPROF
 COMMON BLOCKS:
	NRH!_GLOBAL

 PROCEDURE:
  METHODE: CALCUL D'UNE MOYENNE GLISSANTE SUR gliss CANAUX, IDENTIFICATION
  DES POINTS QUI DEPASSENT LA MOYENNE GLISSANTE (diff image - image lissee,
  normalisee sur 1, >= poids). 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.

 EXAMPLE:
	Please provide a simple example here

 MODIFICATION HISTORY: (bonmartin@obspm.fr)
	16/11/98	adapte du logiciel XHELIO
	09/04/99	ajout mot cle message: liste des pos. identifiees 
       31/08/00	ajout possibilite d'ecrire resultats de la decompo-
			sition en sources elementaires dans fichier ASCII
			(nom standard: 'nrhascipos1d.dat')


PS_Create_1D $SSW/radio/ethz/idl/ragview/display/ps_create_1d.pro
[Previous] [Next]
 NAME:
	PS_Create_1D

 PURPOSE:
	Redirects the plot output of the procedure "Data_Display"
	to a postscript file.

 CATEGORY:
	1D

 CALLING SEQUENCE:
	PS_Create_1D, [ x, y [, qualifier [, dx, dy ] ] ]

 INPUTS:
	x: the x-values, a 2D array. If not present, the x range is set 
		from 0 to the number of elements minus 1.
	y: the y-values also real 2D array, each line is a plot.
	q: the qualifiers for each value to plot. The number follows
		the definition of the !psym system variable.
		It is a 2D integer array
	dx, dy; the errors in x- and y-direction. If the error bars 
		are symmetrical, then "dx" and "dy" are
		2D real arrays. If they are not symmetrical,
		then dx(*,*,0) and dx(*,*,1) contain the errors
		left and right, respectively and dy(*,*,0) and
		 dy(*,*,1) contain the errors up and down,
		respectively.

 KEYWORDS:
	LINESTYLE: for each plot a value corresponding to the
		!p.linestyle system variable. A 1D array.
	THICK: The line thickness, corresponding to the !p.thick
		system variable. A 1D real array.
	OFFSET: An y-offset added to all y-values of a plot,
		a 1D real array.
	COLOR: a color for each plot, 1D integer array
	RESET: If present, the scaling is done automatically,
		otherwise, the last one is used, unless the
		system variables !x/y.range are [0,0]
	XPOS, YPOS: The position of the lower left corner
		of the plot. If not specified, the have both
		the value 1 (units in centimeters).
	XSIZE, YSIZE: The width and height of the plot
	FILENAME: The file name. If not specified,
		the file name will be the first ten chars of the
		variable "!p.title"
	LANDSCAPE: If present the file is printed in landscape 
		 mode
 	LOGO: If set, writes "institute of astronomy' on the 
		bottom of the page.
	SIXEL: If set, the file is in SIXEL format (for printing
		on the ln03 printer).
 SIDE EFFECT:
	Creates a file. The default name is "mdisp.ps", if not 
	precised in the FILENAME 
	keyword. If already present, the old file is deleted.

 CALLS: ***
	DATA_DISPLAY, GETPSSIZES, GETTITLES
 CALLED BY:
	Customize_1D, Display_1D
MODIFICATION HISTORY:
 	Created in June 1991 by A.Csillaghy
	Modified for sixel devices and wave 4, 
		Nov. 92, ETHZ, A.Cs
       Changed the default filename mdisp.ps to ragview.ps 
               csillag@ssl.berkeley.edu, May 16, 1998


psk_correlate $SSW/radio/ovsa/idl/widgets/wquery.pro
[Previous] [Next]
 NAME:psk_correlate

 PURPOSE:
    compute correlation and significance level between two arrays
    using three methods: classical linear, rank Spearman, or rank Kendall

 CATEGORY:

 CALLING SEQUENCE:
    r=psk_correlate(x,y[,corr=corr,/spearman,/kendall])

 INPUTS:
 x,y two equal length array

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 no keyword to compute Pearson linear correlation
 spearman: to compute Spearman rank correlation
 kendall:  to compute Kendall rank correlation
 corr=1,2,3 alternative keyword to specify the type of correlation in the above order

 ROUTINES CALLED: correlate,r_correlate

 OUTPUTS:
 [r,prob], where prob is the null hypothesis probability, the less the better.

 COMMENTS:

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CORRELATE, DEFPARMS, DRAW_EVENT, FIRST, IBETA, JULDAY, LAST, LINFIT, LOADCT, MOMENT
	OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], PLOTDATA__DEFINE, PLOT_MED, PLOT_W, PROGMETER
	QUERY, READ_MED, ROTATE_EVENT, R_CORRELATE, UNIQ [1], UNIQ [2], UNIQ [3], UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], WQUERY, WQUERY_EVENT
	W_HISTOGRAM, XMANAGER, break_file [4]
 CALLED BY:
	W_HISTOGRAM
 SIDE EFFECTS:
 If none element verctors are provided, [nan,nan] is returned
 RESTRICTIONS:
 Only one parametr is allowed in call
 If two ellement vectors are provided, a probability of 1 ( 0-significace) is assigned
 MODIFICATION HISTORY:
  Created 26-March-2003 Gelu M. Nita


Put Breaks $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Breaks
 PURPOSE:
	Writes the indices where  breaks occur in the axes.
 CALLING SEQUENCE:
	PutBreaks, dxBreaks, dyBreaks
 OUTPUTS:
	dxBreaks, dyBreaks: arrays containig the indices where a
		break occur in the x- respectively y-axis.
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, April 91
 CALLS:


Put hoursminutesseconds flag $SSW/radio/ethz/idl/gen/puthms.pro
[Previous] [Next]
 NAME:
	Put hours/minutes/seconds flag
 PURPOSE:
	Sets the hms flag to 0 or 1
 CALLING SEQUENCE:
	PutHMS, flag
 INPUT:
	flag: 1 or 0
 SIDE EFFECT:
	Uses common block "BothDisplays"
 CALLS: ***
	PUTHMS
 MODIFICATION HISTORY:
	Craeted: Apr 91 A. Csillaghy, ETHZ


Put Image Sizes $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Image Sizes
 PURPOSE:
	Writes the variables defining the image size
 CALLING SEQUENCE:
	PutImageSizes, xPos, yPos, width, height scaleheight 
 INPUTS:
	xPos, yPos: the position of the origin  of the image
	width, height: the size of the image
	scaleheight: the height of the scale showing the contrasts
		of the color table.
 KEYWORD:
	PS: if set, the values for printing on a  page are stored
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, April 91
 CALLS:


Put Marks Mode $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Marks Mode
 PURPOSE:
	Stores the axis drawing mode:
		'automatic': the change between range and single pixel
			marking is done by the program
		'range': the program does alwas a range marking.
 CALLING SEQUENCE:
	PutMarksMode, xMarkMode, yMarkMode
INPUTS:
	xMarkMode, yMarkMode: 'automatic' or 'range'
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, October 93
 CALLS:


Put Miscellaneous $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Miscellaneous
 PURPOSE:
	Writes some information needed for printing
 CALLING SEQUENCE:
	PutMiscPS, encapsulated, landscape, reverse, blackFont
 INPUTS:
	encapsulated: if not zero, the image will be encapsulated
		with the command "\insertimage" or
		"\insertplot" in a TeX file.
	landscape: if not zero, the page is printed landscape
	reverse: if not zero low values are printed white, 
		high values black.
	blackFont: if not zero, the background color of the page
		is black.
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, April 91
	reducedFmt added in Jun 93, A.Cs
 CALLS:


Put Offsets $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Offsets
 PURPOSE:
	Writes the offsets of axes and image parts
 CALLING SEQUENCE:
	PutOffsets, axisOffset, imageOffset
 INPUTS:
	axisOffset: the offset between axis and image
	imageOffset: the offset between image parts (for
		non-regular axes.
 KEYWORD:
	PS: if set, the values for printing on a  page are stored
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, April 91
 CALLS:


put selection $SSW/radio/ethz/idl/ragview/datatype/init_selection.pro
[Previous] [Next]
 NAME:
	put selection
 PURPOSE:
  	Save the image "fname" in a file with ending
	".tmpenrad". 
	Delete an temporary image if necessary.
 CALLING SEQUENCE:
	Put_Selection, z, xAxis, yAxis, xMin, xMax, yMin, yMax
  INPUT ARGUMENTS:
	image: the 2D array
	xAxis, yAxis: the 1d arrays corresponding to the image
	xMin, xMax, yMin, yMax: the boundary of the image (in
		pixel number) when it was stored.
 KEYWORDS:
	FILESTATE: either "temporary" or "permanent"
		(default: "temporary")
	FNAME: ther file name. default: compression of !p.title
 SIDE EFFECT:
 	a file is written or/and replaced, in the directory specified
	by ENRAD_SAVE env. variable
 MODIFICATION:
	Created in may 1991 by A.Csillaghy, ETHZ.
	Modified for ENRAD_SAVE in Jan. 93, A.Cs.
 CALLS:


Put Window Size $SSW/radio/ethz/idl/ragview/datatype/init_display.pro
[Previous] [Next]
 NAME:
	Put Window Size
 PURPOSE:
 	Writes the variables defining the window size
 CALLING SEQUENCE:
	PutWinSize, xSize, ySize
 OUTPUTS:
	xSize, ySize: the size of the window or page
 KEYWORD:
	PS: if set, the size of the pageare stored
 RESTRICTION:
	Works only after initialization by calling Init_Display
 HISTORY
	Created: A.Csillaghy, ETHZ, April 91
 CALLS:


PUT_INDEX $SSW/radio/ovsa/idl/index/put_index.pro
[Previous] [Next]
 NAME:
     PUT_INDEX
 PURPOSE:
     Writes an INDEX segment from an INDEX structure to an .ARC file,
     overwriting the existing INDEX segment.
 CATEGORY:
     OVRO APC UTIL
 CALLING SEQUENCE:
     result = put_index(a,nrec,idx)
 INPUTS:
     a       The ASSOC variable associated with the .ARC file (as returned
                from a call to OPENARC()
     nrec    The total number of records in the file (as returned from a call
                to OPENARC()
     idx     The INDEX record structure, as returned from a call to DECODE()
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
     find_index, create_index, get_index_struct, getdata, putdata, idx_encode
 OUTPUTS:
     result  An indication of success [1] or failure [0].
 COMMENTS:
 CALLS: ***
	CREATE_INDEX, FIND_INDEX, GETDATA, IDX_ENCODE, PUTDATA
 CALLED BY:
	WRITE_TPSEG
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 04-Feb-2000 by Dale E. Gary


Put_Shift $SSW/radio/ethz/idl/ragview/datatype/put_shift.pro
[Previous] [Next]
 NAME:
	Put_Shift
 PURPOSE:
	Store the value of the shift between plots
 CATEGORY
	Data Management
 CALLING SEQUENCE:
	Put_Shift, value
 INPUT:
 	value: the shift between plots
 COMMON BLOCK:
	SelectionRetrieval, where the value is stored


PUT_STR_DP $SSW/radio/nrh/idl/dp_soft_rh/dpatch/put_str_dp.pro
[Previous] [Next]
 NAME: PUT_STR_DP
	
 PURPOSE:
       Avant l'appel a rh_dpatchfits_nrh, on regroupe dans
       une structure tous les arguments d'appel.

 CATEGORY:
	Traitement de fichiers NRH

 CALLING SEQUENCE:
	
 INPUTS:  
   tous les parametres pour rh_dpatchfits_nrh

 OUTPUTS:
   str_dp  : structure contenant ces parametres

 CALLS: ***
	DEF_STR_DP
 MODIFICATION HISTORY:
 01 oct    : ecrit par: A. Bouteille
 02 mar  5 : - ajout de sel_ant dans la liste d'entree pour eliminer les 
		  antennes a problemes.
 02 mar  7 : - ajout de crit_arret, larg_2 devient un fltarr(2).
	 27 : - ajout de rot_p .
 03 jun 24 : - ajout des parametres de recalibration
	      - ----------------------- complement du pave central (recentrage)
 03 sep 17 : - ajout de : 
		. i_corr_pos_ant (correction de position des antennes)
		. i_source_cal, h_cal
 04 sep 22 : - chgt de la recalibration manuelle : disparition de g_E2 etc,
		  introduction de phi_ew_ns, g_flag, g_amp, g_phi .
 05 fev  5 : - ajout de t_integ (temps d'integration prealable en sec) a la 
		  liste d'entree.
 05 fev  9 : - ajout de  phi_w_e  a la liste d'entree.
 06 mar  3 : - ajout de une dimension sipplementaire (2) a phi_ew_ns, phi_w_e,
		   g_amp, g_phi pour pouvoir corriger manuellement et simulta-
		   nement non polar et polar. En fait la seule modif dans ce 
		   programme est ce commentaire.
	      - ajout de  i_affich_lobe  et  i_mul_pol  a la liste d'entree.


PUTDATA $SSW/radio/ovsa/idl/util/putdata.pro
[Previous] [Next]
 NAME:
     PUTDATA
 PURPOSE:
     Writes a data record into an APC data file.  The file must already
     be open for writing, and attached to a variable with ASSOC().
 CATEGORY:
     OVRO APC UTIL
 CALLING SEQUENCE:
     result = putdata(rec_n,a,data)
 INPUTS:
     rec_n     the record number in which to place the desired data record
     a         the associated variable for the file, attached
                   with ASSOC(lun,intarr(1024))
     data      the properly formatted DATA record
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED:
 OUTPUTS:
     result    An indication of the success [1] or failure [0] of the write
                 operation
 COMMENTS:
 CALLED BY:
	PUT_INDEX
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 04-Feb-2000 by Dale Gary