Routines for computing solar fraction, lighting, eclipses, etc.
Compute the solar radiation pressure force vector on a spacecraft.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | area |
cross-sectional area of spacecraft [m^2] |
||
| real(kind=wp), | intent(in) | :: | cr |
coefficient of reflectivity |
||
| real(kind=wp), | intent(in), | dimension(3) | :: | r_sc_sun |
vector from spacecraft to sun [km] |
|
| real(kind=wp), | intent(in) | :: | sunfrac |
sun fraction [0=total eclipse, 1=no eclipse] |
solar radiation pressure force vector [N]
Compute the "sun fraction" using the selected shadow model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(celestial_body), | intent(in) | :: | b |
eclipsing body |
||
| real(kind=wp), | intent(in) | :: | rad_body |
radius of the eclipsing body [km] |
||
| real(kind=wp), | intent(in) | :: | rad_sun |
radius of the Sun [km] |
||
| class(ephemeris_class), | intent(inout) | :: | eph |
the ephemeris to use for sun and ssb (if necessary) |
||
| real(kind=wp), | intent(in) | :: | et |
observer ephemeris time (sec) |
||
| real(kind=wp), | intent(in), | dimension(6) | :: | rv |
state of the spacecraft (j2000-body frame) |
|
| integer, | intent(in) | :: | model |
algorithm to use: |
||
| real(kind=wp), | intent(in) | :: | rbubble |
eclipse bubble [km]. see the reference. if rbubble=0, then no bubble is used. only used if model=1 |
||
| logical, | intent(in), | optional | :: | use_geometric |
if true, use geometric positions (no light time or stellar aberration correction) default = false |
|
| character(len=:), | intent(out), | optional, | allocatable | :: | info |
info string |
solar fraction returned:
model=1, circular cubic sun frac value:>0 no eclipse<0 eclipse=0 on the eclipse linemodel=2, true solar fraction value [0=total eclipse, 1=no eclipse],
with model of umbra/penumbra/antumbra (Wertz, 1978)model=3, alternate version of solar fraction (Montenbruck and Gill)model=4, alternate version of solar fraction (nyxspace)Compute the solar fraction visible due to an eclipse by another body.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | d_s |
vector from the spacecraft to the Sun |
|
| real(kind=wp), | intent(in) | :: | rs |
radius of the Sun |
||
| real(kind=wp), | intent(in), | dimension(3) | :: | d_p |
vector from the spacecraft to the planet |
|
| real(kind=wp), | intent(in) | :: | rp |
radius of the planet |
||
| real(kind=wp), | intent(out) | :: | fraction |
fraction of the Sun visible [0=total eclipse, 1=no eclipse] |
||
| character(len=:), | intent(out), | optional, | allocatable | :: | info |
info string |
convert from a j2000-body frame to a j2000-ssb frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(celestial_body), | intent(in) | :: | b |
eclipsing body |
||
| class(ephemeris_class), | intent(inout) | :: | eph |
the ephemeris to use for body and ssb |
||
| real(kind=wp), | intent(in) | :: | et |
ephemeris time (sec) |
||
| real(kind=wp), | intent(in), | dimension(6) | :: | rv |
j2000-body state (km, km/s) |
|
| real(kind=wp), | intent(out), | dimension(6) | :: | rv_ssb |
j2000-ssb state (km, km/s) |
Return the position of a target body relative to an observer, corrected for light time and stellar aberration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ephemeris_class), | intent(inout) | :: | eph |
the ephemeris |
||
| type(celestial_body), | intent(in) | :: | b_target |
target body |
||
| real(kind=wp), | intent(in) | :: | et |
observer ephemeris time (sec) |
||
| real(kind=wp), | intent(in), | dimension(6) | :: | rv_obs_ssb |
state of the observer (j2000 frame w.r.t. solar system barycenter) |
|
| real(kind=wp), | intent(out), | dimension(3) | :: | r_target |
apparant state of the target (j2000 frame) Corrected for one-way light time and stellar aberration |
|
| logical, | intent(out) | :: | status_ok |
true if no problems |
The "circular cubic" shadow model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | rsun |
apparent position vector of sun wrt spacecraft [km] |
|
| real(kind=wp), | intent(in) | :: | radsun |
radius of sun [km] |
||
| real(kind=wp), | intent(in), | dimension(3) | :: | rplanet |
apparent position vector of eclipsing body wrt spacecraft [km] |
|
| real(kind=wp), | intent(in) | :: | radplanet |
radius of the eclipsing body [km] |
||
| real(kind=wp), | intent(out) | :: | sunfrac |
value of the function (>0 no eclipse, <0 eclipse, =0 on the shadow line) |
||
| real(kind=wp), | intent(in), | optional | :: | rbubble |
eclipse bubble radius. if present, then |
Another eclipse model, using circular area assumptions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | d_s |
vector from the spacecraft to the Sun |
|
| real(kind=wp), | intent(in) | :: | rs |
radius of the Sun |
||
| real(kind=wp), | intent(in), | dimension(3) | :: | d_p |
vector from the spacecraft to the planet |
|
| real(kind=wp), | intent(in) | :: | rp |
radius of the planet |
||
| real(kind=wp), | intent(out) | :: | percentsun |
fraction of the Sun visible [0=total eclipse, 1=no eclipse] |
||
| character(len=:), | intent(out), | optional, | allocatable | :: | info |
info string |
Another eclipse model, using circular area assumptions,
coded up based on the nixspace documentation.
The results are very similar to solar_fraction_alt.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | r_l |
vector from the spacecraft to the Sun |
|
| real(kind=wp), | intent(in) | :: | Rl |
radius of the Sun |
||
| real(kind=wp), | intent(in), | dimension(3) | :: | r_e |
vector from the spacecraft to the planet |
|
| real(kind=wp), | intent(in) | :: | Re |
radius of the planet |
||
| real(kind=wp), | intent(out) | :: | percentsun |
fraction of the Sun visible [0=total eclipse, 1=no eclipse] |
||
| character(len=:), | intent(out), | optional, | allocatable | :: | info |
info string |
Unit tests for the listing module.