[Previous]
[Next]
NAME:
PA_POLE
PURPOSE:
Calculate the position angle of the solar poles
CATEGORY:
Astronomy: celestial physics
CALLING SEQUENCE:
function PA_POLE(ID,iYr,Doy,RLNG)
INPUTS:
ID integer = 1,-1 : Get PA relative to Equatorial North of Earth
= 2,-2 : Get PA relative to Ecliptic North
ID>0 gets the PA of the north pole
ID<0 gets the PA of the south pole
iYr integer Year in form XXXX
Doy real Day of year (1-366)
RLNG real Ecliptic longitude of Sun as viewed from
observer (i.e. topocentric longitude)
OUTPUTS:
PA_POLE
real Position angle in degrees
CALLS: ***
atand, cosd, tand
CALLED BY:
Pandora
INCLUDE:
include 'sun.h'
PROCEDURE:
> For given time iYr,Doy and ecliptic longitude of the Sun (as seen
from an observer in the ecliptic plane) the position of angle
of the solar pole is calculated, either relative to ecliptic or to
equatiorial North.
See Spherical Astronomy pp. 430-433 by Green, Robin M., Cambridge UP (1985)
(The position angle is measured counterclockwise, i.e. toward the east,
from North)
> PA(south pole) = PA(north pole)+180
MODIFICATION HISTORY:
Tom Davidson, Paul Hick (UCSD/CASS; pphick@ucsd.edu) July 1992
[Previous]
[Next]
NAME:
Pandora
PURPOSE:
Mostly tools for manipulating Helios photometer data; also:
time transformatios, celestial coordinates transformations, heliocentric
positions of Earth, Helios 1 and Helios2, binary interpretations as
integer*2, integer*4, real*4 and real*8
CATEGORY:
Good stuff
CALLING SEQUENCE:
program PANDORA
INPUTS:
OUTPUTS:
CALLS: ***
ArrI1Zero, ArrR4Bad, AskChar, AskI2, AskI4, AskR4, AskR8, AskWhat, AskYN, Bit16, Bit2to4
Bit32, Bit4to2, DATE_DOY, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, FileInfo
HOSOrbID, HOSOrbit, IndexR4, Julian, LocFirst, N_CARRINGTON, PA_POLE
PRECESSION_APPROX, Pandora_Menu, Pandora_Records, Say, SortI4, Str2Flt, Str2Flt_Exp
Str2Flt_Format, SunNewcomb, TinyR4, bHOSName, bOpenFile, cFlt2Str, cInt2Str
iArrI4ValuePresent, iArrR4Compare, iFreeLun, iGetSymbol [1], iGetSymbol [2]
iHOSInfo, iHOSRead, iHOSWrite, iOSRenameFile, iSearch, iUniqueName, icompress, itrim
iwhitespace
INCLUDE:
include 'dirspec.h'
include 'openfile.h'
include 'hos_e9.h'
PROCEDURE:
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Completed ascii-binary and binary-ascii conversion for Helios
photometer files.
[Previous]
[Next]
NAME:
Pandora_Menu
PURPOSE:
Internal use by Pandora
CALLING SEQUENCE:
integer function Pandora_Menu(iAns,bOS)
CALLS: ***
AskI4, Say
CALLED BY:
Pandora
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
Pandora_Records
PURPOSE:
(Internal use by Pandora only)
CALLING SEQUENCE:
logical function Pandora_Records(cFile,iR,nB,IREC,Z)
CALLS: ***
Say, bOpenFile, bTempFile, iFreeLun, iHOSRead, iHOSWrite
CALLED BY:
Pandora
INCLUDE:
include 'openfile.h'
include 'hos_e9.h'
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
ParseRepair
PURPOSE:
Deconstruct file names into components
CALLING SEQUENCE:
subroutine ParseRepair(FileSpec,iDir,iNam)
INPUTS:
OUTPUTS:
CALLS: ***
LocFirst, Str2Str, Str2StrSet
CALLED BY:
iFileStructure, iGetDirectoryFragment, iGetFileSpec, iGetParentDirectory
iGetTopDirectory, iSetFileSpec
INCLUDE:
include 'filparts.h'
include 'dirspec.h'
include 'str2str_inc.h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
Peep
PURPOSE:
Reads and displays information about several types of files:
Helios data files, SMEI camera images (*.nic), compressed files (*.ice).
CATEGORY:
I/O
CALLING SEQUENCE:
program peep
INPUTS:
file command line argument: name of file
-nic identifies file as a SMEI camera file
-ice identifies file as a compressed SMEI camera file
-hos identifies file as Helios photometer file
-wso identifies file as WSO magnetic field map
CALLS: ***
ArrI4GetMinMax, ArrR4GetMinMax, AskChar, BRead_WSO, Flt2Str, ForeignArg, Int2Str
LocFirst, NicHdr, Say, Str2Str, Time2Str, bReadNic, iGetFileSpec, iHOSInfo, iSetFileSpec
ice_read, itrim, lowercase, smei_frm_read
INCLUDE:
include 'dirspec.h'
include 'openfile.h'
include 'filparts.h'
include 'smei_frm_hdr.h'
include 'smei_frm_layout.h'
PROCEDURE:
If no file name is specified on the command line then a prompt for a
file name will follow.
In Windows a file type can be defined to run when a .nic or .ice file
is double-clicked in Explorer:
- In Explorer go to View/Options/File Type; select New Type
- In 'Descripton of Type' specify: SMEI CCD image
- In 'Associated Extension' specify: .nic
- Below the 'Actions' box, click New.
- In 'Action' specify: open
- In 'Application to perform action' specify: D:\soft\exe\win\peep.exe %1
- Click OK.
MODIFICATION HISTORY:
MAY-2000, Paul Hick (UCSD/CASS)
JAN-2003, Paul Hick (UCSD/CASS)
Added -ice and -nic command line arguments
APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added capability to read WSO magnetic field files
[Previous]
[Next]
NAME:
phys
PURPOSE:
Defines parameter constant for several physical quantities
INCLUDED BY:
AIPS_WTF, IPSBase, LOSPosition, ThomsonElectron, ThomsonElectronFar, ThomsonLOS
ThomsonLOS3D, ThomsonLOS3DStep, ThomsonLOSFar, ThomsonLOSStep
PROCEDURE:
[Previous]
[Next]
NAME:
pInfR4
PURPOSE:
Provides a generic identifier for positive infinity
CATEGORY:
gen/for/lib
CALLING SEQUENCE:
function pInfR4()
INPUTS:
(none)
OUTPUTS:
X real positive infinity identifier
CALLS:
(none)
CALLED BY:
Dust, HOSOrbID, HOSPlot, LOSReach, PrintAll, iHOSArch
SEE ALSO:
BadI4, BadR4, BadR8, TinyR4
INCLUDE:
include 'math.h'
PROCEDURE:
The pInfR4 number is pulled out of the include file.
It is set to the largest positive real*4 number on VMS
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
planet
PURPOSE:
Parameters for several planets and Moon
CATEGORY:
gen/for/h
CALLING SEQUENCE:
include 'planet.h'
INCLUDED BY:
smei_eclipse
MODIFICATION HISTORY:
MAY-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
PlanetOrbit
PURPOSE:
Calculate positions and velocities for planets
as a simple Kepler orbit
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine PlanetOrbit(iPlanet,iYr,Doy,RR,VV)
INPUTS:
iPlanet integer Planet identifier
1: Mercury
2: Venus
3: Earth/Moon
4: Mars
5: Jupiter
6: Saturn
7: Uranus
8: Neptune
9: Pluto
iYr integer time (year and day of year) where ..
Doy real .. position should be calculated
OUTPUTS:
RR(3) real position vector relative to m1:
1: ecliptic longitude (deg),
2: ecliptic latitude (deg),
3: radial distance (AU)
VV(5) real velocity vector relative to m1:
1: ecliptic longitude (deg),
2: ecliptic latitude (deg),
3: velocity (AU/day),
4: tangential velocity (AU/day),
5: radial velocity (AU/day)
CALLS: ***
Julian, KeplerOrbit
CALLED BY:
ExtractPosition, ExtractPositionn8
RESTRICTIONS:
The orbit is strictly a two-body solution.
No perturbations of any kind are taken into account.
PROCEDURE:
The orbital parameters are hardwired.
The calculation is done by KeplerOrbit.
Average orbital elements and centennial rates of change
(from Explanatory Suppl. to the Astronomical Almanac,
Univ. Science Books, 1992, p. 316). Orbital elements
semi-major axis (AU),
eccentricity,
inclination of orbital plane to ecliptic plane (deg).
ecliptic longitude of ascending node (deg),
longitude of perihelion (deg),
mean longitude at epoch J2000 (deg)
MODIFICATION HISTORY:
May 1997, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
POINT_ON_LOS
PURPOSE:
Converts from topocentric to heliocentric coordinates and v.v
CALLING SEQUENCE:
subroutine POINT_ON_LOS(XLNG,XLAT,RP,ELOLD,ELNEW,iEorW)
INPUTS:
(either topocentric or heliocentric)
XLNG real longitude (0<=XLNG<=360) and ...
XLAT real .. latitude (-90<=XLAT<=90) of line of sight (degrees)
RP real radial distance to point P
(in units of the observer-Sun distance)
OUTPUTS:
(either heliocentric or topocentric)
XLNG real longitude (0<=XLNG<360) and ...
XLAT real .. latitude (-90<=XLAT<=90) of point P (degrees)
RP real distance of point P in units of observer-Sun distance
ELOLD real elongation in the old coordinate system (deg); 0<=ELOLD<=180
ELNEW real elongation in the new coordinate system 0<=ELNEW<=180
iEorW integer +1 or -1; indicates on which side (East or West) of
the Sun-Earth line the point is located
CALLS: ***
dacosd, dasind, datan2d, dcosd, dsind
CALLED BY:
LOSPosition, MkPos, MkPostd, PointPOnLOS, PointPOnLOS_Near, PointPOnLOS_Reset, ReadG
SC_ECLIP, SC_ECLIP90, ThomsonLOSDensity, ThomsonSetupLOS, bLOSCheckLoc
iProcessNagoya, iProcessNagoyan, iProcessOoty, iProcessOotyn, iProcessUCSD
iReadNagoya, iReadNagoyan, iReadOoty, iReadOotyn, iReadUCSD
RESTRICTIONS:
> There is no check for -90 <= XLAT <= 90
PROCEDURE:
> The topocentric coordinate system (with Earth in the origin)
has its X-axis pointing towards the Sun. Y and Z-axis are arbitrary
(usually the X-Y plane will be the ecliptic).
The topocentric longitude is measured in a positive sense, i.e.
counterclockwise as viewed from the positive Z-axis.
> The heliocentric coordinate system (with the Sun in the origin
has its X-axis pointing towards Earth.
The heliocentric longitude is measured in a positive sense.
> Spherical coordinates for both systems: longitude (deg), latitude
(deg) and radial distance (units of Sun-Earth distance).
> Input can be in topocentric or heliocentric coordinates. The output
will be in the other coordinate system (the calculation is symmetric).
> iEorW is determined from the input elongation XLNG:
if 0<=XLNG<=180 then iEorW = 1; if 180<XLNG<360 the iEorW = -1
> If input is in topocentric coordinates then
- ELOLD is the angle Sun-Earth-P
- ELNEW is the angle Earth-Sun-P
- iEorW = +1 if P is towards the east of the Sun (viewed from Earth)
- iEorW = -1 if P is towards the west of the Sun (viewed from Earth)
> If input is in heliocentric coordinates then
- ELOLD is the angle Earth-Sun-P
- ELNEW is the angle Sun-Earth-P
- iEorW = -1 if P is towards the east of the Sun (viewed from Earth)
- iEorW = +1 if P is towards the west of the Sun (viewed from Earth)
> If RP is negative then the opposite direction (180+XLNG,-XLAT,-RP)
is used.
> The Sun is located at topocentric longitude 0 deg and latitude 0 deg
and radial distance 1.0
> The Earth is located at heliocentric longitude 0 deg and latitude
0 deg and radial distance 1.0
> Internal calculations are done in double precision
> The easiest way to check the equations is to work out the relations
between the x,y,z components of the vector to P in both coordinates
systems.
MODIFICATION HISTORY:
FEB-1990, Paul Hick (UCSD/CASS); adapted from the subroutine SC_ECLIP.FOR
JUN-1994, Paul Hick (UCSD/CASS; pphick@ucsd.edu); made the calculation
symmetric so that it is valid also going from heliocentric to topocentric.
[Previous]
[Next]
NAME:
PointPOnLOS
PURPOSE:
Calculate the heliocentric coordinates (longitude, latitude and
distance) of the point P on a line sight, which is closest to the Sun
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine PointPOnLOS(XLNG,XLAT,RP,ELO,ELOSUN,iEorW)
INPUTS:
XLNG real topocentric longitude (0<=XLNG<=360) and ...
XLAT real .. latitude (-90<=XLAT<=90) of line of sight (degrees)
OUTPUTS:
XLNG real heliocentric longitude (0<=XLNG<360) and ...
XLAT real .. latitude (-90<=XLAT<=90) of point P (degrees)
RP real heliocentric distance of point P in units of
observer-Sun distance
ELO real elongation (angle between line of sight and direction
to the Sun; degrees); 0<=ELO<=180
ELOSUN real angle between direction to P and direction to observer
as seen from the Sun (degrees); 0<=ELOSUN<=180
iEorW integer = +1 or -1
+1 if P is towards the East of the Sun
-1 if P is towards the West of the Sun
CALLS: ***
BadR4, POINT_ON_LOS, cosd
SEE ALSO:
PointPOnLOS_Near, PointPOnLOS_Reset
RESTRICTIONS:
It is not checked whether the input value LAT is actually in the
permitted range [-90,90] degrees
PROCEDURE:
> See POINT_ON_LOS for explanation of the coordinate system used
> RNEAR is usually used to avoid the point P to move to close to the
observer for large elongation. By default, RNEAR=0. In this case the
observer location is used for solar elongations larger than 90 degrees.
> If RNEAR<0, then for elongations larger than 90 the point P
lies behind the observer.
> If RNEAR=BadR4() (default), then there are no restrictions on the distance
of the point P to the observer.
MODIFICATION HISTORY:
MAR-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
PointPOnLOS_Near
PURPOSE:
Calculate the heliocentric coordinates (longitude, latitude and
distance) of the point P on a line sight, which is closest to the Sun
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
entry PointPOnLOS_Near(RNEAR)
INPUTS:
RNEAR real if the distance d(Observer-Point P) < RNear then the
point on the line of sight at distance RNEAR from the
observer is used instead of P (see PROCEDURE)
CALLS: ***
BadR4, POINT_ON_LOS, cosd
PROCEDURE:
Entry point in PointPOnLOS
[Previous]
[Next]
NAME:
PointPOnLOS_Reset
PURPOSE:
Calculate the heliocentric coordinates (longitude, latitude and
distance) of the point P on a line sight, which is closest to the Sun
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
entry PointPOnLOS_Reset
INPUTS:
(none)
CALLS: ***
BadR4, POINT_ON_LOS, cosd
PROCEDURE:
Entry point in PointPOnLOS
[Previous]
[Next]
NAME:
POLYNOMIAL_EXP
PURPOSE:
Given the coefficients of its expansion in some set of (orthogonal)
polynomials, evaluate the value of a polynomial in point X
CATEGORY:
Math: orthogonal polynomials
CALLING SEQUENCE:
function POLYNOMIAL_EXP(A,B,X,A0,B0,N,PN,POLY)
INPUTS:
A,B real (read-only); interval [A,B]; see PROCEDURE
X real (read-only); X-value in [A,B] where function is evaluated
A0,B0 real (read-only); interval [A0,B0]; see PROCEDURE
N integer (read-only); # terms in polynomial expansion
PN(N) real (read-only); expansion coefficients
POLY real externally declared function, used to evaluate polynomials
OUTPUTS:
POLYNOMIAL_EXP real value of polynomial in point X
CALLS: ***
BadR4
RESTRICTIONS:
> The number of terms in the expansion, N, must be larger then zero.
> A and B must be unequal.
PROCEDURE:
> The function POLY must be declared external in the calling program
The call to POLY has the form F = POLY(XS,I); I is the degree of the
polynomial to be evaluated; XS = A0+(B0-A0)*(X-A)/(B-A) (i.e. XS is the
value corresponding to X after the interval [A,B] is rescaled to
[A0,B0]).
> The input value of X is assumed to be in the same units as interval
[A,B]. The interval [A,B] is mapped to [A0,B0]; X is correspondingly
rescaled to XS=A0+(B0-A0)*(X-A)/(B-A). The expansion is evaluated in XS.
> The polynomial expansion is
VALUE(X) = SUM(i=1,N) { PN(I)*POLY_i-1(XS) }, i.e. PN(I) is the
coefficient of the polynomial of degree I-1
> The polynomials POLY are evaluated in function POLY (see EXTERNAL)
MODIFICATION HISTORY:
DEC-1991; Paul Hick (UCSD)
[Previous]
[Next]
NAME:
PRECESSION_APPROX
PURPOSE:
Converts ecliptic coordinates for epoch JEpoch1 to epoch JEpoch2,
i.e. corrects for precession between the two epochs.
Uses a first order approximation and gives good results only for
time differences of several decades or less.
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine PRECESSION_APPROX(JEpoch1,JEpoch2,LAMBDA,BETA)
CALLS: ***
dcosd, dsind, tand
INPUTS:
JEpoch1 double precision initial epoch in Julian years
JEpoch2 double precision final epoch in Julian years
LAMBDA real ecliptic longitude for JEpoch1 (deg)
BETA real ecliptic latitude for JEpoch1 (deg)
OUTPUTS:
LAMBDA real ecliptic longitude for JEpoch2 (deg)
BETA real ecliptic latitude for JEpoch2 (deg)
CALLED BY:
Pandora
PROCEDURE:
See R. Green, Spherical Astronomy, Cambridge UP, 1985, Sect. 9.7, p 222
A,B,C precession constants
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
PRECESSION_ROT
PURPOSE:
Converts ecliptic coordinates for epoch JEpoch1 to epoch JEpoch2,
i.e. corrects for precession between the two epochs.
Uses the rotate subroutine to transform between frames of reference
and hence is 'exact'.
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine PRECESSION_ROT(JEpoch1,JEpoch2,LAMBDA,BETA)
CALLS: ***
rotate
INPUTS:
JEpoch1 double precision initial epoch in Julian years
JEpoch2 double precision final epoch in Julian years
LAMBDA real ecliptic longitude for JEpoch1 (deg)
BETA real ecliptic latitude for JEpoch1 (deg)
OUTPUTS:
LAMBDA real ecliptic longitude for JEpoch2 (deg)
BETA real ecliptic latitude for JEpoch2 (deg)
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).
EPS inclination between ecliptic and equator
ZETA,Z,THETA precession angles
MODIFICATION HISTORY:
1989, Paul Hick (MPAE,UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
PrintAll
PURPOSE:
Plot Helios photometer data
CATEGORY:
I/O: Helios
CALLING SEQUENCE:
program PRINTALL
INPUTS:
Helios photometer data file
OUTPUTS:
Graphics output to screen and printer
CALLS: ***
ASKCHARG, ArrI4Zero, ArrR4Total, AskI4, AskR4, AskWhat, AskYN, BadR4, CLEARWINDOW, DRAW
DRAWI, FOUT, HOSRead, IGETDEVILIMITS, ISETCOLOR, ISETFOREGROUNDCOLOR
ISETPLOTACTIONIGNORE, ISETPLOTOFF, ISETSYSNORMAL, ISETSYSUNITS, ISETTERMANDPLOT
ISWITCHGRAPHICSOFF, ISWITCHGRAPHICSON, MOVE, MOVEDRAW, MOVEDRAWI, NOUT, NOUTN, USRDF
XYLABEL, cFlt2Str, hardcopy, iArrI4Total, iArrI4ValuePresent, iHOSInfo, pInfR4
INCLUDE:
include 'openfile.h'
include 'hos_e9.h'
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
MAY-2000, Paul Hick (UCSD; pphick@ucsd.edu), added documentation