[Previous]
[Next]
NAME:
eclipsed_area
PURPOSE:
Calculates fraction of solar disk eclipsed by Moon or Earth
CATEGORY:
gen/idl/toolbox
CALLING SEQUENCE:
FUNCTION eclipsed_area, loc_sun, loc_em, $
degrees = degrees , $
elo = elo , $
ut = ut , $
plotc = plotc , $
earth = earth , $
radius = radius , $
silent = silent , $
_extra = _extra
INPUTS:
loc_sun array[3,n] or array[3,2,n]; type: float
if array[3,n]; location of Sun in spherical coordinates
(RA,dec,distance, or long, lat, distance)
if array[3,2,n] then array[3,0,*] specifies the location
of the Sun and array[3,1,*] specifies the location
of the Moon or Earth. In this case loc_em is ignored.
loc_em array[3,n]; type: float
location of Earth or Moon in same coordinates as for the Sun.
OPTIONAL INPUT PARAMETERS:
/degrees if set, all angles are in degrees (default: radians)
/plotc if set, then results are plotted
(angular separation of Sun and Moon or Earth, and fraction of
disk eclipsed).
ut=ut array[*]; type: structure
time structure used to plot a time axis (only used
if /plotc is set).
OUTPUTS:
area array[n]; type: float
fraction of solar disk eclipsed by Moon or Earth.
OPTIONAL OUTPUT PARAMETERS:
elo array[*]; type: float
angular distance between Sun and Moon or Earth
INCLUDE:
@compile_opt.pro
CALLS: ***
BadValue, InitVar, IsTime, IsType, PlotCurve, SyncArgs, ToDegrees, ToRadians
sphere_distance
CALLED BY:
smei_frm_cvhdr, smei_frm_eclipse
PROCEDURE:
MODIFICATION HISTORY:
OCT-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
env_slashes
PURPOSE:
Fixes environment variables on Windows
CATEGORY:
gen/idl/environment
CALLING SEQUENCE:
PRO env_slashes
INPUTS:
(from Windows by retrieving results of spawning
the DOS 'set' command).
OUTPUTS:
(modified env variables)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
FILEPATH, txt_read
PROCEDURE:
On Windows SSW sets up environment variables with a mix
of back- and forward slashes. This causes problems for e.g.
the IDL dialog_pickfile procedure.
This procedure runs through all env variables and changes
forward slashes to backward slashes. Only env variables of
the form SSW_*_INSTR are not modified.
MODIFICATION HISTORY:
FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
EqKepler
PURPOSE:
Kepler's equation is used in the determination of orbital positions.
It gives the relation between mean and eccentric anomaly (for given
orbit eccentricity).
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
F = EqKepler(E,arg)
INPUTS:
E scalar; type: float
eccentric anomaly (radians)
arg array[2], type: float
arg[0] mean anomaly (radians)
arg[1] orbit ellipticity (eccentricity)
OUTPUTS:
EqKepler fnc value
EXTERNAL BY:
KeplerOrbit
PROCEDURE:
The eccentric anomaly is the root of Kepler's equation:
EqKepler = X-arg[1]*sin(X)-arg[0] = 0
See O. Montenbruck, "Practical Ephemeris Calculations", Springer
(1989), par. 3.1.1.4, p. 44
MODIFICATION HISTORY:
1990, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
EulerRotate
PURPOSE:
Calculate spherical angles in rotated coordinate system
CATEGORY:
gen/idl/toolbox/math
CALLING SEQUENCE:
FUNCTION EulerRotate, ABG, In, In1, In2, degrees=Degrees, rectangular=Rectangular
INPUTS:
ABG array[3] or multi-dimensional array[3,..] with first dimension of 3
elements. If multi-dimensional, then:
1. either the array structure, except for the 1st dimension, is the same
as for In. Each position in In is rotated using the matching ABG set.
2. or In is only 1-dimensional i.e. contains only one position. Then
each ABG combination is applied to this one position.
Euler angles [A, B, G]
A phase angle of the pole Z(new) in old coordinate system
B polar angle of the pole Z(new) in old coordinate system
G phase angle of X(new) in coordinate system (2)
/rectangular NOT SET:
In any multi-dimensional array with first dimension of 2 or 3 elements.
array[0,..] is the longitude and array[1,..] the latitude;
array[3,..] (usually the radial distance) is not modified.
/rectangular SET:
In array[3,..], any multi-dimensional array with array[i,..] (i=0,2)
the x,y and z-components
OPTIONAL INPUTS:
/rectangular if set, the input array In is interpreted as vectors in rectangular
coordinates.
if not set, the input array In is assumed to be in spherical coordinates
(longitude, latitude, radial distance).
/degrees if set, input and output is in degrees
OUTPUTS:
/rectangular NOT SET:
double array with same structure as input array In
array[0:1,..] are longitude and latitude in new coordinate system
(0<=Lng<360, -90<=Lat<=90)
/rectangular SET:
array[3,..] with same structure as input array In
x,y,z coordinates in new coordinate system
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CvT3d, SubArray, SuperArray, SyncDims, ToRadians
CALLED BY:
CvPrecess, CvSky, FishEye, HammerAitoff, KeplerOrbit, MercatorProj, PlotCoronagraph
PlotEarthSkymap, PlotPlanarCut, RemoteView_CMEDensity, RemoteView_Init_FOV
RemoteView_StereoStates, RotationMeasure, ThomsonLOSDensity, qvu_draw
smei_star_stdmaps, smei_zld_dumbbell, vu_coronagraph, vu_elotime, vu_linecut
vu_planarcut, vu_spherecut
PROCEDURE:
> /rectangular NOT SET:
Given longitude (phase angle) and latitude (90-polar angle) of a point
in some coordinate system [axes: X(old),Y(old),Z(old)], angles are
calculated in the new coordinate system [axes: X(new),Y(new),Z(new)]
rotated with respect to the original one over the Euler angles Alfa,
Beta, Gamma.
The rotation from old to new system is realized by
(1) rotation around Z(old) over Alfa ---> X(1),Y(1),Z(1)=Z(old)
(2) rotation around Y(1) over Beta ---> X(2),Y(2)=Y(1),Z(2)=Z(new)
(3) rotation around Z(new) over Gamma ---> X(new),Y(new),Z(new).
> /rectangular SET:
The 3D rotation !p.t is used do do the transformation.
MODIFICATION HISTORY:
1989, Paul Hick (MPAE,UCSD)
FEB-1998, Paul Hick (UCSD/CASS), added call to cvt3d to handle conversion
of rectangular coordinates
JUN-2000, Paul Hick (UCSD/CASS), added option to rotate
single position using multiple Euler angle combinations.
SEP-2001, Paul Hick (UCSD/CASS),
removed a restriction on ABG for a transformation of rectangular
coordinates. Only one set of Euler angles was allowed. Now separate
Euler angles can be specified for each vector in 'In'; these are
processed using an explicit do-loop).
AUG-2004, Paul Hick (UCSD/CASS)
For rotations of spherical coordinates (/Rectangular NOT set) a safety
check cos(angle) > (-1) made bad coordinate values disappear
(!values.f_nan > 1 returns 1, while !values.f_nan < 1 returns !values.f_nan).
The safety check now explicitly checks for bad values, so they don't
get lost.
DEC-2005, Paul Hick (UCSD/CASS, pphick@ucsd.edu)
Bug fix. When 1-element arrays are input at In and In1, the output would
be a scalar. The output should always have the same structure as the input.