CubeSatLunarEnvironment:

% Lunar environment calculations for the CubeSat dynamical model.

 Computes sun location with SunV1 and accounts for eclipses from the Earth and
 the Moon via Eclipse. All environment constants including gravity are defined
 here.
--------------------------------------------------------------------------
   Form:
   d 
   e = CubeSatLunarEnvironment( x, t, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x        (14,1)    [r;v;q;w;b]
   t         (1,1)    Time, sec
   d          (.)     Data structure
                      .jD0          Julian date of epoch
                      .surfData (.) optional; empty to skip optical calcs
                      .gravity  (.) 
                           .center  Index of gravity center

   -------
   Outputs
   -------
   env        (.)     Environmental data
                      .r            ECI position (km)
                      .v            ECI velocity (km/s)
                      .q            ECI to body quaternion
                      .mu           Gravitational constant (km3/s2)
                      .radiusPlanet Radius of the center planet (km)
                      .rho          Distance from the Moon (km)
                      .radiation    Planetary radiation W/m2
                      .albedo       Planet bond albedo fraction
                      .uSun         Sun unit vector (ECI)
                      .rSun         Sun distance (km)
                      .solarFlux    Solar flux at position (W/m2)
                      .nEcl         Eclipse fraction (source intensity, 0-1)
                      .accelGrav    Acceleration due to gravity
                      .rMoon        Moon position
                      .vMoon        Moon velocity
 
--------------------------------------------------------------------------
   See also SunV1, Eclipse, AtmDens2, AtmJ70, BDipole
--------------------------------------------------------------------------

Children:

AeroUtils: Coord/QLVLH
Common: General/CellToMat
Common: General/DeBlankLT
Common: General/MatToCell
Common: General/Watermark
Common: Graphics/NPlot
Common: Graphics/NewFig
Common: Graphics/Plot2D
Common: Graphics/PltStyle
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Quaternion/Mat2Q
Common: Quaternion/QMult
Common: Time/DTSToDTA
Common: Time/Date2JD
Common: Time/JD2000
CubeSat: Utilities/CubeSatAttitude
Math: Linear/Cross
Math: Linear/Dot
Math: Linear/DupVect
Math: Linear/Mag
Math: Linear/Unit
Orbit: GravityModels/GravityNormalized
Orbit: GravityModels/NormalizationMatrix
Orbit: GravityModels/UnnormalizeGravity
Orbit: OrbitMechanics/AGravityC
Orbit: OrbitMechanics/APlanet
SC: Ephem/CEcl2Eq
SC: Ephem/Eclipse
SC: Ephem/InterpolateState
SC: Ephem/MoonRot
SC: Ephem/PlanetPosJPL