Package gaiasky.util.gaia
Class ModifiedScanningLaw
java.lang.Object
gaiasky.util.gaia.ModifiedScanningLaw
Class to generate Gaia Modified Scanning Law (MSL).
The MSL is generated by numerical integration of the differential equations
for the heliotropic angles, which means that it is useful for creating a
table of the MSL as function of time, but not for getting the MSL attitude at
specific (random) times. Use the MslHermiteInterpolated for the latter.
Improved version (January 2013) allowing an array of high-density areas to be
considered.
Further optimization (July 2013) to reduced the maximum acceleration.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
There are three modes of scanning, enumerated by the ScanState: NOMINAL = running as in NSL, MODIFIED = running at reduced precession speed, TRANSITION = the precession speed is ramping up or down between the NOMINAL and MODIFIED states.protected static class
Enumerates the various transition functions tested. -
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected static double
protected static double
protected double
Additional fields used by numerical scanning lawsprotected double
Value of the spin phase at tBegprotected double
Additional fields used by numerical scanning lawsprotected gaiasky.util.gaia.ModifiedScanningLaw.Derivm
The dn object allows the Runge-Kutta integrator to calculate derivatives and gives access to constants needed for the calculationprotected long
protected double[]
protected static Vector3d
protected static double
protected ComplexArea[]
protected boolean
Have computed quantities been properly initialized?protected double
protected double
Current value of the solar longitude [rad] and rate of solar longitude [rad/day]protected double
protected double
Reference solar longitude (at the reference epoch) [rad]protected double
Current value of the heliotropic revolving phase [rad]protected double
Value of the revolving phase at tBegprotected double
Additional fields used by numerical scanning lawsprotected double
Reference heliotropic revolving phase (at the reference epoch) [rad]protected static double
protected double
Current value of the heliotropic spin phase Omega [rad].protected double
Additional fields used by numerical scanning lawsprotected double
Reference heliotropic spin phase (at the reference epoch) [rad]protected int
protected int
protected static double
protected double
Precession rate (K) in [rev/yr].protected boolean
protected Vector3d[]
protected long
Reference epoch to which the reference scan parameters referprotected double
Local constantsprotected long
Inertial scanning speed (omega_z) given either as a period in [ns] or as a rate in [deg/hour] = [arcsec/s].protected double
protected double
Local constantsprotected double
protected double
The uniform speed of the z-axis in solar motion units (S) for the nominal scaning law [dimensionless]protected Vector3d
protected double
protected ModifiedScanningLaw.ScanState
protected long
The starting time for the integration as GaiaTime and [ns] from J2010.0protected long
protected long
Current time in [ns] from 2010.0protected long
Variables for the Runge-Kutta integratorprotected static double
protected long
protected double
Current value of the solar aspect angle (revolving angle) [rad] and the quaternion representing a rotation by 90-xi about Y axisprotected double[]
protected double[]
protected double
Local constantsprotected double
Local constants -
Constructor Summary
ConstructorDescriptionModifiedScanningLaw(long gtBeg)
Constructor with NSL initialization for given start time -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adjusts the spin phase (omega) and the number of spin revolutions (omegaRevs) so that 0 <= omega < 2*piadvanceScanningTo(long newTimeNs)
Integrate the MSL forward in time by an arbitrary step.protected void
Calculates omega and omegaRevs from deltaOmega, t, scanPerNs.double
Get current speed of z axis in solar motion unitsdouble
Get current spin phase offset (DeltaOmega)double
Get current spin phase offset rate (d(DeltaOmega/dt)long
Get initial time as GaiaTimeGet a list of high-density areas that have been setdouble
getKappa()
Get current kappa = d(nu)/d(sLon)double
getLSun()
double
long
Get current time step in Runge-Kutta integratordouble
getNu()
Returns the current heliotropic revolving phase in range [0,2*pi]double
getNuDot()
Get current precession angle rate (d(nu)/dt)double
Returns the current heliotropic revolving phase in range [0,4*pi]double
getOmega()
Returns the scanning phase angle (Omega) in the range [0, 2*pi].double
Get current spin phase rate (d(Omega)/dt)double
Returns the scanning phase angle (Omega) in the range [0, 4*pi].int
Returns the integer number of revolutions to be added to the spin phase (omega) such that omega + 2 * pi * omegaRevs is a continuous function of timedouble
Get the precession rate of the underlying NSLlong
Get reference epoch (for the reference values of nu and omega) as nanoseconds since J2010double
getRefNu()
Get reference value of nudouble
Get reference values of omegadouble
Get the (target) scan rateGet current status of scanning (nominal, transition, modified)double
getXi()
protected void
Make constants available to integrator and compute the initial values of the scanning law angles at the starting time of the integration.void
Regret the last step The time and integration variables are reset to their values before the last invocation of the stepForward methodprotected void
reset()
Reset the integrator to (tNow, nuBeg, omegaBeg, ...)void
setHighDensityAreas(ComplexArea[] areas)
Set the region of the sky that is to be considered as "high density"void
setMaxInternalTimeStep(long stepNs)
Set time step in Runge-Kutta integratorvoid
setMslParameters(double factor, double zMaxDeg, double zMinDeg, double s1Min)
Set MSL parameters: speed reduction factor for z axis and AC limitsvoid
setPrecRate(double precRate)
Set the precession rate for the underlying NSLvoid
setRefEpoch(long refEpoch)
Set the reference epoch to which the reference heliotropic angles refervoid
setRefNu(double refNu)
Set the reference heliotropic angle nu (at refEpoch)void
setRefNuOmega(double refNu, double refOmega)
Set the reference heliotropic angles (at refEpoch) to other values than the default values obtained with the contructorvoid
setRefOmega(double refOmega)
Set the reference heliotropic angle Omega (at refEpoch)void
setRefXi(double refXi)
Set the reference heliotropic angle xi (solar aspect angle).void
setScanRate(double scanRate)
Set the scan rates for the underlying NSLvoid
Defines a typical high-density area for the MSL (as of April 2013).protected double
sigmoid(double x)
The sigmoid function provides a smooth transition from 0 (for x << 0) to 1 (for x >> 0)void
stepForward(long tStepNs)
Integrate the MSL forward in time by an arbitrary step.protected double
transitionKappa(double x, double kappaN, double kappaR, ModifiedScanningLaw.TransitionFunction tf)
Calculates a smooth transition of kappa from a nominal value (kappaN) to the reduced value (kappaR), depending on the variable x, which must be in the range from 0 to 1.
-
Field Details
-
PI
protected static final double PI- See Also:
- Constant Field Values
-
TWO_PI
protected static final double TWO_PI- See Also:
- Constant Field Values
-
FOUR_PI
protected static final double FOUR_PI- See Also:
- Constant Field Values
-
DEG
protected static final double DEG- See Also:
- Constant Field Values
-
DAY_NS
protected static final double DAY_NS- See Also:
- Constant Field Values
-
obliquity
protected static final double obliquity- See Also:
- Constant Field Values
-
eclPole
-
refEpoch
protected long refEpochReference epoch to which the reference scan parameters refer -
precRate
protected double precRatePrecession rate (K) in [rev/yr]. -
scanPerNs
protected long scanPerNsInertial scanning speed (omega_z) given either as a period in [ns] or as a rate in [deg/hour] = [arcsec/s]. -
scanRate
protected double scanRate -
sNom
protected double sNomThe uniform speed of the z-axis in solar motion units (S) for the nominal scaning law [dimensionless] -
lSunRef
protected double lSunRefReference solar longitude (at the reference epoch) [rad] -
omegaRef
protected double omegaRefReference heliotropic spin phase (at the reference epoch) [rad] -
nuRef
protected double nuRefReference heliotropic revolving phase (at the reference epoch) [rad] -
tNow
protected long tNowCurrent time in [ns] from 2010.0 -
lSun
protected double lSunCurrent value of the solar longitude [rad] and rate of solar longitude [rad/day] -
lSunDot
protected double lSunDot -
xi
protected double xiCurrent value of the solar aspect angle (revolving angle) [rad] and the quaternion representing a rotation by 90-xi about Y axis -
sinXi
protected double sinXi -
cosXi
protected double cosXi -
nu
protected double nuCurrent value of the heliotropic revolving phase [rad] -
omega
protected double omegaCurrent value of the heliotropic spin phase Omega [rad]. For good numerical precision, this is kept as an angle in the range [0, 2*pi]. The integer number of revolutions since the reference value (omega0) is given by the auxiliary variable omegaRevs. Thus a continuous angle as function of time is in principle given by the quantity omega + 2 * pi * omegaRevs. -
omegaRevs
protected int omegaRevs -
initialized
protected boolean initializedHave computed quantities been properly initialized? -
tBeg
protected long tBegThe starting time for the integration as GaiaTime and [ns] from J2010.0 -
tBegNs
protected long tBegNs -
nuBeg
protected double nuBegValue of the revolving phase at tBeg -
deltaOmegaBeg
protected double deltaOmegaBegValue of the spin phase at tBeg -
omegaRevsBeg
protected int omegaRevsBeg -
deltaOmega
protected double deltaOmegaAdditional fields used by numerical scanning laws -
deltaOmegaDot
protected double deltaOmegaDotAdditional fields used by numerical scanning laws -
omegaDot
protected double omegaDotAdditional fields used by numerical scanning laws -
nuDot
protected double nuDotAdditional fields used by numerical scanning laws -
tOld
protected long tOldVariables for the Runge-Kutta integrator -
y
protected double[] y -
yOld
protected double[] yOld -
dydt
protected double[] dydt -
dn
protected gaiasky.util.gaia.ModifiedScanningLaw.Derivm dnThe dn object allows the Runge-Kutta integrator to calculate derivatives and gives access to constants needed for the calculation -
sFactor
protected double sFactorLocal constants -
zMax
protected double zMaxLocal constants -
zMin
protected double zMinLocal constants -
s1min
protected double s1minLocal constants -
sRed
protected double sRed -
kappa
protected double kappa -
reduced
protected boolean reduced -
spinAxis
-
refDir
-
unit
protected long unit -
dt
protected long dt -
highDensityAreas
-
status
-
-
Constructor Details
-
ModifiedScanningLaw
public ModifiedScanningLaw(long gtBeg)Constructor with NSL initialization for given start time- Parameters:
gtBeg
- - The time elapsed in nanoseconds since epoch J2010
-
-
Method Details
-
initialize
protected void initialize()Make constants available to integrator and compute the initial values of the scanning law angles at the starting time of the integration. -
reset
protected void reset()Reset the integrator to (tNow, nuBeg, omegaBeg, ...) -
setRefEpoch
Set the reference epoch to which the reference heliotropic angles refer- Parameters:
refEpoch
-- Throws:
RuntimeException
-
setPrecRate
public void setPrecRate(double precRate)Set the precession rate for the underlying NSL- Parameters:
precRate
- (target) precession rate in [rev/yr]
-
setScanRate
public void setScanRate(double scanRate)Set the scan rates for the underlying NSL- Parameters:
scanRate
- (target) scan rate in [arcsec/s]
-
setRefNuOmega
public void setRefNuOmega(double refNu, double refOmega)Set the reference heliotropic angles (at refEpoch) to other values than the default values obtained with the contructor- Parameters:
refNu
- value of revolving phase (nu) at refEpoch [rad]refOmega
- value of spin phase (omega) at refEpoch [rad]
-
setRefXi
public void setRefXi(double refXi)Set the reference heliotropic angle xi (solar aspect angle). This is nominally constant, so it does not refer to any specific epoch.- Parameters:
refXi
- value of solar aspect angle (xi) [rad]
-
setRefNu
public void setRefNu(double refNu)Set the reference heliotropic angle nu (at refEpoch)- Parameters:
refNu
- value of revolving phase (nu) at refEpoch [rad]
-
setRefOmega
public void setRefOmega(double refOmega)Set the reference heliotropic angle Omega (at refEpoch)- Parameters:
refOmega
- value of spin phase (omega) at refEpoch [rad]
-
setMaxInternalTimeStep
public void setMaxInternalTimeStep(long stepNs)Set time step in Runge-Kutta integrator- Parameters:
stepNs
- time step [ns]
-
getMaxInternalTimeStep
public long getMaxInternalTimeStep()Get current time step in Runge-Kutta integrator- Returns:
- time step [ns]
-
setMslParameters
public void setMslParameters(double factor, double zMaxDeg, double zMinDeg, double s1Min)Set MSL parameters: speed reduction factor for z axis and AC limits- Parameters:
factor
- reduction factor z speedzMaxDeg
- maximum AC coordinate for reduced speed [deg]zMinDeg
- minimum AC coordinate for reduced speed [deg]s1Min
- minimum parallax factor for reduced speed [-]
-
setTypicalHighDensityArea
public void setTypicalHighDensityArea()Defines a typical high-density area for the MSL (as of April 2013). The area consists of two circles of 0.5 deg radius each, centred on BW (at Galactic coordinates lon = 1.04 deg, lat = -3.88 deg) and Sgr I (at lon = 1.44 deg, lat = -2.64 deg). See presentation by LL at GST-41. -
setHighDensityAreas
Set the region of the sky that is to be considered as "high density"- Parameters:
areas
- high density area
-
getHighDensityAreas
Get a list of high-density areas that have been set- Returns:
-
stepForward
public void stepForward(long tStepNs)Integrate the MSL forward in time by an arbitrary step.- Parameters:
tStepNs
- - time step- See Also:
advanceScanningTo(long)
-
regretLastStep
public void regretLastStep()Regret the last step The time and integration variables are reset to their values before the last invocation of the stepForward method -
getLSun
public double getLSun() -
getLSunDot
public double getLSunDot() -
getXi
public double getXi() -
getNu
public double getNu()Returns the current heliotropic revolving phase in range [0,2*pi]- Returns:
- current heliotropic revolving phase [rad] at time given by the
advanceScanningTo(long)
call.
-
getNuMod4Pi
public double getNuMod4Pi()Returns the current heliotropic revolving phase in range [0,4*pi]- Returns:
- current heliotropic revolving phase [rad] at time given by the
advanceScanningTo(long)
call.
-
getOmega
public double getOmega()Returns the scanning phase angle (Omega) in the range [0, 2*pi].- Returns:
- Scanning phase angle in radian at time given by the last
advanceScanningTo(long)
call.
-
getOmegaMod4Pi
public double getOmegaMod4Pi()Returns the scanning phase angle (Omega) in the range [0, 4*pi].- Returns:
- Scanning phase angle in radian at time given by the last
advanceScanningTo(long)
call.
-
getOmegaRevs
public int getOmegaRevs()Returns the integer number of revolutions to be added to the spin phase (omega) such that omega + 2 * pi * omegaRevs is a continuous function of time- Returns:
- number of revolutions for the spin phase
-
getNuDot
public double getNuDot()Get current precession angle rate (d(nu)/dt)- Returns:
- precession angle rate [rad/day]
-
getOmegaDot
public double getOmegaDot()Get current spin phase rate (d(Omega)/dt)- Returns:
- spin phase rate [rad/day]
-
getDeltaOmega
public double getDeltaOmega()Get current spin phase offset (DeltaOmega)- Returns:
- spin phase offset [rad] - continuous
-
getDeltaOmegaDot
public double getDeltaOmegaDot()Get current spin phase offset rate (d(DeltaOmega/dt)- Returns:
- spin phase offset rate [rad/day]
-
getCurrentS
public double getCurrentS()Get current speed of z axis in solar motion units- Returns:
- speed of z axis [-]
-
getKappa
public double getKappa()Get current kappa = d(nu)/d(sLon)- Returns:
- kappa [-]
-
getStatus
Get current status of scanning (nominal, transition, modified)- Returns:
- status
-
getGTimeBeg
public long getGTimeBeg()Get initial time as GaiaTime- Returns:
- initial time
-
getRefEpoch
public long getRefEpoch()Get reference epoch (for the reference values of nu and omega) as nanoseconds since J2010- Returns:
- reference epoch
-
getRefNu
public double getRefNu()Get reference value of nu- Returns:
- value of nu at refEpoch [rad]
-
getRefOmega
public double getRefOmega()Get reference values of omega- Returns:
- value of omega at refEpoch [rad]
-
getPrecRate
public double getPrecRate()Get the precession rate of the underlying NSL- Returns:
- precession rate in [rev/yr]
-
getScanRate
public double getScanRate()Get the (target) scan rate- Returns:
- scan rate in [arcsec/s]
-
calcOmega
protected void calcOmega()Calculates omega and omegaRevs from deltaOmega, t, scanPerNs. omegaDot is calculated at the same time -
advanceScanningTo
Integrate the MSL forward in time by an arbitrary step. Since the numerical implementation of Scanning Law integrates a differential equation, the only way to advance the scanning is to integrate from the current time (t) to the desired time (tNs), provided that tNs >= t. Otherwise, start from the initial conditions and integrate up to tNs.- See Also:
stepForward(long)
-
adjustOmega
protected void adjustOmega()Adjusts the spin phase (omega) and the number of spin revolutions (omegaRevs) so that 0 <= omega < 2*pi -
transitionKappa
protected double transitionKappa(double x, double kappaN, double kappaR, ModifiedScanningLaw.TransitionFunction tf)Calculates a smooth transition of kappa from a nominal value (kappaN) to the reduced value (kappaR), depending on the variable x, which must be in the range from 0 to 1. x = 0 returns kappa = kappaR, x = 1 returns kappaN.- Parameters:
x
-kappaN
- value for x = 1kappaR
- value for x = 0tf
- type of transition function- Returns:
-
sigmoid
protected double sigmoid(double x)The sigmoid function provides a smooth transition from 0 (for x << 0) to 1 (for x >> 0)- Parameters:
x
-- Returns:
-