[Previous]
[Next]
NAME:
DAILY
PURPOSE:
Automatic analysis and solution of PCAL data in a given file.
CATEGORY:
OVSA APC CALIBRATION ANALYSIS
CALLING SEQUENCE:
refscan = daily([filename][,ref = refscan | ,iref=iref][,/update] $
[,/noprinter][,/nowrite],[/interactive][,sn=sn])
INPUTS:
filename The name of the .ARC file containing the data to be
analyzed. If omitted, the user is prompted for a filename.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ref A scan structure as returned from a previous call to DAILY.
This is used when two different files are to be fit using
a single reference scan. Overrides keyword IREF.
iref Specifies which scan is to be used a the reference--overrides
the automatic selection that is done based on S/N. This
keyword is ignored if REF keyword is used.
update A switch that, if set, causes scans that have already been
analyzed not to be reanalyzed.
noprinter By default, an overview page is printed on a local printer.
This keyword causes the results to be shown on the display
instead.
nowrite By default, the results are written to the data (.ARC) file.
This keyword causes the writing to be skipped.
interactive By default, the analysis is done automatically. This
keyword allows the intermediate results of the fitting
to be adjusted interactively.
sn Specifies Signal to Noise ratio to use in WPHZFIT/PHZFIT. By
default, this is 2.0, but can be lowered to 1.5 or so if too
many baselines are missing due to noisy data.
ROUTINES CALLED:
openarc, getdata, find_index, decode, analyze, amphit, cal_info, plot_phz,
daily_plot
OUTPUTS:
refscan A scan structure containing the data used for the reference
scan, for use in a subsequent call to DAILY.
COMMENTS:
Generally the routine will be called once without any reference scan
specified. Sometimes, however, the data for one day is split into two
separate files. In that case, call DAILY on the first file, without
specifying a reference scan, then use the output reference scan as
input for a second call, to the other file. (Another, better way to
do this is to combine the two files using CONCAT_OVSA_FILE.)
CALLS: ***
AMPHIT, ANALYZE [1], ANALYZE [2], ANALYZE [3], BEST_SCAN, BREAK_FILE [1]
BREAK_FILE [2], BREAK_FILE [3], CAL_INFO, CVDOY, DAILY_PLOT, DECODE, FINDSEG
FINDSEGENTRIES, GETDATA, GET_SEGMENTS, GET_TL_STRUCT, LOBE, MSEC2STR, NINT [1]
NINT [2], OPENARC, OVSA_GET_INDEX, PCLOSE, PHZFIT, WPHZFIT, WRITE_DAILY
break_file [4]
SIDE EFFECTS:
A page is printed to the local printer, unless overridden by the
/NOPRINTER keyword. The results are written to the data file unless
overridden by the /NOWRITE keyword.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 21-May-2000 by Dale E. Gary
29-May-2000 DG
Basically in final form
01-Jun-2000 DG
Added REFSCAN output for handling two separate files with a single
reference scan.
17-Jul-2000 DG
Several changes to make it honor both slope and offset of fits,
and also fix a bug in which I had not been correcting for the
fits before averaging the daily cals. Change output time to be
a reference time to center of scan. Add UPDATE switch.
23-Jul-2000 DG
Added IREF keyword, to give some control over which scan is used
as the reference. Added NOPRINTER, NOWRITE, and INTERACTIVE switches.
Implemented WRITE_DAILY routine to write results to the .ARC file.
27-Jul-2000 DG
Fixed a couple of small bugs introduced in above changes.
06-Sep-2005 DG
Added changes to work with 7 antennas (I thought I had already made
these changes, but I do not see them...)
06-Nov-2005 DG
Phase closure does not work unless phases are corrected for baseline
ORDER and backend phase BEPHZ. I wrote a new routine CAL_INFO that
is used to correct the phases for use in WPHZFIT, where the phase
closure is done. The reference phases also are corrected for
comparison with the DAILY phase results. Finally, the values are
converted back for insertion into the data file with WRITE_DAILY()
18-Jan-2006 DG
Added SN keyword to allow lowering of signal to noise limit, in
case of really crappy data. SN defaults to 2, but can be lowered
to 1.5 or so if there are too many missing baselines.
[Previous]
[Next]
14-Apr-2000 DG
Get rid of C:\TEMP references (use !Defaults.workdir)
10-May-2000 DG
Modified to return CALOUT array
CALLS:
[Previous]
[Next]
NAME:
DAILY_PLOT
PURPOSE:
Plot the results of the DAILY calibration on a single page.
CATEGORY:
OVSA APC CALIBRATION ANALYSIS SUPPORT
CALLING SEQUENCE:
daily_plot, scan,iref,o_datfile,lines[,/printer]
INPUTS:
scan An array of SCAN structures of size NSCAN, created in
DAILY.PRO, containing the information to appear in
the plot.
refscan A SCAN structure (may or may not be one of the elements
of SCAN) containing the reference scan.
o_datfile A string containing the filename of the original
file from which the DAILY calibration data were taken.
lines A string array containing the phase slopes in the form
of a table, which is printed at the bottom of the
output plot. On output, an additional line is added
to the end of this array, giving the phase information
relative to the reference calibration.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
printer A switch to indicate that the output should go to the printer
ROUTINES CALLED:
OUTPUTS:
lines The input string array, plus an additional line at the
end of the array giving the phase information relative
to the reference calibration.
COMMENTS:
CALLS: ***
GET_SCREEN_SIZE, NINT [1], NINT [2], REVERSE
CALLED BY:
DAILY
SIDE EFFECTS:
Creates a plot
RESTRICTIONS:
MODIFICATION HISTORY:
Written 28-May-2000 by Dale E. Gary
01-Jun-2000 DG
Slight change to use REFSCAN, which may not be an element of
the SCAN array.
05-Jun-2000 DG
Add plot and table for Reference Calibration comparison
16-Jul-2000 DG
Change plotting and output of reference comparison to include
phase offset.
17-Jul-2000 DG
Change plotting and output of all scans to include phase offset.
27-Jul-2000 DG
Explicitly set the window size for no printer, to 1/2 the
screen size.
07-Nov-2005 DG
Added another triad, for 7-element data
[Previous]
[Next]
NAME:
Data Display
PURPOSE:
Plotting facility for more than one plots which have
optionally:
-- different number of relevant values
-- error bars
-- different plotting symbols, line thickness,
color, range, etc
CALLING SEQUENCE:
Data_Display [, x], y [, q, dx, dy, userSym]
INPUT PARAMETERS:
x: the x-values, a 2D array. If not present, the x range is set
from 0 to the number of elements minus 1.
y: the y-values also real 2D array, each line is a plot.
q: the qualifiers for each value to plot. The number follows
the definition of the !psym system variable.
It is a 2D integer array
dx, dy; the errors in x- and y-direction. If the error bars
are symmetrical, then "dx" and "dy" are
2D real arrays. If they are not symmetrical,
then dx(*,*,0) and dx(*,*,1) contain the errors
left and right, respectively and dy(*,*,0) and
dy(*,*,1) contain the errors up and down,
respectively.
userSym; the value of a user defined symbol, see the
mdisp manual for more information.
KEYWORDS:
LINESTYLE: for each plot a value corresponding to the
!p.linestyle system variable. A 1D array.
THICK: The line thickness, corresponding to the !p.thick
system variable. A 1D real array.
OFFSET: An y-offset added to all y-values of a plot,
a 1D real array.
COLOR: a color for each plot, 1D integer array
PSYM: the plot symbol used to draw all points having a
qualifier 0, 1D array, see the list at the
!psym system variable description.
XRANGE, YRANGE Two arrays of two values, defining
the range if it is not the minimum and
maximum value in the x and y variables.
LENGTH: If the plots have different number of relevant
values, the length gives how much points of the
array should be drawn.
RESET: If the old x and y range have to be reset.
TITLE, SUBTITLE, XTITLE, YTITLE: the titles.
HMS: if set, the x axis is drawn in hour/min/sec.
SIDE EFFECT:
A window is opened (on x Terminals)
CALLS: ***
DATA_DISPLAY, ERASEVT, ERR_PLOT [1], ERR_PLOT [2], GETHMS, GETTITLES, LOADSELECTION
LOADUSERSYM, N_Texts, PLOTONE, RESET [1], RESET [2], RESET [3], SETBOUND, TIMEAXIS [1]
TIMEAXIS [2], TIMEAXIS [3], VECTCMP, error, get_text
MODIFICATION HISTORY:
Created by A.Csillaghy in May 1991
Institute of Astronomy, ETH Zurich
Totally rewritten in October 1991, A.Cs.
Modification for h/m/s and wave 4 in Dec. 92, A.Cs.
[Previous]
[Next]
NAME:
DAYOFYR
PURPOSE:
Given the year, month and day of month, return the day of the year
as a 3-digit integer.
CATEGORY:
OVRO APC UTILITY
CALLING SEQUENCE:
doy = dayofyr(year,month,day)
INPUTS:
year the 4-digit year, e.g. 1997
month the calendar month, as either a numeric value (1-12) or as
a three-character string (Jan-Dec)
day the day of the month as an integer 1-31.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
doy the day of year as a 3-digit integer
COMMENTS:
CALLS: ***
leap_yr
CALLED BY:
AUTOCAL, Build_Schedule, DECODE, GETGPSLIST, GET_CALEPH, GET_LUNEPH, GET_REGN
GET_SOLEPH, MAKE_SOLCALTRAJ, RADIOFLUX, READ_RSTN_FLUX, SYSDOY, TLSNOW
UPDATE_TPRECS, UPTIME, dayofyrch
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 06-Aug-1998 by Dale Gary
[Previous]
[Next]
NAME:
DCD_FICPOINT
PURPOSE:
Cette fonction decode le contenu d'une ligne correspondant a un point
CATEGORY:
Traitement des points
CALLING SEQUENCE:
Str_point = DCD_FICPOINT( LIGNE )
INPUTS:
LIGNE Chaine correspondant a une ligne d'un fichier de point
KEYWORD PARAMETERS:
Non
OUTPUTS:
STR_POINT Structure contenant les information d'un point de mesure
definie par NRH_STR_COORD__DEFINE
CALLS: ***
RD_FICPOINT, SEL_FICPOINT, SEL_FICPOINT_EVENT, XMANAGER
CALLED BY:
RD_FICPOINT, SEL_FICPOINT
COMMON BLOCKS:
Non
PROCEDURE:
Cette fonction cree la structure correspondante et remplit les
valeurs a partir de la LIGNE
Cette structure est utilisee ensuite pour reporter le point sur une
image tracee par nrh_imageref
EXAMPLE:
RD_FICPOINT (Fichier, Tab)
Indic = SEL_FICPOINT ( Tab)
Str_coord = DCD_FICPOINT ( Tab(Indic) )
MODIFICATION HISTORY:
Ecrit par: J Bonmartin (obspm.fr) le 04/09/98
[Previous]
[Next]
CALLING SEQUENCE:
result = DecConvert( string )
PURPOSE:
Converts string formatted as 'hh:mm:ss.dd' in
decimal format.
INPUT:
string: "hours:minutes:seconds.decimals" format
OUTPUT:
result of function: the FLOAT number
SIDE EFFECT:
If the string given is not of the correct format, an INTEGER
with value 0 is returned.
CALLS: ***
ISDIGIT
CALLED BY:
Radio Astronomy Group Fits Read, Read_Test
MODIFICATION HISTORY:
Created by A.Csillaghy in October 1991
Inst. of Astronomy, ETH Zurich
[Previous]
[Next]
NAME:
DECODE
PURPOSE:
Decode a HEADER, CONFIG, or OBSEQ segment and return the
appropriate structure.
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
struct = decode(data[,incode])
INPUTS:
data the data record to be decoded
incode the segment code of the expected type of segment.
If the data record segment code does not match
INCODE, the return value is set to -1.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
tl_decode get_head_struct get_cfg_struct get_obs_struct
rdbyte rdlong
OUTPUTS:
struct the properly filled data structure of the
appropriate type, or -1 if a failure occurred.
COMMENTS:
The HEADER structure is defined as follows (see get_head_struct)
================================================================
{tls: {tlfield},$ ; A time/label structure
aatab: intarr( 8),$ ; Active antenna table
nptab: intarr( 10),$ ; Antenna pointer table
nant: 0,$ ; Number of active antennas
rdoff: 0,$ ; 2-byte word offset of raw data
; within a data segment record
nsr: 0,$ ; Number of samples per record
nws: 0,$ ; Number of 2-byte words per sample
ndbw: 0,$ ; Number of db words per sample
nfgw: 0,$ ; Number of fg words per sample
lchoff: intarr(8,8),$ ; ij channel offsets within sample
lfgptr: intarr(8,8)} ; Order of fg values in fg words
The CONFIG structure is defined as follows (see get_cfg_struct)
===============================================================
{antype: intarr(8),$ ;Antenna type (0=none,
; 1=27m, 2=2m equatorial,
; 3= 2m alt-az, 4=other)
antxyz:lonarr(3,8),$ ;Nominal ant locations (mm)
muxarr:intarr(8,8),$ ;Baseline type: 0=AB,1=CA,-1=BC
bx: dblarr(8,8),$ ;Matrix of baseline x components (nsec)
by: dblarr(8,8),$ ;Matrix of baseline y components (nsec)
bz: dblarr(8,8),$ ;Matrix of baseline z components (nsec)
htdiff:dblarr(8,8),$ ;Matrix of baseline height differences (nsec)
antpol:intarr(2,8),$ ;Receiver poln codes (0=rcp,
; 1=lcp, 2=vert linear,
; 3=hor linear)
feedrot: intarr(8),$ ;Feed rotation code
; (0=equatorial fixed,
; 1=alt-az fixed)
intvalms: 0,$ ;Interrupt interval (ms)
sampintms: 0,$ ;Sample interval (ms)
msoff: intarr(8,8),$ ;Time offset for chan ij (ms)
nintvals:intarr(8,8),$ ;Number of integ for chan ij
momint: intarr(8,8),$ ;First moment of I.T> for
; channel ij
hifrqref: 0L,$ ;High freq reference (Hz)
plofrq: 0L,$ ;Phase lock reference (Hz)
dlamode: 0,$ ;Delay mode (0=fixed,
; 1=tracking,2=stepping)
dlastep: 0,$ ;Delay steps if delay mode 2
ndlacyc: 0,$ ;Number of cycles between
; delay steps
dlacent: intarr(8),$ ;Antenna delay centers (ns)
bedlaoff:intarr(2),$ ;Backend channel delays (A,B)
ut1mutc: 0L,$ ;UT1-UTC (ms)
tdtmut1: 0L,$ ;TDT-UT1 (ms)
clockerr: 0L,$ ;Clock error (ms)
clockdrift: 0L,$ ;Clock drift (tbd)
zencoder:lonarr(2,8),$ ;Encoder/secctor boundary
; zeroes for each antenna
antoff: lonarr(2,8),$ ;Fixed antenna offsets (mdeg)
aligntab:lonarr(4,8),$ ;Antenna alignment parameters
; for each ant (millideg)
refractivity: 0L, $ ;Nominal refractivity
muxseqid: 0L,$ ;MUX sequence number
nmux: 0L,$ ;Number of elements in MUX sequence
pmuxseq: ptr_new(0),$ ;Pointer to array of sequence entries
hodo: lonarr(2,8),$ ;HO, DO offsets for each antenna
hacorr: {hacorr, $ ;HACORR structure
n:intarr(2),$ ; Number of non-zero values for each ant
ha:lonarr(2,32),$ ; List of HA values at which to apply
corr:lonarr(2,32)},$ ; List of corrections
chanphz: fltarr(8,8),$ ; Channel-based phases, differences for
; each baseline according to AB, BC, or CA
bldir:intarr(8,8)*0+1} ; Baseline direction flag (BLDIR=+1 if
; increasing 1-2 or 4-5, =-1 if 2-1 or 5-4)
The OBSEQ structure is defined as follows (see get_obs_struct)
==============================================================
{tics: 0,$ ; No. of intgr intvl/entry
id: 0,$ ; Obseq id number
nt: 0,$ ; No. of times obseq repeats
nx: 0,$ ; No. of entries
pharm: ptr_new(0),$ ; ptr to array of harmonics
ppol: ptr_new(0),$ ; ptr to poln array
pnd: ptr_new(0),$ ; ptr to noise diode array
phflag: ptr_new(0),$ ; ptr to harmonic flag array
phord: ptr_new(0)} ; ptr to ordered list of harms
The TRAJECTORY structure is defined as follows (see get_traj_struct)
====================================================================
{srcnam:' ',$ ; Name of source being observed
id: 0,$ ; Trajectory number
nrpt: 0,$ ; No. of times trajectory repeats
nx: 0,$ ; No. of lines in trajectory
pDur: ptr_new(0),$ ; ptr to array of durations
pCmd: ptr_new(0),$ ; ptr to array of command strings
pDec: ptr_new(0),$ ; ptr to array of declinations
pHA: ptr_new(0)} ; ptr to array of hour angles
The EPHEMERIS structure is defined as follows (see get_eph_struct)
==================================================================
{ephem, dut: 0,$ ; UT1-UTC
solar: solar,$ ; Solar structure
lunar: lunar,$ ; Lunar structure
cal: cal,$ ; Cal structure
regn: regn} ; Regn structure
where the sub-structure definitions are
(see get_sol_struct)
{ SOLAR,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
(see get_lun_struct)
{ LUNAR,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
(see get_cal_struct)
{ CAL, EPOCH: {epoch} ,$ ; Epoch and other info from file
NCAL: 0,$ ; Number of calibrators
CALEPH:{caleph}(25)} ; Array of ephemeris info
(see get_regn_struct)
{ REGN, EPOCH: {epoch} ,$ ; Epoch and other info from file
NREGN: 0,$ ; Number of active regions
INFO: {info}(25)} ; Array of region info
and the sub-sub-structure definitions are:
{EPOCH, YR: 0,$ ; Year of the calibrator coords
DOY: 0,$ ; Day of year of coords
SEC: 0} ; Hour of coords
{CALEPH, NAME:' ',$ ; Name of calibrator (A8)
RA: 0L,$ ; Right ascen. of calibrator [0.1 mdeg]
DEC: 0L} ; Declination of calibrator [0.1 mdeg]
{INFO, NOA: 0,$ ; NOAA region number
LAT: 0,$ ; Solar latitude of region [deg]
LNG: 0,$ ; Solar longitude of region [deg]
CARRLNG: 0,$ ; Carrington longitude [deg]
AREA: 0,$ ; Sunspot are of region [10-6 of disk]
TYPE:' ',$ ; McIntosh classification (A4)
MAGTYPE:' '} ; Magnetic class (eg BETA-GAMMA) (A12)
The REFCAL structure is defined as follows (see get_refcal_struct)
==================================================================
{refcal, pfrq: ptr_new(0), $ ; Pointer to the frequency list
nant: 0, $ ; Number of antennas in REFCAL
nbl: 0, $ ; Number of baselines in REFCAL
npol: 0, $ ; Number of different poln in REFCAL
tls27m: get_tl_struct(), $ ; Time/Label structure for 27m meas.
tls02m: get_tl_struct(), $ ; Time/Label structure for 2m meas.
tlsi: get_tl_struct(), $ ; Time/Label structure for I meas.
tlsrl: get_tl_struct(), $ ; Time/Label structure for R/L meas.
pFactors: ptr_new(0), $ ; Ptr to the fluxcal factors for NPOL
; polarizations, NANT+NBL channels,
; and NFRQ = n_elements(*pfrq) freqs
pRMS: ptr_new(0), $ ; Pointer to the RMS error corresp. to
; factors.
pPhase: ptr_new(0), $ ; Pointer to phases for NPOL poln,
; NBL channels, and NFRQ frequencies
pFacUpd: ptr_new(0), $ ; Ptr to the fluxcal update factors for NPOL
; polarizations, NANT+NBL channels,
; and NFRQ = n_elements(*pfrq) freqs
pRMSUpd: ptr_new(0), $ ; Pointer to the RMS error corresp. to
; update factors.
PhaseUpd: {tref:0L, $ ; Reference time for phase update
paref:ptr_new(0), $ ; Ptr to phase-freq slope at ref time
; for NBL baselines
pdadt:ptr_new(0)}, $ ; Ptr to time deriv of phase-freq slope
; for NBL baselines.
pOffSun: ptr_new(0)} ; Pointer to off-Sun RCVR IF level,
; for NFEED feeds and NFRQ frequencies
where the sub-structure definitions are
(see get_tpcal_struct)
{TPCAL, TLS27M: GET_TL_STRUCT(),$ ; The TIME/LABEL structure for 27m TPCAL
TLS02M: GET_TL_STRUCT(),$ ; The TIME/LABEL structure for 2m TPCAL
TPFAC: FLTARR(10,86),$ ; Factors for 10 feeds at 86 frequencies
TPRMS: FLTARR(10,86)} ; The errors in the factors.
(see get_ampcal_struct)
{ampcal, TLSI: GET_TL_STRUCT(), $ ; TIME/LABEL structure for I measurements
TLSRL: GET_TL_STRUCT(), $ ; TIME/LABEL structure for R/L meas.
FACTORS: FLTARR(10,86), $ ; Amplitude factors for 10 feeds at 86 frq
RMS: FLTARR(10,86)} ; RMS error for 10 feeds at 86 frequencies
(see get_phzcal_struct)
{phzcal, PHASE: FLTARR(10,86)} ; Phases (deg) for 10 feeds at 86 freq
CALLS: ***
CVDOY, DAYOFYR [1], GET_AMPCAL_STRUCT, GET_BLCOR, GET_CFG_STRUCT, GET_DAILY_STRUCT
GET_EPH_STRUCT, GET_GPARM_STRUCT, GET_HEAD_STRUCT, GET_INDEX_STRUCT
GET_OBS_STRUCT, GET_PHZCAL_STRUCT, GET_TPCAL_STRUCT, GET_TRAJ_STRUCT, L2W, RDBYTE
RDLONG, REVERSE, TL_DECODE, W2L, dayofyr [2]
CALLED BY:
APCALCHEK, ARLOCPLOT, CREATE_INDEX, DAILY, DUMPREC, GET_SCANINFO, MOUNTCAL, NEWSCAN
OVSA_GET_INDEX, PCALCHEK, PLOT_TPCAL, SHOW_REGNS, SURVANAL, WACAL, WANALYZE, WATCHER
WDUMPREC, WPOINT, WREGION, todays_targets
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 18-Jan-1998 by Dale E. Gary
22-Jan-1988 DG
Made incode input optional, and added unknown code error handling.
24-Jun-1998 DG
Added calculation for baseline lengths and htdiff in config segment.
24-Aug-1998 DG
Added TRAJECTORY segment
26-Jan-1999 DG
Added a time/label structure field to the HEADER structure
02-Jul-1999 DG
Added baseline corrections from 1999 Jun 18 baseline observations.
27-Jul-1999 DG
Added REFCAL et al.
13-Sep-1999 DG
Added code to handle the new TPCAL segment, which has 2 records,
although it still can handle the old TPCAL segment at the same time.
14-Sep-1999 DG
Had to change 27-m scale factor for TPCAL data back to 10 to prevent
overflow, but leave the 2-m scale factor at 100.
17-Nov-1999 DG
Add handling of TPUPDATE data (result of CTRCAL)
25-Nov-1999 DG
Updated to agree with new Epoch defn. Add reading of GPARM segment.
01-Dec-1999 DG
Added reading of INDEX segment.
03-Feb-2000 DG
Fixed bug that did not read 10th record of INDEX segment correctly.
23-Mar-2000 DG
Entered new baseline corrections, after source coordinates are finally
under contol.
14-Apr-2000 DG
Get rid of C:\TEMP references (use !Defaults.workdir)
09-May-2000 DG
Needed NANT for proper decoding of baselines, so pass in HEADER
as a keyword, when calling DECODE to decode a CONFIG segment.
07-Jun-2000 DG
Add decoding of DAILYPHZ segment
28-Jun-2000 DG
Change MUX for 3-element in CONFIG decoding, to be completely general.
06-Jul-2000 DG
Moved baseline corrections to a new routine, BLCOR().
16-Jul-2000 DG
Added code associated with new entry MUXARR in CFG structure.
26-Sep-2000 DG
Major change--I realized that I could change the sign on the BCsin
component of the data (done in GAINCOR), and then I no longer need
to reverse the sign of the BC baseline coordinates, nor do I need
different closure phase relations depending on MUX mode. This
simplifies a lot of things!
13-Jan-2001 DG
Decoded MUX sequence, that has been written into the data since
15 Aug 2000. Also changed the index of refraction correction to
0.000285 to agree with value written to CONFIG segment.
13-Mar-2001 DG
Fix bug that occurred when the Segment list in the INDEX filled the record.
19-Mar-2001 DG
I added this on 2 Mar, but that version got overwritten, so here it is
again... DECODE now checks whether the EPHEM record is flagged with a
255 in the last byte (for entries earlier than day 82 of 2000, and if
so, skips the spawn of PRECESS. If not flagged, it spawns PRECESS, then
corrects the DATA record for the new coordinates and writes a copy to
!DEFAULTS.WORKDIR+'EPHEM.ddd'. This record can then be inserted into
the .ARC file so that subsequent readings will not require spawning
PRECESS.
26-Apr-2001 DG
I had a case where a non-standard frequency was included, and the
TPUPDATE value is zero for non-standard frequencies so when applied
it gave an infinite value. Instead, missing values should be 1, so
that when applied they have no net effect. This is done on decoding
the TPUPDATE segment.
15-Jan-2002 DG
Added decoding of new HACORR data in CONFIG segment.
04-Apr-2002 DG
Added newly discovered channel phases (phi_a = 0., phi_b = -50 degrees,
and phi_c = 95 degrees), in CHANPHZ array added to config segment.
These channel-based phases may change from time to time, but only
repeated measurements will tell. The phases are applied in GAINCOR.
05-May-2002 DG
After new measurements, and finding a bug in my GAINCOR code, I changed
the channel phases here to baseline-based channel phases, e.g. phi_ab,
phi_bc, and phi_ca, and determined new values for them (which are very
consistent with the old values.
06-Jul-2002 DG
Added code to analyze the new MUX mode 15 channel phase cal data.
After analyzing new MUX mode 15 data, which allows to use the
Sun for channel phase calibration, I was able to update the channel
phases with some very good chance that it is now correct.
07-Oct-2002 DG
Recoded determination of baseline type (AB, BC, and CA), and made the
baseline coordinates depend on the order of antennas, which was
necessary in the new MUX schemes. Our earlier MUX arrangements
ALWAYS used increasing antenna numbers, so it was fine to do the
baselines by counting up from low to high antenna numbers, but the
new schemes are more flexible, e.g. 721 instead of 127, so the sign
of the baseline has to depend explicitly on the ordering.
07-Nov-2002 DG
Introduce BLDIR entry into CONFIG structure, to keep track of which
order the baseline data were taken in. The convention that BLDIR is
positive for increasing antenna number (e.g. 1-2 or 4-5) and negative
for the inverse order (2-1 or 5-4) will be applied in GAINCOR. This
is necessary so that data taken with different order can be compared.
17-Dec-2002 DG
Fix the special code for chanphz calibration (MUX sequence 15), which
was broken in the October changes.
23-Dec-2002 DG
Add code for chanphz calibration MUX sequence 17.
27-Dec-2002 DG
The antenna position for antenna 7 was changed in the FASAR (CPC)
program on 26-Dec-2002, to compensate for the huge baseline errors
that had been placed in GET_BLCOR. The GET_BLCOR errors were
subsequently reduced, but to allow GET_BLCOR to work for Ant 7 data
prior to 27-Dec-2002, the CONFIG segment values for Ant 7 position
are overridden here.
03-Jan-2003 DG
Changed channel phase values to accord with now correct (I hope)
values deduced from measurements. The earlier values were wrong.
04-Jan-2003 DG
Doh! The values of yesterday were wrong, too. Now hopefully correct.
11-Jan-2003 DG
Still some problems. I decided to change to specify the AB, BC,
and CA channel offsets, rather than relative to AB. They obey
the closure relation (AB + BC - CA = 0), so only two are really
needed, but it is conceptually easier to keep all three.
28-Oct-2003 DG
Change ANTPOL to reflect feed changes on Ants 1 and 2
14-Nov-2003 DG
Change decoding of GPARM segment to deal with case of 6-record
segments (used with new feeds).
12-Feb-2003 DG
Change ANTPOL to override config values for Ant 4, from 18 Nov 2003
onward, due to addition of dual-polarization feed
21-Mar-2004 DG
Change ANTPOL to override config values for Ant 5, from 18 Mar 2004
onward, due to addition of dual-polarization feed. Also change values
for Ant 6, slated to start tomorrow (22 Mar 2004).
18-Jul-2004 DG
Fix bug in decoding GPARM segment, when there are 6 records. GPARM
segment has both R and L data, but DECODE was putting R values in
both R and L locations of GAINPARM.PGCAL.
07-Aug-2004 DG
Added decoding of satellite ephemeris from TRAJECTORY segment
12-Aug-2004 DG
Change ANTPOL to override config values for Ant 7, from 11 Aug 2004
onward, due to addition of dual-polarization feed.
11-Sep-2004 DG
Change ANTPOL to override config values for Ant 8, from 18 Aug 2004
onward, due to addition of dual-polarization feed. Start on code
for analysis of new TPCAL, AMPCAL, PHZCAL, TP-UPDATE segments.
25-Oct-2004 DG
Fixed bug in which I divided DOY by 100 instead of 1000 in
determining when new GPARM went into effect.
09-May-2006 DG
Fixed bug in TP-UPDATE section.
12-Nov-2006 DG
Slightly updated for "new" CHANPHZ values (largely the same).
[Previous]
[Next]
NAME:
DECOMP1D
PURPOSE:
PROCEDURE DE DECOMPOSITION D'UN PROFIL RH UNIDIMENSIONNEL
EN SOURCES ELEMENTAIRES (INTENSITE OU POLARISATION).
CATEGORY:
NRH1 Positions
CALLING SEQUENCE:
DECOMP1D, Xcoor, Imagex, Gliss, Poids,
fitparam, dfitparam, sumgauss, npos
INPUTS:
XCOOR ..... Tableau des canaux
IMAGEX .... Image unidimensionnelle a tracer
(Tableau 1D)
GLISS ...... Nombre de canaux sur lequel la moyenne
glissante est calculee
POIDS ...... Poids minimum d'une source a retenir (->
SIGRMN)
KEYWORD PARAMETERS:
POLAR........Le profil contient l'intensite V
SIMPLE ..... Ajustement d'une Gaussienne
CONST, DROITE, PARABOLE ... Gaussienn + cst., droite
ou parabole
NPOS ....... Nbre maximum d'iterations
OUTPUTS:
FITPARAM .... Tableau des parametres ajustes:
amplitude, canal, FWHM (Dim. 3xNPOS)
DFITPARAM ... Erreur statistique des parametres
SUMGAUSS .... Somme des Gaussiennes ajustees
NPOS ........ Nombre de sources identifiees
CALLS: ***
GAUSS_RH, SIGRMN
CALLED BY:
FOLLOWPOS1D, PROFDECOMP1D
COMMON BLOCKS:
Non
PROCEDURE:
METHODE: CALCUL D'UNE MOYENNE GLISSANTE SUR gliss CANAUX, IDENTIFICATION
DES POINTS QUI DEPASSENT LA MOYENNE GLISSANTE DE sigma * L'ECART-TYPE,
AJUSTEMENT D'UNE GAUSSIENNE (OU D'UNE SOMME D'UNE GAUSSIENNE ET D'UN
POLYNOME D'ORDRE 0, 1 OU 2) A LA SOURCE AINSI IDENTIFIEE.
EXAMPLE:
Please provide a simple example here
MODIFICATION HISTORY: (bonmartin@obspm.fr)
16/11/98 adapte du logiciel XHELIO
[Previous]
[Next]
NAME: DEF_STR_DP
PURPOSE:
Initialisation par defaut d'une structure contenant tous les arguments
d'appel de RH_DPATCHFITS_NRH.
CATEGORY:
Traitement de fichiers NRH.
CALLING SEQUENCE:
INPUTS:
OUTPUTS:
str_dp : structure contenant ces parametres a leur valeur par defaut.
CALLED BY:
PUT_STR_DP
MODIFICATION HISTORY:
01 oct : ecrit par: A. Bouteille
02 mar 5 : - ajout de sel_ant dans la liste d'entree pour eliminer les
antennes a problemes.
02 mar 7 : - ajout de crit_arret, larg_2 devient un fltarr(2).
27 : - ajout de rot_p .
03 jun 24 : - ajout des parametres de recalibration
: - ----------------------- complement du pave central (recentrage)
03 sep 17 : ajout de :
. i_corr_pos_ant, i_source_cal, h_cal,
retrait de : calib_np_p
04 jan 19 : - ajout de rh_common.inc pour utiliser entfi.nbant
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.
- ajout de i_affich_lobe et i_mul_pol dans la structure de
sortie..
06 jun 2 : Modif de a_in, a_ex, larg_2, coeff_seuil, car la version
widgetisee ignore les valeurs definies dans RH_DPNEW et prend
celles definies dans DEF_STR_DP.
Jusqu'au 2 juin on avait a_in=0.83, a_ex=1.15, larg_2=[20, 30],
itermax = 400, gain_iter=0.3
[Previous]
[Next]
NAME:
DEFPARMS
PURPOSE:
Routine to set various "system variables." These are like global
parameters, and once set, are visible to any program in the current
IDL session. If this routine is called a second time, and the
parameters are already defined, it returns quietly.
CATEGORY:
OVRO APC ANALYSIS
CALLING SEQUENCE:
defparms
INPUTS:
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
os_family
OUTPUTS:
COMMENTS:
CALLED BY:
LAUNCHER, OVSA_EXPLORER formerly OVSA_PRESUB, SCAN4FLARE, SOLAID, WPREFERENCES
W_HISTOGRAM, psk_correlate, todays_targets
SIDE EFFECTS:
Numerous system variables are set.
RESTRICTIONS:
MODIFICATION HISTORY:
Written 24-Sep-1997 by Dale Gary
18-Jan-1998 DG
Added scan and segment code system variables
10-Mar-1998 DG
Changed Windows default directories so that DBDIR is C:\STD\
and WORKDIR is C:\WORKING\.
16-Mar-1998 DG
Added !T_GSCAN, !T_FSCAN for Gain and Frequency calibration
scan types.
21-Mar-1998 DG
Added PRFILE entry in !DEFAULTS system variable, to keep track
of which preferences file is in effect. Removed warning modal
dialog when no preferences file is found.
01-Nov-1998 DG
Added total power calibration segment
04-Mar-1999 DG
Added DLASCAN, DLCAL scan types, and MONITOR segment type
22-Jul-1999 DG
Added NCODRZERO scan type, and TPCAL, AMPCAL, and PHZCAL segment types
13-Nov-1999 DG
Added INDEX and EOF segments types
17-Nov-1999 DG
Added GPARM and TPUPD segment types
24-Nov-1999 DG
Added HSKEEP scan type
29-Dec-1999 DG
Added file/scan type !T_PTSCN (point scan)
11-Mar-2000 DG
Changed CPCLOG segment type to DILOGHIST (dialog history)
16-Apr-2000 DG
Fixed bug in definition of !DEFAULTS.CMDDIR (trailing slash is needed)
15-Aug-2000 DG
Changed pickfile() to dialog_pickfile().
05-Janb-2004 GN
Changed the default helpdir to c:\ssw\radio\ovsa\doc
15-Mar-2005 DG
Added SATOBS scan type.
[Previous]
[Next]
NAME:
DELAY
PURPOSE:
Given the current time and hardcoded values for baseline info and
source position info (RA and Dec), calculate the time delay (TAU)
and its time derivative (TAUDOT) for each baselines 1-2, 1-4, and 2-4.
CATEGORY:
OVRO APC INTERFEROMETRY
CALLING SEQUENCE:
delay,time,tcycle,tau,taudot,geometry,uv
INPUTS:
time the current time [msec]
tcycle the duration of a cycle [msec]
geometry the geometry structure as returned from NEWSCAN.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
bdots, lst
OUTPUTS:
tau an NANT x NANT array containing the delay in nsec for
each of the baselines
taudot a corresponding array containing the rate of change of
tau.
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.
COMMENTS:
CALLS: ***
BDOTS, CVDOY, OVSA_LST
CALLED BY:
BASFIT, GAINCOR
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 20-Jun-1998 by Dale Gary
24-Jun-1998 DG
Made it somewhat more general by using baseline coordinates
from config segment structure
10-Jan-1999 DG
Made more general--it is clear that this routine will become a
standard one, so must be made fully precise.
01-Jul-1999 DG
Removed some parameters in the input list that were no longer
used.
01-Nov-1999 DG
Added UV argument, to return u,v coordinates calculated by
BDOTS for middle of interval.
28-Mar-2000 DG
Change to new LST routine, OVSA_LST, based on slalib routines
by Patrick Wallace.
15-Mar-2005 DG
Added code to deal with new GPS satellite observing scheme.
[Previous]
[Next]
NAME:
DELFPOS
PURPOSE:
Detruit les fichiers utilises par le module de recherche de positions
CATEGORY:
RH_2D, Recherche de position
CALLING SEQUENCE:
DELFPOS, Fich1, Fich2, Fich3
OPTIONAL INPUTS:
Fich1: nom du fichier binaire contenant les sources
Fich2: nom du fichier binaire contenant les sources triees
Fich3: nom du fichier fits temporaire des positions
CALLED BY:
CW_POS
MODIFICATION HISTORY:
Ecrit par: C. Renié 08/1998
[Previous]
[Next]
Cette routine permet de connaitre les ellipses que l'on peut determiner
avec 3 distances consecutives du tableau d
APPEL:
d: tableau des distances calculées par trv_dist
gra: tableau des 8 petits axes
grb: tableau des 8 grands axes
tet: tableau des angles d'inclinaisons des ellipses
CALLED BY
CW_SCANSOURCE, TRV_GAUS
[Previous]
[Next]
NAME:
Determine Drift Rate
PURPOSE:
Calculate the drift rate by performing the following steps:
1) Cross-correlation on the currently displayed image
2) Spline fitting to add additional data points
3) Linear Regression of crosscorrelation maxima
to calculate slope (drift_rate) and variance
After a first iteration the user can remove CC-maxima
with the mouse and the linear regression is then redone.
CALLING SEQUENCE
DriftRate, zReal, xAxis, yAxis, xMin, xMax, yMin, yMax,
addPts, /LOGFREQ
INPUTS:
zReal: the 2D data array;
xAxis, yAxis: the two axes.
xMin, xMax, yMin, yMax: the selected boundaries of
the image.
addPts: Number of points to insert between existing ones
(by cubic spline interpolation).
OUTPUTS:
None
KEYWORDS:
LOGFREQ: If set, a logarithmic scale is used for frequency axis
and slope a is output instead of drift rate.
PSOUT: If set, postscript files of the two (or one)
resulting plots will be created (named drift_plot.1.ps and
drift_plot_2.ps)
CALLS: ***
DRIFT_PLOT, DRIFT_RATE, PLOT_IMAGE, REGRESS, Read_Test, SPLINE, STRN [1], STRN [2]
STRN [3], SWAPVARS, TV_Y_ADAPT, XKILL, XMESSAGE, correl1d
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
02/01/30 Initial version
Oliver Trachsel <toliver@astro.phys.ethz.ch>
Institute of Astronomy, ETH Zurich
[Previous]
[Next]
PURPOSE:
Conversion Device Unit -> Image Pixel Unit for the
enrad system
CALLS:
CALLED BY
Automatic polarization determination with background subtraction
Pixel_Read, Tv_Zoom
[Previous]
[Next]
NAME:
Display 2D Image
PURPOSE:
User Interface for displaying
two-dimensional data and provide
image handling facilities: Zoom, move, read values,
color table handling. This
is a part of the RagView image processing system.
CATEGORY:
User Interface
CALLING SEQUENCE
Display_2D, image [, xAxis, yAxis
[,xMin, xMax, yMin, yMax ] ]
INPUTS:
image: the 2D data array;
xAxis, yAxis: the two axes. They must have the same
dimension as their corresponding one in
the variable "image"
xMin, xMax, yMin, yMax: the selected boundaries of
the image if just a part is to be displayed.
Units: image pixels
OUTPUTS:
xMin, xMax, yMin, yMax: the boundaries of
the image displayed, which may have
change by zooms, moves, etc. (image pixels)
KEYWORD:
TITLE: The name of the image (can be different from the
value of !p.title). Will be used for naming
e.g postscript files.
CALLS: ***
CHANGESIZE, CT_Handling, Cont_Surf, DISPLAY_2D, DRIFT_RATE, GETWNR, General_Menu [1]
General_Menu [2], HISTOFACILITY, INIT_SELECTION, Image_Info, Init_Display
Move_Image, POLARIZATION, PUTIMAGESIZE, PUTWINSIZE, PUT_SELECTION, Pixel_Read
PrintInterface, RAG_ADJCT, SHOW_IMAGE, Tv_Zoom, ZOOM, error
SIDE EFFECTS:
Display opens a lot of windows and create
files, dependent of the user's choices.
RESTRICTIONS:
Works only in interactive mode.
MODIFICATION HISTORY:
Created: (4/91) A.Csillaghy csillag@astro.phys.ethz.ch
Institute for Astronomy, ETH Zurich
Modified for printing sixel files
Dec. 92, A.Cs
Logo eliminated in Nov 93, A.cs
Modified for IDL5 / SSW / RagView in March 98 -- ACS
Added three new menu entries to calculate drift rate and
polarization
Jan. 02, Oliver Trachsel <oliver.trachsel@email.ch>
[Previous]
[Next]
PROGECT:
Phoenix 2 solar radio spectrometer
NAME:
Display_1D
PURPOSE:
User interface to handle with a set of plots
stored in the selection
It assumes the selectioner is active.
CATEGORY
Radio (/ssw/radio)
CALLING SEQUENCE:
Display_1D
CALLED BY:
MDisp
SIDE EFFECTS:
Uses a lot of windows. Uses the selection data type.
RESTRICTION:
Use only in interactive mode.
Tested only on Unix
CALLS: ***
DATA_DISPLAY, GETTITLES, HISTOFACILITY, Integration, N_SELECTED, PS_Create_1D
PrintInterface, Read_Values, XCHOICE, Zoom_1D
SEE ALSO:
Display_2D, MDisp, RagView
MODIFICATION HISTORY:
Created in April 1991 by A.Csillaghy
Inst. of Astronomy ETH Zurich
Replaced General_Menu by XChoice for IDL 5.1 version
csillag@ssl.berkeley.edu, October 1998
[Previous]
[Next]
Modification History
2003-Jul-05 DG
Added REFMAP keyword, so that the OVSA data can be overlaid
onto a reference map, if desired.
CALLS:
CALLED BY
imagr [1]
[Previous]
[Next]
NAME:
DLACHEK
PURPOSE:
Main routine to analyze delay center data. Responds to scans
of type TEST DATA (scan code 1).
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
dlachek[,filename][,hrec | ,after=after][,debug][,/cmdfile]
INPUTS:
filename the name of the file containing PNTCAL data. If
omitted, the file DAILY.ARC in directory
!DEFAULTS.WORKDIR is assumed.
hrec the record number of the SOLAR scan header. Data
will be processed up to the next EOS segment.
If this argument is given, then AFTER keyword
is ignored.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
after an optional time string of the standard form
[yyyy.ddd ]hh:mm[:ss] after which to start
looking for a valid PNTCAL or TEST DATA scan.
cmdfile a switch that indicates that the routine was called
from a command file, so issue no modal messages, and
print any error messages to <WORKDIR>\ACAL.MSG.
debug a switch that activates some debugging statements
for getting an indication of intermediate steps.
This switch is not compatible with /CMDFILE switch.
ROUTINES CALLED:
openarc, getdata, lasthrec, tl_decode, decode, acfit
OUTPUTS:
COMMENTS:
There will have to be modifications to this routine when
additional antennas are available.
CALLS: ***
ACFIT, GETDATA, LASTHREC, NEWSCAN, OPENARC
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 16-Jun-1998 by Dale Gary
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.)
03-Nov-1998 DG
Removed NaNs before using MEDIAN routine at the very end.
04-Feb-1999 DG
Converted to use NEWSCAN routine
[Previous]
[Next]
NAME:
DLAFIT
PURPOSE:
Fits a gaussian to the central part of the delay pattern for a
single baseline, to represent the delay center offset in nsec.
CATEGORY:
OVRO APC CALIBRATION
CALLING SEQUENCE:
dlafit,x,y,x0,chisq,xfit,yfit
INPUTS:
input description
OPTIONAL (KEYWORD) INPUT PARAMETERS:
flag description
ROUTINES CALLED:
curvefit
OUTPUTS:
COMMENTS:
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], CURVEFIT, GFUNCT
CALLED BY:
DLASCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 21-May-2000 by Dale E. Gary
[Previous]
[Next]
NAME:
DLAPRED6
PURPOSE:
Predict the values of delay offset for each baseline given a set
of new delay centers. This version for 6-element only.
CATEGORY:
OVRO APC CALIBRATION
CALLING SEQUENCE:
x = dlapred6(d,t,new=new)
INPUTS:
d the original delay center values
t the new delay center values
OPTIONAL (KEYWORD) INPUT PARAMETERS:
new if set to 1, this is the "new" 6-element MUX sequence.
ROUTINES CALLED:
OUTPUTS:
x the predicted delay offsets
COMMENTS:
Added the A and B backend offsets, and cleaned it up.
CALLED BY:
DLASCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 11-Jan-2001 by Dale E. Gary
07-Oct-2002 DG
Added NEW keyword, to give solution to new MUX sequence.
[Previous]
[Next]
NAME:
DLAPRED7
PURPOSE:
Predict the values of delay offset for each baseline given a set
of new delay centers. This version for 7-element only.
CATEGORY:
OVRO APC CALIBRATION
CALLING SEQUENCE:
x = dlapred7(d,t)
INPUTS:
d the original delay center values
t the new delay center values
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
OUTPUTS:
x the predicted delay offsets
COMMENTS:
Added the A and B backend offsets, and cleaned it up.
CALLED BY:
DLASCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 10-Jul-2004 by Dale E. Gary
[Previous]
[Next]
NAME:
DLASCAN
PURPOSE:
Analyze DELAY SCAN data. Responds to SCANCODE 1 (TEST DATA) or
SCANCODE 9 (DLASCAN DATA).
CATEGORY:
OVRO APC CALIBRATION
CALLING SEQUENCE:
dlascan[,filename][,hrec | ,after=after][,erec][,debug][,/cmdfile]
INPUTS:
filename the name of the file containing the data. If
omitted, the file DAILY.ARC in directory
!DEFAULTS.WORKDIR is assumed.
hrec the record number of the scan header. Data
will be processed up to the next EOS segment.
If this argument is given, the AFTER keyword
is ignored.
erec the record number of the last record in the scan.
If omitted, the file will be read until the EOF
or a new header is reached.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
after an optional time string of the standard form
[yyyy.ddd ]hh:mm[:ss] after which to start
looking for a valid 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>\DLASCAN.MSG.
debug a switch that activates some debugging statements
for getting an indication of intermediate steps.
This switch is not compatible with /CMDFILE switch.
ROUTINES CALLED:
openarc, getdata, lasthrec, tl_decode, decode, get_cycle, congrid, dlafit, dlasolve,
dlapred
OUTPUTS:
COMMENTS:
This routine is fairly general as regards number of antennas, but
currently the MUX sequence is not recorded in the data, so one
must enter the assignments of AB, BC, and CA channels by hand for
each MUX sequence to be used. Currently two MUX sequences are
defined, one for 5-element and one for 6-element. The channel
assignments are:
5-element MUX sequence, 124, 125, 126, 456 yields:
abchan = [ 5,19] ; Baselines 12 and 45
bcchan = [13,15,17,23] ; Baselines 24, 25, 26, 56
cachan = [ 7, 9,11,21] ; Baselines 14, 15, 16, 46
6-element MUX sequence, 457, 456, 124, 125, 167, 267 yields:
abchan = [ 6,12,20,24] ; Baselines 12, 16, 26, 45
bcchan = [16,18,30,32,34] ; Baselines 24, 25, 56, 57, 67
cachan = [ 8,10,14,22,26,28] ; Baselines 14, 15, 17, 27, 46, 47
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], CW_BGROUP, DLAFIT, DLAPRED, DLAPRED6, DLAPRED7
DLASCAN_EVENT, DLASOLVE, FLAGOOL, GAINCOR, GET_CYCLE, LASTHREC, LOADCT, MOMENT, NEWSCAN
NINT [1], NINT [2], OPENARC, OVSA_GET_COLOR, SELECT_DATA, UNIQ [1], UNIQ [2], UNIQ [3]
WDLA_ADJ, XMANAGER
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 07-Mar-1999 by Dale Gary
15-Mar-1999 DG
Major changes to make it work better, add annotation and printing,
refine results by setting range to +/- 30 for non-AB baselines,
and average points for non-AB baselines.
14-May-1999 DG
Slight change to reflect change to GET_CYCLE(), which now returns
the segment code of the last read record if it is not a data record.
05-Feb-2000 DG
Removed now unnecessary sin and cos lookup tables in GAINCOR call.
14-Mar-2000 DG
Significant changes to allow routine to work with either 5 or 6
antennas. Found and fixed additional error in setting the number
of cycles to average--now just read it from the cfg segment.
22-May-2000 DG
Added FIT and SOLVE buttons, and fully implemented the fitting and
solution procedures with new or updated versions of DLAFIT and DLASOLVE.
10-Jan-2001 DG
Fixed problem where program would crash if first few points were NaN.
29-Jun-2002 DG
Fixed slight problem with FIT button not coming on at end of short scan.
07-Oct-2002 DG
The new MUX sequences needed for 7-element operation required that I
change the assignment of which are AB, BC, and CA baselines. This
should be obtained from *CFG.PMUXSEQ, but for now it is hardwired.
23-Jul-2003 DG
Changed GET_COLOR to OVSA_GET_COLOR to avoid conflict
with routine of the same name in SMM tree.
10-Jul-2004 DG
Fixed a bug in the assignment of channel type. Also updated routine
to work with 7 elements.
16-Jan-2004 DG
Try to fix crash that occurred when data were entirely missing for a
baseline, when trying to plot that baseline.
14-Mar-2005 DG
Changed handling of polarization to reflect changes to polarization
hardware.
[Previous]
[Next]
NAME:
DLASOLVE
PURPOSE:
Given the DELAY CENTER offsets for each baseline, solve for the best
values of DELAY CENTERs.
CATEGORY:
OVRO APC CALIBRATION
CALLING SEQUENCE:
dlasolve,d,ss,r
INPUTS:
d the delay centers for each antenna, as given in the CONFIG
segment, corresponding to the value in force at the time
of the observations.
ss the delay shifts determined by DLAFIT routine.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
openarc, getdata, lasthrec, tl_decode, decode, get_cycle, congrid
OUTPUTS:
r the updated delay values, which are to replace the current
values in D.
COMMENTS:
This routine is very specific to the MUX sequence. Currently two
MUX sequences are defined, one for 5-element and one for 6-element.
The channel assignments are:
5-element MUX sequence, 124, 125, 126, 456 yields:
abchan = [ 5,19] ; Baselines 12 and 45
bcchan = [13,15,17,23] ; Baselines 24, 25, 26, 56
cachan = [ 7, 9,11,21] ; Baselines 14, 15, 16, 46
6-element MUX sequence, 457, 456, 124, 125, 167, 267 yields:
abchan = [ 6,12,20,24] ; Baselines 12, 16, 26, 45
bcchan = [16,18,30,32,34] ; Baselines 24, 25, 56, 57, 67
cachan = [ 8,10,14,22,26,28] ; Baselines 14, 15, 17, 27, 46, 47
CALLED BY:
DLASCAN
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 22-May-2000 by Dale Gary
Adapted from DLAFITSYS routine
10-Jan-2001 DG
Added A and B channel delays as d[6] and d[7], for 6-element data
10-Jul-2004 DG
Added a case for 7-element data. This also needs to be able to handle
missing values.
[Previous]
[Next]
NAME:
DLCALCHEK
PURPOSE:
Main routine to analyze Delay Line Loss Calibration data. Responds to
scans of type DLCAL (scan code 10) or TEST DATA (scan code 1).
CATEGORY:
OVRO APC DATA ANALYSIS
CALLING SEQUENCE:
dlcalchek[,filename][,hrec | ,after=after][,debug][,/cmdfile]
INPUTS:
filename the name of the file containing DLCAL data. If
omitted, the file DAILY.ARC in directory
!DEFAULTS.WORKDIR is assumed.
hrec the record number of the DLCAL scan header. Data
will be processed up to the next EOS segment.
If this argument is given, then AFTER keyword
is ignored.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
after an optional time string of the standard form
[yyyy.ddd ]hh:mm[:ss] after which to start
looking for a valid DLCAL 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>\DLCAL.MSG.
debug a switch that activates some debugging statements
for getting an indication of intermediate steps.
This switch is not compatible with /CMDFILE switch.
ROUTINES CALLED:
openarc, getdata, lasthrec, newscan
OUTPUTS:
COMMENTS:
CALLS: ***
GETDATA, LASTHREC, MOMENT, NEWSCAN, OPENARC, OVSA_PLOTERR, REVERSE
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 04-Mar-1999 by Dale Gary
21-May-1999 DG
Change to write out results into file !DEFAULTS.DBDIR+'DELAY.DAT'
11-Jan-2000 DG
Eliminated hardwired directory locations.
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.
[Previous]
[Next]
NAME:
DOTIMEAVG
PURPOSE:
Performs time averaging of data for SOLAID
CATEGORY:
OVRO APC SOLAID
CALLING SEQUENCE:
result = dotimeavg(tavg,time,amparr[,phzarr])
INPUTS:
tavg The averaging time, in seconds
time On input, the array of times corresponding to the data
amparr On input, the array of amplitudes or total power values
corresponding to the times in array TIME
phzarr On input, the array of phases corresponding to the times
in array TIME. If omitted, AMPARR is interpreted as an
array of total power values
OPTIONAL (KEYWORD) INPUT PARAMETERS:
ROUTINES CALLED:
poly_2d, juldate, pandb
OUTPUTS:
time On output, the array of times derived from averaging TIME
by TAVG.
amparr On output, the array of amplitudes or total powers derived
from averaging array AMPARR by TAVG.
phzarr On output, the array of phases derived from averaging array
PHZARR by TAVG.
COMMENTS:
CALLED BY:
SOLAID
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 28-Jun-2000 by Dale E. Gary (derived from earlier, buggy version)
[Previous]
[Next]
NAME:
DT_TM_MAK
PURPOSE:
Set up a time and date string from reference JD and offset.
CATEGORY:
CALLING SEQUENCE:
s = dt_tm_mak(jd0, [sec])
INPUTS:
jd0 = Julian Date of a reference date (0:00 hr). in
sec = Seconds since JD0 at 0:00. in
KEYWORD PARAMETERS:
Keywords:
FORMAT = format string. Allows output date to be customized.
The default format string is 'Y$ n$ d$ h$:m$:s$ w$'
The following substitutions take place in the format string:
Y$ = 4 digit year.
y$ = 2 digit year.
N$ = full month name.
n$ = 3 letter month name.
0n$= month as a 2 digit number.
d$ = day of month number.
0d$= 2 digit day of month number.
doy$= 3 digit day of year.
W$ = full weekday name.
w$ = 3 letter week day name.
h$ = hour.
m$ = minute.
s$ = second.
f$ = fraction of second (see DECIMAL, DENOMINATOR below).
I$ = time interval in days to 2 decimal places.
i$ = time interval in days as an integer.
H$ = time interval in integer hours.
@ = Carriage Return.
! = Line feed.
DECIMAL=dp Number of decimal places to use for fraction of
second (def=3) for f$ in format. f$ will include dec pt.
DENOMINATOR=den If given then fraction is listed as nnn/ddd
ddd is given by den. Over-rides DECIMAL keyword. Ex:
DENOM=1000 might give 087/1000 for f$ in format.
OUTPUTS:
S = resulting string. out
CALLS: ***
JD2YMD [1], JD2YMD [2], JD2YMD [3], MONTHNAMES [1], MONTHNAMES [2], MONTHNAMES [3]
REPCHR [1], REPCHR [2], REPCHR [3], SECHMS [1], SECHMS [2], SECHMS [3], STRESS [1]
STRESS [2], STRESS [3], WEEKDAY [1], WEEKDAY [2], WEEKDAY [3], YMD2DN
CALLED BY:
TIME_LABEL [1], TIME_LABEL [2], TIME_LABEL [3]
COMMON BLOCKS:
NOTES:
Notes: Some examples: 'h$:m$:s$' -> 09:12:04,
'd$ n$ Y$' -> 12 Jan 1991, 'd$D h$h' -> 3D 2h, ...
MODIFICATION HISTORY:
R. Sterner. 17 Nov, 1988.
Johns Hopkins University Applied Physics Laboratory.
RES 20 Apr, 1989 --- 2 digit year.
R. Sterner, 26 Feb, 1991 --- Renamed from time_date_str.pro
R. Sterner, 27 Feb, 1991 --- Renamed from tm_dt_str.pro
R. Sterner, 28 Feb, 1991 --- changed format.
R. Sterner, 17 Jun, 1992 --- fixed a bug for large sec.
R. Sterner, 27 Sep, 1993 --- Modified to handle arrays.
R. Sterner, 2 Dec, 1993 --- Slightly modified def format.
R. Sterner, 1994 Jun 15 --- Added fraction of second.
R. Sterner, 1995 Mar 8 --- Added i$ format.
R. Sterner, 1995 Jul 6 --- Added 0d$ format.
R. Sterner, 1997 Feb 3 --- Added new keywords 0n$ and doy$ to
give month as 2 digit number and day of year.
Matthew Savoie, Systems Technology Associates --- 1997 Feb 5
fixed a bug by adding floor to: days = long(floor(idays)).
R. Sterner, 1997 Dec 18 --- Added DDECIMAL=ddec for number of
decimal places in Day of Year.
Copyright (C) 1988, 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]
NAME:
DT_TM_MAK
PURPOSE:
Set up a time and date string from reference JD and offset.
CATEGORY:
CALLING SEQUENCE:
s = dt_tm_mak(jd0, [sec])
INPUTS:
jd0 = Julian Date of a reference date (0:00 hr). in
sec = Seconds since JD0 at 0:00. in
KEYWORD PARAMETERS:
Keywords:
FORMAT = format string. Allows output date to be customized.
The default format string is 'y$ n$ d$ h$:m$:s$'
The following substitutions take place in the format string:
Y$ = 4 digit year.
y$ = 2 digit year.
N$ = full month name.
n$ = 3 letter month name.
d$ = day of month number.
W$ = full weekday name.
w$ = 3 letter week day name.
h$ = hour.
m$ = minute.
s$ = second.
@ = Carriage Return.
! = Line feed.
OUTPUTS:
S = resulting string. out
CALLS: ***
JD2YMD [1], JD2YMD [2], JD2YMD [3], MONTHNAMES [1], MONTHNAMES [2], MONTHNAMES [3]
REPCHR [1], REPCHR [2], REPCHR [3], SECHMS [1], SECHMS [2], SECHMS [3], STRESS [1]
STRESS [2], STRESS [3], WEEKDAY [1], WEEKDAY [2], WEEKDAY [3], YMD2DN
CALLED BY:
TIME_LABEL [1], TIME_LABEL [2], TIME_LABEL [3]
COMMON BLOCKS:
NOTES:
Notes: Some examples: 'h$:m$:s$' -> 09:12:04,
'd$ n$ Y$' -> 12 Jan 1991, 'd$D h$h' -> 3D 2h, ...
MODIFICATION HISTORY:
R. Sterner. 17 Nov, 1988.
Johns Hopkins University Applied Physics Laboratory.
RES 20 Apr, 1989 --- 2 digit year.
R. Sterner, 26 Feb, 1991 --- Renamed from time_date_str.pro
R. Sterner, 27 Feb, 1991 --- Renamed from tm_dt_str.pro
R. Sterner, 28 Feb, 1991 --- changed format.
Copyright (C) 1988, 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]
NAME:
dulk_frfr
PURPOSE:
Derive Bremsstrahlung (free-free)
(c.f. Dulk, 1985, ARAA, 23, 169)
CALLING SEQUENCE:
dulk_frfr,te,b_los,vem,freq,fi,rc
dulk_frfr,te,b_los,vem,freq,fi,rc,omega,tau
INPUTS:
te ; electron temperature [K]
b_los ; LOS component of magnetic field strength [G]
vem ; [cm^-3] volume emission measure
freq ; [Hz] observing frequency.
omega ; source size in surface angle [steradian]
OUTPUTS:
fi ; [SFU] flux density (need 'vem' input)
rc ; polarization degree
tau ; optical thickness (need 'em' input)
OPTIONAL INPUTS:
OPTIONAL OUTPUTS:
HISTORY:
Writtern 1999-09-08 T. Yokoyama
Revised 2000-05-03 T. Yokoyama bug fix
[Previous]
[Next]
NAME:
dulk_gysy
PURPOSE:
Derive gyrosyncrotron radiation from power-law electrons.
(c.f. Dulk, 1985, ARAA, 23, 169)
CALLING SEQUENCE:
dulk_gysy,delta,bb,theta,nv,freq,fi,rc
dulk_gysy,delta,bb,theta,nv,freq,fi,rc,omega,tau
INPUTS:
delta : power-law index of non-thermal e- distribution
bb : magnetic field strength [G]
theta : angle [degree] between Line-of-sight and magnetic vector
freq ; [GHz] observing frequency. Default is 17GHz.
nv ; [particles] total number (E>10keV) of non-thermal e-
omega : source size in surface angle [steradian]
OUTPUTS:
fi ; [SFU] flux density (need 'nv' input)
rc : polarization degree
tau ; optical thickness
OPTIONAL INPUTS:
OPTIONAL OUTPUTS:
HISTORY:
Writtern 1999-09-08 T. Yokoyama
Revised 2000-05-03 T. Yokoyama bug fix
Revised 2000-10-18 T. Yokoyama nv,omega,tau
[Previous]
[Next]
NAME:
DUMPREC
PURPOSE:
Formats a segment record into a string array in DUMP format
(either raw hex or with formatting depending on the segment
type).
CATEGORY:
OVRO APC DATA-FORMAT
CALLING SEQUENCE:
out = dumprec(data[,header][,/raw[,ncol=ncol]])
INPUTS:
data an APC segment record
header the header structure corresponding to the data (needed
if the data represent a data segment, but not
needed for other types of segments).
OPTIONAL (KEYWORD) INPUT PARAMETERS:
raw specifies that the dump is to be formatted in hex
ncol specifies the number of columns for raw dump format.
This keyword is ignored unless /RAW switch is used.
ROUTINES CALLED:
decode tl_decode get_segtyp
OUTPUTS:
out a string array with variable contents depending on
the segment type, and whether the RAW keyword is
specified. In all cases, the first element of the
OUT array contains the UT date/time and segment
type of the segment record.
COMMENTS:
CALLS: ***
CVDOY, DECODE, GET_SCNTYP, GET_SEGTYP, MSEC2STR, RDBYTE, SEC2HMS, TL_DECODE, W2L
CALLED BY:
WDUMPREC, WTESTPLOT
SIDE EFFECTS:
RESTRICTIONS:
MODIFICATION HISTORY:
Written 26-Sep-1997 by Dale Gary
09-Dec-1997 DG
Added header decoding
13-Jan-1998 DG
Added CONFIG segment decoding (most of this is preliminary
and will be cleaned up later).
18-Jan-1998 DG
Now uses new DECODE routine to do most of the work
28-Mar-1998 DG
Fixed typo that was messing up RAW formatted data.
24-Aug-1998 DG
Added TRAJECTORY segment
09-Dec-1998 DG
Added support for UINT variable type, due to change in IDL 5.2
17-May-1999 DG
Added dump of ENCODER segment
26-May-1999 DG
Slight changes to allow it to work with In-Lab encoder
08-Jun-1999 DG
Added decoding of EPHEMERIS segment
26-Jul-1999 DG
Added decoding of MONITOR segment
25-Nov-1999 DG
Updated to agree with new Epoch defns
28-Nov-1999 DG
Added decoding of INDEX segment
26-Dec-1999 DG
Added decoding of GAINPARM segment
11-Mar-2000 DG
Added decoding of new DIALOG HISTORY segment
20-May-2000 DG
Adjust output of Encoder segment dump, to work better when there are
a lot of glitches.
14-Jun-2000 DG
Added decoding of DAILYPHZ segment
23-Jul-2000 DG
Some changes to the DAILYPHZ segment decoding
28-Dec-2000 DG
Fixed a bug in the TPCAL decoding
13-Jan-2001 DG
Added decoding of MUX sequence info
14-Jan-2001 DG
Changed reading of MONITOR segment to reflect change in format,
due to new FCAL scheme.
13-Mar-2001 DG
Fix bug that occurred when the Segment list in the INDEX filled the record.
11-Apr-2001 DG
Fix bug that caused crash if MUX sequence was not in the CONFIG segment
15-Jan-2001 DG
Added dump of new HACORR data from CONFIG segment.
08-Nov-2003 DG
Changed headings of TPCAL, TPUPD, AMPCAL, and PHZCAL segments to
reflect change in polarization of the 27-m antennas. Note that
the actual data, if old, may cause the second record of a segment
to be mis-labeled, although the first segment is labeled correctly.
28-Jul-2004 DG
Changed handling of AMPCAL and PHZCAL segments to reflect change in
polarization of the 2-m antennas.
27-Aug-2005 DG
Changed handling of TPCAL and TPUPD segments to reflect change in
polarization of the 2-m antennas.