[Previous]
[Next]
NAME:
defsysv_smei
PURPOSE:
Defines a number of useful constants as system variables
CATEGORY:
Environment
CALLING SEQUENCE:
defsysv_smei
INPUTS:
(none)
OUTPUTS:
Defines system variables
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
DEFSYSV_
CALLED BY:
IDL_startup, IDL_vm_startup
PROCEDURE:
> For all system variables the IDL defsysv procedure is called only if the variable
doesn't exist yet. A 2nd call to this procedure does nothing useful.
> !TheForegroundColor and !TheBackgroundColor
The idea is to set !TheForegroundColor to black and !TheBackgroundColor to white.
IDL sets the foreground to white (color index !d.n_colors-1) and the background to
black (index 0) everytime the plot device is switched with 'set_plot'. This can be
reversed by calling 'flip_colors' (which uses the two new color-related system
variables).
> !TheTerminal, !ThePrinter
Typically the terminal device (e.g. X or WIN) and the printer device (e.g. HP, EPS)
remain the same during an IDL session. To assist in switching back to either device
after a 'set_plot' call the device names are stored in two system variables.
!TheTerminal can be set here since IDL sets the proper !d.name on startup.
!ThePrinter is set here to the generic windows 'PRINTER' device, just to make sure it
exists. For other platforms dependent it should be updated in the IDL_postop_* procedures.
> !ThePlotFile
!ThePlotFile is used by 'set_page' and 'spitplot' do keep track of the current plotfile.
The constants are stored in several structures: !sun, !earth, !physics
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
OCT-2002, Paul Hick (UCSD/CASS)
Added JulianYr to !earth
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added !TheTime
[Previous]
[Next]
NAME:
destroyvar
PURPOSE:
Destroy an IDL variable
CATEGORY:
Toolbox: generic
CALLING SEQUENCE:
PRO destroyvar, a, b, c, d, e, f, g, h
INPUTS:
a,b,c,d,e,f,g,h any IDL variable
OUTPUTS:
(none; that's the point)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
AlignHeliosphere, CvSky, GetColors [2], GetColors [3], InsituTimeSeries, PRO bold
PlotBars, PlotDashes, PlotEarthSkymap [2], PlotEarthSkymap [3]
PlotEarthSkymap [4], RemoteView, RemoteView_Display2D, RemoteView_Display3D
RemoteView_FOV, SMEI_cr_removal, ThomsonLOSDensity, ThomsonLOSFar
ThomsonLOSRomb, ThomsonLOSStep, ThomsonSetupLOS, TimeSplit, TimeXAxis, allsky [1]
allsky [2], allsky [3], allsky_f, ark_duty_cycle, big_eph, big_eph_clean, big_orbit
cvsmei_init, even_light, even_light_info, even_light_photometry, fileset_sizes
flt_read, flt_string, forecast, forecast_env, forecast_ftp, forecast_ice
getipssources, getnagoyasources, getootyasources, getsmeisources, grd_read
hide_env, init_contiguous_group, jpl_close, maygeometry, merge_ranges
next_contiguous_group, nso_fe_start, plotbars_plot, qGlitch_Run
qImage_cw_DrawEphem, qImage_cw_Ephem, qImage_cw_EphemKill [1]
qImage_cw_EphemKill [2], qImage_cw_SMEI, qLine_Curve, qView_ApplyGain
qView_Gain, qView_PlotTrack, qvu_pick, run_map, set_page, skyd_cat, skyd_pass2make
smei_buf, smei_buf_getframe, smei_buf_prep, smei_buf_read, smei_filepath
smei_findcrazy, smei_findobj, smei_findpnt, smei_frm_base, smei_frm_drive
smei_frm_findpoint, smei_frm_hbar, smei_frm_summary, smei_frm_track
smei_frm_where, smei_getfile, smei_hdr_c3maskupload, smei_hdr_get, smei_hdr_plot
smei_mkbase, smei_mkcal, smei_orbit_stats, smei_plot_timeseries, smei_setup_roi
smei_sgp4_orbits, smei_sky, smei_sky_cleanedge_fov, smei_sky_read, smei_star_fit
smei_star_list, smei_star_lsqfit, smei_star_readpnt, smei_star_remove
smei_star_show, smei_star_standard, smei_www_skymaps, smei_zld_model
smeidb_mounted, stardistance, strbreak, thomsonfig, txt_block_read, txt_read
vox_update, vu_coronagraph, vu_earthskymap, vu_elotime, vu_extract, vu_getdata
vu_header, vu_insitu, vu_linecut, vu_movie, vu_nagoyasourcemap, vu_planarcut
vu_radialcut, vu_read, vu_remoteview, vu_solardisk, vu_spherecut, vu_syncgrid
vu_synopticmap, vu_thomson_antifish, vu_thomson_hammer, vu_type_insitu
vu_vox_write, where_overlap, wso_write, www_help_crosslinks, www_help_is_code
xhcs
RESTRICTIONS:
Up to 8 variables can be destroyed in one call
PROCEDURE:
Use 'temporary' to move the variable to be deleted to local variable,
which in turn is destroyed when the subroutine exits.
MODIFICATION HISTORY:
MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
Distance2Line
PURPOSE:
Calculates the distance of a point to a line for points and lines in the x-y plane
CATEGORY:
Tricks
CALLING SEQUENCE:
d = Distance2Line(line, point, [,/close])
INPUTS:
line array[2,n]; type: any
array of points (x,y coordinates) defining line(s)
There should be at least 2 points (n>=2)
pointx if only pointx is specified:
array[2,m1,m2,...]; type: any
points to be tested
if both pointx and pointy are specified:
pointx array[m1]
x-coordinates of points to be tested
pointy array[m2]
y-coordinates of points to be tested
if /grid is not set then m1 MUST be equal to m2
if /grid is set then each x-coordinate is combined with
each y-coordinate to cover an m1 x m2 grid of points
OPTIONAL INPUT PARAMETERS:
/close_area adds first point of 'line' array to the end of the array
(this effectively 'closes' the curve described by the 'line' array).
/grid (only used if both pointx and pointy are used)
OUTPUTS:
d array[n',m1,m2,...]
n'=n-1 if /close_area not set
n'=n if /close_area set
OPTIONAL OUTPUT PARAMETERS:
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, SyncDims
RESTRICTIONS:
If the 'line' array represents a boundary of an area in the x-y plane with a simple
enough shape then this procedure can be used to find points inside the closed area.
If 'line' runs in the clockwise/counter-clockwise direction around the area then all
distances will be positive/negative for points inside the closed area.
'Simple enough shape' means that the curvature should be in the same sense everywhere.
PROCEDURE:
> Each pair of points line[*,i] and line[*,i+1] (i=0,n-1) defines a line in the
x-y plane. If /close_area is set then an additional pair line[*,n], line[*,0]
is defined.
> For each point in the 'point' array the distance to each of the lines is
calculated. The distance is positive it the point is toward the right of the line when
looking from line[*,i] to line[*,i+1], and negative on the other side.
> If vectors r1 and r2 correspond to points line[*,i] and line[*,i+1], respectively, and
vector p corresponds to a point then the distance calculated as
(r2-p)x(r1-p).z/|r2-r1| (z is a unit vector in the z-direction)
MODIFICATION HISTORY:
JAN-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
Distance2Sun
PURPOSE:
Calulates Electron-Sun distance and angle Sun-Electron-Observer
CALLING SEQUENCE:
FUNCTION Distance2Sun, Elo, S, SinChi, degrees=Degrees, grid=grid
INPUTS:
Elo array; type: float
elongations of lines of sight
S array; type: float
Distance along line of sight (i.e. Observer-Electron
distance) in units of the Observer-Sun distance.
If /grid NOT set then S should have the same structure
as 'Elo'. If /grid is set then any array is allowed.
OPTIONAL INPUT PARAMETERS:
/degree if set all angles are in degrees (default: radians)
/grid if set then every element in S is combined with
every element in Elo
OUTPUTS:
Result array; type: float
Sun-Electron distance (same units as S)
SinChi array; type: float
Sine of angle Sun-Electron-Observer
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, SuperArray, ToRadians
CALLED BY:
ThomsonLOSStep, ThomsonTang, ThomsonTangMRad, thomsonfig
PROCEDURE:
> The elongation is the angle between observer-Sun and observer-electron
direction (Elo = 0 is the direction observer-Sun)
> Cosine and sine rule in triangle with Sun, Observer and Electron on the corners.
MODIFICATION HISTORY:
SEP-1996, Paul Hick (UCSD)
JUN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Replacement for old ElSunDistance function
Added /grid keyword
[Previous]
[Next]
NAME:
do_file
PURPOSE:
File manipulations: moving, copying and deleting files
CALLING SEQUENCE:
FUNCTION do_file, file, dest, $
copy = copy , $
delete = delete , $
move = move , $
silent = silent , $
buffer = buffer
INPUTS:
file scalar: type: string
file spec (may contain wildcards)
dest scalar: type: string
destination for copy or move
OPTIONAL INPUT PARAMETERS:
/copy copies file
/delete deletes file
/move moves (renames) file
silent=silent controls messages to screen
OUTPUTS:
Result 1 = success ; 0 = failure
on Windows and Unix no status code is available
and the value 1 is returned.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
FILEPATH, GetFileSpec, InitVar, IsType, SetFileSpec, hide_env, who_am_i
CALLED BY:
Plot_Helios_Br, Plot_g_level1, Plot_velocity, bin_read, clean, clean_loc_smei
flt_read, forecast_ftp, forecast_ice, get_page, grd_read, img_read, mk_flick, orb_comp
run_ssw_smei, set_page, smei_buf, smei_findcrazy, smei_frm_cp, smei_frm_findpoint
smei_frm_read, smei_fts_read, smei_hdr_plot, smei_mkglare, smei_mkorb
smei_orbit_stats, smei_sky_cleanedge_map, smei_star_readpnt, smei_star_remove
smei_star_split, smei_zld_remove [1], tolowcase, txt_read, vox_read, vu_get_page
vu_image, vu_movie, vu_quick_movie, vu_write, www_help_rsi, www_help_smei
RESTRICTIONS:
One and only one keyword can be set
PROCEDURE:
> FIND_FILE is used to locate a file matching the input `file' value.
(if file='' or absent no action is taken).
> `dest' is checked by DO_PARSE to make sure it is a valid file name
On VMS all file operations use call_external to execute system functions or
other F77 functions:
/move calls the system function LIB$RENAME_FILE first (if not succesful
the F77 function COPY_FILE is called followed by a LIB$DELETE_FILE
call (this should work across drives)
/copy calls the F77 function COPY_FILE
/delete calls the system function LIB$DELETE_FILE
> On Windows and Unix the proper shell command is spawned, with 'file' and
'destin' as arguments.
RESTRICTIONS:
If large groups of files are processes the concatenated list of file names
can create a cp,rm or mv command that is too long. The threshold for the length
of a shell command apparently is 128kB (the actual limit is somewhat lower in
practice, and apparently is not the same for all Linux boxes on the subnet,
even those running the same Linux distribution).
Currently files are processed in groups that keep the length below 124 kB. So far
this appears to be a safe value. Use the keyword buffer to override the default.
MODIFICATION HISTORY:
JAN-1995, Paul Hick (UCSD/CASS)
APR-2000, Paul Hick (UCSD/CASS)
IDL 5.4 has some added feature: /hide keyword for Windows; exit status
for Windows and unix. The unix modifications haven't been tested since
we don't have 5.4 on any of the Linux boxes yet.
JAN-2002, Paul Hick (UCSD/CASS)
Fixed a pretty lethal bug in the file delete procedure on Windows.
(it might try to delete all files in the current directory!!).
SEP-2005, Paul Hick (UCSD/CASS)
Added code to copy multiple files at once.
JUL-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Replaced findfile by file_search
[Previous]
[Next]
NAME:
dusan_earth
PURPOSE:
Hack to look at evo_earth.dat file from Dusan's MHD runs
CALLING SEQUENCE:
PRO dusan_earth, $
xysize = xysize , $
density = density , $
velocity = velocity , $
correlation =correlation , $
timeseries =timeseries , $
font = font
INCLUDE:
@compile_opt.pro
@vu_fnc_include.pro
CALLS: ***
InitVar, InsituTimeSeries, Instrument, TimeInterpol, TimeOp, TimeSet, TimeUnit, WhatIs
flt_read, get_page, set_page, vu_insitucurve