[Previous]
[Next]
NAME:
XCvarFormat
PURPOSE:
Provides format specification for Carrington variables.
CATEGORY:
I/O
CALLING SEQUENCE:
integer function XCvarFormat(NCoff,XC,cStr)
INPUTS:
NCoff integer Carrington rotation offset
XC real*4 Carrington variable with NCoff subtracted
OUTPUTS:
cStr character*(*) output string var
CALLS: ***
Flt2Str, Int2Str, Int2StrSet, LocFirst, Str2Str, itrim
CALLED BY:
ExtractInsitu, T3D_fill_global, T3D_fill_time, T3D_get, T3D_get_all, T3D_get_grid
T3D_get_mode, T3D_header, T3D_iget, T3D_iset, T3D_set, T3D_set_mode, cXCvarFormat
INCLUDE:
include 'str2str_inc.h'
PROCEDURE:
The Carrington time in nv3d files is written into the file
name in F9.4 format. The time and marker are appended to the
content of cStr. If the input value of cStr is 'nv3d' then
the output will be of the form 'nv3d1999.9999'.
MODIFICATION HISTORY:
SEP-2002, Paul Hick (UCSD/CASS)
NOV-2002, Paul Hick (UCSD/CASS)
Minor modification in handling of fraction.
APR-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bug fix. For XC values with a fraction very close to 1
(i.e. 0.9999....) the fraction was truncated to zero.
[Previous]
[Next]
NAME:
XMAP_OBS_POS
PURPOSE:
Given the modified Carrington variable XSC of the spacecraft, calculate
the corresponding modified Carrington variable for an observed location
at heliographic longitude XLNG
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
function XMAP_OBS_POS(XSC,XLNG)
INPUTS:
XSC real modified Carrington variable for spacecraft position
XLNG real heliographic longitude for point of observation
(degrees; 0 <= XLNG < 360)
OUTPUTS:
XMAP_OBS_POS
real modified Carrington variable for observation point
CALLED BY:
ExtractInsitu, Extractd, Extractd3d, LOSPosition, MAP_DATA, MkPos, MkPostd, READ_HOS
ReadG, bLOSCheckLoc, iProcessOoty, iProcessOotyn, iReadOoty, iReadOotyn
PROCEDURE:
The difference in heliographic longitude between spacecraft and
observed location is used to obtain the modified Carrington variable
for the observed location.
The difference in longitude is subject to the restriction:
If the observed point lies in the eastern hemisphere, 0 <= DXLNG < -180;
If it lies in the western hemisphere 0 <= DXLNG < 180.
Then XOBS = XSC-DXLNG/360.
MODIFICATION HISTORY:
JAN-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
XMAP_SC_POS
PURPOSE:
Calculate the 'modified Carrington variable' for a given spacecraft
position at a given time iYr,Doy
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
function XMAP_SC_POS(SC_NAME, iYr, Doy, nCar, JDCar)
INPUTS:
SC_NAME real external function; identifies spacecraft
iYr integer year
Doy real day of year, including fraction for time of day
nCar integer # Carrington start times
(see PROCEDURE for meaning of negative nCar)
JDCar(*) double precision Carrington start times (Julian days)
OUTPUTS:
XMAP_SC_POS real modified Carrington variable
CALLS: ***
BadR4, Julian, Say, cFlt2Str
CALLED BY:
JD_SYNC, MAP_DATA, READ_HOS, ReadG, SetGrid, Write3D_bb_UT, Write3D_nv_UT
iProcessNagoya, iProcessNagoyan, iProcessOoty, iProcessOotyn, iProcessUCSD
iReadNagoya, iReadNagoyan, iReadOoty, iReadOotyn, iReadUCSD, ipsd, ipsdt
shift_MOD [1], shift_MOD [2], surf_MOD
RESTRICTIONS:
The time iYr,Doy for which the modified Carrington variable is required
must be inside the time range covered by JDCar
REMARK:
The Carrington rotation number in the discussion below refers to the
array index of JDCar. If the 'spacecraft' is EARTH this corresponds
to the conventional Carrington rotation number except for an offset
which depends on the exact call to MAP_TZERO, which calculates JDCar.
PROCEDURE:
> SC_NAME must be declared EXTERNAL in the calling program
SC_NAME is a user-written function which calculates the heliographic
longitude Lng of a spacecraft for a given time iYr,Doy
The call to SC_NAME has the form:
Lng = SC_NAME(iYr,Doy)
where iYr (integer*4) and Doy (real*4) are input and Lng (real*4)
is output.
> DEFINITION: Carrington start time
Time at which the spacecraft heliographic longitude is zero.
A list of Carrington start times JDCar is calculated by subroutine
MAP_TZERO.
> DEFINITION: Carrington rotation N
The spacecraft moves across Carrington rotation N between times
JDCar(N) and JDCar(N+1). Between these times the spacecraft
heliographic longitude decreases from 360 to 0.
> DEFINITION: Modified Carrington variable
For a given time T the spacecraft position is inside Carrington
rotation N at heliographic location (Lng,Lat).
The rotation number N and the longitude Lng are combined in the
'modified Carrington variable' by
XS = N+(360.-Lng)/360.
i.e. the integer part of XS identifies the Carrington rotation,
and the fraction the heliographic longitude; as the spacecraft
moves across Carrington rotation N, XS increases from N to N+1.
> If the specified time lies outside the range covered by the
JDCar array then program execution stops if nCar is set to a
positive value; for negative values BadR4() is returned.
MODIFICATION HISTORY:
JAN-1991, Paul Hick (UCSD/CASS)
JUN-2002, Paul Hick (UCSD/CASS)
Fixed bug for input times very close to the start/end of a
Carrington rotation. The result sometimes would be off by +/- 1.
OCT-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bugfix. Changed declaration JDCar(nCar) to JDCar(*).
nCar can be negative!
[Previous]
NAME:
XMAP_SC_POS8
PURPOSE:
Calculate the 'modified Carrington variable' for a given spacecraft
position at a given time iYr,Doy8
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
function XMAP_SC_POS8(SC_NAME, iYr, Doy8, nCar, JDCar)
INPUTS:
SC_NAME real external function; identifies spacecraft
iYr integer year
Doy8 double precision day of year, including fraction for time of day
nCar integer # Carrington start times
(see PROCEDURE for meaning of negative nCar)
JDCar(*) double precision Carrington start times (Julian days)
OUTPUTS:
XMAP_SC_POS real modified Carrington variable
CALLS: ***
BadR4, Julian8, Say, cFlt2Str
CALLED BY:
MkTimes, write3D_infotd3D
RESTRICTIONS:
The time iYr,Doy8 for which the modified Carrington variable is required
must be inside the time range covered by JDCar
REMARK:
The Carrington rotation number in the discussion below refers to the
array index of JDCar. If the 'spacecraft' is EARTH this corresponds
to the conventional Carrington rotation number except for an offset
which depends on the exact call to MAP_TZERO, which calculates JDCar.
PROCEDURE:
> SC_NAME must be declared EXTERNAL in the calling program
SC_NAME is a user-written function which calculates the heliographic
longitude Lng of a spacecraft for a given time iYr,Doy8
The call to SC_NAME has the form:
Lng = SC_NAME(iYr,Doy8)
where iYr (integer*4) and Doy8 (double precision) are input and Lng (real)
is output.
> DEFINITION: Carrington start time
Time at which the spacecraft heliographic longitude is zero.
A list of Carrington start times JDCar is calculated by subroutine
MAP_TZERO.
> DEFINITION: Carrington rotation N
The spacecraft moves across Carrington rotation N between times
JDCar(N) and JDCar(N+1). Between these times the spacecraft
heliographic longitude decreases from 360 to 0.
> DEFINITION: Modified Carrington variable
For a given time T the spacecraft position is inside Carrington
rotation N at heliographic location (Lng,Lat).
The rotation number N and the longitude Lng are combined in the
'modified Carrington variable' by
XS = N+(360.-Lng)/360.
i.e. the integer part of XS identifies the Carrington rotation,
and the fraction the heliographic longitude; as the spacecraft
moves across Carrington rotation N, XS increases from N to N+1.
> If the specified time lies outside the range covered by the
JDCar array then program execution stops if nCar is set to a
positive value; for negative values BadR4() is returned.
MODIFICATION HISTORY:
JAN-1991, Paul Hick (UCSD/CASS)
JUN-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Fixed bug for input times very close to the start/end of a
Carrington rotation. The result sometimes would be off by +/- 1.