[Previous]
[Next]
NAME:
GAINCOR
PURPOSE:
Correct one cycle of data for complex gain (amplitude, phase,
total power), averaging where necessary, and apportion data into
proper polarization bins. NB: BIGDATA is changed on output.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
smldata = gaincor(bigdata,pol,cfg,obseq,tcycle,gparm,geometry,uv[,/ndon])
INPUTS:
bigdata Data for one observing cycle, of size n channels by
ncycle. On output, this contains the corrected data.
pol A parallel byte array giving the polarization state
for each channel and each observing sequence entry.
The polarization is coded as 0 = RCP, 1 = LCP, 3 = LIN
cfg The CONFIG structure corresponding to the data.
obseq The OBSEQ structure corresponding to the data.
tcycle The start time of the current cycle
gparm The nonlinearity, attenuation factors, and offsets from a GCAL,
but restricted to the active antennas.
geometry The structure from NEWSCAN containing various delay parameters
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ndon A switch that causes GAINCOR to operate only on samples for
which the noise diode is ON. Typically, for data with both
noise diode on and off, GAINCOR would be called twice, once
for data with nd off, and again with nd on.
ROUTINES CALLED:
OUTPUTS:
smldata The output data array, formatted to a three-dimensional
array of channel number, frequency index, and pol index.
NB: If the data are all I poln, SMLDATA will still be
returned with R, L, and I, but the R and L entries
will be NaN. The calling routine has to deal with it.
uv An NANT x NANT array containing the u,v coordinates in
nsec. U is contained in the upper non-diagonal elements
and V is in the lower non-diagonal elements.
bigdata The corrected, but unaveraged data--just the corrected version
of the input BIGDATA array with the non-data words unchanged.
COMMENTS:
CALLS: ***
APPLY_BEPHZ, DELAY, UNIQ [1], UNIQ [2], UNIQ [3], W2L
CALLED BY:
ACALCHEK, ANALYZE [1], APCALCHEK, CTRCALCHEK, DLASCAN, FLAREMETER, HIGHRES, PCALCHEK
PNTCHEK, Read_DriftData, SATCALCHEK, SOLAID, SURVANAL, TPANALYZE
SIDE EFFECTS:
RESTRICTIONS:
The 20*DB bit is ignored, since it is not implemented and would
cause a complication from the "clean" method used. If the 20*DB
attenuation bit is implemented, this routine has to change.
MODIFICATION HISTORY:
Written 15-May-1998 by Dale E. Gary
21-Jun-1998 DG
Added removal of natural fringes. Very interim mode--lots of
cleanup to do to make it faster and more general.
24-Jun-1998 DG
Made it a little more general by reading the antenna locations
properly from the config segment.
22-Aug-1998 DG
Fixed problems with WHERE returning -1
23-Aug-1998 DG
Attenuation values are now in the data! Added code to apply them,
including results of latest GCAL. Fringe gain values are now in
the data! Added code to apply FG corrections, too.
10-Jan-1999 DG
Changed input argument name from HEADIN to GEOMETRY
16-Feb-1999 DG
Changed the way nonlinearity is applied--no nonlinearity is
allowed for correlated data, only total power data.
25-May-1999 DG
Major, major bug squashed that was causing serious errors. The
1 MHz frequency correction was not correctly applied. Finally,
the phases are correct and calibration can now proceed.
01-Jul-1999 DG
Changed call to GETTAU to reflect change in arguments. Substantive
change is passing in of cycle duration, which had been hardwired
to 10 s.
01-Nov-1999 DG
Make swapping of 46 and 56 channels conditional on date (1999.303)
to reflect change in CPC program FASAR. Also changed to return
argument UV, calculated in DELAY and BDOTS.
14-Nov-1999 DG
Rather extensive changes to remove dependence on 5-element data. It now
seems to work well with 2-element data. Should be general enough for
any combination of antennas.
26-Nov-1999 DG
Changed to reflect the new form of GPARM structure (introduced due
to creation of GAINPARM segment).
05-Feb-2000 DG
Several changes designed to speed up the routine, mainly in the fp loop.
Removed now unnecessary sin and cos lookup tables.
28-Mar-2000 DG
Fixed long-standing bug in which tau was referred to the middle of
a cycle, but evaluated relative to the beginning of the cycle. Fix
was to subtract cycledur/2 from TSAMPLE array.
29-Jul-2000 DG
Updated the documentation to reflect the arguments used--no change
to the code itself.
26-Sep-2000 DG
Major change--I realized that I could change the sign on the BCsin
component of the data, and then I no longer need to reverse the sign
of the BC baseline coordinates (which had been done in DECODE), nor
do I need different closure phase relations depending on MUX mode.
This simplifies a lot of things!
04-Nov-2000 DG
Return the corrected, but unaveraged, data in BIGDATA.
03-Apr-2001 DG
Slight changes related to flagging of POLN samples, during development
of GET_TIMING routine.
15-Dec-2001 DG
Added skip of phase correction if source name is SATELLITE
28-Mar-2002 DG
Fixed a bad bug related to change of number of DB words for 3-element
data, which failed to apply correct FG to 3-element data.
05-May-2002 DG
In April I put in the code for CHANPHZ, but made some errors. As of
now the CHANPHZ corrections appear to be applied correctly. The
CHANPHZ corrections come from DECODE, and are placed into the CONFIG
structure, so here it is just a matter of extracting those corrections
and applying them.
17-Dec-2002 DG
Disabled apply_bldir, to implement new scheme for phase calibration,
in which these things are applied externally in AMPHIT files.
03-Jan-2003 DG
After long investigation, the mystery of 135 degree phase closure is
solved--due to peculiarities of the Mk II backend. Armed with this
knowledge, baseline phases are corrected here so that all phases will
close to zero from now on.
29-Jan-2004 DG
The large flares of Oct-Nov 2003 showed a flaw in GAINCOR, due to two
problems: 1) The 20*dB attenuation bit was ignored and 2) when
implemented the Ant 1 data are wrong because the 20*dB bit does not
function in that antenna. An antenna-dependent correction is now
implemented.
14-Feb-2004 DG
Fixed apparently long-standing bug that gave wrong attenuation in
3-element mode for small dishes (except 124). The extraction of
attenuation setting G[I] from DB word was according to index--now
changed to IANTS[index].
20-Jul-2004 DG
We went to 3 fringe gain words in the data, for 7-element operation,
but this required a change in the FG code. In doing that, I discovered
a simpler way to extract both the fringe gain and db entries, so I made
that change to both.
26-Sep-2004 DG
Modified to handle pure dual-polarization feeds, which now allows use
of 2 channels, and somewhat simpler code to average data in each
polarization. The new code is activated for header.tls.yrday > 2004.231.
07-Oct-2004 DG
Standardize to 2 polarization channels for data after 2004.231, even
when obseq may observe only 1. Missing polarization is treated as NaN.
[Previous]
[Next]
NAME:
GAUSFIT
PURPOSE:
ACALCHEK support routine. Fits a gaussian curve to NDAT values of
Y at values of X. It is assumed that all values of Y have equal
error.
CATEGORY:
OVRO APC ACALCHEK SUPPORT ROUTINE
CALLING SEQUENCE:
gausfit,x,y,ndat,pk,fwhm,x0,nuse,rmserr
INPUTS:
x an array of size NDAT containing the spatial coordinates
corresponding to the measurements in Y. The FWHM is
returned in the same units as X.
y an array of size NDAT containing the amplitude measurements
corresponding to the spatial coordinates in X.
ndat the number of points in X and Y.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
pk the peak amplitude of the fitted gaussian.
fwhm the full-width at half maximum of the fitted gaussian
x0 the spatial coordinate of the center of the fitted gaussian.
nuse the number of points used in the fit. NUSE = 0 indicates
a bad fit.
rmserr the rms deviation of the points to the fitted gaussian.
COMMENTS:
Method is to linearize the problem so that the generic gaussian
function
Y = pk*exp(-C*(x-x0)^2) where C = 2.772589/fwhm^2
becomes
ln(Y) = ln(pk) - C*x^2 + 2*C*x*x0 - C*x0^2
This latter function is fit with a polynomial of degree 2
Y' = a + b*x + c*x^2
where
a = ln(pk) - C*x0^2
b = 2*C*x0
c = -C = -2.772589/fwhm^2
CALLS: ***
POLY_FIT
CALLED BY:
ACFIT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 17-Jun-1998 by Dale E. Gary
[Previous]
[Next]
NAME:
GAUSFIT_S
PURPOSE:
SATCALCHEK support routine. Fits a gaussian curve to NDAT values of
Y at values of X. It is assumed that all values of Y have equal
error.
CATEGORY:
OVRO APC ACALCHEK SUPPORT ROUTINE
CALLING SEQUENCE:
gausfit_s,x,y,ndat,pk,fwhm,x0,nuse,rmserr
INPUTS:
x an array of size NDAT containing the spatial coordinates
corresponding to the measurements in Y. The FWHM is
returned in the same units as X.
y an array of size NDAT containing the amplitude measurements
corresponding to the spatial coordinates in X.
ndat the number of points in X and Y.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
pk the peak amplitude of the fitted gaussian.
fwhm the full-width at half maximum of the fitted gaussian
x0 the spatial coordinate of the center of the fitted gaussian.
nuse the number of points used in the fit. NUSE = 0 indicates
a bad fit.
rmserr the rms deviation of the points to the fitted gaussian.
COMMENTS:
Method is to linearize the problem so that the generic gaussian
function
Y = pk*exp(-C*(x-x0)^2) where C = 2.772589/fwhm^2
becomes
ln(Y) = ln(pk) - C*x^2 + 2*C*x*x0 - C*x0^2
This latter function is fit with a polynomial of degree 2
Y' = a + b*x + c*x^2
where
a = ln(pk) - C*x0^2
b = 2*C*x0
c = -C = -2.772589/fwhm^2
CALLS: ***
POLY_FIT
CALLED BY:
SCFIT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 24-Jul-2005 by Dale E. Gary
Based on GAUSFIT routine--only minor differences reflecting different
search pattern
[Previous]
[Next]
NAME:
GAUSS_RH
PURPOSE:
Ajustement d'un profil entre les minimas de part et d'autre d'un
point d'indice imax par une gaussienne ou la somme d'une
gaussienne et d'une constante, une droite ou une parabole.
CATEGORY:
NRH1 Positions
CALLING SEQUENCE:
GAUSS_RH, xtab, ytab, imax, imin0, imin1, coeff, sigmaa, gsfctn, $
SIMPLE=simple, CONST=const, DROITE=droite, PARABOLE=parabole
INPUTS:
xtab Abscissa array (input)
ytab Ordinate array (input)
imax Index of the point around which local minima are searched for
KEYWORD PARAMETERS:
SIMPLE Fit Gaussian (default value)
CONST Fit Gaussian + constant
DROITE Fit Gaussian + straight line
PARABOLE Fit Gaussian + parabola
OUTPUTS:
imax Index of the highest ordinate value
imin0 Index of the minimum below point imax
imin1 Index of the minimum above point imax
coeff Coefficients of the fit (6 elem. array)
sigmaa Vector of standard deviations for the elements of coeff
gsfctn Array of computed Gaussian values
CALLS: ***
GAUSSFITKLK
CALLED BY:
DECOMP1D
COMMON BLOCKS:
Non
MODIFICATION HISTORY: (bonmartin@obspm.fr)
18/11/98 Adapte du logiciel XHELIO (KLK)
12/04/99 Redefinition de la procedure de recherche: chercher les
minima locaux autour du point no. imax dont l'exces par
rapport a la moyenne glissante est maximum (routines
SIGRMN.PRO, RUNRMN_RH.PRO);
ajuster une fonction en s'appuyant sur un intervalle
symetrique par rapport a ce point
[Previous]
[Next]
NAME:
GAUSSCST_FUNCT
PURPOSE:
EVALUATE THE SUM OF A GAUSSIAN FUNCTION AND A CONSTANT
AND OPTIONALLY RETURN THE VALUE OF ITS PARTIAL DERIVATIVES.
NORMALLY, THIS FUNCTION IS USED BY CURVEFIT TO FIT THE
SUM OF A LINE AND A VARYING BACKGROUND TO ACTUAL DATA.
CATEGORY:
NRH1 POSITIONS
CALLING SEQUENCE:
FUNCT,X,A,F,PDER
INPUTS:
X = VALUES OF INDEPENDENT VARIABLE.
A = PARAMETERS OF EQUATION DESCRIBED BELOW.
OUTPUTS:
F = VALUE OF FUNCTION AT EACH X(I).
OPTIONAL OUTPUT PARAMETERS:
PDER = (N_ELEMENTS(X),5) ARRAY CONTAINING THE
PARTIAL DERIVATIVES. P(I,J) = DERIVATIVE
AT ITH POINT W/RESPECT TO JTH PARAMETER.
CALLS: ***
GAUSSFITKLK, GAUSSLIN_FUNCT, GAUSSPARAB_FUNCT, M_CURVEFIT
CALLED BY:
GAUSSFIT [3], GAUSSLIN_FUNCT, GAUSSPARAB_FUNCT
COMMON BLOCKS:
NONE.
SIDE EFFECTS:
NONE.
RESTRICTIONS:
NONE.
PROCEDURE:
F = A(0)*EXP(-Z^2/2) + A(3)
Z = (X-A(1))/A(2)
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 adapte des routines de RSI par KLK (Ludwig Klein)
[Previous]
[Next]
NAME:
GAUSSFIT
PURPOSE:
Fit the equation y=f(x) where:
F(x) = A0*EXP(-z^2/2) + A3 + A4*x + A5*x^2
and
z=(x-A1)/A2
A0 = height of exp, A1 = center of exp, A2 = sigma (the width).
A3 = constant term, A4 = linear term, A5 = quadratic term.
The parameters A0, A1, A2, A3 are estimated and then CURVEFIT is
called.
Modif KLK 1/2/1996: Ajuster, selon le mot cle, une Gaussienne, sa somme
avec une constante, une droite ou une parabole.
CATEGORY:
NRH1 Positions
CALLING SEQUENCE:
Result = GAUSSFIT(X, Y [, A])
INPUTS:
X: The independent variable. X must be a vector.
Y: The dependent variable. Y must have the same number of points
as X.
OUTPUTS:
The fitted function is returned.
OPTIONAL OUTPUT PARAMETERS:
A: The coefficients of the fit. A is a six-element vector as
described under PURPOSE.
CALLS: ***
GAUSSCST_FUNCT, GAUSSFITKLK, GAUSSLIN_FUNCT, GAUSSPARAB_FUNCT, M_CURVEFIT
CALLED BY:
ADD_SCATTER_DRM, ANAL_BCS_PHA, ANAL_STIMS, AN_NIMCP_1_2, AN_NIMCP_AVG, CAL_SHER
CDS_LINEFIT_WRAP, DECOMPOSE_BATSE_DRM, DSPEXP, Enorm_drm, FE25_BSC_TEMP, Fitting
HISTOGAUSS, HXT_BACK, HXT_CAL_FIX [1], HXT_CAL_FIX [2], H_VS_TIME, STOKESFIT
XSM_PREP, exp_scale min_exp max_exp [1], find_grid, fit_pha
get_linearity sig e_min e_max, ltc, read_ltc file
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
The peak or minimum of the Gaussian must be the largest
point in the Y vector.
PROCEDURE:
If the (MAX-AVG) of Y is larger than (AVG-MIN) then it is assumed
that the line is an emission line, otherwise it is assumed there
is an absorbtion line. The estimated center is the MAX or MIN
element. The height is (MAX-AVG) or (AVG-MIN) respectively.
The width is found by searching out from the extrema until
a point is found less than the 1/e value.
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 adapte des routines de RSI par KLK (Ludwig Klein)
[Previous]
[Next]
NAME:
GAUSSLIN_FUNCT
PURPOSE:
EVALUATE THE SUM OF A GAUSSIAN AND A STRAIGHT LINE
AND OPTIONALLY RETURN THE VALUE OF ITS PARTIAL DERIVATIVES.
NORMALLY, THIS FUNCTION IS USED BY CURVEFIT TO FIT THE
SUM OF A LINE AND A VARYING BACKGROUND TO ACTUAL DATA.
CATEGORY:
NRH1 POSITIONS
CALLING SEQUENCE:
FUNCT,X,A,F,PDER
INPUTS:
X = VALUES OF INDEPENDENT VARIABLE.
A = PARAMETERS OF EQUATION DESCRIBED BELOW.
OUTPUTS:
F = VALUE OF FUNCTION AT EACH X(I).
OPTIONAL OUTPUT PARAMETERS:
PDER = (N_ELEMENTS(X),5) ARRAY CONTAINING THE
PARTIAL DERIVATIVES. P(I,J) = DERIVATIVE
AT ITH POINT W/RESPECT TO JTH PARAMETER.
CALLS: ***
GAUSSCST_FUNCT, GAUSSFITKLK, GAUSSPARAB_FUNCT, M_CURVEFIT
CALLED BY:
GAUSSCST_FUNCT, GAUSSFIT [3], GAUSSPARAB_FUNCT
COMMON BLOCKS:
NONE.
SIDE EFFECTS:
NONE.
RESTRICTIONS:
NONE.
PROCEDURE:
F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
Z = (X-A(1))/A(2)
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 adapte des routines de RSI par KLK (Ludwig Klein)
[Previous]
[Next]
NAME:
GAUSSPARAB_FUNCT
PURPOSE:
EVALUATE THE SUM OF A GAUSSIAN AND A 2ND ORDER POLYNOMIAL
AND OPTIONALLY RETURN THE VALUE OF IT'S PARTIAL DERIVATIVES.
NORMALLY, THIS FUNCTION IS USED BY CURVEFIT TO FIT THE
SUM OF A LINE AND A VARYING BACKGROUND TO ACTUAL DATA.
CATEGORY:
NRH1 POSITIONS
CALLING SEQUENCE:
FUNCT,X,A,F,PDER
INPUTS:
X = VALUES OF INDEPENDENT VARIABLE.
A = PARAMETERS OF EQUATION DESCRIBED BELOW.
OUTPUTS:
F = VALUE OF FUNCTION AT EACH X(I).
OPTIONAL OUTPUT PARAMETERS:
PDER = (N_ELEMENTS(X),6) ARRAY CONTAINING THE
PARTIAL DERIVATIVES. P(I,J) = DERIVATIVE
AT ITH POINT W/RESPECT TO JTH PARAMETER.
CALLS: ***
GAUSSCST_FUNCT, GAUSSFITKLK, GAUSSLIN_FUNCT, M_CURVEFIT
CALLED BY:
GAUSSCST_FUNCT, GAUSSFIT [3], GAUSSLIN_FUNCT
COMMON BLOCKS:
NONE.
SIDE EFFECTS:
NONE.
RESTRICTIONS:
NONE.
PROCEDURE:
F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
Z = (X-A(1))/A(2)
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 adapte des routines de RSI par KLK (Ludwig Klein)
[Previous]
[Next]
NAME:
GAUSSSIM_FUNCT
PURPOSE:
EVALUATE A GAUSSIAN
AND OPTIONALLY RETURN THE VALUE OF ITS PARTIAL DERIVATIVES.
NORMALLY, THIS FUNCTION IS USED BY CURVEFIT TO FIT THE
SUM OF A LINE AND A VARYING BACKGROUND TO ACTUAL DATA.
CATEGORY:
NRH1 POSITIONS
CALLING SEQUENCE:
FUNCT,X,A,F,PDER
INPUTS:
X = VALUES OF INDEPENDENT VARIABLE.
A = PARAMETERS OF EQUATION DESCRIBED BELOW.
OUTPUTS:
F = VALUE OF FUNCTION AT EACH X(I).
OPTIONAL OUTPUT PARAMETERS:
PDER = (N_ELEMENTS(X),5) ARRAY CONTAINING THE
PARTIAL DERIVATIVES. P(I,J) = DERIVATIVE
AT ITH POINT W/RESPECT TO JTH PARAMETER.
COMMON BLOCKS:
NONE.
SIDE EFFECTS:
NONE.
RESTRICTIONS:
NONE.
PROCEDURE:
F = A(0)*EXP(-Z^2/2) + A(3)
Z = (X-A(1))/A(2)
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 Adapte des routines de RSI par KLK (Ludwig KLEIN)
[Previous]
[Next]
NAME:
GCALCHEK
PURPOSE:
Main routine to analyze gain calibration data. Responds to
scans of type GCAL (scan code 4) or TEST DATA (scan code 1).
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
gcalchek[,filename][,hrec | ,after=after][,gains][,debug][,/cmdfile]
INPUTS:
filename the name of the file containing GCAL data. If
omitted, the file DAILY.ARC in directory
!DEFAULTS.WORKDIR is assumed.
hrec the record number of the GCAL 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 GCAL 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>\GCAL.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, lasthrec, newscan, getdata, tl_decode, decode, gcfit, nlfit,
write_off, write_gcparm, write_gainrec
OUTPUTS:
gains optional output parameter to return the receiver, noise
diode, and rms spectra in an array of size GAINS(3,NANT,86)
or GAINS(3,NANT,172), depending on the epoch
COMMENTS:
Starting on 2003.310 (5-Nov-2003), the GAINCAL consists of both
RCP and LCP measurements. This routine should work for epochs both
before and after this.
CALLS: ***
AVG [1], AVG [2], GCFIT, GETDATA, LASTHREC, NEWSCAN, NLFIT, OPENARC, PLOT_GCPARM
PROGMETER, TL_DECODE, WRITE_GAINREC, WRITE_GCPARM [1], WRITE_GCPARM [2], WRITE_OFF
CALLED BY:
WATCHER
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 17-Jan-1998 by Dale Gary
08-Mar-1998 DG
Updated to implement a somewhat different scheme. The
nonlinearity parameter is determined only from 0 and 5 DB
data, in routine NLFIT.
15-Mar-1998 DG
Added cmdfile switch for unattended operation.
18-Jun-1998 DG
Added koff = 2 as number of samples before DOSEQ starts.
Without this, we were off by one harmonic.
21-Jun-1998 DG
Changed from reading a(rec) to getdata(rec,a) throughout,
so that routine should work under UNIX.
25-Aug-1998 DG
Added check for new TRAJECTORY segments (but contents ignored
for now.)
23-Feb-1999 DG
Convert to use NEWSCAN.
07-Apr-1999 DG
Implement early form of GCAL.DIAG file, to write out diagnostics
for use by DIAGNOSE routine.
01-Dec-1999 DG
Changed to write the GPARM.REC file (and write the gain parameter
segment directly into the .ARC file if appropriate). This reflects
changes in WRITE_GAINREC.PRO.
11-Jan-2000 DG
Eliminate hardwired directory
16-Dec-2000 DG
Added optional argument, GAINS that, if present, causes GCALCHEK
to skip all output and return the receiver and noise diode values
to the calling program instead. This will be used to go through
a large number of files and accumulate receiver and noise diode
statistics.
11-Mar-2001 DG
Made sin/cos channel offsets consistent by enforcing that all AB
channels have same offset, all BC channels, etc.
06-Nov-2003 DG
Several changes to make it work for new RCP/LCP measurements. The
gain parameters are calculated only for RCP (as before), but the
GAINS array now contains both polarizations.
09-Jan-2004 DG
Slight changes to plot_gcparm and gcfit calls to use polarization
keyword.
18-Jul-2004 DG
Significant changes to use NAN as non-data values instead of 0 or -1.
23-Aug-2005 DG
Fix bug handling older GCAL data (due to GCSTAT2 undefined).
[Previous]
[Next]
NAME:
GCFIT
PURPOSE:
Routine to perform gain calibration fitting of a single model
of nonlinearity to each TP channel and return the residuals and
corresponding gain parameters.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
gcparm = gcfit(gcdata,gcflag,nlparm,offsets[,tls][,/refine_off][,msglun=msglun][,pol=pol])
INPUTS:
gcdata the GCAL data array, of size (2,7,NANT,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 number of total power channels,
and the last index is the frequency
gcflag a corresponding array containing 0 where the data are
bad and 1 where the data are good.
nlparm an NANT-element array of nonlinearity parameters, one for
each total power channel.
offsets a NANT-element array of channel offsets, one for each
total power channel.
tls a time/label structure containing the date/time for use
in the PLD file. Not needed when refine_off switch
is used.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
refine_off a switch. If set, new, updated values for the offsets
are determined and the routine returns early.
msglun the logical unit number of GCAL.MSG. If nonzero, it
indicates that the routine was called from a command
file, so issue no modal messages, and print any error
messages to msglun.
pol a single char string, either 'r' or 'l' depending on which
polarization is being fit.
ROUTINES CALLED:
OUTPUTS:
gcparm an array of size 6 by 5 containing the GCAL parameters,
one row for each total power channel. The seven
parameters are:
index contents
0 the value of the nonlinearity parameter
1 the atten. factor rel. to nominal for 5 DB
2 the atten. factor rel. to nominal for 10 DB
3 the atten. factor rel. to nominal for 20 DB
4 the effective noise diode value rel. to nominal 500
5 the residual for the fit
COMMENTS:
This routine is independent of number of antennas
CALLS: ***
FLAGPAIR, GET_ND_EFF, OVSA_PLOTERR
CALLED BY:
GCALCHEK
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 19-Jan-1998 by Dale E. Gary
23-Jan-1998 DG
Changed to apply offsets inside the routine
10-Mar-1998 DG
Cleaned up details and debugging statements. This routine is
now close to production quality. Made it independent of number
of antennas. Also implemented /REFINE_OFF keyword.
14-Mar-1998 DG
Reduced size of GCPARM to (6,nant)
15-Mar-1998 DG
Added msglun switch for unattended operation.
16-Mar-1998 JL
Added creation of PLD file.
21-Jul-1999 DG
Changed to return the effective noise diode value in GCPARM(4,*)
11-Jan-2000 DG
Eliminated hardwired directory locations.
26-Jun-2000 DG
Fixed plot to work with more than 5 antennas
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.
16-Dec-2000 DG
Added IFonly keyword, to return only the IF and ND levels.
09-Jan-2004 DG
Added POL keyword and writing of two different GCAL_DIAG files
according to which polarization is set.
18-Jul-2004 DG
Significant rewrite to utilize NAN instead of 0 or -1 as non-data
values. Chief desired result is to eliminate 0 in receiver and
ND spectra.
02-Oct-2006 DG
Fixed a bug, probably introduced two years ago when NAN was
implemented. When the missing values were transferred from 10 db
to 5 db to 0 db, Nan values from, say, 0 db data were not replaced
with good data from 10 db or 5 db. This meant that saturated values
in the 0 db data were "missing" from the gain calibration.
[Previous]
[Next]
NAME:
General_Menu
PURPOSE:
Menu wich decides what kind of display to use
("AnMenu" or "WMenu") for a menu. In the case, of
the vt-type terminals, if there is not enough place for all
the entries on the screen, they will be displayed only when
explicitely wanted.
WARNING: This routine is obsolete. It has been replaced by
XChoice in Ragview/Mdisp. The routine does not work
properly on Solaris/IDL 5.1 because of WMenu.
CALLING SEQUENCE:
choice = General_Menu( texts, title )
INPUT ARGUMENTS:
texts: an array of strings
title: a scalar string
OUTPUT ARGUMENT:
choice: The number of the entry selected + 1 (they are
ranged from 1 to the number of elements).
KEYWORD:
OPAQUE: an array of the same dimension as texts,
containing boolean values. If a value is one,
the corresponding array entry will NOT be
displayed.
/NO_CLEAR: If set, on VT terminals, the graphic display
is not erased and the menu is superimposed.
SIDE EFFECT:
On X-Windows, a window is opened.
On VT Terminals, the screen is cleared
CALLS: ***
CLEAR_SCREEN [1], CLEAR_SCREEN [2], GET_DFONT [1], GET_DFONT [2], ethz_XCHOICE
CALLED BY:
Change_Selection, Customize_1D, Display 2D Image, ETHZ_Background, FILEMENU
Files_Handling [1], Files_Handling [2], Fitting, Fourrier, Histogram Facility
Initialize Selection [2], Modif_Axis, Modif_PS, Modification of 1D Plots
Modify Image Pixels, Modify Titles, Onedimensional files handling
Overplot Texts, PrintInterface, RAG Exponentiation, RAG Log, Selection delete
Symbols, Texts_2D, Tv_Zoom, edit [1], edit [2], put selection
MODIFICATION HISTORY:
Created in June 1991 by A.Csillaghy
Institute of Astronomy, ETH Zurich
Extended in September 1991 for Megamenus, A.Cs.
Extended in Feb 95 for x megamenus ... A.Cs.
The Part with ANMenu is not supported any more.
(ANMENU is not available any more!)
June 98, csillag@ssl.berkeley.edu
Obsolete routine in October 1998. ACs, WMenu replaced by
XChoice for small menus
Xchoice changed to ETHZ_XChoice 12/9/98 ACs
[Previous]
[Next]
NAME:
General_Menu
PURPOSE:
Menu wich decides what kind of display to use
("AnMenu" or "WMenu") for a menu. In the case, of
the vt-type terminals, if there is not enough place for all
the entries on the screen, they will be displayed only when
explicitely wanted.
CALLING SEQUENCE:
choice = General_Menu( texts, title )
INPUT ARGUMENTS:
texts: an array of strings
title: a scalar string
OUTPUT ARGUMENT:
choice: The number of the entry selected + 1 (they are
ranged from 1 to the number of elements).
KEYWORD:
OPAQUE: an array of the same dimension as texts,
containing boolean values. If a value is one,
the corresponding array entry will NOT be
displayed.
/NO_CLEAR: If set, on VT terminals, the graphic display
is not erased and the menu is superimposed.
SIDE EFFECT:
On X-Windows, a window is opened.
On VT Terminals, the screen is cleared
CALLED BY:
Change_Selection, Customize_1D, Display 2D Image, ETHZ_Background, FILEMENU
Files_Handling [1], Files_Handling [2], Fitting, Fourrier, Histogram Facility
Initialize Selection [2], Modif_Axis, Modif_PS, Modification of 1D Plots
Modify Image Pixels, Modify Titles, Onedimensional files handling
Overplot Texts, PrintInterface, RAG Exponentiation, RAG Log, Selection delete
Symbols, Texts_2D, Tv_Zoom, edit [1], edit [2], put selection
MODIFICATION HISTORY:
Created in June 1991 by A.Csillaghy
Institute of Astronomy, ETH Zurich
Extended in September 1991 for Megamenus, A.Cs.
Extended in Feb 95 for x megamenus ... A.Cs.
The Part with ANMenu is not supported any more.
(ANMENU is not available any more!)
June 98, csillag@ssl.berkeley.edu
[Previous]
[Next]
NAME:
Get Breaks
PURPOSE:
Reads the indices where breaks occur in the axex.
CALLING SEQUENCE:
GetBreaks, 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:
[Previous]
[Next]
NAME:
Get HMS Flag
PURPOSE:
Returns 1 if the hours/minute/second flag is set, else 0
CALLING SEQUENCE :
result = GetHMS()
RESULT OF FUNCTION:
1 if x axis will be displayed in h/m/s by enrad
0 otherwise
SIDE EFFECT:
The common block BothDisplays is used.
CALLS: ***
GETHMS
MODIFICATION HISTORY:
Created in June 91, A.Csillaghy, ETHZ
[Previous]
[Next]
NAME:
Get Image Sizes
PURPOSE:
Reads the variables defining the image size
CALLING SEQUENCE:
GetImageSizes, xPos, yPos, width, height scaleheight
OUTPUTS:
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 in the
variables (in cm)
RESTRICTION:
Works only after initialization by calling Init_Display
HISTORY
Created: A.Csillaghy, ETHZ, April 91
CALLS:
[Previous]
[Next]
NAME:
Get Marks Mode
PURPOSE:
Reads the mode in which the axes are to be drawn:
'automatic': the change between range and single pixel
marking is done by the program
'range': the program does alwas a range marking.
CALLING SEQUENCE:
GetMarksMode, xMarkMode, yMarkMode
OUTPUTS:
xMarksMode, yMarksMode: 'automatic' or 'range'
RESTRICTION:
Works only after initialization by calling Init_Display
HISTORY
Created: A.Csillaghy, ETHZ, October 93
CALLS:
[Previous]
[Next]
NAME:
Get Miscellaneous
PURPOSE:
Reads som information needed for printing
CALLING SEQUENCE:
GetMiscPS, encapsulated, landscape, reverse, blackFont
OUTPUTS:
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
CALLS:
[Previous]
[Next]
NAME:
Get Names
PURPOSE:
Returns an array of strings containing the names of
the plots stored in the plot table, or in the selection.
CALLING SEQUENCE:
result = Get_Names()
KEYWORD:
SELECTION: If set only the names in the selection list ; ; are returned.
CALLS:
[Previous]
[Next]
NAME:
Get Offsets
PURPOSE:
Reads the offsets of axes and image parts
CALLING SEQUENCE:
GetOffsets, axisOffset, imageOffset
OUTPUTS:
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:
[Previous]
[Next]
NAME:
Get Window Number
PURPOSE:
checks for the number of the window in which to
display the next data set
OUTPUT:
Then window number
RESTRICTIONS
Works in the framework of the window manager of RAGView.
The procedure Init_Selection must be called first!
AUTHOR:
A. Csillaghy, csillag@astro.phys.ethz.ch
CALLS:
[Previous]
[Next]
NAME:
Get Window Size
PURPOSE:
Reads the variables defining the window size
CALLING SEQUENCE:
GetWinSize, xSize, ySize
OUTPUTS:
xSize, ySize: the size of the window or page
KEYWORD:
PS: if set, the size of the page is in the variables
RESTRICTION:
Works only after initialization by calling Init_Display
HISTORY
Created: A.Csillaghy, ETHZ, April 91
CALLS:
[Previous]
[Next]
NAME:
GET_AMPCAL_STRUCT
PURPOSE:
Define structure necessary for holding reference amplitude calibration
information from the AMPCAL segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
ampcal = get_ampcal_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
ampcal an empty amplitude calibration structure
COMMENTS:
CALLS: ***
GET_TL_STRUCT
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 27-Jul-1999 by Dale E. Gary
20-Feb-2006 DG
Added a third index to FACTORS and RMS to account for both R and L
data--a result of all dishes having R and L.
[Previous]
[Next]
NAME:
GET_BLCOR
PURPOSE:
Returns the latest baseline correction (values are just entered
into this routine as they are updated).
CATEGORY:
OVSA APC INTERFEROMETRY
CALLING SEQUENCE:
blcor = get_blcor()
INPUTS:
NONE
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
blcor a 3x8-element array containing the three-axis baseline
corrections, in nsec as X,Y,Z, for eight antennas.
Antennas that do not yet exist have zeroes.
COMMENTS:
CALLED BY:
DECODE, OVSA_UV
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 06-Jul-2000 by Dale E. Gary
26-Dec-2002 DG
Changed original BLCOR value for antenna 7 because this
huge offset was converted to a position change for antenna 7
and then entered into the FASAR (CPC) program. The header
values for antenna 7 prior to 27 Dec 2002 (2002.361) will be
overridden in DECODE.
30-Aug-2004 DG
Entered initial, rough determination of antenna 8 BLCOR
06-Sep-2004 DG
Final values for Ant 8, plus a slight adjustment to Ant 2.
Antenna 8 position in header is now 1035728, -91609, -8708,
which will be overridden in DECODE for dates prior to
06 Sep 2004 (2004.249).
07-Sep-2004 DG
Tweaked baseline correction for Ant 7, and Ant 2, based on
yesterday's very high quality observations.
[Previous]
[Next]
NAME:
GET_CALEPH
PURPOSE:
Return precessed coordinates for calibrators, as found in
the file !DEFAULTS.EPHEMDIR+COORDS.FTH.
CATEGORY:
OVRO APC EPHEMERIS
CALLING SEQUENCE:
cal = get_caleph([file=file])
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
file Optional file name for COORDS.FTH input file. If omitted,
!DEFAULTS.EPHEMDIR+'COORDS.FTH' is assumed.
ROUTINES CALLED:
get_ovcal_struct
OUTPUTS:
cal A calibrator ephemeris structure of the form:
{EPOCH: STRUCTURE ; Epoch and other info from file
{YR: INT ; Year of the calibrator coords
DOY: INT ; Day of year of coords
SEC: INT } ; Time of coords
NCAL: INT ; Number of calibrator sources
CALEPH: STRUCTURE ; Array of ephemeris info
{NAME: STRING ; Name of calibrator (A8)
RA: LONG ; Right ascen. of calibrator [0.1 mdeg]
DEC: LONG} ; Declination of calibrator [0.1 mdeg]
}
COMMENTS:
Requires the file !DEFAULTS.EPHEMDIR+'COORDS.FTH', which is the file
created by PRECESS and sent to the CPC on a daily basis.
CALLS: ***
DAYOFYR [1], GET_OVCAL_STRUCT, dayofyr [2]
CALLED BY:
MAKE_EPHEM, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
30-Jan-1999 DG
Slight change to use GET_CAL_STRUCT() routine
07-Feb-1999 DG
Added FILE keyword argument
25-Nov-1999 DG
Updated to agree with Epoch defn in GPARM structure
11-Jan-2000 DG
Eliminated hardwired directory locations
23-Jul-2003 DG
Changes GET_CAL_STRUCT to GET_OVCAL_STRUCT to avoid conflict
with routine of the same name in LASCO tree.
[Previous]
[Next]
NAME:
GET_CFG_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
config segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
cfg = get_cfg_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
cfg an empty config segment structure
COMMENTS:
CALLED BY:
DECODE
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 13-Jan-1998 by Dale Gary
24-Jun-1998 DG
Added bx, by, bz and htdiff entries to structure.
16-Jul-2000 DG
Added MUXARR entry to structure
13-Jan-2001 DG
Added MUX sequence decoding
15-Jan-2002 DG
Added HACORR structure
04-Apr-2002 DG
Added CHANPHZ array
07-Nov-2002 DG
Added BLDIR array
[Previous]
[Next]
NAME:
GET_CYCLE
PURPOSE:
Returns one cycle of data, and the time corresponding to the beginning
of the cycle. This routine can be called repeatedly to return a
sequence of cycles of data, as long as the DATA array is not modified
between calls.
CATEGORY:
OVRO APC DATA
CALLING SEQUENCE:
cycle = get_cycle(a,data,currec,header,obseq,cfg,tcycle)
INPUTS:
a A file associated variable as returned from OPENARC.
data Must be a named variable. On input, DATA contains the data
that have been read during a previous call to GET_CYCLE().
On the first call, DATA should be undefined (i.e. either
not previously referenced, or use DELVAR,DATA before the
first call).
header The HEADER structure corresponding to the data.
obseq The OBSEQ structure corresponding to the data.
cfg The CONFIG structure corresponding to the data.
tcycle Must be a named variable. On input, TCYCLE contains the
start time [msec] returned by a previous call to GET_CYCLE().
On the first call, TCYCLE may be anything, or undefined.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
getdata, tl_decode
OUTPUTS:
cycle Contains one cycle of data as a simple, linear array of
samples of length HEADER.NWS*OBSEQ.NX, where HEADER.NWS
is the number of words in a sample and OBSEQ.NX is the
number of samples in an observing sequence. If no more
data can be read due to a zero record (indicating that the
file is still being written), CYCLE = 0. If no more data
can be read due to reading a non-data record, a partial cycle
of data may be returned. If a non-data record is read,
the segmentcode of the record is returned.
data Must be a named variable. On output, DATA contains the data
that have been read during the call to GET_CYCLE(), but not
yet placed into the CYCLE output variable. On the first
call, DATA should be undefined (i.e. either not previously
referenced, or use DELVAR,DATA before the first call).
tcycle Must be a named variable. On output, TCYCLE contains the
start time [msec] of the cycle returned in CYCLE. If CYCLE = 0,
TCYCLE should be ignored.
COMMENTS:
Do not change the contents of DATA or TCYCLE between calls to GET_CYCLE().
CALLS: ***
GETDATA, TL_DECODE
CALLED BY:
ACALCHEK, ANALYZE [1], CTRCALCHEK, DLASCAN, FLAREMETER, HIGHRES, PNTCHEK
Read_DriftData, SATCALCHEK, SOLAID, SURVANAL, TOP20, TPANALYZE
SIDE EFFECTS:
RESTRICTIONS:
This routine is going to break if the DATA segment is broken up by
non-data segments (e.g. Engineering segments)
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
20-Jan-1999 DG
Added code to indicate that a zero record has been read (i.e., the file
is still being actively written to). The calling routine can wait for
some time, then try again.
15-Mar-1999 DG
Added detection of EOS segment, in which case the routine returns a -1.
14-May-1999 DG
Change EOS detection to more general returning of segment code.
Major rewrite to solve some problems:
1. The cycle time was 200 ms off due to not taking KOFF into account
2. GET_CYCLE could not find the start of a cycle unless it was
called with the first record in the scan. This has been relaxed
so that it can be called with any record.
22-Jan-2000 DG
First attempt to make the code work over a day change within a scan
28-Mar-2000 DG
Made change to account for newly determined timing issue--the time/label
field has a time that is one sample "late" since it is the time
corresponding to the end of acquisition of the first sample. Variable
NSOFF takes care of this. Also fixed a round-off problem introduced
in my code to account for a day change--amounted to 2 msec.
11-Mar-2001 DG
Fixed long-standing bug that caused "dead reckoning" in start from middle
of a scan to fail if the start was somewhere within the first cycle.
08-Feb-2002 DG
GET_CYCLE failed if the first record after a TRAJECTORY was not a data
record. Added a check for this. Note that first call to GET_CYCLE
should now be WHILE (n_elements(data) eq 0) DO get_cycle,...
03-Mar-2002 DG
FLAREMETER was getting into an infinite loop. Added code to return an
EOF segment code when a file read error occurs.
[Previous]
[Next]
NAME:
GET_DAILY_STRUCT
PURPOSE:
Define structure used for holding the results of a DAILY phase
calibration.
CATEGORY:
OVRO APC STRUCT
CALLING SEQUENCE:
dailyphz = get_daily_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
dailyphz an empty reference calibration structure
COMMENTS:
This structure requires the use of a pointer to the AMF array,
because the array size may vary and structure definitions
must be static. To use, always free the existing pointer and
then create a new one. For example:
ptr_free,dailyphz.pamf
dailyphz.pamf = ptr_new(amf)
This will ensure that the memory area pointed to by the
existing pointer is freed back to the memory pool.
CALLS: ***
GET_TL_STRUCT
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 08-Jun-2000 by Dale E. Gary
16-Jul-2000 DG
Added the POFF array to the structure.
[Previous]
[Next]
NAME:
GET_DELAYBITS
PURPOSE:
Returns delay bit normalization factors for the antennas used, for
this data record.
CATEGORY:
OVRO APC DATA CALIBRATION
CALLING SEQUENCE:
dlafac = get_delaybits(data)
INPUTS:
data The data record for which to return the normalization factors
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
getdata, tl_decode
OUTPUTS:
dlafac The normalization factors for each antenna for the set
delays in this data record
COMMENTS:
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 21-May-1999 by Dale E. Gary
[Previous]
[Next]
NAME:
GET_DUT
PURPOSE:
Return the time difference DUT = UT1-UTC for a given Julian date.
CATEGORY:
OVRO APC EPHEMERIS
CALLING SEQUENCE:
dut = get_dut(jd)
INPUTS:
jd Julian date of the day for which the DUT is wanted.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
dut UT1-UTC [msec]
COMMENTS:
Requires the file !DEFAULTS.EPHEMIR+'DUT.USN', which is to be FTP'd
weekly from ftp://maia.usno.navy.mil/ser7/ser7.dat. This is
done with the !DEFAULTS.CMDDIR+'NEWDUT.BAT' file.
CALLED BY:
MAKE_EPHEM
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
11-Jan-2000 DG
Eliminated hardwired directory locations
[Previous]
[Next]
NAME:
GET_ENDTYP
PURPOSE:
Returns a string identifying a reason for an end of scan,
as indicated by the last byte of an EOS recod.
CATEGORY:
OVRO APC DATA-ANALYSIS
CALLING SEQUENCE:
endtypstr = get_endtyp(endcode)
INPUTS:
endcode the end code as read from the last byte
of an EOS record.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
endtypstr a string giving the reason for ending the scan, or the
string 'UNKNOWN' if the endcode is zero, or 'UNDEFINED'
if the endcode is invalid.
COMMENTS:
CALLED BY:
GET_SEGMENTS
SIDE EFFECTS:
RESTRICTIONS:
SEE ALSO:
GET_SCNTYP, GET_SEGTYP
MODIFICATION HISTORY:
Written 17-Mar-1999 by Dale E. Gary
[Previous]
[Next]
NAME:
GET_EPH_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
ephemeris segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
ephem = get_eph_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
ephem an empty EPHEM segment structure
COMMENTS:
CALLS: ***
GET_LUN_STRUCT, GET_OVCAL_STRUCT, GET_REGN_STRUCT, GET_SOL_STRUCT
CALLED BY:
DECODE, NEWSCAN, SURVANAL
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 30-Jan-1999 by Dale Gary
23-Jul-2003 DG
Changes GET_CAL_STRUCT to GET_OVCAL_STRUCT to avoid conflict
with routine of the same name in LASCO tree.
[Previous]
[Next]
NAME:
GET_GPARM_STRUCT
PURPOSE:
Define structure necessary for holding gain parameter calibration information
from the GAINPARM segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
gainparm = get_gparm_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
gainparm an empty gain parameter structure
COMMENTS:
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 24-Nov-1999 by Dale E. Gary
[Previous]
[Next]
NAME:
GET_HEAD_STRUCT
PURPOSE:
Define structures necessary for holding information from OVRO APC
headers. This routine is just a bookkeeping convenience--it should
be used only once to create the header structure at the start of
a session. If an empty header is needed later, it can more easily
be obtained by the statement: header = {header}
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
header = get_head_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
header an empty header record structure
COMMENTS:
CALLS: ***
GET_TL_STRUCT
CALLED BY:
DECODE, WDUMPREC
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 13-Jan-1998 by Dale Gary
26-Jan-1999 DG
Added a time/label structure field to the structure definition
[Previous]
[Next]
NAME:
GET_INDEX_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
index segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
idx = get_index_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
idx an empty index segment structure
COMMENTS:
CALLED BY:
DECODE, OVSA_GET_INDEX, WACAL, WANALYZE, WPOINT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 29-Nov-1999 by Dale E. Gary
[Previous]
[Next]
NAME:
GET_LUN_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
lunar ephemeris data.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
lunar = get_lun_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
lunar an empty LUNAR structure
COMMENTS:
CALLED BY:
GET_EPH_STRUCT, GET_LUNEPH
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 30-Jan-1999 by Dale Gary
[Previous]
[Next]
NAME:
GET_LUNEPH
PURPOSE:
Return a three-day consecutive lunar ephemeris, given the
Julian date of the first day.
CATEGORY:
OVRO APC EPHEMERIS
CALLING SEQUENCE:
lunar = get_luneph(jd)
INPUTS:
jd Julian date of the first day for which the lunar
ephemeris data are wanted.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
rd_luneph (internal routine), dayofyr, get_lun_struct
OUTPUTS:
lunar A lunar ephemeris structure of the form
{ RA: LONARR(3), ; Right ascension for each day [0.1 mdeg]
DEC: LONARR(3), ; Declination for each day [0.1 mdeg]
RAD: INTARR(3), ; Radius for each day [0.1 mdeg]
HP: INTARR(3), ; Horizontal parallax [0.1 mdeg]
REFT: INTARR(3), ; Reference time [sec]
DOY: INTARR(3)} ; Reference day of year
COMMENTS:
Requires the file !DEFAULTS.EPHEMDIR+'LUNAREPH.DAT', which is the same file
used by the CPC (FASAR) to determine the lunar coordinates.
CALLS: ***
DAYOFYR [1], GET_LUN_STRUCT, RD_LUNEPH, dayofyr [2]
CALLED BY:
MAKE_EPHEM
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
30-Jan-1999 DG
Slight change to use GET_LUN_STRUCT() routine
11-Jan-2000 DG
ELiminated hardwired directory locations.
[Previous]
[Next]
NAME:
GET_ND_EFF
PURPOSE:
Routine to get a properly normalized "effective noise diode" value
given a list of noise diode increments and the indexes corresponding to
the key frequencies.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
nd_eff = get_nd_eff(idx,ndlist)
INPUTS:
idx the list of indexes into the NDLIST array corresponding to
the key frequencies (currently harmonics 7,9,14,25,41,53)
ndlist the list of noise diode factors in which to select the key
values (typically 85 values, one for each frequency).
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
nd_eff the single value corresponding to the key noise diode value.
COMMENTS:
CALLED BY:
GCFIT, MAKE_TPCAL, MAKE_TPCAL2
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 22-Jul-1999 by Dale E. Gary
[Previous]
[Next]
NAME:
GET_OBS_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
observing sequence segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
obseq = get_obs_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
obseq an empty config segment structure
COMMENTS:
This structure requires the use of pointers to arrays,
because the array sizes are variable and structure definitions
must be static. To use, always free the existing pointer and
then create a new one. For example, to add a new array, harm,
to the structure, do the following:
ptr_free,obseq.pharm
obseq.pharm = ptr_new(harm)
This will ensure that the memory area pointed to by the
existing pointer is freed back to the memory pool.
CALLED BY:
DECODE, WDUMPREC
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 15-Jan-1998 by Dale Gary
[Previous]
[Next]
NAME:
GET_OLDWINDOW
PURPOSE:
Cette procedure renvoie la derniere fenetre du module utilisee
fct a utiliser pour recuperer une fenetre ou on veut
faire un noerase
CATEGORY:
NRH1 General
CALLING SEQUENCE:
Indice = GET_OLDWINDOW,ideb,ifin
INPUTS:
IDEB Indice de debut
IFIN indice de fin
KEYWORD PARAMETERS:
Non
OUTPUTS:
INDICE indice de la fenetre a utiliser
CALLED BY:
MENUTRACEISOPH
RESTRICTIONS:
La signification de IDEB et IFIN est a preciser
MODIFICATION HISTORY: (bonmartin@obspm.fr)
17/11/98 Adapte du logiciel XHELIO (module window.pro) (JB)
[Previous]
[Next]
NAME:
GET_OVCAL_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
calibrator ephemeris data.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
cal = get_ovcal_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
cal an empty CAL structure
COMMENTS:
CALLED BY:
GET_CALEPH, GET_EPH_STRUCT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 30-Jan-1999 by Dale Gary
25-Nov-1999 DG
Updated to agree with Epoch defn in GPARM structure
23-Jul-2003 DG
Changes GET_CAL_STRUCT to GET_OVCAL_STRUCT to avoid conflict
with routine of the same name in LASCO tree.
[Previous]
[Next]
NAME:
GET_OVSA_IMAGE
PURPOSE:
To produce a dynamic spectrum with the frequency dimension mapped into a log scale .
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
get_ovsa_image,data,f,tavg
INPUTS:
data: a (nfreq x ntimes) dynamic spectrum
f : the frequency array
tavg: the time array
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
image: a dynamic spectrum with the frequency dimension mapped into a log scale.
COMMENTS:
CALLED BY:
PLOT_MED
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 26-Nov-2002 by Gelu Nita
[Previous]
[Next]
Project : OVSA
Name : get_ovsa_log
Purpose : Format solar.scd in Max Millennium Flare Catalog
format
Category :
Syntax : get_ovsa_log
Inputs :
Keywords :
CALLS: ***
ARR2STR [1], Arr2Str [2], CNV_XY2H, DATE2MJD [1], DATE2MJD [2], DATE2MJD [3]
DATE_CODE, GET_UTC, PANDB, RD_TEXT, STR_SEP, ftp_file
Restrictions: CAN ONLY BE RUN IN UNIX!
History : Written 09 November 2000, P. Gallagher (BBSO)
Contact : ptg@bbso.njit.edu
[Previous]
[Next]
NAME:
GET_PHZCAL_STRUCT
PURPOSE:
Define structure necessary for holding reference phase calibration information
from the PHZCAL segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
phzcal = get_phzcal_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
phzcal an empty phase calibration structure
COMMENTS:
This is a trivial structure, but I am using a structure to keep the
parallelism with TPCAL and AMPCAL structures, which are slightly more
complex.
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 27-Jul-1999 by Dale E. Gary
20-Feb-2006 DG
Added a third index to PHASE to account for both R and L
data--a result of all dishes having R and L.
[Previous]
[Next]
NAME:
GET_REFCAL_STRUCT
PURPOSE:
Define structure used for holding all of the reference calibration
information gathered from TPCAL, AMPCAL, and PHZCAL segments, but
pared down to the minimum size necessary for the data within the
current scan.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
refcal = get_refcal_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
refcal an empty reference calibration structure
COMMENTS:
This structure requires the use of pointers to arrays,
because the array sizes are variable and structure definitions
must be static. To use, always free the existing pointer and
then create a new one. For example, to add a new array, pFactors,
to the structure, do the following:
ptr_free,refcal.pFactors
refcal.pFactors = ptr_new(Factors)
This will ensure that the memory area pointed to by the
existing pointer is freed back to the memory pool.
To apply phase update to data, subtract from phase at baseline
i the phase
P_i = poff_i(t1) + [(t-t1)/(t2-t1)]*[poff_i(t2)-poff_i(t1)]
+ {dpdf_i(t1) + [(t-t1)/(t2-t1)]*[dpdf_i(t2)-dpdf_i(t1)]}*f
where
poff_i(t1) = (*refcal.PhaseUpd[0].paref)[i] [degrees]
dpdf_i(t1) = (*refcal.PhaseUpd[0].pdpdf)[i] [degrees/GHz]
t1 = refcal.PhaseUpd[0].tref [msec]
poff_i(t2) = (*refcal.PhaseUpd[1].paref)[i] [degrees]
dpdf_i(t2) = (*refcal.PhaseUpd[1].pdpdf)[i] [degrees/GHz]
t2 = refcal.PhaseUpd[1].tref [msec]
CALLS: ***
GET_TL_STRUCT
CALLED BY:
NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 27-Jul-1999 by Dale E. Gary
20-Nov-1999 DG
Added an entry for OffSun RCVR level to structure
02-Dec-1999 DG
Added parallel pointers for update calibrations, so that they
can be optionally applied.
08-Jun-2000 DG
Changed structure for PhaseUpd entry to contain phase and time
dependent parameters.
16-Jul-2000 DG
A second change to PhaseUpd entry to reflect new approach.
07-Nov-2002 DG
Added BLDIR and CHANPHZ entries.
27-Nov-2002 DG
Removed name of structure, so that it becomes an anonymous
structure. This solves the problem of saved calibration
data having an incompatible structure definition.
[Previous]
[Next]
NAME:
GET_REGN
PURPOSE:
Return solar active region information from NOAA file
!DEFAULTS.EPHEMDIR+'REGIONS.NOA'.
CATEGORY:
OVRO APC EPHEMERIS
CALLING SEQUENCE:
regn = get_regn()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
get_regn_struct
OUTPUTS:
regn A calibrator ephemeris structure of the form:
{EPOCH: STRUCTURE ; Epoch and other info from file
{YR: INT, ; Year of the region coords
DOY: INT, ; Day of year of coords
SEC: INT} ; Time of coords
NREGN: INT , ; Number of active regions
INFO: STRUCTURE ; Array of region info
{NOA: INT, ; NOAA region number
LAT: INT, ; Solar latitude of region (+N) [deg]
LNG: INT, ; Solar longitude of region (+E) [deg]
CARRLNG: INT, ; Carrington longitude [deg]
AREA: INT, ; Sunspot are of region [10-6 of disk]
TYPE: STRING, ; McIntosh classification (A4)
MAGTYPE: STRING} ; Magnetic class (eg BETA-GAMMA) (A12)
}
COMMENTS:
Requires the file !DEFAULTS.EPHEMDIR+'REGIONS.NOA', which is a file
FTP'd from NOAA on a daily basis.
CALLS: ***
DAYOFYR [1], GET_REGN_STRUCT, REVERSE, STR_SEP, dayofyr [2]
CALLED BY:
MAKE_EPHEM
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
30-Jan-1999 DG
Slight change to use GET_REGN_STRUCT() routine
25-Nov-1999 DG
Updated to agree with Epoch defn in GPARM structure
11-Jan-2000 DG
Eliminated hardwired directory locations
03-Oct-2000 DG
Use STRUPCASE() to make contents of REGIONS.NOA file all
uppercase, to fix problems introduced by format change at
NOAA.
[Previous]
[Next]
NAME:
GET_REGN_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
active region data.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
regn = get_regn_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
regn an empty REGN structure
COMMENTS:
CALLED BY:
GET_EPH_STRUCT, GET_REGN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 30-Jan-1999 by Dale Gary
25-Nov-1999 DG
Updated to agree with Epoch defn in GPARM structure
[Previous]
[Next]
NAME:
GET_SCANINFO
PURPOSE:
Searches a data (.ARC) file and returns a SCANINFO structure
of information for each scan.
CATEGORY:
OVRO APC FILE UTILITY
CALLING SEQUENCE:
scaninfo = get_scaninfo([filename])
INPUTS:
filename the filename and path of the data (.ARC) file to read.
If omitted, the user is asked to select a file
interactively.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
scaninfo an array of SCANINFO structures, one for each scan
in the file. The SCANINFO structure is just the
SCNTRY structure from the INDEX segment structure,
plus two additional tags: OBSID, containing the
observing sequence ID number, and ANTLIST, containing
the HEADER.AATAB list of active antennas (just a
list of antenna numbers, e.g. [1,2,4,5,6,255,255,255]
where 255 indicates unused antennas).
COMMENTS:
CALLS: ***
DECODE, FINDSEG, GETDATA, OPENARC, OVSA_GET_INDEX
CALLED BY:
LOCATE_SCAN
SIDE EFFECTS:
RESTRICTIONS:
The input data (.ARC) file must have an INDEX segment.
MODIFICATION HISTORY:
Written 27-Jul-2000 by Dale E. Gary
18-Jul-2001 GN
Replaced get_index by ovsa_get_index to avoid conflict with Yohkoh
14-Oct-2002 DG
Bails out if reading a record returns -1
12-Nov-2006 DG
Added MUXSEQID tag, and reading of CONFIG segment
[Previous]
[Next]
NAME:
GET_SCNTYP
PURPOSE:
Returns a string identifying a scan type from
scancode in the Time/Label field of a record.
CATEGORY:
OVRO APC DATA-ANALYSIS
CALLING SEQUENCE:
scntypstr = get_scntyp(scancode)
INPUTS:
scancode the scan code as read from Time/Label field
of a segment record.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
scntypstr a string giving the scan type, or the
string '***unknown scan type***' if
the scancode is invalid.
COMMENTS:
CALLED BY:
DUMPREC, GET_SEGMENTS, LOCATE_SCAN
SIDE EFFECTS:
RESTRICTIONS:
SEE ALSO:
GET_SEGTYP
MODIFICATION HISTORY:
Written 26-Sep-1997 by Dale Gary
15-Mar-1999 DG
Added Delay Scan
18-May-1999 DG
Added several new scan types (from DELAY CAL through POINT)
15-Mar-2005 DG
Added SATELLITE OBS scan type.
31-Jul-2006 DG
Added FST-CTRCAL scan type.
[Previous]
[Next]
NAME:
GET_SEGMENTS
PURPOSE:
Reads all segment records from a file, in an optimized manner,
and returns a string list of information for each segment.
CATEGORY:
OVRO APC DATA-ANALYSIS
CALLING SEQUENCE:
seglist = get_segments(a,nrec[,srec][,lrec])
INPUTS:
a the ASSOC variable associated with the file to be
examined.
nrec the number of records currently in the file
OPTIONAL (KEYWORD) INPUT PARAMETERS:
srec the start record number at which to start reading
segments. If omitted, the start record is 1.
lrec the end record number at which to stop reading
segments. If omitted, the end record is NREC
ROUTINES CALLED:
getdata, getlrecn, tl_decode, get_scantyp, get_segtyp, get_endtyp
OUTPUTS:
seglist a string array (list) of segment information, or
-1 if file could not be opened, or 0 if file
contained no segments.
COMMENTS:
CALLS: ***
GETDATA, GETLRECN, GET_ENDTYP, GET_SCNTYP, GET_SEGTYP, TL_DECODE
CALLED BY:
CREATE_INDEX, DAILY, FINDSEG, FIND_INDEX, LASTHREC, LAUNCHER, NEWSCAN, QUICKLOOK, SOLAID
SPLIT_OVSA_FILE, WACAL, WANALYZE, WPOINT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 25-Sep-1997 by Dale Gary
10-Jan-1998 DG
Added code to find the end of actual data in the case of an
untruncated real-time data file, which may have fill (zero)
data at the end of the file.
11-Jan-1998 DG
Changed due to use of OPENARC routine, and to use ASSOC
variable as argument rather than filename.
14-Jan-1998 DG
Changed to honor return of -1 from getlrecn, indicating
that the file is empty.
22-Jun-1998 DG
Changed calls a(rec) to getdata(rec,a) so that routines will
work on a UNIX system.
07-Sep-1998 DG
Added code to work with segments within segments, although
it only works properly if the intervening segment is only
one record long.
07-Jan-1999 DG
Added code to find the end of scan segments and write an
entry for each in the output array.
13-Mar-1999 DG
Fixed problem with CVDOY returning an Invalid day of year message,
when the last record was all zeroes.
17-Mar-1999 DG
Added ENDCODE response to EOS segment
16-May-1999 DG
Added SCRDUMP segment
18-May-1999 DG
Several changes to fix problems with new LAUNCHER behavior,
segments not in scans, and scans with no data segments.
01-Nov-1999 DG
Added a line to fix crash on checking an empty file (lastrec = 0).
23-Jul-2000 DG
Slight change to deal with zero length segments (generally a
blank record).
27-Jul-2000 DG
Added optional start and end record arguments, to speed up
finding segments when a restricted record range is to be searched.
25-Jan-2001 DG
Added code to skip DIALOG_HISTORY records, to fix a major problem
caused by them.
18-Jan-2006 DG
Fixed problem with empty records. Using NSEGREC as a UINT means that
what used to be -1 is now 65535, so test for this case explicitly.
[Previous]
[Next]
NAME:
GET_SEGTYP
PURPOSE:
Returns a string identifying a segment type from
segcode in the Time/Label field of a record.
CATEGORY:
OVRO APC DATA-ANALYSIS
CALLING SEQUENCE:
segtypstr = get_segtyp(segcode)
INPUTS:
segcode the segment code as read from Time/Label field
of a segment record.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
segtypstr a string giving the segment type, or the
string '***unknown segment type***' if
the segcode is invalid.
COMMENTS:
CALLED BY:
DUMPREC, FINDSEG, GET_SEGMENTS
SIDE EFFECTS:
RESTRICTIONS:
SEE ALSO:
GET_SCNTYP
MODIFICATION HISTORY:
Written 26-Sep-1997 by Dale Gary
07-Sep-1998 DG
Added MONITOR segment (added TRAJEC segment around 25 Aug).
03-Feb-1998 DG
Added EPHEMERIS segment (usurped the segment number of the
MONITOR segment, so MONITOR must now be segment code 10).
16-May-1999 DG
Added SCRDUMP segment and ENCODER segment
24-Jul-1999 DG
Added TPCAL, AMPCAL, and PHZCAL segments
13-Nov-1999 DG
Added EOF and INDEX segments
17-Nov-1999 DG
Added GAINPARM and TP-UPDATE segments
11-Mar-2000 DG
Changed CPC LOG segment type to DIALOG HISTORY segment type
07-Jun-2000 DG
Added DAILYPHZ segment
[Previous]
[Next]
NAME:
GET_SOL_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
solar ephemeris data.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
solar = get_sol_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
solar an empty SOLAR structure
COMMENTS:
CALLED BY:
GET_EPH_STRUCT, GET_SOLEPH
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 30-Jan-1999 by Dale Gary
[Previous]
[Next]
NAME:
GET_SOLEPH
PURPOSE:
Return a three-day consecutive solar ephemeris, given the
Julian date of the first day.
CATEGORY:
OVRO APC EPHEMERIS
CALLING SEQUENCE:
solar = get_soleph(jd)
INPUTS:
jd Julian date of the first day for which the solar
ephemeris data are wanted.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
rd_soleph (internal routine), pandb, get_sol_struct
OUTPUTS:
solar A solar ephemeris structure of the form
{ RA: LONARR(3), ; Right ascension for each day [0.1 mdeg]
DEC: LONARR(3), ; Declination for each day [0.1 mdeg]
RAD: INTARR(3), ; Radius for each day [0.1 mdeg]
PA: LONARR(3), ; P-Angle of solar disk [0.1 mdeg]
B0: LONARR(3), ; B0-Angle of solar disk [0.1 mdeg]
HP: INTARR(3), ; Horizontal parallax [0.1 mdeg]
REFT: INTARR(3), ; Reference time (always 0)[sec]
DOY: INTARR(3)} ; Reference day of year
COMMENTS:
Requires the file !DEFAULTS.EPHEM+'SUN1994-2020.DAT, which is the same file from
which the CPC (FASAR) file SOLAREPH.DAT was generated to determine the
solar coordinates.
CALLS: ***
DAYOFYR [1], GET_SOL_STRUCT, PANDB, RD_SOLEPH, dayofyr [2]
CALLED BY:
MAKE_EPHEM, MAKE_SOLCALTRAJ, NEWSCAN, UPTIME
SIDE EFFECTS:
RESTRICTIONS:
Negative declination is determined by dash in column 41! Beware if
structure changes in future solar ephemeris files.
MODIFICATION HISTORY:
Written 12-Jan-1999 by Dale E. Gary
30-Jan-1999 DG
Slight change to use GET_SOL_STRUCT() routine
11-Jan-2000 DG
Eliminated hardwired directory locations.
25-Jul-2000 DG
Discovered a bug in the solar declination near the equinoxes!
When, e.g., declination -00 54 13 was read, -00 was read as zero,
not negative zero, so sign was not transferred properly. The routine
now keys on the dash representing the minus sign, so should be
correct, but if the structure of future files change, this will
have to be changed also. Note that all files within one hour
declination of 0 (near the equinoxes) have incorrect ephemeris
(about 5 days in March, and again in September).
18-Jan-2005 DG
Inserted another 15 years worth of solar data and changed the
file name to 'sun1994-2020.dat'.
[Previous]
[Next]
NAME:
GET_SRSP_TL_STRUCT
PURPOSE:
Define structure necessary for holding information from SRSP
time/label field.
CATEGORY:
SRSP APC DATA ANALYSIS
CALLING SEQUENCE:
tl_struct = get_srsp_tl_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
tl_struct an empty time/label field structure
COMMENTS:
CALLED BY:
SRSP_TL_DECODE
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 13-May-2001 by Dale E. Gary
[Previous]
[Next]
NAME: GET_STR_DP
PURPOSE:
Apres appel a rh_dpatchfits_nrh, on restaure toutes les
variables contenues dans la structure.
CATEGORY:
Traitement de fichiers NRH
INPUTS:
structure regroupant tous les arguments d'appel necessaires au
calcul d'image.
OUTPUTS:
tous les parametres contenus dans la structure
MODIFICATION HISTORY:
01 oct : - ecrit par: A. Bouteille
02 mar 5 : - ajout de sel_ant 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)
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 2 : - ajout de t_integ a la liste de sortie.
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.
[Previous]
[Next]
Project : OVSA Schedule
Name : get_survey
Purpose : Read NOAA AR summary and generate a .fth file
for us in the schedule
Category :
Explanation :
Syntax : IDL> get_survey[,/do_exit]
CALLS: ***
ARR2STR [1], Arr2Str [2], CNV_H2XY, DIFF_ROT [1], DIFF_ROT [2], GET_UTC, PB0R, RD_TEXT
REVERSE
Examples :
Inputs : The file e:\ephem\regions.noa must exist
Outputs : e:\working\arsurvey.fth
Keywords : do_exit A switch to force exit from IDL
History : Written 16 Aug 2000, P. T. Gallagher.
19-Aug-2000 DG
Added /do_exit switch, to fix problem of STARTUP file
exiting before running.
11-Mar-2001 DG
Changed from 21 DOSEQ to 25 DOSEQ, to give ND-ON measurements.
10-Jul-2003 DG
Changed to use !defaults instead of hardcoded locations.
21-Sep-2005 DG
Routine was failing when there were too few regions. Now it
will just repeat last region up to two times.
[Previous]
[Next]
CALLING SEQUENCE: Get_Text, entry, x, y, text, sizeText
PURPOSE: Loads into variables the texts stored in the table.
CALLED BY
Data Display, Overplot Texts, Texts_2D
[Previous]
[Next]
NAME:
GET_TIMING
PURPOSE:
Determine time offsets [msec] from center of each observing cycle, for
each sample and channel within the sample.
CATEGORY:
OVRO APC TIME
CALLING SEQUENCE:
msoff = get_timing(pol,header,cfg,obseq)
INPUTS:
pol A byte array giving the polarization state
for each channel and each observing sequence entry.
The polarization is coded as 0 = RCP, 1 = LCP, 3 = LIN
header The HEADER structure corresponding to the data.
cfg The CONFIG structure corresponding to the data.
obseq The OBSEQ structure corresponding to the data.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
msoff A long array of size [NCHAN,NFRQ,NPOL] giving the time offsets
[msec] for each sample and each channel within the sample,
relative to the center of a cycle.
COMMENTS:
Timing is complicated for OVSA data, since we have only three correlators
and do time-multiplexing of baselines, frequencies and poln. Thus, each datum
is obtained at slightly different times within a cycle. To keep careful
track of timing, it is necessary to have the information provided by this
routine. Note that if a particular frequency/baseline/poln combination is
measured twice in a cycle (the usual case) then the time indicated in MSOFF
is the center time between the two measurements.
CALLS: ***
UNIQ [1], UNIQ [2], UNIQ [3]
CALLED BY:
NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 03-Apr-2001 by Dale Gary
14-Dec-2001 DG
Changed to reflect new 2 and 4 polarization flags, used for
2m TP channels to indicate that data should be saved in RCP and
LCP channels as well.
[Previous]
[Next]
NAME:
GET_TL_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
time/label field.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
tl_struct = get_tl_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
tl_struct an empty time/label field structure
COMMENTS:
CALLED BY:
DAILY, GET_AMPCAL_STRUCT, GET_DAILY_STRUCT, GET_HEAD_STRUCT, GET_REFCAL_STRUCT
GET_TPCAL_STRUCT, MAKE_APCAL, MAKE_APCAL2, MAKE_TPCAL, TLSNOW, TL_DECODE
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 29-Jan-1999 by Dale Gary
27-Sep-2005 DG
Record numbers changed to UINT
[Previous]
[Next]
NAME:
GET_TPCAL_STRUCT
PURPOSE:
Define structure necessary for holding total power calibration information
from the TPCAL segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
tpcal = get_tpcal_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
tpcal an empty total power calibration structure
COMMENTS:
CALLS: ***
GET_TL_STRUCT
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 27-Jul-1999 by Dale E. Gary
20-Nov-1999 DG
Slight change to return 1.0 for TPFAC as a default rather than zero.
27-Aug-2005 DG
Added a third index to TPFAC and TPRMS to account for both R and L
data--a result of all dishes having R and L.
[Previous]
[Next]
NAME:
GET_TRAJ_STRUCT
PURPOSE:
Define structure necessary for holding information from OVRO APC
trajectory segment.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
traj = get_traj_struct()
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
traj an empty trajectory segment structure
COMMENTS:
This structure requires the use of pointers to arrays,
because the array sizes are variable and structure definitions
must be static. To use, always free the existing pointer and
then create a new one. For example, to add a new array, cmd,
to the structure, do the following:
ptr_free,traj.pcmd
traj.pcmd = ptr_new(cmd)
This will ensure that the memory area pointed to by the
existing pointer is freed back to the memory pool.
CALLED BY:
DECODE, NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 24-Aug-1998 by Dale E. Gary
05-Sep-1998 DG
Changed spelling of SRCNAM to SRCNAME
07-Aug-2004 DG
Added SATHA, SATDEC, and SATT entries.
[Previous]
[Next]
NAME:
GET_WINDOW
PURPOSE:
Cette fonction renvoie la fenetre courante du module pour afficher
CATEGORY:
NRH1 General
CALLING SEQUENCE:
Indice = GET_WINDOW,ideb,ifin
INPUTS:
IDEB Indice de debut
IFIN indice de fin
KEYWORD PARAMETERS:
TITLE XSIZE YSIZE
OUTPUTS:
INDICE indice de la fenetre a utiliser
CALLED BY:
MENUBCKGRD, MENUTRACEISOPH, MENUTRACEPOS
RESTRICTIONS:
La signification de IDEB et IFIN est a preciser
MODIFICATION HISTORY: (bonmartin@obspm.fr)
17/11/98 Adapte du logiciel XHELIO (module window.pro) (JB)
[Previous]
[Next]
NAME:
GETDATA
PURPOSE:
Returns a data record for a given record within an APC data file.
Use of this routine requires that the record number of the desired
record be known. The file must already be open and attached to a
variable with ASSOC().
CATEGORY:
OVRO APC DATA-ACCESS
CALLING SEQUENCE:
data = getdata(rec_n,a)
INPUTS:
rec_n the record number of the desired data record
a the associated variable for the file, attached
with ASSOC(lun,intarr(1024))
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
data the data record as read from the file. If a file
read error occurs, -1 is returned.
COMMENTS:
CALLED BY:
APCALCHEK, ARLOCPLOT, DAILY, DLACHEK, DLCALCHEK, FCALCHEK, FINDSEG, FIND_INDEX, GCALCHEK
GET_CYCLE, GET_SCANINFO, GET_SEGMENTS, LIMCHEK, MOUNTCAL, NEWSCAN, OVSA_GET_INDEX
PCALCHEK, PKUPCHEK, PUT_INDEX, SCREENDMP, SHOW_REGNS, SOLAID, SRSP_DUMPREC
SRSP_PLOT_FCAL, SRSP_PLOT_RCAL, SURVANAL, TPCALCHEK1, TPCALCHEK2, UPDATE_TPRECS
WACAL, WANALYZE, WATCHER, WDIALOG_HISTORY, WDUMPREC, WFSURVEY, WPOINT, WRITE_DAILY
WRITE_TPSEG, srsp_dumpfile, srsp_get_obseq
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 25-Sep-1997 by Dale Gary
15-Jun-1999 DG
Added alternate return to return a -1 if a file read error
occurs.
11-Jan-2000 DG
Eliminate !UNIX variable and use !VERSION instead
[Previous]
[Next]
NAME:
GETGNP
PURPOSE:
From specified date, searches the !DEFAULTS.DBDIR directory
for the most appropriate *.GNP file, reads the most appropriate
entry, and returns the gain parameters.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
gnp = getgnp(yrday)
INPUTS:
yrday A string of the form in TLS.YRDAY giving the year and
day number of the data for which gain parameters are
desired.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
gnp The gain parameter structure as read from the file.
COMMENTS:
The gain parms will ultimately be contained in a segment in the
data, so reading from a file on disk should not be necessary,
but for now...
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CVDOY, REVERSE, break_file [4]
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 31-Jul-1998 by Dale E. Gary
26-Nov-1999 DG
Changed to return a new form of GNP structure (introduced due
to creation of GAINPARM segment).
[Previous]
[Next]
NAME:
GETGPSaVG
PURPOSE:
A set of routines that implement the SDP4 or SGP4 calculations
of satellite coordinates from Two-Line Element files. See
documentation at http://www.celestrak.com/ .The code herein
is partly adapted from the FORTRAN code of Hoots and
Roehrich (1980) Spacetrack routines, and partly from T.s. Kelso's
Pascal (Trakstar) routines. Only those routines needed to
calculate HA and DEC are included.
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
getgpsavg,filename,sat,datein,havg,davg,dh,dd,satepoch,ts,plot=plot
INPUTS:
filename a string giving the name and path of the GEO.TXT file of
two-line elements. This is downloaded from Kelso's
http://www.celestrak.com/ website and used without
modification.
sat the unique NORAD identifier giving the satellite to do
the calculations for.
datein an ANYTIM() formatted string giving the date and time at
which to calculate satellite positions.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
plot if set, plots the HA and DEC coordinates every 10 minutes
for the 24 h UT day given by JD.
ROUTINES CALLED:
OUTPUTS:
havg the average HA coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
davg the average DEC coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
dh the total range of variation of the HA coordinate for
the given day
dd
satepoch the year, day of year, and time (in fraction of a day)
to which the two-line element coordinations refer,
e.g. 02287.234.
ts the time for which the coordinates have been calculated,
expressed as minutes since SATEPOCH.
COMMENTS:
CALLS: ***
CALCULATE_HADEC, CALCULATE_OBS, CALCULATE_RADEC, CALCULATE_USER_POSVEL, CVDOY
GETGPS, INPUT_OBSERVER, SDP4, SGP4, THETAG, THETAG_JD, anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5]
CALLED BY:
GETGPSSATS
SIDE EFFECTS:
A plot may be produced if /PLOT is used.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 18-Jul-2004 by Dale E. Gary, adapted from GETSATAVG routine.
[Previous]
[Next]
NAME:
GETGPSaVG
PURPOSE:
A set of routines that implement the SDP4 or SGP4 calculations
of satellite coordinates from Two-Line Element files. See
documentation at http://www.celestrak.com/ .The code herein
is partly adapted from the FORTRAN code of Hoots and
Roehrich (1980) Spacetrack routines, and partly from T.s. Kelso's
Pascal (Trakstar) routines. Only those routines needed to
calculate HA and DEC are included.
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
getgpsavg,filename,sat,datein,havg,davg,dh,dd,satepoch,ts,plot=plot
INPUTS:
filename a string giving the name and path of the GEO.TXT file of
two-line elements. This is downloaded from Kelso's
http://www.celestrak.com/ website and used without
modification.
sat the unique NORAD identifier giving the satellite to do
the calculations for.
datein an ANYTIM() formatted string giving the date and time at
which to calculate satellite positions.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
plot if set, plots the HA and DEC coordinates every 10 minutes
for the 24 h UT day given by JD.
ROUTINES CALLED:
OUTPUTS:
havg the average HA coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
davg the average DEC coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
dh the total range of variation of the HA coordinate for
the given day
dd
satepoch the year, day of year, and time (in fraction of a day)
to which the two-line element coordinations refer,
e.g. 02287.234.
ts the time for which the coordinates have been calculated,
expressed as minutes since SATEPOCH.
COMMENTS:
CALLS: ***
CALCULATE_HADEC, CALCULATE_OBS, CALCULATE_RADEC, CALCULATE_USER_POSVEL, CALDAT
CVDOY, INPUT_OBSERVER, SDP4, SGP4, THETAG, THETAG_JD, anytim [1], anytim [2], anytim [3]
anytim [4], anytim [5]
CALLED BY:
GETGPSSATS
SIDE EFFECTS:
A plot may be produced if /PLOT is used.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 18-Jul-2004 by Dale E. Gary, adapted from GETSATAVG routine.
[Previous]
[Next]
NAME:
GETGPSLIST
PURPOSE:
Gets the list of GPS satellites and their coordinates for the
given Julian date. Returns an array of GEOSAT structures
containing the name, number, time range, ha range, dec range,
and pointers to time, ha and dec arrays for every 5 minutes
that the satellite is within the OVSA 2-m antenna sky area.
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
out = getgpslist(jd[,num=num])
INPUTS:
jd Julian date for which to obtain the information. Typically
will use systime(/jul) funtion.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
num The NORAD number of the satellite for which to return
the information, in case only one satellite is desired.
ROUTINES CALLED:
dayofyr, getgps, sec2hms, hms2sec
OUTPUTS:
COMMENTS:
Dates too far from the TLE file date will be erroneous, so
update the gps-ops.txt file before calling this function.
CALLS: ***
CALDAT, DAYOFYR [1], GETGPS, HMS2SEC, NINT [1], NINT [2], SEC2HMS, dayofyr [2]
CALLED BY:
SCHEDULE, WGETGPS
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 14-Mar-2005 by Dale E. Gary
[Previous]
[Next]
NAME:
GETGPSSATS
PURPOSE:
Routine to return global positioning satellite information, including
HA and DEC pointing coordinates. Uses information in GPS-OPS.TXT file
of Two-Line Elements from http://www.celestrak.com/NORAD/elements .
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
out = getgpssats(jd[,/struct][,num=num][,/plot])
INPUTS:
jd Julian date on which to calculate satellite positions
OPTIONAL (KEYWORD) INPUT PARAMETERS:
struct if set, causes information to be returned as a structure.
Otherwise, information is returned as a string array of
simple ascii text.
num the satellite number for which to return information.
Each satellite is given a unique identifier by NORAD.
If given, information is returned only for the satellite
specified, AND the information is for the current date
and time. If omitted, information for ALL satellites
in GEO.TXT that are visible from OVRO is returned,
with coordinates averaged over the 24 h UT day of the
date given by JD.
plot if set, plots the HA and DEC coordinates every 10 minutes
for the 24 h UT day given by JD. Usually, NUM will be
specified when /PLOT is used.
ROUTINES CALLED:
getsatavg
OUTPUTS:
out normally a 29-element string array of ascii text, but if
the /STRUCT keyword is used, OUT will be a 29-element
array of GEOSAT structures.
COMMENTS:
CALLS: ***
CALDAT, GETGPSaVG [1], GETGPSaVG [2]
SIDE EFFECTS:
A plot may be produced if /PLOT is used.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 18-Jul-2004 by Dale E. Gary, based on GETSATS routine.
[Previous]
[Next]
NAME:
GETLRECN
PURPOSE:
Returns the record number of the last record that contains good
data, in a file with ASSOC variable A. This will be the actual
last record number when the file contains archived data, but will
be somewhere in the middle of a real-time data file.
CATEGORY:
OVRO APC DATA
CALLING SEQUENCE:
lastrec = getlrecn(a,nrec)
INPUTS:
a ASSOC variable representing the file
nrec The number of records in the file
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
lastrec The record number of the last record that contains good
data, or -1 if no records in file.
COMMENTS:
CALLS: ***
RDBYTE
CALLED BY:
GET_SEGMENTS, LAUNCHER, SOLAID, TRUNCATE, WATCHER
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 10-Jan-1998 Dale E. Gary
14-Jan-1998 DG
Added error handling in case of no records in file.
22-Jun-1998 DG
Use ceiling function on return, to round record up
to nearest integer.
24-Aug-1998 DG
Special case of no records in the file.
31-Jul-1999 DG
Tests if the last record has segment code 100, in which case we want
to consider the next to last record as the last record.
[Previous]
[Next]
NAME:
GETOFF
PURPOSE:
From specified date, searches the !DEFAULTS.DBDIR directory
for the most appropriate *.OFF file, reads the most appropriate
entry, and returns the offsets.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
off = getoff(yrday)
INPUTS:
yrday A string of the form in TLS.YRDAY giving the year and
day number of the data for which offsets are desired.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
off The offsets as read from the file.
COMMENTS:
The offsets will ultimately be contained in a segment in the
data, so reading from a file on disk should not be necessary,
but for now...
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CVDOY, REVERSE, break_file [4]
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 31-Jul-1998 by Dale E. Gary
[Previous]
[Next]
NAME:
GETPARMS
PURPOSE:
Routine to read GCAL files (offsets and gain parameters) and return
the appropriate values for a given date and time
CATEGORY:
OVRO APC UTILITY
CALLING SEQUENCE:
gparm = getparms(tls)
INPUTS:
tls A standard time/label structure giving the date and time for
which the parameters are desired.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
break_file
OUTPUTS:
gparm A structure containing the offsets and gain parameters. If
there was a problem finding or reading the files, GAINPARM
will contain nominal values (offsets all zero, nonlinearity
zero, and unit attenuation factors), and the epoch will have
day number set to zero.
Structure contents:
{gparm, epoch: strarr(2) ; Each of length 17, YYYY.DDD HH:MM:SS
poffsets: ptr to fltarr(NANT^2) ; Array of offsets, one for each chan
pgnp: ptr to NANT-element array of structures as follows
{gnp,nlparm: float ; Nonlinearity parameter
attn: fltarr(3) ; Attenuation factor
ndfac: float ; ND_eff factor (relative to 500)
resid: float ; Residual indicating quality of GCAL
}
dlcal: fltarr(4,14) ; To hold Delay line calibration
pgcal: ptr to NANT-element x NF-element array with GCAL results
{gcal, rcvr: float ; Receiver IF level
nd: float ; Noise Diode increment
resid: float ; RMS difference of model to data
}
}
COMMENTS:
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CVDOY, GETLINE, break_file [4]
CALLED BY:
NEWSCAN, PCALCHEK
SIDE EFFECTS:
RESTRICTIONS:
Contains code specific to 5 antennas.
MODIFICATION HISTORY:
Written 23-Aug-1998 by Dale E. Gary
05-Sep-1998 DG
Made the GPARM structure a named structure.
26-Nov-1999 DG
Changed to return a new form of GPARM structure (introduced due
to creation of GAINPARM segment).
[Previous]
[Next]
NAME:
GETSATaVG
PURPOSE:
A set of routines that implement the SDP4 or SGP4 calculations
of satellite coordinates from Two-Line Element files. See
documentation at http://www.celestrak.com/ .The code herein
is partly adapted from the FORTRAN code of Hoots and
Roehrich (1980) Spacetrack routines, and partly from T.s. Kelso's
Pascal (Trakstar) routines. Only those routines needed to
calculate HA and DEC are included.
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
getsatavg,filename,sat,datein,havg,davg,dh,dd,satepoch,ts,plot=plot
INPUTS:
filename a string giving the name and path of the GEO.TXT file of
two-line elements. This is downloaded from Kelso's
http://www.celestrak.com/ website and used without
modification.
sat the unique NORAD identifier giving the satellite to do
the calculations for.
datein an ANYTIM() formatted string giving the date and time at
which to calculate satellite positions.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
plot if set, plots the HA and DEC coordinates every 10 minutes
for the 24 h UT day given by JD.
ROUTINES CALLED:
OUTPUTS:
havg the average HA coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
davg the average DEC coordinate (as seen from OVRO), over the
24 hour UT day on the date given in DATEIN
dh the total range of variation of the HA coordinate for
the given day
dd
satepoch the year, day of year, and time (in fraction of a day)
to which the two-line element coordinations refer,
e.g. 02287.234.
ts the time for which the coordinates have been calculated,
expressed as minutes since SATEPOCH.
COMMENTS:
CALLS: ***
CALCULATE_HADEC, CALCULATE_OBS, CALCULATE_RADEC, CALCULATE_USER_POSVEL, CALDAT
CVDOY, INPUT_OBSERVER, SDP4, SGP4, THETAG, THETAG_JD, anytim [1], anytim [2], anytim [3]
anytim [4], anytim [5]
CALLED BY:
GETSATS
SIDE EFFECTS:
A plot may be produced if /PLOT is used.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Oct-2002 by Dale E. Gary
29-Jul-2006 DG
Fix bug in calculation of dh, dd
[Previous]
[Next]
NAME:
GETSATS
PURPOSE:
Routine to return geostationary satellite information, including
HA and DEC pointing coordinates. Uses information in GEO.TXT file
of Two-Line Elements from http://www.celestrak.com/NORAD/elements .
CATEGORY:
OVRO APC SCHEDULE
CALLING SEQUENCE:
out = getsats(jd[,/struct][,num=num][,/plot])
INPUTS:
jd Julian date on which to calculate satellite positions
OPTIONAL (KEYWORD) INPUT PARAMETERS:
struct if set, causes information to be returned as a structure.
Otherwise, information is returned as a string array of
simple ascii text.
num the satellite number for which to return information.
Each satellite is given a unique identifier by NORAD.
If given, information is returned only for the satellite
specified, AND the information is for the current date
and time. If omitted, information for ALL satellites
in GEO.TXT that are visible from OVRO is returned,
with coordinates averaged over the 24 h UT day of the
date given by JD.
plot if set, plots the HA and DEC coordinates every 10 minutes
for the 24 h UT day given by JD. Usually, NUM will be
specified when /PLOT is used.
ROUTINES CALLED:
getsatavg
OUTPUTS:
out normally a 49-element string array of ascii text, but if
the /STRUCT keyword is used, OUT will be a 49-element
array of GEOSAT structures.
COMMENTS:
CALLS: ***
CALDAT, GETSATaVG
CALLED BY:
SCHEDULE, WGETSATS
SIDE EFFECTS:
A plot may be produced if /PLOT is used.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 12-Oct-2002 by Dale E. Gary
[Previous]
[Next]
NAME:
GETTASK
PURPOSE:
Function that returns a list of task names appropriate to a given
type of entry as used in LAUNCHER, or, if the numtasks switch is set,
returns the number of defined tasks. This gives LAUNCHER its
"context-sensitivity."
CATEGORY:
OVRO APC ANALYSIS
CALLING SEQUENCE:
list = gettask(type)
ntasks = gettask(/numtasks)
INPUTS:
type the type of entry that the task must be able to act
upon. If numtasks switch is set, this input is ignored.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
numtasks if set, the number of defined tasks is returned.
ROUTINES CALLED:
ovsa_make_index
OUTPUTS:
list the list of task names that can act upon entries of the
type specified (only if numtasks switch is not set)
numtasks the number of tasks that have been defined in this file
COMMENTS:
CALLED BY:
LAUNCHER
SIDE EFFECTS:
RESTRICTIONS:
The defparms routine must be called before this function is called.
MODIFICATION HISTORY:
Written 25-Sep-1997 by Dale Gary
13-Jan-1998 DG
Added WTestPlot and Truncate tasks
16-Mar-1998 DG
Added GCalChek and FCalChek tasks. Had to introduce generic and
specific tasks, since my original idea had problems.
23-Jun-1998 DG
Added SolChek and ACalChek tasks.
04-Mar-1999 DG
Added DLCalChek task
20-Apr-1999 DG
Several changes to implement scans properly, instead of using
segments.
12-May-1999 DG
Added DLAscan task
15-Nov-1999 DG
Added CtrCalChek task
29-Dec-1999 DG
Added PntChek task
12-Mar-2000 DG
Added WDialog_History task
14-Apr-2000 DG
Get rid of C:\TEMP references (use !Defaults.workdir)
18-Apr-2000 DG
Change to reflect change in call to TPANALYZE
07-Nov-2000 DG
Added EXTRACT_RAW_DATA task
23-Jul-2003 DG
Changed name of MAKE_INDEX to OVSA_MAKE_INDEX to avoid conflict with
LASCO routine of the same name.
[Previous]
[Next]
NAME:
GETTPND
PURPOSE:
Routine used by TPCALCHEK to determine some values related to
the noise diode increment, for normalizing the TP calibration
data to the noise diode.
CATEGORY:
OVRO APC DATA CALIBRATION
CALLING SEQUENCE:
result = gettpnd(tpdata,tpflag,ndfac,ndavg,ndrms)
INPUTS:
tpdata the total power data measured during a REF TP CAL
observation, of size TPDATA(2,4,2,85,NRPT), with indexes
as follows: index 1 = 0 (ND OFF), or 1 (ND ON)
index 2 = 0 (RR), 1 (RL), 2 (LL), or 3 (LR)
index 3 = 0 (ant 1) or 1 (ant 2)
index 4 = frequency index, harm 5-90 with 89 skipped
index 5 = number of times sequence is repeated
tpflag parallel array to TPDATA, with 0 indicating good data, 1 bad data
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
openarc, lasthrec, getdata, tl_decode, decode, tpnorm, gettpnd
OUTPUTS:
ndfac the noise diode factors for each data point, relative to
the noise diode level averaged over the NRPT measurements.
The size is NDFAC(4,2,85,NRPT).
ndavg the average noise diode increment over the NRPT measurements,
with size NDAVG(4,2,85).
ndrms the RMS deviation of the NRPT measurements relative to NDAVG.
Size is the same as NDAVG.
COMMENTS:
CALLED BY:
TPCALCHEK1, TPCALCHEK2
SIDE EFFECTS:
RESTRICTIONS:
This version written to work on first-generation data.
Changes will be made as new capabilities are added to
the system.
MODIFICATION HISTORY:
Written 29-Oct-1998 by Dale Gary (from earlier version)
22-Jul-1999 DG
Change MAXRMS from 5 to 20.
[Previous]
[Next]
NAME:
GETWRD
PURPOSE:
Return the n'th word from a text string.
CATEGORY:
CALLING SEQUENCE:
wrd = getwrd(txt, n, [m])
INPUTS:
txt = text string to extract from. in
n = word number to get (first = 0 = def). in
m = optional last word number to get. in
KEYWORD PARAMETERS:
Keywords:
LOCATION = l. Return word n string location.
DELIMITER = d. Set word delimiter (def = space).
/LAST means n is offset from last word. So n=0 gives
last word, n=-1 gives next to last, ...
If n=-2 and m=0 then last 3 words are returned.
/NOTRIM suppresses whitespace trimming on ends.
OUTPUTS:
wrd = returned word or words. out
CALLED BY:
TIMEAXIS [1], TIMEAXIS [2], TIMEAXIS [3], XPRINT [1], XPRINT [3]
COMMON BLOCKS:
NOTES:
Note: if m > n wrd will be a string of words from word n to
word m. If no m is given wrd will be a single word.
n<0 returns text starting at word abs(n) to string end
If n is out of range then a null string is returned.
See also nwrds.
MODIFICATION HISTORY:
Ray Sterner, 6 Jan, 1985.
R. Sterner, Fall 1989 --- converted to SUN.
R. Sterner, Jan 1990 --- added delimiter.
R. Sterner, 18 Mar, 1990 --- added /LAST.
R. Sterner, 31 Jan, 1991 --- added /NOTRIM.
Johns Hopkins University Applied Physics Laboratory.
Copyright (C) 1985, 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.
[Previous]
[Next]
PURPOSE:
Subtracts a gliding background from an image.
CALLING SEQUENCE:
result = GlidBackSub( image, wLen [ , direction ] )
INPUT PARAMETERS:
image: a 2D array
wLen: length of the window defining the gliding
background
direction: 'X' or 'Y'
RESULT:
The image without background
KEYWORDS:
/WEIGHTED: if present, the pixels on the center of the
gliding window have more weights in the
gliding background definition than the pixel on
the border. Otherwise, they have all the same
weight.
BACKGROUND: for getting the background array.
CALLS: ***
AVG [1], AVG [2], REVERSE
CALLED BY:
ETHZ_Background, Eliminate wrong channels
PROCEDURE:
1. Computation of the coefficients (weights)
2. For each profile, selection of the gliding window,
and computation of the (weighted) average.
3. Subtarction of this average from the original image.
MODIFICATION HISTORY:
Created in November 1991 by A.Csillaghy,
Institute of Astronomy, ETH Zurich.
[Previous]
[Next]
NAME:
GPARM_ACTIVE
PURPOSE:
Selects gain parameter information for the active antennas from the
complete set of gain parameters for all antennas, as measured during
a GCAL.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
gparm = gparm_active(gainparm,aa)
INPUTS:
gainparm The full set of gain parameters as a GPARM structure, containing
nonlinearity, attenuation factors, and offsets from a GCAL
aa A simple list of active antennas, e.g. active antennas 4, 5,
and 6 would be represented by an array [4,5,6].
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
gparm A new GPARM structure, but restricted to only the active antennas.
COMMENTS:
CALLED BY:
NEWSCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 14-Nov-1999 by Dale E. Gary
18-Jul-2004 DG
Add dimension to GCAL so that both R and L are returned.
[Previous]
[Next]
NAME:
GR_IMAGES
PURPOSE:
WIDGET pour la visualisation de plusieurs images dans la meme fenetre
CATEGORY:
WIDGET
CALLING SEQUENCE:
GR_IMAGES, GROUP = group
INPUTS:
OPTIONAL INPUTS:
GROUP Identifieur du widget appelant
CALLS: ***
CW_FIELD, CW_INFONRH, CW_RD_STRING, CW_SELFIELD, GR_IMAGES_EVENT, NRH_DISP_GRIMAGE
NRH_FOPEN, NRH_PICKFILE, READ_NRHIM, TIME_IND_NRH, XLOADCT [1], XLOADCT [2]
XLOADCT [3], XMANAGER
CALLED BY:
HESSI_NRH, NRH
COMMON BLOCKS:
FICHR, str_fic structure definie dans rh_2d.pro
selection de fichiers
IMAGES_GR, str_imgr
li:3, nombre de lignes de la fenetre
co:6, nombre de colonnes de la fenetre
dim:128, dimension d'une image
crli:0, ligne courante
crco:0, colonne courante
crwin:-1, fenetre courante
tsel:' ', heure de l'image
inc: increment d'indice
stk:0 Parametre de STOKES 0: I, 1: V
DATA_NRH2,Donnees, Header Donnees et Header lu
PROCEDURE:
Cette procedure permet de visualiser des images dans une meme fenetre
et de les sortir dans un fichier PS. Les fichiers d'origine et la
disposition sont libres. A chaque nouvelle image la position dans la ligne
est incrementee. En fin de ligne la colonne est incrementee.
L'utilisateur peut intervenir sur la position de l'image en modifiant
les indices de lignes et de colonnes
EXAMPLE:
GR_IMAGES
ou
GR_IMAGES,GROUP= id
MODIFICATION HISTORY:
Ecrit par: J Bonmartin le 07/11/97 (bonmartin@obspm.fr)
Modif ouverture de fichiers pour HESSI le 19/01/01 (JB)