[Previous]
[Next]
NAME:
CenterOfMass
PURPOSE:
Calculate center of mass of a distribution of masses in n dimensions
CATEGORY:
gen/idl/toolbox
CALLING SEQUENCE:
FUNCTION CenterOfMass, mass_array, loc_array
INPUTS:
mass_array array of any structure; type: integer or float
OPTIONAL INPUT PARAMETERS:
loc_array array[n, size(mass_array,/dim)]
i.e. same structure as mass_array with one extra
leading dimension
OUTPUTS:
P scalar, or array[n]; double precision
coordinates of center of mass. In the one-dimensional
case (n=1) a scalar is returned.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SyncDims
CALLED BY:
even_light, qImage_cw_ZEllipse, qImage_cw_ZUpdate, wedge_content
SIDE EFFECTS:
The center of mass calculation is done in double precision.
PROCEDURE:
Two separate cases are calculated:
> 1. Only the mass_array is specified as an n-dimensional array.
The center of mass is returned as an n-element array (scalar if n=1).
The array index in each dimension is used as the distance scale:
mass_array = [[1,2],[3,4]]
P = centerofmass(mass_array)
results in
P = [0.6,0.7]
> 2. If both mass_array and loc_array are specified then loc_array, with
leading dimension of n elements, specifies the n-dimensional locations
of the masses in mass_array, e.g. in the 3-dimensional case, if mass_array
is a 10x10 array then loc_array would be a 3x10x10 array, with
loc_array[0,*,*] the x-coordinate, loc_array[1,*,*] the y-coordinate and
loc_array[2,*,*] the z-ccordinate.
The above example again:
mass_array = [1,2,3,4]
loc_array = [[0,0],[1,0],[0,1],[1,1]]
P = centerofmass(mass_array)
results in
P = [0.6,0.7]
MODIFICATION HISTORY:
NOV-1999, Paul Hick (UCSD/CASS)
FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
internally the procedure converts the mass array to a normalized mass by
dividing by the total mass. This results in a divide by zero if the sum is
zero (presumably because all masses are zero). To avoid this one unit is
added to each mass.
[Previous]
[Next]
NAME:
CheckDir
PURPOSE:
Check whether a directory exists
CATEGORY:
Environment
CALLING SEQUENCE:
FUNCTION CheckDir, Name, LongName, stay=stay, silent=silent
INPUTS:
Name scalar string, the directory name
Name='' always returns status=1B with
LongName set to the current directory.
OPTIONAL INPUT PARAMETERS:
/stay if set then a 'cd' to the directory is made (if it exists)
OUTPUTS:
Status 0 : directory doesn't exist
1 : directory exists
OPTIONAL OUTPUT PARAMETERS:
LongName scalar string
Status=0 : null string
Status=1 : fully qualified directory name
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
FindAllSubDirs, RemoteView_Display2D, RemoteView_Display3D, SetFileSpec
getnagoyasources, getootyasources, getsmeisources, hide_env, mk_flick
nagoya_glevel, qImage_cw_SmeiMask, qView_FileFilter, skyd_cat, skyd_version
smei_base_testcase, smei_buf, smei_buf_get, smei_buf_getframe, smei_buf_mget
smei_buf_prep, smei_filepath, smei_frm_cp, smei_frm_findpoint, smei_frm_summary
smei_frm_write, smei_getfile, smei_hdr_get, smei_hdr_make, smei_hdr_plot
smei_mkcal_auto, smei_mkmask, smei_mkorb, smei_mksidereal, smei_orbit_stats
smei_sky_track, smei_star_fitone, smei_star_remove, smei_www_skymaps
smei_zld_remove [1], smei_zld_remove [2], smeidb_mounted, unhide_env
vu_get_page, vu_image, vu_movie, vu_quick_movie, www_help, www_help_rsi
RESTRICTIONS:
> No attempt is made to pre-process the input directory name
(such as translation of logicals/env. variables, etc.)
CALLS: ***
FILEPATH, InitVar, hide_env, who_am_i
PROCEDURE:
> CD is used to decide whether a directory exists, and is
used to retrieve the full directory name.
> filepath is called to make sure a trailing (back)slash is appended on
Unix and Windows systems.
MODIFICATION HISTORY:
DEC-1997, Paul Hick
SEP-2002, Paul Hick (UCSD/CASS)
Return zero if input spec contains wildcard.
FEB-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added name of calling routine to informational message.
[Previous]
[Next]
NAME:
clock
PURPOSE:
Display time of day (including day of year (DOY) and Julian day number (JD)
CATEGORY:
Totally unnecessary
CALLING SEQUENCE:
PRO clock
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
TimeGet, TimeSet
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CombineRotations
PURPOSE:
Combine two rotations, i.e. find the rotation resulting from
first applying one (R1), then another (R2) rotation.
CATEGORY:
gen/idl/toolbox/math
CALLING SEQUENCE:
FUNCTION CombineRotations, R1, R2, R3, R4, R5, $
quaternion = quaternion , $
euler_angles= euler_angles , $
dcm = dcm , $
geometric = geometric , $
degrees = degrees
INPUTS:
R1 array[3,n], array[4,n], array[3,3,n]; type: float
first rotation
R2 array[3,m], array[4,m], array[3,3,m]; type: float
second rotation
R1 and/or R2 can be a single rotation with the other
multiple rotations, i.e. n = 1 and m != 1; or n != 1
and m = 1. The single rotation will be combined with
each of the multiple rotations.
R3,R4,R5 Additional rotations. Up to 5 rotations can be combined
in a single call.
OPTIONAL INPUT PARAMETERS:
/quaternion input and output rotations are in quaternions;
/euler_angles in- and output rotations are in Euler angles triplets
/dcm in- and output rotations are in direction cosine matrices
/geometric in- and putput rotations are in geometic form
(unit vector, plua rotation around unit vector).
/degrees if set then all angles are in degrees (default: radians)
OUTPUTS:
R array[3,n > m]; type: same as input
combined rotation in same form as input
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CvRotation, InitVar, IsType, SyncArgs
CALLED BY:
CvSky, CvSky_Galactic, smei_cam_quaternion, smei_camera, smei_frm_where
smei_orient_test, vu_linecut, vu_planarcut, vu_spherecut
SEE ALSO:
EulerRotate
PROCEDURE:
See definition of quaternions in: Foley, van Dam, Feiner and Hughes
'Computer graphics, principles and practice', 2nd edition.
Addison-Wesley, 1992, page 1063
MODIFICATION HISTORY:
MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
compile_opt
PURPOSE:
Controls default IDL error handler and special compiler options
CALLING SEQUENCE:
@compile_opt.pro
PROCEDURE:
Included in virtually all IDL procedures in the SSW_SMEI tree
MODIFICATION HISTORY:
JAN-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
cv
CALLING SEQUENCE:
PRO cv
INCLUDE:
@compile_opt.pro
CALLS: ***
AngleRange, TimeSet, WhatIs, big_eph, ra_fictitious_sun, sgp4_orbit_axis
sphere_distance, txt_read
[Previous]
[Next]
NAME:
CvPrecess
PURPOSE:
Converts equatorial or ecliptic coordinates for epoch UT1 to
epoch UT2, i.e. corrects for precession between the two epochs.
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvPrecess, UT1, UT2, pos , $
degrees = degrees , $
from_ecliptic = from_ecliptic , $
to_ecliptic = to_ecliptic , $
rectangular = rectangular
CALLS: ***
CvSky, CvSky_Precess, EulerRotate, InitVar, REVERSE
INPUTS:
UT array[n]; type: time structure
initial epoch
UT array[n]; type: time structure
final epoch
pos[2,n] or pos[3,n]
spherical coordinates at start epoch UT1
RA or longitude, declination or latitude, and, optional
the distance (the distance is not modified)
OPTIONAL INPUT PARAMETERS:
/degrees if set, all angles are in degrees
/from_ecliptic
/to_ecliptic
by default the input and output are assumed to be in
equatorial coordinates (RA and declination).
If /from_ecliptic is set then the input is assumed to be
in ecliptic coordinates (longitude and latitude)
If /to_ecliptic is set then the output is in ecliptic
coordinates
OUTPUTS:
pos[2,n] or pos[3,n]
spherical coordinates at final epoch UT2
RA or longitude, declination or latitude, and, optional
the distance (the distance is not modified)
INCLUDE:
@compile_opt.pro
CALLS: ***
CvSky, CvSky_Precess, EulerRotate, InitVar, REVERSE
CALLED BY:
big_eph, getnagoyasources, getootyasources, getsmeisources, jpl_eph, jpl_test
mpc_eph, mpc_orbit_eph, sgp4_eph, smei_sky, usno_eph
PROCEDURE:
See R. Green, Spherical Astronomy, Cambridge UP, 1985, Sect. 9.5, p. 217
(1) First transform ecliptic longitude and latitude to equatorial right
ascension and declination (for initial epoch);
(2) Transform equatorial coordinates for initial epoch to epoch J2000.0;
(3) Calculate equatorial coordinates for epoch J2000.0 to final epoch;
(4) Transform back to ecliptic coordinates (for final epoch).
MODIFICATION HISTORY:
DEC-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Adapted from Fortran subroutine PRECESSION_ROT
[Previous]
[Next]
NAME:
CvRotation
PURPOSE:
Convert between several ways of specifying rotations
CATEGORY:
gen/idl/toolbox/math
CALLING SEQUENCE:
FUNCTION CvRotation, $
from_euler = from_euler , $
from_quaternion = from_quaternion , $
from_dcm = from_dcm , $
from_geometric = from_geometric , $
to_euler = to_euler , $
to_quaternion = to_quaternion , $
to_dcm = to_dcm , $
to_geometric = to_geometric , $
degrees = degrees
INPUTS:
OPTIONAL INPUT PARAMETERS:
Only one of the from_* keywords is specified:
from_euler=from_euler
array[3,n]; type: real
triplets of Euler angles
from_quaternion=from_quaternion
array[4,n]; type: real
unit quaternion quatruplets with the scalar in array[3,n]
(MUST be unit quanternion)
from_dcm array[3,3,n]; type: float
direction cosine matrices
from_geometric
array[3,n] or array[4,n]
unit vector, plus angle of rotation around unit vector.
array[3,n]: phase angle, latitude and angle of rotation
array[4,n]: rectangular coordinates and angle of rotation
Only one of the /to_* keywords is specified:
/to_euler if set then the output is an array[3,n] of Euler angles
/to_quaternion
if set then the output is an array[4,n] on unit quaternions
/to_dcm if set then direction cosine matrices array[3,3,n] are returned
/to_geometric
if set then a unit vector in rectangular coordinates and an
angle of rotation around the unit vector, array[4,n]
are returned.
/degrees if set, all angles are in degrees (default: radians)
OUTPUTS:
out array[3,n], array[4,n]; type: same as input
Euler angles, unit quaternion, direction cosine matrix
or unit vector with angle of rotation.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
AngleRange, CV_COORD, InitVar, IsType, ToRadians, boost
CALLED BY:
CombineRotations, CvSky_Galactic, cvsmei, smei_ccd2sky, smei_frm_where
smei_orient_test, smei_sgp4_quat, smei_sky2cam
SEE ALSO:
EulerRotate
RESTRICTIONS:
The quaternion to Euler angle conversion may still have problems near qx = qy = 0
(rotations around the z-axis) and q0 = qz = 0 (rotations around axis in x-y plane.
The singularities themselves (strictly qx=qy=0 and strictly q0=qz=0) are dealt
with properly.
PROCEDURE:
The Euler angle triplets define rotation around z-axis, y-axis and
z-axis respectively.
A specific rotation can be specified by more then one set of Euler
angles or quaternions. For Euler angles [pi+alfa, -beta, pi+gamma] is the same
rotation as [alfa, beta, gamma]. For quaternions [-qx,-qy,-qz,-q0] is the same
rotation as [qx,qy,qz,q0]. If q = cos(phi/2)+sin(phi/2)*u and
-q = cos(chi/2)+sin(chi/2)*v (for unit vectors u and v), then v=-u and
chi/2=180-phi/2, i.e. chi=360-phi. So -q is a rotation over -phi after changing
the sign of the rotation vector.
The conversion /to_euler always returns a positive beta in [0,180].
MODIFICATION HISTORY:
FEB-2003, Paul Hick (UCSD/CASS)
MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Rewrite. Moved scalar quaternion component from first to last position
Improved calculation of quaternions from DCM or Euler angles
(avoiding singularities for q0 close to zero).
[Previous]
[Next]
NAME:
CvSky
PURPOSE:
Converts between ecliptic, heliographic, equatorial and geographic
coordinates
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky, UT, fromvectors , $
from_ecliptic = from_ecliptic , $
from_centered_ecliptic= from_centered_ecliptic, $
from_equatorial = from_equatorial , $
from_galactic = from_galactic , $
from_heliographic= from_heliographic, $
from_centered_heliographic= from_centered_heliographic, $
from_geographic = from_geographic , $
from_gse = from_gse , $
from_gsm = from_gsm , $
from_rtn = from_rtn , $
from_ihg = from_ihg , $
to_ecliptic = to_ecliptic , $
to_centered_ecliptic= to_centered_ecliptic, $
to_equatorial = to_equatorial , $
to_galactic = to_galactic , $
to_heliographic = to_heliographic , $
to_centered_heliographic= to_centered_heliographic , $
to_geographic = to_geographic , $
to_rtn = to_rtn , $
to_gse = to_gse , $
to_gsm = to_gsm , $
to_ihg = to_ihg , $
heliocentric = heliocentric , $
bodycentric = bodycentric , $
degrees = degrees , $
rectangular = rectangular , $
euler_angles = euler_angles , $
euler_info = euler_info , $
silent = silent
INPUTS:
UT array; type: standard time structure
times (UT); Note that if /rectangular is set then UT
can only be an array[1]
(i.e. a single time must be specified)
fromvectors array;
OPTIONAL INPUTS:
from_ecliptic = from_ecliptic
from_centered_ecliptic = from_centered_ecliptic
from_heliographic= from_heliographic
from_centered_heliographic= from_centered_heliographic
from_geographic = from_geographic
from_equatorial = from_equatorial
from_rtn = from_rtn
from_gse = from_gse
from_gsm = from_gsm
from_ihg = from_ihg
array [2,n] or array[3,n]
/rectangular NOT set: In[0,*] is longitude, In[1,*] is latitude;
In[2,*] (optional?) is radial distance
/rectangular set: rectangular (x,y,z) coordinates
Alternatively, fromvectors contains the input vectors and the
appropriate keyword /from* is SET.
/to_ecliptic conversion to ecliptic coordinates
/to_centered_ecliptic
conversion to sun-centered ecliptic coordinates
(/heliocentric NOT set) or earth-centered ecliptic
coordinates (/heliocentric SET)
/to_heliographic conversion to heliographic coordinates
/to_centered_heliographic
conversion to earth-centered heliographic coordinates
/to_geographic conversion to geographic coordinates
/to_equatorial conversion to equatorial ccordinates
/to_rtn conversion to magnetic RTN coordinates
/to_gse conversion to magnetic GSE coordinates
/to_gsm conversion to magnetic GSM coordinates
/to_ihg conversion to inertial heliographic coordinates
/heliocentric used in conjunction with from_centered_ecliptic and
to_centered_ecliptic keywords: sun-centered if /heliocentric
is NOT set; earth-centered if /heliocentric SET
/degrees input and output angles are in degrees
/rectangular input and output is in rectangular coordinates
silent=silent suppresses information messages
INPUTS/OUTPUTS:
Result array[2,*] or array[3,*]; type: double
output array according to selected /to... keyword
if /rectangular is set then the output array will be
in rectangular (x,y,z) coordinates; otherwise spherical
coordinates (longitude, latitude, and (optional) radial
distance is returned
OPTIONAL OUTPUTS:
euler_angles=euler_angles
array[3,*]; type: double
Euler angles applied to input coordinates.
euler_info=euler_info
scalar; type: string
descriptive string describing the transformation
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CombineRotations, CvSky_Equatorial, CvSky_GSE, CvSky_GSM, CvSky_Galactic
CvSky_Geographic, CvSky_Heliographic, CvSky_IHG, CvSky_RTN, EulerRotate, InitVar
IsType, REVERSE, SuperArray, big_eph, destroyvar, jpl_body, who_am_i
CALLED BY:
Carrington, CvPrecess, CvSky_GSM, EarthSky3DLoc, EarthTransit3DLoc
InsituTimeSeries [1], InsituTimeSeries [2], PlotCoronagraph, PlotEarthSkymap
PlotEloTimeMap, PlotPolarSkymap, RemoteView, RemoteView_BodyLoc
RemoteView_Display2D, RemoteView_FovTilt, RemoteView_Init_View
RemoteView_ZEclipticPlane, RotationMeasure, ScEarth, big_eph, big_orbit, cvsmei
jpl_eph, jpl_test, mpc_eph, mpc_orbit_eph, smei_frm_where, smei_sky
smei_sky_getmask, smei_zld_model, smei_zld_remove [1], smei_zld_remove [2]
usno_eph, vu_coronagraph, vu_elotime, vu_extract, vu_linecut, vu_planarcut
vu_point_source, vu_spherecut, vu_timeseries, vu_vox_drawelatitude
vu_vox_drawelongitude, vu_vox_draworbit, vu_vox_write
PROCEDURE:
For the regular celestial coordinate frames see e.g.
R. Green, Spherical Astronomy, Cambridge UP, 1985, Section 17.7, p. 430.
For magnetic RTN,GSE and GSM coordinate frames, see
???
GSE used for magnetic measurements near Earth
x-axis towards Sun, z-axis towards ecliptic North pole
GSM variation on GSE
x-axis towards Sun, z-axis along projection of Earth's magnetic
dipole in plane perpendicular to x-axis. The y-z plane is the
same for GSE and GSM.
RTN used for magnetic field measurements in a heliographic reference
frame. x-axis (R-axis) points radially away from the Sun
The y-axis (T-axis) is the cross product of solar north (solar
rotations axis) and R-axis. The z-axis (N-axis) is the cross product
of R and T-axis.
For an observer in the solar equator the N-axis points toward solar North.
For an observer at Earth x(RTN) = - x(GSE) = -x(GSM), and
three magnetic coordinate frames share the same y-z plane)
IHG used for outer-heliospheric studies. z-axis is toward solar North.
x-axis is towards ascending node of solar equator on ecliptic.
MODIFICATION HISTORY:
MAR-1997, Paul Hick (UCSD/CASS)
adapted from FORTRAN version
MAR-1998, Paul Hick (UCSD/CASS)
now accepts multi-dim arrays
JAN-2001, Paul Hick (UCSD/CASS)
added /rectangular keyword
SEP-2001, Tamsen Dunn, Paul Hick (UCSD/CASS)
added transformations from/to magnetic frames RTN, GSE and GSM
SEP-2006, Paul Hick (UCSD/CASS)
Added fromvectors argument
Added from_centered_ecliptic and to_centered_ecliptic keywords
Added euler_angles and euler_info keywords
Added silent keyword
Added underscores to to* and from* keywords
OCT-2006, Paul Hick (UCSD/CASS)
Now accumulates all Euler angles and calls EulerRotate only once
to perform the coordinate transformation.
JUN-2008, Paul Hick (UCSD/CASS)
Added /to_ihg and from_ihg=from_ihg keywords.
DEC-2009, Paul Hick (UCSD/CASS)
Bugfix. If fromvectors is used, in combination with more than one
of the from_* keywords, routine would abort.
JUL-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added from_centered_heliographic and to_centered_heliographic
[Previous]
[Next]
NAME:
CvSky_Equatorial
PURPOSE:
Euler angles for Ecliptic --> Equatorial conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
abc = CvSky_Equatorial(UT [, /degrees)
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set, all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; type: double
Euler angles for converting from
ecliptic to equatorial coordinates
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, TimeGet, ToDegrees
CALLED BY:
CvSky, CvSky_Galactic
PROCEDURE:
Angle ecliptic-equator as in:
Spherical Astronomy, R.M. Green, Cambridge UP, p. 220, eq 9.25
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_Galactic
PURPOSE:
Euler angles for Ecliptic --> Galactic conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_Galactic, UT, degrees=Degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set, all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; Euler angles for converting from
ecliptic to heliographic coordinates
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CombineRotations, CvRotation, CvSky_Equatorial, CvSky_Precess, REVERSE, TimeSet
CALLED BY:
CvSky
PROCEDURE:
Angle ecliptic-equator as in:
Spherical Astronomy, R.M. Green, Cambridge UP, p. 41, eq 2.31
MODIFICATION HISTORY:
SEP-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_Geographic
PURPOSE:
Euler angles for Ecliptic to Geographic conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_Geographic, UT, degrees=Degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; type: float
Euler angles
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, TimeGet, ToDegrees
CALLED BY:
CvSky
PROCEDURE:
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_GSE
PURPOSE:
Euler angles for Ecliptic to GSE conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_GSE, UT, degrees=degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
Result array[3,n]; type: float
Euler angles
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, big_eph, jpl_body
CALLED BY:
CvSky
PROCEDURE:
Geocentric Solar Ecliptic (GSE) coordinates:
x-axis points from Earth to Sun
y-axis is in the ecliptic plane opposing orbital motion
z-axis points to ecliptic north
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS)
OCT-2006, Pual Hick (UCSD/CASS; pphick@ucsd.edu)
Replaced NewcombSun by big_eph
[Previous]
[Next]
NAME:
CvSky_GSEQ
PURPOSE:
Euler angles for Ecliptic to GSEQ conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_GSEQ, UT, degrees=degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
Result array[3,n]; type: float
Euler angles
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, big_eph, jpl_body
PROCEDURE:
Geocentric Solar Equatorial (GSEQ) coordinates:
x-axis points from Earth to Sun
y-axis is parallel to Sun's equatorial plane pointing
east of the Sun
z-axis is pointing north and completes righthanded
coordinate frame
The Sun's rotation axis lies in the x-z plane.
MODIFICATION HISTORY:
OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_GSM
PURPOSE:
Euler angles for Ecliptic to GSM conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_GSM, UT, degrees=degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
Result array[3,n]; type: float
Euler angles
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CvSky, SubArray, SuperArray, TimeGet, ToDegrees, ToRadians, big_eph, jpl_body
CALLED BY:
CvSky
PROCEDURE:
Geocentric Solar Magnetospheric (GSM) coordinates
x-axis points from Earth to Sun
z-axis is the northern magnetic pole, projected in plane perp to x-axis.
The difference between the GSM system and the GSE
and GSEQ is a rotation about the X-axis.
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS)
JUN-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bugfix. The conversion of UT to years since 2000 somehow
lost the subtraction of 2000.
[Previous]
[Next]
NAME:
CvSky_Heliographic
PURPOSE:
Euler angles for Ecliptic to Heliographic conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_Heliographic, UT, degrees=degrees, longitude=longitude
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
longitude array[n] or scalar; type: float; default: 0
heliographic longitude(s). See PROCEDURE.
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; type: float
Euler angles for rotation from ecliptic to heliographic
coordinate frame
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
AngleRange, IsType, SubArray, SuperArray, TimeGet, TimeUnit, ToDegrees
CALLED BY:
CvSky, vu_solardisk
SEE ALSO:
CvSky_IHG
PROCEDURE:
The ecliptic longitude for the ascending node and the inclination of
equator to ecliptic are from R. Green, "Spherical astronomy", p. 431
If keyword 'longitude' is specified than the Euler angles refer
to a rotation from an ecliptic reference frame to a
heliographic reference frame with longitude measured from the
heliographic meridian through 'longitude', instead of the
heliographic prime meridian (i.e. heliographic longitude zero).
This is useful, for instance, to set up 'earth-centered'
heliographic coordinates with heliographic longitude measured
from the heliographic longitude of Earth.
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_IHG
PURPOSE:
Euler angles for Ecliptic to IHG conversion
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_IHG, UT, degrees=degrees
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; type: float
Euler angles
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, TimeGet, TimeUnit, ToDegrees
CALLED BY:
CvSky
SEE ALSO:
CvSky_Heliographic
PROCEDURE:
The IHG z-axis is along the solar rotation axis (solar north).
The x-axis is toward the ascending node of the solar equator
on the ecliptic. See
http://nssdcftp.gsfc.nasa.gov/miscellaneous/documents/b46547.txt
and Burlaga, "MHD Processes in the Outer Heliosphere",
Space Sci. Rev. 39, 255-316, 1984.
Note that the nssdc website says:
"The X(IHG) axis drifts slowly with time, approximately one
degree per 72 years", while the Burlaga paper says (p. 260)
".. we shall take the X(IHG) axis along the direction of the
ascending node in 1900". I.e. the Burlaga paper seems to want
the X(IHG) axis fixed at epoch 1900.
Here we follow the description of the website.
The ecliptic longitude for the ascending node and the
inclination of equator to ecliptic are from
R. Green, "Spherical astronomy", p. 431
MODIFICATION HISTORY:
JUN-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_Precess
PURPOSE:
Euler angles for precesion of equatorial coordinates from epoch UT to J2000
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
abc = CvSky_Precess(UT [, /degrees)
INPUTS:
UT array[n]; type: time structure
OPTIONAL INPUT PARAMETERS:
/degrees if set, all angles are in degrees (default: radians)
OUTPUTS:
abc array[3,n]; Euler angles for precession from epoch UT to J2000
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
SubArray, SuperArray, TimeGet, ToDegrees
CALLED BY:
CvPrecess, CvSky_Galactic
PROCEDURE:
Precession angles from:
Spherical Astronomy, R.M. Green, Cambridge UP, p. 219, eq 9.23
MODIFICATION HISTORY:
DEC-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
CvSky_RTN
PURPOSE:
Euler angles for Heliographic to RTN conversion at Earth
CATEGORY:
smei/gen/idl/ephem
CALLING SEQUENCE:
FUNCTION CvSky_RTN, UT_or_LOC, degrees=degrees
INPUTS:
UT_or_LOC array[3,n]; type: float
heliocentric locations in heliographic
coordinates (heliographic longitude, latitude and
distance)
array[n]; type: time structure
UT times; in this case the heliocentric locations
is assumed to be at Earth at the specified times
OPTIONAL INPUT PARAMETERS:
/degrees if set all angles are in degrees (default: radians)
OUTPUTS:
Result array[3,n]; type: float
Euler angles to rotate from heliographic
coordinates to RTN coordinates
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
IsTime, SubArray, big_eph, jpl_body
CALLED BY:
CvSky, RotationMeasure
PROCEDURE:
RTN (Radial, Tangential, Normal) coordinates at point P:
x-axis = radial direction
y-axis = in tangent plane, parallel to solar equator
z-axis = in tangent plane, pointing toward the solar north pole
MODIFICATION HISTORY:
AUG-2002, Paul Hick (UCSD/CASS)
OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added option to directly enter heliocentric locations
in addition to always using Earth's location.