[Previous]
[Next]
NAME:
MAP_CarrTime
PURPOSE:
Get start and end (in Julian days) of Carrington rotation IROT
CALLING SEQUENCE:
subroutine MAP_CarrTime(IROT,JDCar)
INPUTS:
IROT integer Carrington rotation number
OUTPUTS:
JDCar(2) double precision Start and end time (JD)
CALLS: ***
EARTH, Julian, MAP_TZERO
INCLUDE:
include 'sun.h'
EXTERNAL:
external EARTH
PROCEDURE:
The approximate start time is estimated based on the starttime of
Carrington rotation 1750 and the synodic rotation rate of Earth.
MAP_TZERO is used to refine the estimate.
MODIFICATION HISTORY:
AUG-1993, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
MAP_DATA
PURPOSE:
Get modified Carrington variable for spacecraft location and observed
locations
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine MAP_DATA(SC_NAME,iYr,N,NOBS,Doy,ZOBS,XSC,XOBS,nCar,JDCar)
INPUTS:
SC_NAME real external function; identifies spacecraft
iYr integer year
N integer # observation times
NOBS integer # observations at each time
(e.g. # sectors for Helios data)
Doy(N) real day of year (fraction for time of day)
ZOBS(N,NOBS) real heliographic longitudes of observed
locations (degrees, in [0,360))
OUTPUTS:
XSC(N) real modified Carrington variable for
spacecraft locations
XOBS(N,NOBS) real modified Carrington variable for
observed locations
nCar integer # start times of Carrington rotations
JDCar(nCar) double precision Carrington start times in Julian days
(JDCar is output from subroutine MAP_TZERO)
CALLS: ***
MAP_TZERO, XMAP_OBS_POS, XMAP_SC_POS
EXTERNAL:
external SC_NAME
PROCEDURE:
> Loop over all observation time (N) and all simultaneous observations
(NOBS) at each time.
> SC_NAME must also be declared EXTERNAL in the calling program
SC_NAME is a user-written function which calculates the heliographic
longitude XLNG of a spacecraft for a given time iYr,Doy
The call to SC_NAME has the form:
XLNG = SC_NAME(iYr,Doy)
where iYr (integer*4) and Doy (real*4) are input and XLNG (real*4)
is output.
> SC_NAME is available for Helios A (function HELIOS_1), Helios B
(HELIOS_2) and Earth (EARTH); the function EARTH_ELIMB and EARTH_WLIMB
can be used to handle earth-based limb observations.
MODIFICATION HISTORY:
JAN-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
MAP_TZERO
PURPOSE:
Calculate list of start times for subsequent 'Carrington rotations'
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
subroutine MAP_TZERO(SC_NAME,iYr,Doy_IN,DELDOY,nCar,JDCar)
INPUTS:
SC_NAME real external function; identifies spacecraft
iYr integer year
Doy_IN real doy of year; including fraction for time of day
DELDOY real required accuracy (in days) for the Carrington
start times JDCar
nCar integer # start times to be calculated
OUTPUTS:
JDCar(nCar) double precision Carrington start times in Julian days
CALLS: ***
Dbl2Str, Flt2Str, Int2Str, Julian, Say, Str2Str
CALLED BY:
AdjustJDCar, MAP_CarrTime, MAP_DATA, N_CARRINGTON, SetGrid, ipsd, ipsdt
PROCEDURE:
> SC_NAME must be declared EXTERNAL in the calling program unit.
SC_NAME is a user-written function which calculates the heliographic
longitude XLNG of a spacecraft for a given time iYr,Doy
The call to SC_NAME has the form:
XLNG = SC_NAME(iYr,Doy)
where iYr (integer*4) and Doy (real*4) are input and XLNG (real*4)
is output.
> iYr,Doy_IN is the time where the search for start times begins.
the first nCar Carrington start times after iYr,Doy_IN are calculated
> The spacecraft is supposed to move in the ecliptic, circling the Sun in
the same direction as Earth (direct motion)
> The start time of a new Carrington rotation is defined as the time for
which the heliographic longitude of the spacecraft is zero.
MODIFICATION HISTORY:
JAN-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
mapangles
INCLUDED BY:
Get2Dval, MkDMaptdn, MkVMaptdN, mapcoordinates
PROCEDURE:
Statement functions for converting between modified Carrington variables
and latitudes(deg) to array indices.
nLng, nLat will usually be provided as arguments to the subroutine using
this include file.
Note that nLng1=nLng-1 and nLat1=nLat-1 must be defined.
Currently included in mapcoordinates.h
[Previous]
[Next]
NAME:
mapcoordinates
INCLUDED BY:
ExtractMap, Get3DTval, Get3Dval, Get4Dval, MkPos, MkShift
RESTRICTIONS:
Contains executable statements.
INCLUDE:
include 'sun.h'
include 'mapradial.h'
include 'mapangles.h'
include 'timecoordinates.h'
PROCEDURE:
The include statement for this file must be the last declaration
statement, and must be preceeded by the include statement for
sun.h (contains Sun$RAU)
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
MapGrid
PURPOSE:
Calculates the function values on an equidistant grid covering
the full heliographic longitude/latitude range of a synoptic map
from a set of 'random' observations scattered across the map.
CATEGORY:
Plotting
CALLING SEQUENCE:
subroutine MapGrid(XCbeg,XCend,YLbeg,YLend,NC,
& NL,XC,YL,ZL,NAV,DAV,NX,NY,Z,ZD,ZW,Zmin,Zmax,ZDmin,ZDmax)
INPUTS:
XCbeg real Carrington variable at Z(NX,*)
XCend real Carrington variable at Z(1,*)
(XCrange=XCend-XCbeg must be less/equal 1)
(XCrange=1 corresponds to 360 deg in longitude)
YLbeg real heliographic latitude at Z(*,1) (degrees)
YLend real heliographic latitude at Z(*,NY) (degrees)
(YLbeg and YLend must be in [-90,90])
NC integer # Carrington rotations to be averaged
NL integer # observations
If NL is set to a negative value then values
BadR4() in array ZL are ignored.
XC(NL) real values of 'modified Carrington' variable
YL(NL) real heliographic latitude (degrees)
ZL(NL) real function values
NAV integer determines how the averaging is done
= 0 : averaging over square bins (fast!)
= 1 : use the weight function SphereWeight
(slow, but more sound method)
DAV real half-width of weighting function in units of
the horizontal grid spacing (used in
calculating the grid function values Z)
NX,NY integer X,Y dimensions of equidistant map grid
OUTPUTS:
Z (NX,NY) real function values in grid points
BadR4() if no function value available
ZD(NX,NY) real standard deviations
ZW(NX,NY) real weighting factors (scratch array)
Zmin real minimum value in Z
Zmax real maximum value in Z
ZDmin real minimum value in ZD
ZDmax real maximum value in ZD
CALLS: ***
ArrR4GetMinMax, ArrR4Zero, BadR4, SphereWeight
CALLED BY:
ipsd, ipsdt, ipsg2, ipsg2s, ipsg2t
RESTRICTIONS:
> If XCend .lt. XCbeg their values are interchanged
> XCrange = XCend-XCbeg must be less/equal 1
> YLbeg and YLend must be in the range [-90,90]
> NC must be larger/equal 1
> If any of these restrictions is violated the input values of XCend,
YLbeg,YLend and NC will be changed
PROCEDURE:
> The 'modified Carrington variable' contains information about the
Carrington rotation to which the observations belongs (integer part)
and the heliographic longitude [(1.-decimal fraction)*360.]
> I.e. XCbeg lies in Carrington rotation N0 = int(XCbeg) and
corresponds to heliographic longitude XLbeg = (1-(XCbeg-N0))*360
degrees
> The first and last grid point in the X-direction [i.e. Z(1,*) and
Z(NX,*)] have heliographic longitudes XCend*360. and XCbeg*360.
(grid spacing XCrange*360./(NX-1) degrees).
> The first and last grid point in the Y-direction [i.e. Z(*,1) and
Z(*,NY) correspond to latitude YLbeg and YLend
(grid spacing (YLend-YLbeg)/(NY-1))
> I.e. XCrange=1,YLbeg=-90,YLend=90,NX=37,NY=19 would result
in an equidistant grid with grid spacing of 10 degrees in X and Y
direction covering both hemispheres.
> XC values in [XCbeg,XCend] are used to construct the synoptic
map. Points outside this range are used only for obtaining the
function values of grid points near the edge of the range.
> If the grid should run from 0 [Z(1,*)] to 360 degrees [Z(NX,*)]
XCbeg must be an integer.
> The weight function SphereWeight is a decreasing function of angular
distance from a given grid point (i.e. a function of the two
independent variables in any spherical coordinate system defined on the
unit sphere). The grid function values are calculated as weighted
averages over all data points (with weight SphereWeight). The method
is more sound than the averaging over square bins, but is much more
computationally intensive.
> The code for SphereWeight is appended to this subroutine
MODIFICATION HISTORY:
JAN-1992, Paul Hick (UCSD)
SEP-2001, Paul Hick (UCSD), added option to skip bad values in the
input array ZL.
[Previous]
[Next]
NAME:
mapradial
INCLUDED BY:
mapcoordinates
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
MapReadSingle
PURPOSE:
Read files containing Carrington maps into a 2D array
All files containing data inside range [XCBeg, XCEnd] are averaged together
using a weighted mean.
CATEGORY:
I/O
CALLING SEQUENCE:
function MapReadSingle(cWild,BListFnc,BReadFnc,NCoff,XCBeg,XCEnd,nLng,nLat,Z,R0)
INPUTS:
cWild character wildcard for locating synoptic map files
in format used by ForeignFile.
BListFnc integer external function
name of integer function used by BListAll
BReadFnc integer external function
name of integer function used to read individual files
NCoff integer integer Carrington variable offset
XCBeg real start Carrington variable
XCEnd real stop Carrington variable (usually XCbeg+3)
nLng integer # grid longitudes covering [XCbeg,XCend]
nLat integer # grid latitudes covering [-90,90]
OUTPUTS:
Z(nLng,nLat) real function values for synoptic map
R0 real source surface distance in AU
CALLS: ***
ArrR4DivideByArrR4, ArrR4TimesConstant, ArrR4Total, ArrR4Zero, BListAll, BadR4, Say
SplineGridX, SplineGridY, cXCvarFormat
CALLED BY:
T3D_Read_B
EXPLICIT:
integer BListFnc
integer BReadFnc
EXTERNAL:
external BListFnc
external BReadFnc
PROCEDURE:
> The external integer function BListFnc is called as follows:
I = BListFnc(cFile, NCoff, TFound,XCFoundBeg,XCFoundEnd,R0)
with input arguments
cFile character fully-qualified file name
NCoff integer a Carrington offset to be subtracted from
the output time and Carrington variables
and output arguments
I integer return status
0 : failure
1 : success
TFound real time assinged to the Carrington map
XCFoundBeg real start Carrington variable of the synoptic map
XCFoundEnd real end Carrington variable of the Carrington map
(always XCFoundEnd=XCFoundBeg+1.0
R0 real source surface distance in AU
> The external integer function BReadFnc is called as follows
> This user-written function BReadFnc reads each seperate file into the scratch array ZFile
I = BReadFnc(cFile,nMax,ZFile,nLng,nLat)
with input arguments
cFile character fully-qualified file name
nMax integer Max. # elements read from file
and output arguments
I integer return status
0 : failure
1 : success
ZFile(nLng,nLat)
real 2D array for synoptic map
nLng integer # grid longitudes in the data file
nLat integer # grid latitudes in the data file
> nLng = 0 or nLat = 0 signals automatically sets the map
dimensions, matching the resolution of the data files
> The output array ZFile covers the full heliographic longitude range [0,360],
i.e. ZFile(1,*) corresponds to 0 deg; ZFile(nLng,*) to 360 deg.
> The latitude range covers the full latitude range [-90,90],
i.e. ZFile(*,1) corresponds to -90 deg; ZFile(*,nLat) to +90 deg.
> The longitude grid must be evenly spaced in degrees
> The latitude grid must be evenly space in latitude or sin(latitude)
> MapReadSingle extracts data from ZFile in the range [XCbeg,XCend].
> The output array Z will be such that Z(1,*,*) corresponds to
Carrington variable XCend and Z(nLng,*,*) to XCbeg.
> Currently the following types of synoptic data can be read:
- Magnetic source surface map:
Original WSO maps: BList_WSO, BRead_WSO
NOAAS WSO maps: BList_WSO_NOAA, BRead_WSO_NOAA
MODIFICATION HISTORY:
JUL-1993, Paul Hick (UCSD/CASS)
MAY-2002, Paul Hick (UCSD/CASS)
Rewritten to support the tomography program. All plotting support
for GRPACK programs has been dropped.
AUG-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bug fix. Changed order of two pairs of XCBeg,XCEnd variables in call to
SplineGridX (XCEnd needs to come first).
[Previous]
[Next]
NAME:
MapReadTimes
PURPOSE:
Read files containing Carrington maps into a 2D array
CATEGORY:
I/O
CALLING SEQUENCE:
function MapReadTimes(cWild,BListFnc,BReadFnc,NCoff,nTim,TT,XCBeg,XCEnd,nLng,nLat,nRad,Z,R0)
INPUTS:
cWild character wildcard for locating synoptic map files
in format used by ForeignFile.
BListFnc integer external function
name of integer function used by BListAll
BReadFnc integer external function
name of integer function used to read individual files
NCoff integer integer Carrington variable offset
nTim integer # Carrington times
TT real Carrington times (with NCoff subtracted)
XCBeg real start Carrington variable (with NCoff subtracted)
XCEnd real stop Carrington variable (with NCoff subtracted)
nLng integer # grid longitudes covering [XCbeg,XCend]
nLat integer # grid latitudes covering [-90,90]
nRad integer # grid radial distances
OUTPUTS:
Z(nLng,nLat,nRad,nTim)
real function values for synoptic map
R0 real source surface distance in AU
CALLS: ***
ArrR4Bad, ArrR4Copy, ArrR4GetMinMax, ArrR4TimesConstant, BListAll, BadR4
SAYTOOSMALL, Say, SplineGridX, SplineGridY, SplineY, cXCvarFormat
iArrR4ValuePresent
CALLED BY:
T3D_Read_B
INCLUDE:
include 'filparts.h'
EXPLICIT:
integer BListFnc
integer BReadFnc
EXTERNAL:
external BListFnc
external BReadFnc
RESTRICTIONS:
At least two synoptic maps need to available for the spline interpolation.
This could be a problem if only a single time TT is specified. If no files earlier
or later than TT is found than the function BListAll will fail to bracket the
time and return only a single file. In this case array Z will be filled with bad
values.
PROCEDURE:
> The external integer function BListFnc is called as follows:
I = BListFnc(cFile, NCoff, TFound,XCFoundBeg,XCFoundEnd,R0)
with input arguments
cFile character fully-qualified file name
NCoff integer a Carrington offset to be subtracted from
the output time and Carrington variables
and output arguments
I integer return status
0 : failure
1 : success
TFound real time assinged to the Carrington map
XCFoundBeg real start Carrington variable of the synoptic map
XCFoundEnd real end Carrington variable of the Carrington map
(always XCFoundEnd=XCFoundBeg+1.0
R0 real source surface distance
> The external integer function BReadFnc is called as follows
This user-written function reads each seperate file into the scratch array ZFile.
I = BReadFnc(cFile,nMax,ZFile,nLng,nLat)
with input arguments
cFile character fully-qualified file name
nMax integer Max. # elements read from file
and output arguments
I integer return status
0 : failure
1 : success
ZFile(nLng,nLat)
real 3D array for synoptic map
nLng integer # grid longitudes in the data file
nLat integer # grid latitudes in the data file
> nLng = 0 or nLat = 0 signals automatically sets the map
dimensions, matching the resolution of the data files
> The output array ZFile covers the full heliographic longitude range [0,360],
i.e. ZFile(1,*) corresponds to 0 deg; ZFile(nLng,*) to 360 deg.
> The latitude range covers the full latitude range [-90,90],
i.e. ZFile(*,1) corresponds to -90 deg; ZFile(*,nLat) to +90 deg.
> The longitude grid must be evenly spaced in degrees
> The latitude grid must be evenly space in latitude or sin(latitude)
> The output array Z will be such that Z(1,*,*) corresponds to
Carrington variable XCend and Z(nLng,*,*) to XCbeg.
If XCEnd-XCBeg > 1 (covers more than one Carrington rotation) than heliographic
longitudes occur more than once in the output array. These will all be filled
with the same value.
> Currently the following types of synoptic data can be read:
- Magnetic source surface map:
Original WSO maps: BList_WSO, BRead_WSO
NOAAS WSO maps: BList_WSO_NOAA, BRead_WSO_NOAA
MODIFICATION HISTORY:
JUL-1993, Paul Hick (UCSD/CASS)
MAY-2002, Paul Hick (UCSD/CASS)
Rewritten to support the tomography program. All plotting support
for GRPACK programs has been dropped.
SEP-2002, Paul Hick (UCSD/CASS)
The output array for times that are not bracketed by two files
are now flagged as bad (the spline interpolation produces crazy
values when it has to extrapolate).
AUG-2003, Paul Hick (UCSD/CASS)
Bug fix. Changed order of two pairs of XCBeg,XCEnd variables in call to
SplineGridX (XCEnd needs to come first).
SEP-2013, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Made sure last time is always bracketed, if necessary by
replicating the last map at 1-day intervals.
[Previous]
[Next]
NAME:
MapWarp
PURPOSE:
Convert the vertical scale of a synoptic map from latitude to
sin(latitude) or v.v.
CALLING SEQUENCE:
subroutine MapWarp(NX,NY,Z, YLB,YLE, ZMIN,ZMAX)
INPUTS:
NX,NY integer dimension of input grid
Z(NX,NY,2) real grid fnc-values
YLB,YLE real latitude (or sin(latitude))
corresponding to bottom (i=1) and top (i=NY)
row of input array Z.
OUTPUTS:
Z(NX,NY,2) real grid fnc-values in the new grid
YLB,YLE real sin(latitude) (or latitude) of bottom
and top row of output array Z
CALLS: ***
ArrR4GetMinMax, ArrR4Mask, BadR4, asind, nrInterpol, sind
PROCEDURE:
> If the input values of YLB and YLE are both in the range [-1,1]
the conversion is from sin(latitude) to latitude.
> Otherwise the conversion is from latitude to sin(latitude)
> For each longitude (column in array Z(I,J=1..NX,1) a cubic spline
is calculated based on all unflagged grid points (Z(I,J,2) .eq. -1).
The spline is used to calculate the fnc-values in the new grid.
Grid points in the output grid are assigned the same flag status
(value Z(.,.,2)) as the nearest grid point of the old grid in the
latitudinal direction of the old grid.
MODIFICATION HISTORY:
JUN-93, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
math
PURPOSE:
Define mathematical constants
INCLUDED BY:
AIPS_WTF, BadI4, BadI8, BadR4, BadR8, CheckMass, CvR4, CvR8, EqKepler, EqKeplerd
GridSphere3D, IPSBase, IPSFuncQ, KeplerOrbit, RebinSphere, SUNRA, SphereWeight
SunRadius, ThomsonFarY, ThomsonLOS, ThomsonLOS3D, ThomsonLOSFar, ThomsonLOSStep
ThomsonMid, ThomsonMidFar, ThomsonMidpoint, ThomsonMidpointFar, ThomsonS10
Time2KeplerOrbit, Time2SunRA, Time2SunRadius, TinyR4, asind, cosd, dasind, dcosd, pInfR4
smei_base, smei_cal, smei_eclipse
PROCEDURE:
[Previous]
[Next]
NAME:
MATRIX_INV_R4
PURPOSE:
Matrix inversion
CATEGORY:
Math: matrix algebra
CALLING SEQUENCE:
function MATRIX_INV_R4(N,A,IK,JK)
INPUTS:
N integer dimension of the NxN matrix A
A real*4 matrix
IK,JK integer scratch arrays
OUTPUTS:
MATRIX_INV_R4 integer 0 if inversion not succesfull; 1 if succesfull
A real*4 inverse matrix
PROCEDURE:
Matrix inversion by Gauss-Jordan elimination with full pivoting
MODIFICATION HISTORY:
Joop Gronenschild (SRON)
[Previous]
[Next]
NAME:
MATRIX_INV_R8
PURPOSE:
Matrix inversion
CATEGORY:
Math: matrix algebra
CALLING SEQUENCE:
function MATRIX_INV_R8(N,A,IK,JK)
INPUTS:
N integer dimension of the NxN matrix A
A double precision matrix
IK,JK integer scratch arrays
OUTPUTS:
MATRIX_INV_R8 integer 0 if inversion not succesfull; 1 if succesfull
A double precision inverse matrix
PROCEDURE:
Matrix inversion by Gauss-Jordan elimination with full pivoting
MODIFICATION HISTORY:
Joop Gronenschild (SRON)
[Previous]
[Next]
NAME:
MessengerOrbit
PURPOSE:
Calculate Messenger orbit (position and velocity vectors)
CATEGORY:
/gen/for/lib/ephem
CALLING SEQUENCE:
subroutine MessengerOrbit(iYr,Doy,RR,VV)
INPUTS:
iYr integer year
Doy real day of year
OUTPUTS:
RR(3) real position vector: ecliptic longitude and
latitude (deg), radial distance (AU)
VV(5) real velocity vector: ecliptic longitude and
latitude (deg), magnitude, radial and
tangential velocity (AU/day)
(will be zero if the Messenger orbital
data base is used; see PROCEDURE).
CALLS: ***
Julian, KeplerOrbit, Say
PROCEDURE:
Times have to be later than 2007/01/01 00 UT
MODIFICATION HISTORY:
JUL-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
JAN-2012, John Clover (UCSD/CASS)
Modified existing Stereo element program to use
Messenger elements
[Previous]
[Next]
NAME:
MidExp
PURPOSE:
CATEGORY:
CALLING SEQUENCE:
subroutine MidExp( Funk, AA,BB,S,N )
INPUTS:
OUTPUTS:
INCLUDE:
include 'midpnt_inc.h'
PROCEDURE:
See Numerical Recipes
MODIFICATION HISTORY:
JUN-1993, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
MidInf
PURPOSE:
CATEGORY:
CALLING SEQUENCE:
subroutine MidInf( Funk, AA,BB,S,N )
INPUTS:
OUTPUTS:
CALLED BY:
ThomsonLOS, ThomsonLOS3D
EXTERNAL BY:
ThomsonLOS, ThomsonLOS3D
INCLUDE:
include 'midpnt_inc.h'
PROCEDURE:
See Numerical Recipes
MODIFICATION HISTORY:
JUN-1993, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
MidPnt
PURPOSE:
CATEGORY:
CALLING SEQUENCE:
subroutine MidPnt(Func, A,B,S,N)
INPUTS:
OUTPUTS:
INCLUDE:
include 'midpnt_inc.h'
PROCEDURE:
See Numerical Recipes
MODIFICATION HISTORY:
JUN-1993, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
midpnt_inc
INCLUDED BY:
MidExp, MidInf, MidPnt, MidSql, MidSqu
PROCEDURE:
Common part of the Mid* functions used in nrQRomo
[Previous]
[Next]
NAME:
MidSql
PURPOSE:
CATEGORY:
CALLING SEQUENCE:
subroutine MidSql( Funk, AA,BB,S,N )
INPUTS:
OUTPUTS:
INCLUDE:
include 'midpnt_inc.h'
PROCEDURE:
See Numerical Recipes
MODIFICATION HISTORY:
JUN-1993, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
MidSqu
PURPOSE:
CATEGORY:
CALLING SEQUENCE:
subroutine MidSqu( Funk, AA,BB,S,N )
INPUTS:
OUTPUTS:
INCLUDE:
include 'midpnt_inc.h'
PROCEDURE:
See Numerical Recipes
MODIFICATION HISTORY:
JUN-1993, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
Mk_D2V
PURPOSE:
Make a velocity map at the density map surface if there is none available
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine Mk_D2V(NN,DD,VV,D1AU,RR)
INPUTS:
DD(N) real Density map
N integer # data points
D1AU real 1 AU density
RR real Velocity map reference height
OUTPUTS:
VV(N) real Velocity map
CALLS: ***
BadR4
CALLED BY:
ipsd
PROCEDURE:
Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
AUG-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Made NN a read-only variable.
[Previous]
[Next]
NAME:
Mk_D2VN
PURPOSE:
Make a velocity map at the density map surface if there is none available
CATEGORY:
Data processing
CALLING SEQUENCE:
call Mk_D2VN(N,DD,VV,DEN1AU,Speed,RR)
INPUTS:
DD(N) real Density map
N integer # data points
DEN1AU real Average solar wind density at 1 AU
Speed real Average solar wind speed at 1 AU
RR real Velocity map reference height
OUTPUTS:
VV(N) real Velocity map
CALLS: ***
BadR4
CALLED BY:
ipsdt
PROCEDURE:
Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
Mk_V2D
PURPOSE:
Make a density map from the velocity map using the constant momentum
flux assumption
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine Mk_V2D(NN,VV,DD,D1AU,RR)
INPUTS:
VV(NN) real Velocity map
nLng integer # longitudes
nLat integer # latitudes
D1AU real density at 1 AU
RR real Velocity map reference height
OUTPUTS:
DD(NN) real Density map
CALLS: ***
BadR4
CALLED BY:
ipsd
PROCEDURE:
Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
Mk_V2DN
PURPOSE:
Make a density map from the velocity map using the constant momentum
flux assumption
CATEGORY:
Data processing
CALLING SEQUENCE:
call Mk_V2DN(N,VV,DD,Speed,DEN1AU,RR)
INPUTS:
VV(N) real Velocity map
nLng integer # longitudes
nLat integer # latitudes
Speed real Average solar wind speed at 1 AU
DEN1AU real Average solar wind density at 1 AU
RR real Velocity map reference height
OUTPUTS:
DD(nLng,nLat) real Density map
CALLS: ***
BadR4
CALLED BY:
ipsdt
PROCEDURE:
Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkD2V
PURPOSE:
Make a velocity map from a density map using the constant
momentum flux assumption
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkD2V(N,DD,VV,V0)
INPUTS:
N integer # data points
DD(N) real nr^2
V0 real Standard velocity
OUTPUTS:
VV(N) real Velocity
CALLS: ***
ArrR4Total, BadR4
CALLED BY:
ipsg2, ipsg2s, ipsg2t
PROCEDURE:
Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
MAY-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
MkDMap
PURPOSE:
Change the density map from the line of sight (L.O.S.) values of G-level and
weights by the ratio of observed to model values for each line of sight.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkDMap(LON,LAT,GWTij,PW,FIX,NL,NLOS,NLOSP1,
& nLng,nLat,DMAP,ANLIMIT,GSSIG,SIGB,NS,
& NBADSG,SIGMAP,ANMAP,DMA,FIXM,WTSM,DMEANF,DFIXM2,WTP,CONR)
INPUTS:
LON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
LAT(NLOSP1,NL) integer Heliographic lat. point on L.O.S.
GWTij(NLOS,NL) real m Weights of each point along the L.O.S.
PW real Power of G to N
FIX(NL) real Ratio observed/model G for total L.O.S.
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
DMAP(nLng,nLat) real Density map
SIGMAP real Density map convergence criteria
ANLIMIT real Number of points constituting deconvolution
GSSIG(NL) real Deviation of source from mean in sigma
SIGB real G-level sigma cut-off
NS integer 1 = Activate sigma cut-off, 0 = do not
NBADSG(NL) integer Bad source G-value 0 - bad, 1 - good
CONR real Gridsphere filter factor
SCRATCH ARRAYS:
ANMAP(nLng,nLat) real Scratch array
DMA (nLng,nLat) real Scratch array
FIXM (nLng,nLat) real Scratch array
WTSM (nLng,nLat) real Scratch array
DMEANF(nLng,nLat) real Scratch array
DFIXM2(nLng,nLat) real Scratch array
WTP(NLOS,NL) real Scratch array
OUTPUTS:
DMAP(nLng,nLat) real Density map
BADD real Value of map where there is no projection
NBADSG(NL) integer Bad source G-value 0 - bad, 1 - good
SIGMAP real Density map convergence criteria
CALLS: ***
ArrR4Bad, ArrR4Zero, BadR4, GridSphere2D, Say, cosd, itrim
CALLED BY:
ipsd
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkDMaptdn
PURPOSE:
Change the density map from the line of sight (L.O.S.) values of G-level and
weights by the ratio of observed to model values for each line of sight.
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkDMaptdn(LON,LAT,ITIM,GWTij,PW,FIX,NL,NLOS,NLOSP1,
nLng,nLat,nT,DMAP,ANLIMIT,GSSIG,SIGB,NS,NBADSG,SIGMAP,
ANMAP,DMA,FIXM,WTSM,DMEANF,DFIXM2,WTP,Alng,ConstL,CONR,CONT,aNday,Ztmp)
INPUTS:
LON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
LAT(NLOSP1,NL) integer Heliographic lat. point on L.O.S.
ITIM(NLOSP1,NL) integer Projected times at reference surface
GWTij(NLOS,NL) real m Weights of each point along the L.O.S.
PW real Power of G to N
FIX(NL) real Ratio observed/model G for total L.O.S.
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
nT integer Number of time intervals
DMAP(nLng,nLat,nT) real Density map
SIGMAP real Density map convergence criteria
ANLIMIT real Number of points constituting deconvolution
GSSIG(NL) real Deviation of source from mean in sigma
SIGB real G-level sigma cut-off
NS integer 1 = Activate sigma cut-off, 0 = do not
NBADSG(NL) integer Bad source G-value 0 - bad, 1 - good
OUTPUTS:
DMAP(nLng,nLat,nT) real Density map
BADD real Value of map where there is no projection
NBADSG(NL) integer Bad source G-value 0 - bad, 1 - good
SIGMAP real Density map convergence criteria
SCRATCH ARRAYS:
ANMAP(nLng,nLat,nT) real
DMA(nLng,nLat,nT) real
FIXM(nLng,nLat,nT) real
WTSM(nLng,nLat,nT) real
DMEANF(nLng,nLat,nT) real
DFIXM2(nLng,nLat,nT) real
WTP(NLOS,NL) real
Ztmp(nLng,nLat,nT) real
CALLS: ***
ArrR4Bad, ArrR4GetMinMax, ArrR4Zero, BadR4, GridSphere2D, Say, TimeSmooth, cosd, itrim
CALLED BY:
ipsdt
INCLUDE:
include 'mapangles.h'
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
mkenv
PURPOSE:
Process logicals and symbols
CATEGORY:
Environment
CALLING SEQUENCE:
mkenv [-sym -log] [-set -get -del] [-value_only] [name=value]
INPUTS:
Command line switches and arguments
-sym process a logical
-log process a symbol
If neither is set then -log is assumed
-get get value of symbol or logical
-set set a symbol or logical
-delete delete a symbol or logical
If neither is set then
-get is assumed if no name=value pair is specified
-set is assumed if a name=value pair is specified
-value_only Only used if -get is set.
By default -get will display a line of the form
Logical: name = value
if the logical or symbol is defined, or
Logical: name is not defined
if the logical or symbol doesn't exist.
If -value_only is set then only the name of the logical
or symbol is displayed if it exists; it it doesn't then
nothing is displayed. This is useful for extracting the
the value and storing it in a script variable:
value=$($exe/mkenv -log -get temp)
sets 'value' to the value of the logical temp, or to the
null string (if temp doesn't exist).
name=value name: name of the logical or symbol
value: value to be assigned to logical or symbol
OUTPUTS:
If -get is used a line is written to standard output giving the value
of the specified logical or symbol.
The exit status of the program is 0 on failure and 1 on success.
CALLS: ***
ForeignArg, LocFirst, Say, Str2Str, iCheckDirectory, iDeleteLogical [1]
iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2], iGetFileSpec
iGetLogical [1], iGetLogical [2], iGetSymbol [1], iGetSymbol [2]
iSetLogical [1], iSetLogical [2], iSetSymbol [1], iSetSymbol [2], icompress, itrim
lowercase
INCLUDE:
include 'dirspec.h'
SIDE EFFECTS:
-set and -delete update the ~/LOGFIL.TXT file
PROCEDURE:
This program is useful primarily on Linux and Unix for maintaining the
file ~/LOGFIL.TXT containing 'logical' and 'symbol' definitions.
MODIFICATION HISTORY:
JUL-2000, Paul Hick (UCSD; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
MkGModel
PURPOSE:
Make model line of sight G-levels from a density map at a given height.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkGModel(XCbeg,XCend,XLON,XLAT,RP,WTS2,DFAC,PW,DEN1AU,NL,
& NLOS,NLOSP1,DMAP,nLng,nLat,DREF,GM2,GWTij,GMWTij,GMWTi)
INPUTS:
XCbeg real Beginning Carrington Rotation value
XCend real Ending Carrington Rotation value
XLON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL) integer Heliographic lat. (in deg.) point on L.O.S.
RP (NLOSP1,NL) real Distance above Sun of point on L.O.S.
WTS2(NLOS ,NL) real Weights of each point along the L.O.S.
DFAC(NLOSP1,NL) real Density factors for each L.O.S. point
PW real Density power
DEN1AU real Average density at 1 AU
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
DMAP(nLng,nLat) real Density map
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
DREF real Height of density reference map
OUTPUTS:
GM2(NL) real Model G-levels for a given source
GWTij(NLOS ,NL) real Value weights
SCRATCH ARRAYS:
GMWTij(NLOS,NL) real
GMWTi(NL) real
CALLS: ***
BadR4, Get2Dval
CALLED BY:
ipsd
PROCEDURE:
Following, a latex file containing the scintillation
index value m and the weighting function.
Line-of-sight integration
Scintillation index \\
$$ m^2 = \int dz W(z) $$
Weighting function \\
$$ W(z) = (\Delta N_e(z))^2 \int dq
\sin^2(\frac{q^2\lambda z}{4\pi})
\exp(-\frac{\theta_o^2 q^2 z^2}{2})
q^{-3} $$
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkGModeltdn
PURPOSE:
Make model line of sight G-levels from a density map at a
given height. Following, a latex file containing the scintillation
index value m and the weighting function.
Line-of-sight integration
Scintillation index \\
$$ m^2 = \int dz W(z) $$
Weighting function \\
$$ W(z) = (\Delta N_e(z))^2 \int dq
\sin^2(\frac{q^2\lambda z}{4\pi})
\exp(-\frac{\theta_o^2 q^2 z^2}{2})
q^{-3} $$
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkGModeltdn(XCbe,XCtbeg,XCtend,XCtpr,XLON,XLAT,RP,
& WTS2,DFAC,PW,DEN1AU,NL,NLOS,NLOSP1,DMAP,
& nLng,nLat,nT,RRS,GM2,GWTij,GMWTij,GMWTi)
INPUTS:
XCbe(2,nT) real Beginning and ending Carrington variables
XCtbeg real Beginning time interval
XCtend real Ending time variable
XCtpr(NLOSP1,NL)real Projected time (in XC)
XLON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL) integer Heliographic lat. (in deg.) point on L.O.S.
RP (NLOSP1,NL) real Distance above Sun of point on L.O.S.
WTS2(NLOS ,NL) real Weights of each point along the L.O.S.
DFAC(NLOSP1,NL) real Density factors for each L.O.S. point
PW real Density power
DEN1AU real Average density at 1 AU
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
DMAP(nLng,nLat,nT) real Density map
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
nT integer Number of time intervals
dRR real Interval between height maps
RRS real Height of deconvolution surfaces
OUTPUTS:
GM2(NL) real Model G-levels for a given source
GWTij(NLOS ,NL) real Value weights
SCRATCH ARRAYS:
GMWTij(NLOS,NL) real
GMWTi(NL) real
CALLS: ***
BadR4, Get3DTval, stop_here
CALLED BY:
ipsdt
PROCEDURE:
MODIFICATION HISTORY:
NOV-1995, B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkLOSWeights
PURPOSE:
To make weights for each source
CATEGORY:
Tomography
CALLING SEQUENCE:
subroutine MkLOSWeights(IM,dS,NS,NL,XE,RR,WW,PWR)
INPUTS:
IM integer Mode of operation
1 = Velocity weights - 327 MHz
2 = G-level weights - 81.5 MHz
3 = UCSD velocity - 72.8 MHz
4 = Thomson scat U weights
5 = Thomson scat B weights
6 = Thomson scat V weights
dS real resolution along LOS (in units of RR)
NS integer # segments of length dS along LOS
NL integer # IPS data points
XE(NL) real IPS line of sight elongations (deg)
RR(NL) real Observer-Sun distance (AU)
PWR real See PROCEDURE
OUTPUTS:
WW(NS,NL) real Weights at each pos. along the L.O.S per source
CALLS: ***
AIPS_WTF, THOM_WTF, cosd
CALLED BY:
ipsd, ipsdt
SEE ALSO:
LOSWeights
PROCEDURE:
> Note that dS is defined in units of the observer-Sun distance; NOT in AU
> If the radial power index PWR is not 2, then an additional weight factor is
included. The extra term comes from the radial dependence of the density fluctations
in the los integral. delta(n)^2 ~ r^[-2*(2-PWR)]
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkPos
PURPOSE:
To determine line of sight positions and their projections at a given
height above the Sun.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkPos(XCbeg,XCend,RRS,dRR,DLOS,nLng,nLat,nRad,XC3D,
& NL,NS1,DIST,XLS,XCE,XP,XD,IYRS,DOYS,
& XCproj,XClos,XLlos,RRlos,LON,LAT)
INPUTS:
XC3D(nLng,nLat,nRad) real Shifts to map to height RR (set by MkXCShifts)
nLng integer # longitudes
nLat integer # latitudes
nRad integer # TS MAPS (height begins at 0 AU)
dRR real Heights between individual maps (in AU)
RRS real Distance above Sun for deconvolution maps
DIST(NL) real Distance of Sun to Earth
XLS(NL) real Ecliptic longitude of Sun
XCE(NL) real Carrington variable of Earth
XP(NL) real Longitude diff. relative to Earth-Sun
XD(NL) real Declination of Source
IYRS(NL) integer Year of source observation
DOYS(NL) real Day of year (and fraction) of source observation
NL integer # G-level data points
DLOS real resolution along LOS (in units of DIST)
NS1 integer # segments of length DLOS along LOS + 1
(the extra element is used to store Point-P info)
OUTPUTS:
XCproj(NS1,NL) real Modified Carrington variables for points on LOS,
after projection to reference surface RR
XClos(NS1,NL) real Modified Carrington variables for points on LOS
XLlos(NS1,NL) real Heliographic latitude for points on LOS
RRlos(NS1,NL) real Height above Sun for points on L.O.S.
LON (NS1,NL) integer Int value of the heliographic longitude
LAT (NS1,NL) integer Int value of the heliographic latitude
CALLED BY:
ipsd
INCLUDE:
include 'mapcoordinates.h'
CALLS: ***
ECLIPTIC_HELIOGRAPHIC, Get3Dval, POINT_ON_LOS, XMAP_OBS_POS, cosd
PROCEDURE:
> XClos and XCproj are on the same scale as XCE.
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkPostd
PURPOSE:
To determine line of sight positions and their projections at a given
height above the Sun.
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkPostd(XCbe,XCtbeg,XCtend,Idaybeg,RRS,dRR,DLOS,nLng,nLat,nMap,nT,
& XCshift,NL,NS1,DIST,XLS,XCE,XP,XD,IYRS,DOYS,
& XCproj,XClos,XLproj,XLlos,RRlos,XCtpr,XCtim,LON,LAT,ITIM)
INPUTS:
XCbe(2,nT) real Time interval map beginnings and endings
XCtbeg real*8 Time interval beginning
XCtend real*8 Time interval ending
Idaybeg integer Total integer number of days in beginning year associated with XCtbeg
RRS real Distance above Sun for deconvolution maps
dRR real Heights between individual maps (in AU)
DLOS real resolution along LOS (in units of DIST)
nLng integer # longitudes
nLat integer # latitudes
nMap integer # TS MAPS (height begins at 0 AU)
nT integer # time intervals
XCshift(nLng,nLat,nMap,nT,3) real Shifts to map to height RR (set by MkXCShifts)
NL integer # G-level data points
NS1 integer # segments of length DLOS along LOS + 1
(the extra element is used to store Point-P info)
DIST(NL) real Observer-Sun distance at source time
XLS(NL) real Ecliptic longitude of Sun
XCE(NL) real Carrington variable of Earth
XP(NL) real Longitude diff. relative to Earth-Sun
XD(NL) real Declination of Source
IYRS(NL) integer Year of source observation
DOYS(NL) real Day of year (and fraction) of source observation
OUTPUTS:
XCproj(NS1,NL) real Modified Carrington variables for points on LOS,
after projection to reference surface RR
XClos(NS1,NL) real Modified Carrington variables for points on LOS
XLproj(NS1,NL) real Heliographic latitude for L.O.S. points on the reference surface
XLlos(NS1,NL) real Heliographic latitude for points on LOS
RRlos(NS1,NL) real Height above Sun for points on L.O.S.
XCtpr(NS1,NL) real*8 Time of observation on reference surface
XCtim(NS1,NL) real*8 Time of observation on L.O.S.
LON (NS1,NL) integer Int value of the heliographic longitude
LAT (NS1,NL) integer Int value of the heliographic latitude
ITIM (NS1,NL) integer Int value of time on reference surface
CALLS: ***
ECLIPTIC_HELIOGRAPHIC8, Get4Dval, POINT_ON_LOS, XMAP_OBS_POS, cosd
CALLED BY:
ipsdt
PROCEDURE:
> XClos and XCproj are on the same scale as XCE.
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkShift
PURPOSE:
Makes shifts at even heights to use in determining projections.
The shifts give the average longitude shift in fractions of a rotation
required to get to the input reference velocity map at each latitude
and longitude point on the map.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkShift(XCbeg,XCend,nLng,nLat,nMap,VV,DD,XC3D,Vratio,
& Dratio,RR,dRR,CLRV,CLRD,VLL,VUL,NSIDE,Vtmp,Dtmp,XLtmp)
INPUTS:
nLng integer # longitude points
nLat integer # latitude points
nMap integer # heights (height begins at SUN__RAU AU)
VV(nLng,nLat) real Map of velocity values at a given height RR
DD(nLng,nLat) real Map of density values at a given height RR
RR real Distance above sun for reference velocity map
dRR real Distance between individual maps (in AU)
CLRV real Velocity map radius filter distance
CLRD real Density map radius filter distance
VLL real Lower limit on traceback velocity
VUL real Upper limit on traceback velocity
Vtmp(nLng,nLat,2) real Internal scratch array
Dtmp(nLng,nLat) real Internal scratch array
XLtmp(nLng) real Internal scratch array
OUTPUTS:
XC3D(nLng,nLat,nMap) real XC3D contains the final shifts at all heights
in terms of fractions of a Carrington rotation
Vratio (nLng,nLat,nMap) real velocity ratios
Dratio (nLng,nLat,nMap) real density ratios (normalized density ratio???)
CALLS: ***
ArrR4Constant, ArrR4Copy2, ArrR4SetMinMax, ArrR4Zero, BadR4, FLINT, GridSphere2D
CALLED BY:
ipsd
INCLUDE:
include 'mapcoordinates.h'
PROCEDURE:
> XC3D(I,J,N) is the shift needed to trace location (I,J,N) back to the reference
surface, i.e. XC = XCfrac(I)+XC3D(I,J,N) defines the origin of point (I,J,N)
at the reference surface in terms of a modified Carrington variable.
XC3D(I,J,N) will be negative above the reference surface (N>nRR), positive
below the reference surface (N<nRR), and zero at the reference surface (N=nRR).
> Bad grid points in VV and DD are filled with GridSphere2D
MODIFICATION HISTORY:
MAR-1997, B. Jackson (UCSD) (original name was MAKE_TS)
MAY-1998, Paul Hick (UCSD; pphick@ucsd.edu); revision
APR-1999, Paul Hick, B. Jackson (UCSD/CASS); revision
[Previous]
[Next]
NAME:
MkShiftdn
PURPOSE:
To make XC shift maps at even heights to use in determining projections.
The maps give the average longitude shift in fractions of a rotation
required to get to the input reference velocity map at each latitude
and longitude point on the map. This version of the subroutine underwent
considerable modification on about 4/1/02 when the way of determining ratios
were not accumulated with each height, but were accumulated relative to the base
at the source surface. This version, which is where the majority of the
time is spent in the tomography program, is more than twice as slow as the
old version of the mkshiftd subroutine.
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkShiftdn(XCbe,XCint,XCtbeg,XCtend,ALng,nLng,nLat,nMap,nT,nTmax
nCar,JDCar,NCoff,VV,DD,XCshift,Vratio,Dratio,RR,dRR,CLRV,CLRD,VLL,VUL,
NSIDE,Vtmp,Dtmp,XLTtmp,XLtmp,XLtmpt,Dtmpt)
INPUTS:
XCbe(2,nT) real Boundary values of time maps
XCint(nTmax) real Boundaries of time intervals
XCtbeg double precision Beginning time interval
XCtend double precision Ending time interval
Alng real Rotations per nLng1
nLng integer # longitude points
nLat integer # latitude points
nMap integer # heights (height begins at SUN__RAU AU)
nT integer # time intervals
nTmax integer Maximum # of time intervals
nCar integer # Carrington rotations
JDCar double precision Julian Date at beginning of rotations
NCoff integer # number of rotation offset values from the beginning rotation number
VV(nLng,nLat,nT)real Map of velocity values at a given height RR
DD(nLng,nLat,nT)real Map of density values at a given height RR
RR real Distance above sun for reference velocity map
dRR real Distance between individual maps (in AU)
CLRV real Velocity map radius filter distance
CLRD real Density map radius filter distance
VLL real Lower limit on traceback velocity
VUL real Upper limit on traceback velocity
Vtmp(nLng,nLat,nT,3) real Internal scratch array
Dtmp(nLng,nLat,nT) real Internal scratch array
XLTtmp(nLng,nT,5) real Internal scratch array
XLtmp(nLng,nT) real Internal scratch array
XLtmpt(nLng,nT) real Internal scratch array
Dtmpt(nT) real Internal scratch array
OUTPUTS:
XCshift(nLng,nLat,nMap,nT,3) real XCshift contains the final shifts at all heights
in terms of fractions of a Carrington rotation
Vratio (nLng,nLat,nMap,nT) real velocity ratios
Dratio (nLng,nLat,nMap,nT) real density ratios
CALLS: ***
ArrR4Constant, ArrR4Copy, ArrR4Copy2, ArrR4GetMinMax, ArrR4SetMinMax, ArrR4Zero
BadR4, FLINT, GridSphere2D, Say, TimeSmooth
CALLED BY:
ipsdt
PROCEDURE:
> XCshift(I,J,N,K,3) is the shift needed to trace location (I,J,N,K) back
to the reference surface at a given time, i.e.
XC = XCfrac(I)+XCshift(I,J,N,K,3) defines the origin of point (I,J,N,K,3)
at the reference surface in terms of a modified Carrington variable.
XCshift(I,J,N,K,3) will be negative above the reference surface (N>nRR),
zero at the reference surface (N=nRR) and will point to an earlier
or the same time. Bad grid points in VV and DD are filled with
GridSphere2D
MODIFICATION HISTORY:
MAR-1997, B. Jackson (UCSD) (original name was MAKE_TS)
MAY-1998, Paul Hick (UCSD; pphick@ucsd.edu); revision
APR-1999, Paul Hick, B. Jackson (UCSD); revision
APR-2001, B. Jackson (UCSD); revision
[Previous]
[Next]
NAME:
MkTimes
PURPOSE:
Makes Carrington longitude intervals and year and doy intervals for
the time dependent tomography program.
CALLING SEQUENCE:
subroutine MkTimes(bForecast,MJDcntr,NmidHR,aNday,NTmax,Alng,nLng,nCar,JDCar,
& NT,iYr,Idaybeg,XCintD,XCinT,XCbe,XCtbeg,XCtend,IYRS,DOYS)
INPUTS:
bForecast logical .TRUE. Forecast mode
.FALSE. Non forecast mode
MJDcntr double precision Modified Julian date at the time of the observation
NmidHR integer Number of hours before midnight
aNday real Number of days to combine for digital result (can be fractions of days)
NTmax integer # of intervals
ALng real Carrington interval per nLng number
nLng integer # of longitude resolution intervals in aLng
nCar integer # Carrington rotations
JDCar double precision Julian Date at beginning of rotations
OUTPUTS:
NT integer # of intervals (set by this routine depending on bForecast)
iYr integer The beginning year
Idaybeg integer Number of days in the beginning time year (varies with leap year)
XCinTD(NTmax) double precision Time interval values in DOY since beginning value XCtbeg at beginings of each interval
XCinT(NTmax) real Time interval values in XC since beginning value XCtbeg at beginings of each interval
XCbe(2,NTmax) real Carrington longitude begining and end values
XCtbeg double precision Start time of sources in doy (Time from beginning)
XCtend double precision End time of sources in doy (Time from beginning)
IYRS(NTmax) integer Interval year values
DOYS(NTmax) double precision Interval day of year values
CALLED BY:
ipsdt
EXTERNAL:
external EARTH8
CALLS: ***
EARTH8, Julian8, XMAP_SC_POS8
MODIFICATION HISTORY:
APR-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bug fix. Variable Leap was never initialized if XCtbeg >= 1.
OCT-2007, ???
Added line forcing nT to be an even number
[Previous]
[Next]
NAME:
MkV2D
PURPOSE:
Make a density map from a velocity map using the constant momentum
flux assumption
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkV2D(N,VV,DD,V0)
INPUTS:
N integer # data points
VV(N) real Velocity map
V0 real V0^2 is the momentum flux nvr^2
at 1 AU. If nr^2 at 1 AU is 1
then V0 is the velocity at 1 AU
OUTPUTS:
DD(N) real normalized density nr^2
CALLS: ***
BadR4
CALLED BY:
ipsg2, ipsg2s, ipsg2t
PROCEDURE:
> It is assumed that the momentum flux is independent of
heliocentric distance (not only independent of V at a specific
distance).
> Bad values (indicated by BadR4()) are not processed
MODIFICATION HISTORY:
MAY-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
MkVeltd
PURPOSE:
To make a velocity map from the velocity ratios determined by the main program
CATEGORY:
Data processing
INPUTS:
nLng,nLat,nMap,nT,nTmaxV,Cshift,Vmap,Vratio
OUTPUTS:
TrueVel
CALLS: ***
BadR4
MODIFICATION HISTORY:
JULY-2001, Tamsen Dunn (UCSD; tdunn@ucsd.edu)
[Previous]
[Next]
NAME:
MkVMap
PURPOSE:
Change the velocity map from the line of sight (L.O.S.) values of velocity and
weights by the ratio of observed to model values for each line of sight.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkVMap(LON,LAT,RP,XEV,VWTij,FIX,NL,NLOS,NLOSP1,DMAP,DREF,
& XLON,XLAT,DFAC,nLng,nLat,PW,VMAP,ANLIMIT,VLIM,VSSIG,VM,SIGB,NS,
& NBADSV,SIGMAP,ANMAP,VMA,FIXM,WTSM,VMEANF,VFIXM2,WTP,CONR)
INPUTS:
LON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
LAT(NLOSP1,NL) integer Heliographic lat. point on L.O.S.
RP (NLOSP1,NL) real Distance above Sun of point on L.O.S.
XEV(NL) real Source Elongation
VWTij(NLOS,NL) real Weights of each point along the L.O.S.
FIX(NL) real Ratio observed/model V for total L.O.S.
NL integer Number of velocity data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
DMAP(nLng,nLat) real Density map
DREF real Density map reference height
XLON(NLOSP1,NL) real Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL) real Latitude (in deg.) of point on L.O.S.
DFAC(NLOSP1,NL) real Interpolated DF value between maps at RP
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
PW real Power of density relationship to g-level
VMAP(nLng,nLat) real Velocity map
SIGMAP real Velocity map convergence criteria
ANLIMIT real Number of points constituting deconvolution
VLIM real Limit on velocity (maximum)
VSSIG(NL) real Deviation of source from mean in sigma
VM(NL) real Model value
SIGB real Velocity sigma cut-off
NS integer 1 = Activate sigma cut-off, 0 = do not
NBADSV(NL) integer Bad source velocity 0 - bad, 1 - good
CONR real Gridsphere filter factor
SCRATCH FILES:
ANMAP(nLng,nLat) real Scratch array
VMA(nLng,nLat) real Scratch array
FIXM(nLng,nLat) real Scratch array
WTSM(nLng,nLat) real Scratch array
VMEANF(nLng,nLat) real Scratch array
VFIXM2(nLng,nLat) real Scratch array
WTP(NLOS,NL) real Scratch array
OUTPUTS:
VMAP(nLng,nLat) real Velocity map
NBADSV(NL) integer Bad source velocity 0 - bad, 1 - good
SIGMAP real Velocity map convergence criteria
CALLS: ***
ArrR4Bad, ArrR4Zero, BadR4, GridSphere2D, Say, cosd, itrim, sind
CALLED BY:
ipsd
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkVMaptdN
PURPOSE:
Change the velocity map from the line of sight (L.O.S.) values of velocity and
weights by the ratio of observed to model values for each line of sight.
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkVMaptdn(LON,LAT,ITIM,RP,XEV,VWTij,FIX,NL,NLOS,NLOSP1,XLON,XLAT,
nLng,nLat,nT,VMAP,ANLIMIT,VLIM,VSSIG,VM,SIGB,NS,NBADSV,SIGMAP,
ANMAP,VMA,FIXM,WTSM,VMEANF,VFIXM2,WTP,Alng,ConstL,CONR,CONT,aNday,Ztmp)
INPUTS:
LON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S.
LAT(NLOSP1,NL) integer Heliographic lat. point on L.O.S.
ITIM(NLOSP1,NL) integer Projected time values
RP (NLOSP1,NL,NT) real Distance above Sun of point on L.O.S.
XEV(NL) real Source Elongation
VWTij(NLOS,NL,NT) real Weights of each point along the L.O.S.
FIX(NL) real Ratio observed/model V for total L.O.S.
NL integer Number of velocity data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
XLON(NLOSP1,NL,NT) real Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL,NT) real Latitude (in deg.) of point on L.O.S.
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
nT integer Number of time intervals
VMAP(nLng,nLat,nT) real Velocity map
SIGMAP real Velocity map convergence criteria
ANLIMIT integer Number of points constituting deconvolution
VLIM real Limit on velocity (maximum)
VSSIG(NL) real Deviation of source from mean in sigma
VM(NL) real Model value
SIGB real Velocity sigma cut-off
NS integer 1 = Activate sigma cut-off, 0 = do not
NBADSV(NL) integer Bad source velocity 0 - bad, 1 - good
OUTPUTS:
VMAP(nLng,nLat,nT) real Velocity map
NBADSV(NL) integer Bad source velocity 0 - bad, 1 - good
SIGMAP real Velocity map convergence criteria
SCRATCH ARRAYS:
ANMAP(nLng,nLat,nT) integer
VMA(nLng,nLat,nT) real
FIXM(nLng,nLat,nT) real
WTSM(nLng,nLat,nT) real
VMEANF(nLng,nLat,nT) real
VFIXM2(nLng,nLat,nT) real
WTP(NLOS,NL) real
Ztmp(nLng,nLat,nT) real
CALLS: ***
ArrR4Bad, ArrR4GetMinMax, ArrR4Zero, BadR4, GridSphere2D, Say, TimeSmooth, cosd, itrim
sind
CALLED BY:
ipsdt
INCLUDE:
include 'mapangles.h'
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MkVModel
PURPOSE:
Make model line of sight velocities from a velocity map at a given height.
The LOS. values are assumed to vary with the densities from a model
relative to a mean which includes densities determined from that model.
Note - this is somewhat unlike the LOS. weights determined for densities.
CATEGORY:
Data processing
CALLING SEQUENCE:
subroutine MkVModel(XCbeg,XCend,XEV,XLON,XLAT,RP,WTS1,DFAC,VFAC,
& PW,NL,NLOS,NLOSP1,VMAP,VLIM,DMAP,nLng,nLat,DREF,
& VREF,DCON,VM,VWTij)
INPUTS:
XCbeg real Beginning Carrington Rotation value
XCend real Ending Carrington Rotation value
XEV(NL) real Source elongations
XLON(NLOSP1,NL) real Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL) real Heliographic lat. (in deg.) point on L.O.S.
RP (NLOSP1,NL) real Distance above Sun of point on L.O.S.
WTS1(NLOS ,NL) real Weights of each point along the L.O.S.
DFAC(NLOSP1,NL) real Density factors for each L.O.S. point
VFAC(NLOSP1,NL) real Velocity factors for each L.O.S. point
PW real Density power
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
VMAP(nLng,nLat) real Velocity map
VLIM real Linit on velocity (maximum)
DMAP(nLng,nLat) real Density map
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
DREF real Height of density reference map
VREF real Height of velocity reference map
DCON real Height of deconvolved velocity map
OUTPUTS:
VM(NL) real Model Velocities for a given source
VWTij(NLOS ,NL) real L.O.S. weights
CALLS: ***
BadR4, Get2Dval, sind
CALLED BY:
ipsd
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD), MAR, 1999 B. Jackson (UCSD) to
include VFAC
[Previous]
[Next]
NAME:
MkVModeltd
PURPOSE:
Make model line of sight velocities from a velocity map at a given height.
The LOS. values are assumed to vary with the densities from a model
relative to a mean which includes densities determined from that model.
Note - this is somewhat unlike the LOS. weights determined for densities.
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkVModeltd(XCbe,XCtbeg,XCtend,XEV,XLON,XLAT,RP,
WTS1,DFAC,VFAC,PW,NL,NLOS,NLOSP1,VMAP,VLIM,DMAP,
nLng,nLat,nT,RRS,VM,VWTij)
INPUTS:
XCbe(2,nT) real Beginning and ending Carrington variables
XCtbeg double precision Beginning time interval
XCtend double precision Ending time interval
XEV(NL) real Source elongations
XLON(NLOSP1,NL) real Projected Carr. rot. value of point on L.O.S.
XLAT(NLOSP1,NL) real Heliographic lat. (in deg.) point on L.O.S.
RP (NLOSP1,NL) real Distance above Sun of point on L.O.S.
WTS1(NLOS ,NL) real Weights of each point along the L.O.S.
DFAC(NLOSP1,NL) real Density factors for each L.O.S. point
VFAC(NLOSP1,NL) real Velocity factors for each L.O.S. point
PW real Density power
NL integer Number of G-level data points
NLOS integer Number of L.O.S. distance segments
NLOSP1 integer Number of L.O.S. distance segments + 1
VMAP(nLng,nLat,nT) real Velocity map
VLIM real Linit on velocity (maximum)
DMAP(nLng,nLat,nT) real Density map
nT integer Number of time intervals
nLng integer Number of longitude points in DMAP
nLat integer Number of latitude points in DMAP
dRR real distance between reference maps
RRS real Height of reference maps
OUTPUTS:
VM(NL) real Model Velocities for a given source
VWTij(NLOS ,NL) real L.O.S. weights
CALLS: ***
BadR4, Get3DTval, sind, stop_here
CALLED BY:
ipsdt
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD), MAR, 1999 B. Jackson (UCSD) to
include VFAC
[Previous]
[Next]
NAME:
MkVObsn360
PURPOSE:
Make pseudo observed point P velocities from a velocity map
CATEGORY:
Data processing
CALLING SEQUENCE:
call MkVObsn360(XCbeg,XCend,VMAP,nLng,nLat,XC,XL,NL,NLV,NLOSP1,
XLS,XCE,XP,XD,XE,IYRS,DOYS,VOBS,XLSV,XCEV,XPV,XDV,XEV,IYRSV,DOYSV)
INPUTS:
XCbeg real Beginning Carrington Rotation value
XCend real Ending Carrington Rotation value
VMAP(nLng,nLat) real Velocity map
nLng integer Number of longitudes
nLat integer Number of latitudes
XC(NL,NLOSP1) integer Projected Carr. rot. value of point on L.O.S.
XL(NL,NLOSP1) integer Heliographic lat. (in deg.) point on L.O.S.
NL integer Number of G-level data points
NLOSP1 integer Number of L.O.S. distance segments + 1
XLS(NL) real Ecliptic longitude of Sun
XCE(NL) real Carrington variable of Earth
XP(NL) real Longitude diff. (Earth-Sun)
XD(NL) real Declination of Source
XE(NL) real Elongation of source
IYRS(NL) integer Year of source observation
DOYS(NL) real Day of year (and fraction) of source obs.
OUTPUTS:
NLV integer Number of velocity data points
VOBS(NL) real Pseudo observed velocities for a given source
XLSV(NL) real Ecliptic longitude of Sun of p.v. source obs.
XCEV(NL) real Carrington variable of Earth of p.v. source obs.
XPV(NL) real Longitude diff. (Earth-Sun) of p.v. source obs.
XDV(NL) real Declination of p.v. source
XEV(NL) real Elongation of p.v. source
IYRSV(NL) integer Year of p.v. source observation
DOYSV(NL) real Day of year (and fraction) of p.v. source obs.
CALLS: ***
Get2Dval
PROCEDURE:
MODIFICATION HISTORY:
NOV, 1995 B. Jackson (STEL,UCSD)
[Previous]
[Next]
NAME:
MKVTRACE
PURPOSE:
Calculate velocity traceback array from IPS velocity data
CALLING SEQUENCE:
subroutine MKVTRACE(JD,cVel,IPSD,NL,XR,YL,XC,NIND,VTrace,LngV,LatV,VSOL1,VSOL2,NSIDE)
INPUTS:
JD real*8
cVel character*(*)
IPSD integer
NL integer
XR(NL) real
YL(NL) real
XC(NL) real
NIND(NL) integer
LngV integer
LatV integer
VSol1(LngV,LatV,2)real
VSol2(LngV,LatV,2)real
NSIDE(LngV,LatV,-1:1,-1:1)
integer*1
OUTPUTS:
VTRACE(NL)
CALLS: ***
ArrR4Copy, BadR4, GridFill, IndexR4, Julian, N_CARRINGTON, Say, fncWZ, iFltArr, iSearch
CALLED BY:
READ_HOS
EXTERNAL:
external fncWZ
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
FEB-1996, Paul Hick (UCSD); extracted from main program SANHEL.FOR