dshsaa.raw package

Submodules

dshsaa.raw.astrodll module

dshsaa.raw.astrodll.AToN(a)[source]

Converts semi-major axis A to mean motion N.

Parameters

a (float) – Semi-major axis A (km).

Returns

N (float) - The mean motion N (revs/day).

dshsaa.raw.astrodll.AstroConvFrTo(xf_Conv, frArr)[source]

This function is intended for future use. No information is currently available.

Because the purpose of frArr and toArr is unclear, each array is automatically set to the maximum length permitted in the C_ASTRODLL spec.

Parameters
  • xf_Conv (int) – The purpose of this parameter is not yet known

  • frArr (float[<=128]) – The purpose of this parameter is not yet known

Returns

toArr (float[128]) - The output array of data

dshsaa.raw.astrodll.AstroFuncGetInfo()[source]

Retrieves information about the current version of AstroFunc.dll.

Returns

infoStr (str) - A string describing version number, build date, and platform

dshsaa.raw.astrodll.AstroFuncInit(maindll_handle)[source]

Initializes AstroFunc DLL for use in the program.

If this function returns an error, it is recommended that you stop the program immediately.

An error will occur if you forget to load and initialize all the prerequisite DLLs, as listed in the DLL Prerequisites section of the accompanying documentation, before using this DLL.

Parameters

maindll_handle (settings.stay_int64) – The handle that was reaturned by maindll.DllMainInit()

Returns

retcode (int) - 0 if AstroFunc.dll is initialized successfully, non-0 if there is an error.

dshsaa.raw.astrodll.AzElToLAD(az, el)[source]

Converts azimuth and elevation to vector triad LAD in topocentric horizontal coordinate system.

Parameters
  • az (float) – Input azimuth (deg).

  • el (float) – Input elevation angle (deg).

Returns

  • Lh (float[3]) - The resulting unit vector from the station to the satellite (referred to the horizon coordinate system axis). (double[3])

  • Ah (float[3]) - The resulting unit vector perpendicular to the hour circle passing through the satellite, in the direction of increasing Az. (double[3])

  • Dh (float[3]) - The resulting unit vector perpendicular to L and is directed toward the zenith, in the plane of the hour circle. (double[3])

dshsaa.raw.astrodll.AzElToRaDec(thetaG, lat, lon, az, el)[source]

Converts Azimuth/Elevation in local horizon reference frame to Right Ascension/Declination in topocentric reference frame. Requires some information about the ground site.

Parameters
  • thataG (float) – greenwhich mean sidereal time (rad)

  • lat (float) – station’s astronomical latitude (deg, +N, -S)

  • lon (float) – station’s astronomical longitude (deg, +E, -W)

  • az (float) – station’s azimuth (deg)

  • el (float) – station’s elevation (deg)

Returns

  • RA (float) - station’s right ascension (deg)

  • dec (float) - station’s declination (deg)

dshsaa.raw.astrodll.BrouwerToKozai(eccen, incli, nBrouwer)[source]

Converts Brouwer mean motion to Kozai mean motion.

Parameters
  • eccen (float) – eccentricity

  • incli (float) – inclination (degrees)

  • nBrouwer (float) – Brouwer mean motion (revs/day).

Returns

kozai (float) - Kozai mean motion (revs/day).

dshsaa.raw.astrodll.ClassToEqnx(metricClass)[source]

Converts a set of classical elements to a set of equinoctial elements.

Parameters

metricClass (float[6]) – The set of classical elements to be converted. (double[6])

Returns

metricEqnx (float[6]) - The resulting set of equinoctial elements. (double[6])

dshsaa.raw.astrodll.CompMoonPos(ds50ET)[source]

Computes the Moon position at the specified time.

Parameters

ds50ET (float) – The number of days since 1950, ET for which to compute the moon position.

Returns

  • uvecMoon (float[3]) - The resulting moon position unit vector. (double[3])

  • moonVecMag (float) - The resulting magnitude of the moon position vector (km).

dshsaa.raw.astrodll.CompSunMoonPos(ds50ET)[source]

Computes the Sun and Moon position at the specified time.

Parameters

ds50ET (float) – The number of days since 1950, ET for which to compute the sun and moon position.

Returns

  • uvecSun (float[3]) - The resulting sun position unit vector. (double[3])

  • sunVecMag (float) - The resulting magnitude of the sun position vector (km).

  • uvecMoon (float[3]) - The resulting moon position unit vector. (double[3])

  • moonVecMag (float) - The resulting magnitude of the moon position vector (km).

dshsaa.raw.astrodll.CompSunPos(ds50ET)[source]

Computes the Sun position at the specified time.

Parameters

ds50ET (float) – The number of days since 1950, ET for which to compute the sun position.

Returns

  • uvecSun (float[3]) - The resulting sun position unit vector. (double[3])

  • sunVecMag (float) - The resulting magnitude of the sun position vector (km).

dshsaa.raw.astrodll.CompTrueAnomaly(metricKep)[source]

Computes true anomaly from a set of Keplerian elements.

Parameters

metricKep (float[6]) – The set of Keplerian elements for which to compute true anomaly. (double[6])

Returns

true_anomaly (float) - The true anomaly in degrees.

dshsaa.raw.astrodll.CovMtxPTWToUVW(pos, vel, ptwCovMtx)[source]

Converts covariance matrix PTW to UVW.

Parameters
  • pos (float[3]) – The input position vector (km). (double[3])

  • vel (float[3]) – The input velocity vector (km/s). (double[3])

  • ptwCovMtx (float[6][6]) – The PTW covariance matrix to be converted. (double[6,6])

Returns

uvwCovMtx (float[6][6]) - The resulting UVW covariance matrix. (double[6,6])

dshsaa.raw.astrodll.CovMtxUVWToPTW(pos, vel, uvwCovMtx)[source]

Converts covariance matrix UVW to PTW

Parameters
  • pos (float[3]) – the input position vector (km) (double[3])

  • vel (float[3]) – the input velocity vector (km/s) (double[3])

  • uvwCovMtx (float[6][6]) – the UVW covariance matrix to be converted. (double[6,6])

Returns

ptwCovMtx (float[6][6]) - The resulting PTW covariance matrix (double[6,6])

dshsaa.raw.astrodll.ECIToEFG(thetaG, posECI, velECI)[source]

Converts ECI position and velocity vectors to EFG position and velocity vectors.

Parameters
  • thetaG (float) – Theta - Greenwich mean sidereal time (rad).

  • posECI (float[3]) – The ECI (TEME of Date) position vector (km) to be converted. (double[3])

  • velECI (float[3]) – The ECI (TEME of Date) velocity vector (km/s) to be converted. (double[3])

Returns

  • posEFG (float[3]) - The resulting EFG position vector (km). (double[3])

  • velEFG (float[3]) - The resulting EFG velocity vector (km/s). (double[3])

dshsaa.raw.astrodll.ECIToTopoComps(theta, lat, senPos, satPos, satVel)[source]

Converts satellite ECI position/velocity vectors and sensor location to topocentric components.

Parameters
  • theta (float) – Theta - local sidereal time(rad).

  • lat (float) – Station’s astronomical latitude (deg). (+N) (-S)

  • senPos (float[3]) – Sensor position in ECI (km). (double[3])

  • satPos (float[3]) – Satellite position in ECI (km). (double[3])

  • satVel (float[3]) – Satellite velocity in ECI (km/s). (double[3])

Returns

xa_topo (float[10]) - An array that stores the resulting topocentric components. (double[10])

  • [0]: Resulting right ascension (RA) (deg)

  • [1]: Declination (deg)

  • [2]: Azimuth (deg)

  • [3]: Elevation (deg)

  • [4]: Range (km)

  • [5]: RAdot (first derivative of right ascension) (deg/s)

  • [6]: DecDot (first derivative of declination) (deg/s)

  • [7]: AzDot (first derivative of azimuth) (deg/s)

  • [8]: ElDot (first derivative of elevation) (deg/s)

  • [9]: RangeDot (first derivative of range) (km/s)

dshsaa.raw.astrodll.ECRToEFG(polarX, polarY, posECR, velECR)[source]

Converts ECR position and velocity vectors to EFG position and velocity vectors.

Parameters
  • polarX (float) – Polar motion X (arc-sec).

  • polarY (float) – Polar motion Y (arc-sec).

  • posECR (float[3]) – The ECR position vector (km) to be converted. (double[3])

  • velECR (float[3]) – The ECR velocity vector (km/s) to be converted. (double[3])

Returns

  • posEFG (float[3]) - The resulting EFG position vector (km). (double[3])

  • velEFG (float[3]) - The resulting EFG velocity vector (km/s). (double[3])

dshsaa.raw.astrodll.EFGPosToLLH(posEFG)[source]

Converts an EFG position vector to geodetic latitude, longitude, and height.

Parameters

posEFG (float[3]) – The EFG position vector (km) to be converted. (double[3])

Returns

metricLLH (float[3]) - The resulting geodetic north latitude (degree), east longitude (degree), and height (km). (double[3])

dshsaa.raw.astrodll.EFGToECI(thetaG, posEFG, velEFG)[source]

Converts EFG position and velocity vectors to ECI position and velocity vectors.

Parameters
  • thetaG (float) – Theta - Greenwich mean sidereal time (rad).

  • posEFG (float[3]) – The EFG position vector (km) to be converted. (double[3])

  • velEFG (float[3]) – The EFG velocity vector (km/s) to be converted. (double[3])

Returns

  • posECI (float[3]) - The resulting ECI (TEME of Date) position vector (km). (double[3])

  • velECI (float[3]) - The resulting ECI (TEME of Date) velocity vector (km/s). (double[3])

dshsaa.raw.astrodll.EFGToECR(polarX, polarY, posEFG, velEFG)[source]

Converts EFG position and velocity vectors to ECR position and velocity vectors.

Parameters
  • polarX (float) – Polar motion X (arc-sec).

  • polarY (float) – Polar motion Y (arc-sec).

  • posEFG (float[3]) – The EFG position vector (km) to be converted. (double[3])

  • velEFG (float[3]) – The EFG velocity vector (km/s) to be converted. (double[3])

Returns

  • posECR (float[3]) - The resulting ECR position vector (km). (double[3])

  • velECR (float[3]) - The resulting ECR velocity vector (km/s). (double[3])

dshsaa.raw.astrodll.EarthObstructionAngles(earthLimb, satECI, senECI)[source]

Computes Earth/Sensor/Earth Limb and Earth/Sensor/Satellite angles.

Parameters
  • earthLimb (float) – Earth limb distance (km).

  • satECI (float[3]) – Satellite position in ECI (km). (double[3])

  • senECI (float[3]) – Sensor position in ECI (km). (double[3])

Returns

  • earthSenLimb (float) - The resulting earth/sensor/limb angle (deg).

  • earthSenSat (float) - The resulting earth/sensor/sat angle (deg).

  • satEarthSen (float) - The resulting sat/earth/sensor angle (deg).

dshsaa.raw.astrodll.EqnxToClass(metricEqnx)[source]

Converts a set of equinoctial elements to a set of classical elements

TODO: Determine and document vector sequence

Parameters

metricEqnx (float[6]) – The set of equinoctial elements to be converted. (double[6])

Returns

metricClass (float[6]) - The resulting set of classical elements. (double[6])

dshsaa.raw.astrodll.EqnxToKep(metricEqnx)[source]

Converts a set of equinoctial elements to a set of classical elements

TODO: Determine and document vector sequence

Parameters

metricEqnx (float[6]) – The set of equinoctial elements to be converted. (double[6])

Returns

metricClass (float[6]) - The resulting set of classical elements. (double[6])

dshsaa.raw.astrodll.EqnxToPosVel(metricEqnx)[source]

Converts a set of equinoctial elements to position and velocity vectors.

Parameters

metricEqnx (float[6]) – The set of equinoctial elements to be converted. (double[6])

Returns

  • pos (float[3]) - The resulting position vector. (double[3])

  • vel (float[3]) - The resulting velocity vector. (double[3])

dshsaa.raw.astrodll.GetInitialDrag(semiMajorAxis, eccen)[source]

Computes initial values for the SGP drag term NDOT and the SGP4 drag term BSTAR based upon eccentricity and semi-major axis.

Parameters
  • semiMajorAxis (float) – Semi-major axis (km).

  • eccen (float) – Eccentricity (unitless).

Returns

  • ndot (float) - Ndot (revs/day^2).

  • bstar (float) - Bstar (1/earth radii).

dshsaa.raw.astrodll.IsPointSunlit(ds50ET, ptEci)[source]

Determines if a point in space is sunlit at the input time ds50ET

Parameters
  • ds50ET (float) – The number of days since 1950, ET for which to determine if the point is sunlit.

  • ptEci (float) – a position in ECI (km). (double[3])

Returns

retcode (int) - 0 if unlit, 1 if lit, possibly other values on error (undocumented)

dshsaa.raw.astrodll.KepOscToMean(metricOscKep)[source]

Converts a set of osculating Keplerian elements to a set of mean Keplerian elements using method 9 algorithm.

Parameters

metricOscKep (float[6]) – The set of osculating Keplerian elements to be converted. (double[6])

Returns

metricMeanKep (float[6]) - The resulting set of mean Keplerian elements. (double[6])

dshsaa.raw.astrodll.KepToEqnx(metricKep)[source]

Converts a set of Keplerian elements to a set of equinoctial elements.

Parameters

metricKep (float[6]) – The set of Keplerian elements to be converted. (double[6])

Returns

metricEqnx (float[6]) - The resulting set of equinoctial elements. (double[6])

dshsaa.raw.astrodll.KepToPosVel(metricKep)[source]

Converts a set of osculating Keplerian elements to osculating position and velocity vectors.

Parameters

metricKep (float[6]) – The set of Keplerian elements to be converted. (double[6])

Returns

  • pos (float[3]) - The resulting position vector. (double[3])

  • vel (float[3]) - The resulting velocity vector. (double[3])

dshsaa.raw.astrodll.KepToUVW(metricKep)[source]

Converts a set of Keplerian elements to Ubar, Vbar, and Wbar vectors.

Parameters

metricKep (float[6]) – The set of Keplerian elements to be converted. (double[6])

Returns

  • uBar (float[3]) - The resulting ubar vector. (double[3])

  • vBar (float[3]) - The resulting vbar vector. (double[3])

  • wBar (float[3]) - The resulting wbar vector. (double[3])

dshsaa.raw.astrodll.KozaiToBrouwer(eccen, incli, nKozai)[source]

Converts Kozai mean motion to Brouwer mean motion.

Parameters
  • eccen (float) – eccentricity

  • incli (float) – inclination (degrees)

  • nKozai (float) – Kozai mean motion (revs/day).

Returns

nBrouwer (float) - Brouwer mean motion (revs/day).

dshsaa.raw.astrodll.LLHToEFGPos(metricLLH)[source]

Converts geodetic latitude, longitude, and height to an EFG position vector.

Parameters

metricLLH (float[3]) – An Array containing the geodetic north latitude (degree), east longitude (degree), and height (km) to be converted. (double[3])

Returns

posEFG (float[3]) - The resulting EFG position vector (km). (double[3])

dshsaa.raw.astrodll.LLHToXYZ(thetaG, metricLLH)[source]

Converts geodetic latitude, longitude, and height to an ECI position vector XYZ.

Parameters
  • thetaG (float) – Theta - Greenwich mean sidereal time (rad).

  • metric LLH (float[3]) – An array containing geodetic north latitude (degree), east longitude (degree), and height (km) to be converted. (double[3])

Returns

metricXYZ (float[3]) - The resulting ECI (TEME of Date) position vector (km). (double[3])

dshsaa.raw.astrodll.NToA(n)[source]

Converts mean motion N to semi-major axis A.

Parameters

n (float) – Mean motion N (revs/day).

Returns

a (float) - The semi-major axis A (km).

dshsaa.raw.astrodll.PosVelMuToEqnx(pos, vel, mu)[source]

Converts position and velocity vectors to a set of equinoctial elements with the given mu value.

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3])

  • mu (float) – The value of mu.

Returns

metricEqnx (float[6]) - The resulting set of equinoctial elements. (double[6])

dshsaa.raw.astrodll.PosVelMuToKep(pos, vel, mu)[source]

Converts osculating position and velocity vectors to a set of osculating Keplerian elements with the given value of mu.

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3])

  • mu (float) – The value of mu.

Returns

metricKep (float[6]) - The resulting set of Keplerian elements. (double[6])

dshsaa.raw.astrodll.PosVelToEqnx(pos, vel)[source]

Converts position and velocity vectors to a set of equinoctial elements.

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3])

Returns

metricEqnx (float[6]) - The resulting set of equinoctial elements. (double[6])

dshsaa.raw.astrodll.PosVelToKep(pos, vel)[source]

Converts osculating position and velocity vectors to a set of osculating Keplerian elements.

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3])

Returns

metricKep (float[6]) - The resulting set of Keplerian elements. (double[6])

dshsaa.raw.astrodll.PosVelToPTW(pos, vel)[source]

Converts position and velocity vectors to U, V, W vectors. The resulting vectors have the following meanings. U vector: V x W V vector: along velocity direction W vector: pos x vel

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3])

Returns

  • uVec (float[3]) - The resulting U vector. (double[3])

  • vVec (float[3]) - The resulting V vector. (double[3])

  • wVec (float[3]) - The resulting W vector. (double[3])

dshsaa.raw.astrodll.PosVelToUUVW(pos, vel)[source]

Converts position and velocity vectors to U, V, W vectors. The resulting vectors have the following meanings. U vector: along radial direction V vector: W x U W vector: pos x vel

Parameters
  • pos (float[3]) – The position vector to be converted. (double[3])

  • vel (float[3]) – The velocity vector to be converted. (double[3]) - uVec (float[3]) - The resulting U vector. (double[3]) - vVec (float[3]) - The resulting V vector. (double[3]) - wVec (float[3]) - The resulting W vector. (double[3])

dshsaa.raw.astrodll.RADecToLAD(RA, dec)[source]

Converts right ascension and declination to vector triad LAD in topocentric equatorial coordinate system.

Parameters
  • RA (float) – Right ascension (deg)

  • dec (float) – Declination (deg)

Returns

  • L (float[3]) - The resulting unit vector from the station to the satellite (referred to the equatorial coordinate system axis). (double[3])

  • A_Tilde (float[3]) - The resulting unit vector perpendicular to the hour circle passing through the satellite, in the direction of increasing RA. (double[3])

  • D_Tilde (float[3]) - The resulting unit vector perpendicular to L and is directed toward the north, in the plane of the hour circle. (double[3])

dshsaa.raw.astrodll.RAEToECI(theta, astroLat, xa_rae)[source]

Converts full state RAE (range, az, el, and their rates) to full state ECI (position and velocity)

Parameters
  • theta (float) – Theta - local sidereal time(rad).

  • astroLat (float) – Astronomical latitude (ded).

  • xa_rae (float[6]) –

    An array contains input data. The data at each index is listed below. (double[6])

    • [0]: Range (km)

    • [1]: Azimuth (deg)

    • [2]: Elevation (deg)

    • [3]: Range Dot (km/s)

    • [4]: Azimuth Dot (deg/s)

    • [5]: Elevation Dot (deg/s)

Returns

  • senPos (float[3]) - Sensor position in ECI (km). (double[3])

  • satPos (float[3]) - Satellite position in ECI (km). (double[3])

  • satVel (float[3]) - Satellite velocity in ECI (km/s). (double[3])

dshsaa.raw.astrodll.RaDecToAzEl(thetaG, lat, lon, RA, dec)[source]

Converts right ascension and declination in the topocentric reference frame to Azimuth/Elevation in the local horizon reference frame.

Parameters
  • thetaG (float) – Theta - Greenwich mean sidereal time (rad).

  • lat (float) – Station’s astronomical latitude (deg). (+N) (-S)

  • lon (float) – Station’s astronomical longitude (deg). (+E) (-W)

  • RA (float) – Right ascension (deg)

  • dec (float) – Declination (deg)

Returns

  • az (float) - Azimuth (deg)

  • el (float) - Elevation (deg)

dshsaa.raw.astrodll.RotDateToJ2K(spectr, nutationTerms, ds50TAI, posDate, velDate)[source]

Rotates position and velocity vectors from coordinates of date to J2000.

Parameters
  • spectr (float) – Specifies whether to run in SPECTR compatibility mode. A value of 1 means Yes.

  • nutationTerms (float) – Nutation terms (4-106, 4:less accurate, 106:most acurate).

  • ds50TAI (float) – Time in days since 1950, TAI for which the coordinates of position and velocity vectors are currently expressed.

  • posDate (float[3]) – The position vector from coordinates of Date. (double[3])

  • velDate (float[3]) – The velocity vector from coordinates of Date. (double[3])

Returns

  • posJ2K (float[3]) - The resulting position vector in coordinates of J2000. (double[3])

  • velJ2K (float[3]) - The resulting velocity vector in coordinates of J2000. (double[3])

dshsaa.raw.astrodll.RotJ2KToDate(spectr, nutationTerms, ds50TAI, posDate, velDate)[source]

Rotates position and velocity vectors from coordinates of date to J2000.

Parameters
  • spectr (float) – Specifies whether to run in SPECTR compatibility mode. A value of 1 means Yes.

  • nutationTerms (float) – Nutation terms (4-106, 4:less accurate, 106:most acurate).

  • ds50TAI (float) – Time in days since 1950, TAI for which the coordinates of position and velocity vectors are currently expressed.

  • posJ2K (float[3]) – The position vector from J2000. (double[3])

  • velJ2K (float[3]) – The velocity vector from J2000. (double[3])

Returns

  • posDate (float[3]) - The resulting position vector in coordinates of date, ds50TAI. (double[3])

  • velDate (float[3]) - The resulting velocity vector in coordinates of date, ds50TAI. (double[3])

dshsaa.raw.astrodll.SolveKepEqtn(metricKep)[source]

Solves Kepler’s equation (M = E - e sin(E)) for the eccentric anomaly, E, by iteration.

Parameters

metricKep (float[6]) – The set of Keplerian elements for which to solve the equation. (double[6])

Returns

E (float) - The eccentric anomaly “E”

dshsaa.raw.astrodll.XYZToLLH(thetaG, metricPos)[source]

Converts an ECI position vector XYZ to geodetic latitude, longitude, and height.

Parameters
  • thetaG (float) – ThetaG - Greenwich mean sidereal time (rad).

  • metricPos (float[3]) – The ECI (TEME of Date) position vector (km) to be converted. (double[3])

Returns

metricLLH (float[3]) - The resulting geodetic north latitude (degree), east longitude(degree), and height (km). (double[3])

dshsaa.raw.envdll module

dshsaa.raw.envdll.EnvGetEarthShape()[source]

Returns the value representing the shape of the earth being used by the Astro Standards software, either spherical earth or oblate earth

Returns

earth_shape (int) - The value indicates the shape of the earth that is being used in the Astro Standards software: 0=spherical earth, 1= oblate earth

dshsaa.raw.envdll.EnvGetFkConst(xf_FkCon)[source]

Retrieves the value of one of the constants from the current fundamental catalogue (FK) model.

Param

xf_FkCon (int) - An index specifying the constant you wish to retrieve.

xf_FkCon

Value

1

C1: Earth rotation rate w.r.t. moving equinox (rad/day)

2

C1DOT: Earth rotation acceleration (rad/day2)

3

THGR70: Greenwich angle (1970; rad)

Returns

fkcon (float) - a floating point representation of the requested value

dshsaa.raw.envdll.EnvGetFkIdx()[source]

Returns the current fundamental catalogue (FK) setting.

Returns

fk_setting (int) - Return the current FK setting as an integer. Valid values are: (4 = FK4, 5 = FK5). The FK model is shared among all the Standardized Astrodynamic Algorithms DLLs in the program.

dshsaa.raw.envdll.EnvGetFkPtr()[source]

Returns a handle that can be used to access the fundamental catalogue (FK) data structure. The handle returned by this function is sometimes called a pointer for historical reasons. The name EnvGetFkPtr comes from the fact that the handle used to be called a pointer.

Note

This function is needed when calling the ThetaGrnwch function from TimeFunc.dll.

Returns

fk_ptr (int) - A handle which can be used to access the FK data structure.

dshsaa.raw.envdll.EnvGetGeoConst(xf_GeoCon)[source]

Retrieves the value of one of the constants from the current Earth constants (GEO) model.

Parameters

xf_GeoCon (int) –

An index specifying the constant you wish to retrieve, see XF_GEOCON_? for field specification

xf_GeoCon

xf_GeoCon Interpretation

1

FF: Earth flattening (reciprocal; unitless)

2

J2 (unitless)

3

J3 (unitless)

4

J4 (unitless)

5

KE (er^1.5/min)

6

KMPER: Earth radius (km/er)

7

RPTIM: Earth rotation rate w.r.t. fixed equinox (rad/min)

8

CK2: J2/2 (unitless)

9

CK4: -3/8 J4 (unitless)

10

KS2EK: Converts km/sec to er/kem

11

THDOT: Earth rotation rate w.r.t. fixed equinox (rad/kem)

Returns

geocon (float) - The value of requested value

dshsaa.raw.envdll.EnvGetGeoIdx()[source]

Returns the current Earth constants (GEO) setting. The GEO model is shared among all the Standardized Astrodynamic Algorithms DLLs in the program.

Returns

geo_idx (int) - The current GEO setting, expressed as an integer.

value

value interpretation

84

WGS-84

96

EGM-96

72

WGS-72 (default)

2

JGM2

68

STEM68R, SEM68R

5

GEM5

9

GEM9

dshsaa.raw.envdll.EnvGetGeoStr()[source]

Returns the name of the current Earth constants (GEO) model.

Returns

geo_str (str) - The geoStr parameter may contain one of the following values:

WGS-84

EGM-96

WGS-72

JGM2

SEM68R

GEM5

GEM9

dshsaa.raw.envdll.EnvGetInfo()[source]

Returns information about the EnvConst DLL. The returned string provides information about the version number, build date, and the platform of the EnvConst DLL.

Returns

info (str) - A string containing information abou the EnvConst DLL

dshsaa.raw.envdll.EnvInit(maindll_handle)[source]

Initializes the EnvInit DLL for use in the program.

If this function returns an error, it is recommended that you stop the program immediately.

An error will occur if you forget to load and initialize all the prerequisite DLLs, as listed in the DLL Prerequisites section of the accompanying documentation, before using this DLL.

When the function is called, the GEO model is set to WGS-72 and the FK model is set to FK5. If the user plans to use the SGP4 propagator, DO NOT change this default setting. Otherwise, SGP4 won’t work

Returns

retcode (int) - Returns zero indicating the EnvConst DLL has been initialized successfully. Other values indicate an error.

dshsaa.raw.envdll.EnvLoadFile(envFile)[source]

Reads Earth constants (GEO) model and fundamental catalogue (FK) model settings from a file.

The users can use NAME=VALUE pair to setup the GEO and FK models in the input file.

For GEO model, the valid names are GEOCONST, BCONST and the valid values are WGS-72, WGS72, 72, WGS-84, WGS84, 84, EGM-96, EGM96, 96, JGM-2, JGM2, 2, SEM68R, 68, GEM5, 5, GEM9, and 9.

For FK model, the valid name is FKCONST and the valid values are: FK4, 4, FK5, 5.

All the string literals are case-insensitive.

Returns

retcode (int) - Returns zero indicating the input file has been loaded successfully. Other values indicate an error

dshsaa.raw.envdll.EnvSaveFile(envConstFile, saveMode, saveForm)[source]

Saves the current Earth constants (GEO) model and fundamental catalogue (FK) model settings to a file.

Parameters
  • envConstFile (str) – The name of the file in which to save the settings. (string[512])

  • saveMode (int) – Specifies whether to create a new file or append to an existing one. (0 = create, 1= append)

  • saveForm (int) – Specifies the mode in which to save the file. (0 = text format, 1 = xml (not yet implemented, reserved for future))

Returns

retcode (int) - Returns zero indicating the GEO and FK settings have been successfully saved to the file. Other values indicate an error.

dshsaa.raw.envdll.EnvSetEarthShape(earth_shape)[source]

Specifies the shape of the earth that will be used by the Astro Standards software, either spherical earth or oblate earth

Parameters

earth_shape (int) – The value indicates the shape of the earth: 0=spherical earth, 1= oblate earth (default)

dshsaa.raw.envdll.EnvSetFkIdx(xf_FkMod)[source]

Changes the fundamental catalogue (FK) setting to the specified value.

If the users enter an invalid value for the fkIdx, the program will continue to use the current setting.

The FK model is globally shared among the Standardized Astrodynamic Algorithms DLLs. If its setting is changed, the new setting takes effect immediately.

The FK model must be set to FK5 to use the SGP4 propagator.

Parameters

xf_FxKod (int) – Specifies the FK model to use. The following values are accepted: xf_FkMod= 4: FK4, xf_FkMod= 5: FK5

dshsaa.raw.envdll.EnvSetGeoIdx(xf_GeoMod)[source]

Changes the Earth constants (GEO) setting to the specified value.

Parameters

xf_GeoMod (int) –

If you specify an invalid value for xf_GeoMod, the program will continue to use the current setting.

The GEO model is globally shared among the Standardized Astrodynamic Algorithms DLLs. If its setting is changed, the new setting takes effect immediately

The following table lists possible values of the parameter value GEO setting:

value

value interpretation

84

WGS-84

96

EGM-96

72

WGS-72 (default)

2

JGM2

68

STEM68R, SEM68R

5

GEM5

9

GEM9

dshsaa.raw.envdll.EnvSetGeoStr(geoStr)[source]

Changes the Earth constants (GEO) setting to the model specified by a string literal.

Parameters

geoStr (str) –

If you specify an invalid value for geoStr, the program will continue to use the current setting.

The GEO model is globally shared among the Standardized Astrodynamic Algorithms DLLs. If its setting is changed, the new setting takes effect immediately.

The following table lists possible values of the parameter value GEO setting:

geoStr (any string in the row)

Interpretation

’WGS-84’, ‘WGS84’, ‘84’

WGS-84

’EGM-96’, ‘EGM96’, ‘96’

EGM-96

’WGS-72’, ‘WGS72’, ‘72’

WGS-72 (default)

’JGM-2, ‘JGM2’, ‘2’

JGM-2

’SEM68R’, ‘68’

STEM68R, SEM68R

’GEM5’, ‘5’

GEM5

’GEM9’, ‘9’

GEM9

The GEO model must be set to WGS-72 to use the SGP4 propagator.

dshsaa.raw.exceptions module

exceptions.py contains all custom warnings and exceptions for the package

exception dshsaa.raw.exceptions.Error[source]

Bases: Exception

Base class for other exceptions

exception dshsaa.raw.exceptions.KnownFault[source]

Bases: dshsaa.raw.exceptions.Error

Raised when known bad code would be run

Parameters

err_msg (str) – When called as raw.exceptions.KnownFault(“err_msg”), the appropriate KnownFault error will be thrown with the “err_msg” string provided.

dshsaa.raw.maindll module

dshsaa.raw.maindll.CloseLogFile()[source]

Closes the log file last opened by this process.

Returns

None (None) - This is a true void function. The only way to verify that the function worked is to check whether the log file is in use by this process.

dshsaa.raw.maindll.DllMainGetInfo()[source]

Returns information about DllMain DLL

Returns

info (str) - a regular python string describing DllMain DLL

dshsaa.raw.maindll.DllMainInit()[source]

Inits a DLLMain wrapper object in memory

Returns

maindll_handle (settings.stay_int64) - A 64 bit integer (a “pointer” or “reference”) used to help the other DLLs find the running instance of maindll

dshsaa.raw.maindll.GetInitDllNames()[source]

Returns a list of names of the Standardized Astrodynamic Algorithms DLLs that were initialized successfully.

This function provides a quick way to check whether all of the prerequisite DLLs have been loaded and initialized correctly. Improper initialization of the Standardized Astrodynamic Algorithms DLLs is one of the most common causes of program crashes.

Returns

initdllnames (str) - a string representation of the DLLs that were successfully initialized. (byte[512])

dshsaa.raw.maindll.GetLastErrMsg()[source]

Returns a character string describing the last error that occurred.

As a common practice, this function is called to retrieve the error message when an error occurs. This function works with or without an opened log file.

If you call this function before you have called DllMainInit(), the function will return an invalid string. This could result in undefined behavior.

Returns

lastErrMsg (str) - a string representation of the last error message (byte[128])

dshsaa.raw.maindll.GetLastInfoMsg()[source]

Returns a character string describing the last informational message that was recorded.

This function is usually called right after space objects (TLEs, VCMs, sensors, observations, etc.) in an input text file were loaded. It gives information about how many records were successfully loaded, how many were bad, and how many were duplicated.

This function works with or without an opened log file.

If you call this function before you have called DllMainInit(), the function will return an invalid string. This could result in undefined behavior.

Returns

lastInfoMsg (str) - A string representation of the last logged informational message. (byte[128])

dshsaa.raw.maindll.LogMessage(message)[source]

Writes a message into the log file.

Make sure the log file is open by calling OpenLogFile before using this function.

The message is limited to 128 characters. If the message is longer than this, it will be truncated.

Returns

None (None) - This is a void function

dshsaa.raw.maindll.OpenLogFile(logfile)[source]

Opens a log file that all objects connected to maindll will write to.

Parameters

logfile (str) – name of the file to write to

Returns

retcode (int) - the return status of the linked function, 0 on success, <0 on various failures

dshsaa.raw.settings module

settings.py is an internal module to the raw package which addresses operating system specific architecture.

dshsaa.raw.settings.array2d_to_list(ar)[source]

Converts a 2d ctypes array into a list of equal shape. Only works for double and integer ctypes!

Parameters

ar (ctypes.c_int[?][?], ctypes.c_double[?][?]) – A 2d ctypes array of doubles or integers.

Returns

li (int[?][?] or float[?][?]) - A list of ints or floats matching the input ar

dshsaa.raw.settings.array_to_list(vector_obj)[source]

Converts c.c_int[] and c.c_double[] arrays into python lists of ints or floats. This does NOT work for any other data types!

Parameters

vector_obj (ctypes.c_int[?], ctypes.c_double[?]) – An array of integers or doubles managed by the ctypes library.

Returns

new_list (int[?] or float[?]) - A list of ints or floats from the ctypes array.

dshsaa.raw.settings.byte_to_str(byte_obj)[source]

Converts a ctypes byte output into a python string. This is usually used when the *.restype is set to ctypes.c_char_p and a string is returned from a binary DLL.

Parameters

byte_obj (ctypes.c_char_p) – The byte object which needs to be encoded into a python string

Returns

byte_obj (str) - the byte object re-expressed as an ASCII string. NOT UTF-8! The AFSPC DLLs exclusively use ASCII and we need to respect that.

dshsaa.raw.settings.double1

A ctypes array double[1]

alias of dshsaa.raw.settings.c_double_Array_1

dshsaa.raw.settings.double10

A ctypes array double[10]

alias of dshsaa.raw.settings.c_double_Array_10

dshsaa.raw.settings.double128

A ctypes array double[128]

alias of dshsaa.raw.settings.c_double_Array_128

dshsaa.raw.settings.double3

A ctypes array double[3]

alias of dshsaa.raw.settings.c_double_Array_3

dshsaa.raw.settings.double512

A ctypes array double[512]

alias of dshsaa.raw.settings.c_double_Array_512

dshsaa.raw.settings.double6

A ctypes array double[6]

alias of dshsaa.raw.settings.c_double_Array_6

dshsaa.raw.settings.double64

A ctypes array double[64]

alias of dshsaa.raw.settings.c_double_Array_64

dshsaa.raw.settings.double6x6

A 2D ctypes array double[6][6]

alias of dshsaa.raw.settings.c_double_Array_6_Array_6

dshsaa.raw.settings.enforce_limit(byte_obj, length, terminator=True)[source]

When sending byte strings to DLL, this function will trim any byte strings in excess of a specified limit and ensure they end in a proper terminator

Parameters
  • byte_obj (bytes) – The byte string we wish to limit in length

  • terminator (optional, bool) – if true, enforce last byte is , else leave last byte as is

Returns

byte_obj (bytes) - The byte string trimmed to the appropriate length with the final address guaranteed to be \.

dshsaa.raw.settings.feed_2d_list_into_array(li, ar)[source]

Copies the contents of a 2D python list into a 2D ctypes array. Assumes both list and array are rectangular and of equal dimension. If arrays are _not_ rectangular, a memory leak could occur!

Only tested to work with integers and floats mapped to c.c_double[m][n].

Will throw exception if list is different size from the array.

Parameters
  • li (list) – the list of data to feed into the array

  • ar (ctype[][]) – the array to feed data into

Returns

ar (ctype[][]) - The array that has been filled with data from li.

dshsaa.raw.settings.feed_list_into_array(li, ar)[source]

Takes each element of a list li, casts them to the type of array ar, then copies them into each index of ar.

Parameters
  • li (list) – A list of python elements.

  • ar (ctypes_array) – A fully initialized ctype array. Usually the array is ctypes.c_double[], ctypes.c_int[], or ctypes.c_char_p[].

Returns

ar (ctypes.sometype) - Returns the ctype array with the python list contents in it.

dshsaa.raw.settings.list_to_array(li, ct=<class 'ctypes.c_double'>)[source]

Converts a python list of ints or floats into a ctypes array.

Parameters
  • li (float[?]) – A list of ints or floats to convert into a ctypes array.

  • ct (ctypes type constructor, ctypes.c_double, ctypes.c_int) – A ctype type to cast the elements of li (defaults to ctypes.c_double, but ctypes.c_int is known to work.)

Returns

ar (see parameter ct) - A ctypes array representation of the input list li with each element being type-cast to ct.

class dshsaa.raw.settings.stay_int64[source]

Bases: ctypes.c_long

ctypes primitives are automatically converted into python primitives unless subclassed. In order to consistently type check int64 numerical types (used as memory handles), c_int64 was subclassed but no changes were made to properties or methods

This class is used as instructions for ctypes.DLLNAME.restype and ctypes.DLLNAME.argtypes[] declaration. It is not intended to create new 64 bit integers.

You may verify that an object is a memory handle, you may use isinstance. For example:

if not isinstance(satKey, settings.stay_int64):
        raise TypeError("satKey is type %s, should be type %s" % (type(satKey), settings.stay_int64))
dshsaa.raw.settings.str_to_byte(s, fixed_width=None, limit=None, terminator=None)[source]

Converts a python string into a ctypes.c_char_p() compatible bytes object.

Parameters
  • s (str) – The string that needs to be converted.

  • fixed_width (int, optional) – If provided, specifies the length of the byte array, padding with zeroes if necessary.

  • limit (int, optional) – The maximum number of characters allowed. An error is thrown if that limit is exceeded. This is often used if the DLL has an express limit, like 512 bytes.

  • terminator (bytes, optional) – If provided, terminates the byte object with the provided bytes object. It is recommended to use settings.string_term, which is known to work well with the DLLs.

Returns

b (bytes) - A python bytes representation of the ctypes string. Call settings.str_to_c_char_p to convert directly ctypes compatible string.

dshsaa.raw.settings.str_to_c_char_p(s, fixed_width=None, limit=None, terminator=None)[source]

Converts a python string to a ctypes.c_char_p type of object.

Parameters
  • s (str) – The string that needs to be converted.

  • fixed_width (int, optional) – If provided, specifies the length of the byte array, padding with zeroes if necessary.

  • limit (int, optional) – The maximum number of characters allowed. An error is thrown if that limit is exceeded. This is often used if the DLL has an express limit, like 512 bytes.

  • terminator (bytes, optional) – If provided, terminates the byte object with the provided bytes object. It is recommended to use settings.string_term, which is known to work well with the DLLs.

Returns

m (ctypes.c_char_p) - A DLL compatible string. This is acceptable to input as a paramter to a DLL method call when the *.argtypes[] element is set to ctypes.c_char_p.

dshsaa.raw.settings.string_term = b'\x00'

In many early compiled languages, such as those the SAA DLLs were built on, strings are created by building a null terminated character array. Those arrays were encoded roughly like this:

['s','t','r','i','n','g','\0']

This string_term variable contains the \0 part of that structure. Some functions in settings use the terminator= optional argument. It is recommended that terminator=settings.string_term.

dshsaa.raw.sgp4dll module

dshsaa.raw.sgp4dll.Sgp4GetInfo()[source]

Returns information about the current version of Sgp4Prop.dll.

Retrun

infoStr (str) - A string containing information about Sgp4.

dshsaa.raw.sgp4dll.Sgp4GetLicFilePath()[source]

Returns the current path to the Sgp4 Open License File

Returns

LicFilePath (str) - The path to the current license file.

dshsaa.raw.sgp4dll.Sgp4GetPropOut(satKey, xf_Sgp4Out)[source]

Retrieves propagator’s precomputed results. This function can be used to obtain results from a propagation which are not made available through calls to the propagation functions themselves.

This function should be called immediately after a successful call to Sgp4PropMse() or Sgp4PropDs50UTC() to retrieve the desired values.

It is the caller’s responsibility to ensure that the array passed in the destArray parameter is large enough to hold the requested values. The required size can be found by looking at the destArray size column of the table below describing valid index values.

The destArray Arrangement column lists the order of the elements in the array. It is not necessarily the subscript of the element in the array since this is language-dependent. For example, in C/C++ the first element in every array is the zero-subscripted element. In other programming languages, the subscript of the first element is 1.

Note: This function is not thread safe, please use Sgp4PropAll() instead

The table below shows the values for the xf_Sgp4Out parameter:

Index

Index Interpretation

destArray size

destArray Arrangement

1

Revolution number

1

  1. Revolution number (based on the Osculating Keplerian Elements)

2

Nodal Apogee Perigee

3

  1. nodal period (minutes)

  2. apogee (km)

  3. perigee (km)

3

Mean Keplerian Elements

6

  1. semi-major axis (km)

  2. eccentricity (unitless)

  3. inclination (degree)

  4. mean anomaly (degree)

  5. right ascension of the ascending node (degree)

  6. argument of perigee (degree)

4

Osculating Keplerian Elements

6

Same as Mean Keplerian Elements

Parameters
  • satKey (settings.stay_int64) – The unique key of the satellite for which to retrieve results.

  • xf_SgpOut – Specifies which propagator outputs to retrieve. See table above.

Returns

  • retcode (int) - 0 if the requested information is retrieved successfully, non-0 if there is an error.

  • destArr (float[?]) - A list of 1 to 6 elements pulled from the propogator. See table above.

dshsaa.raw.sgp4dll.Sgp4Init(apPtr)[source]

Initializes the Sgp4 DLL for use in the program.

Parameters

apPtr (settings.stay_int64) – The handle that was returned from DllMainInit(). See the documentation for DllMain.dll for details.

Returns

retcode (int) - 0 if Sgp4Prop.dll is initialized successfully, non-0 if there is an error.

dshsaa.raw.sgp4dll.Sgp4InitSat(satKey)[source]

Initializes an SGP4 satellite from an SGP or SGP4 TLE.

Internally, when this function is called, Tle.dll’s set of TLEs is searched for the provided satKey. If found, the associated TLE data will be used to create an SGP4 satellite which then will be added to Sgp4Prop.dll’s set of satellites. Subsequent calls to propagate this satellite will use the data in this set to compute the satellite’s new state.

This routine should be called once for each satellite you wish to propagate before propagation begins, or any time the associated data that is stored by Tle.dll is changed.

The call to this routine needs to be placed before any calls to the SGP4 propagator routines (Sgp4PropMse(), Sgp4PropDs50UTC(), etc.).

Parameters

satKey (settings.stay_int64) – The satellite’s unique key. This key will have been returned by one of the routines in Tle.dll.

Returns

retcode (int) - 0 if the satellite is successfully initialized and added to Sgp4Prop.dll’s set of satellites, non-0 if there is an error.

dshsaa.raw.sgp4dll.Sgp4PosVelToKep(yr, day, pos, vel)[source]

Converts osculating position and velocity vectors to a set of mean Keplerian SGP4 elements.

The new position and velocity vectors are the results of using SGP4 propagator to propagate the computed sgp4MeanKep to the time specified in year and day of epoch time. They should be closely matched with the input osculating position and velocity vectors.

The mean Keplerian elements are SGP4’s Brouwer mean motion not SGP’s Kozai mean motion.

Parameters
  • yr (int) – 2 or 4 digit year of the epoch time

  • day (float) – Day of year of the epoch time.

  • pos (float[3]) – Input osculating position vector (km). (double[3])

  • vel (float[3]) – Input osculating velocity vector (km/s). (double[3])

Returns

  • retcode (int) - 0 if the conversion is successful, non-0 if there is an error.

  • posNew (float[3]) - Resulting position vector (km) propagated from the sgp4MeanKep. (double[3])

  • velNew (float[3]) - Resulting velocity vector (km/s) propagated from the sgp4MeanKep. (double[3])

  • sgp4MeanKep (float[6]) - Resulting set of Sgp4 mean Keplerian elements. (double[6])

dshsaa.raw.sgp4dll.Sgp4PropAll(satKey, timeType, timeIn)[source]

Propagates a satellite, represented by the satKey, to the time expressed in either minutes since epoch or days since 1950, UTC. All propagation data is returned by this function.

TODO: Create a table identifying each element of xa_Sgp4Out. This value was undocumented and the data must be recovered and crosschecked manually.

Parameters
  • satKey (settings.stay_int64) – The unique key of the satellite to propagate.

  • timeType (int) – The propagation time type: 0 = minutes since epoch, 1 = days since 1950, UTC

  • timeIn (float) – The time to propagate to, expressed in either minutes since epoch or days since 1950, UTC.

Returns

  • retcode (int) - 0 if the propagation is successful, non-0 if there is an error.

  • xa_Sgp4Out (float[64]) - The array that stores all Sgp4 propagation data, see XA_SGP4OUT_? for array arrangement (double[64])

dshsaa.raw.sgp4dll.Sgp4PropDs50UTC(satKey, ds50UTC)[source]

Propagates a satellite, represented by the satKey, to the time expressed in days since 1950, UTC. The resulting data about the satellite is placed in the various reference parameters.

It is the users’ responsibility to decide what to do with the returned value. For example, if the users want to check for decay or low altitude, they can put that logic into their own code.

The following cases will result in an error:

  • Semi major axis A <= 0 or A >1.0D6

  • Eccentricity E >= 1.0 or E < -1.0D-3

  • Mean anomaly MA>=1.0D10

  • Hyperbolic orbit E2>= 1.0

  • satKey doesn’t exist in the set of loaded satellites

  • GEO model not set to WGS-72 and/or FK model not set to FK5

Parameters
  • satKey (settings.stay_int64) – The unique key of the satellite to propagate.

  • ds50UTC (float) – The time to propagate to, expressed in days since 1950, UTC.

Returns

  • retcode (int) - 0 if the propagation is successful, non-0 if there is an error.

  • mse (float) - Resulting time in minutes since the satellite’s epoch time.

  • pos (float[3]) - Resulting ECI position vector (km) in True Equator and Mean Equinox of Epoch. (double[3])

  • vel (float[3]) - Resulting ECI velocity vector (km/s) in True Equator and Mean Equinox of Epoch. (double[3])

  • llh (float[3]) - Resulting geodetic latitude (deg), longitude(deg), and height (km). (double[3])

dshsaa.raw.sgp4dll.Sgp4PropDs50UtcLLH(satKey, ds50UTC)[source]

Propagates a satellite, represented by the satKey, to the time expressed in days since 1950, UTC. Only the geodetic information is returned by this function.

It is the users’ responsibility to decide what to do with the returned value. For example, if the users want to check for decay or low altitude, they can put that logic into their own code.

This function is similar to Sgp4PropDs50UTC but returns only LLH. This function is designed especially for applications which plot ground traces.

The following cases will result in an error:

  • Semi major axis A <= 0 or A >1.0D6

  • Eccentricity E >= 1.0 or E < -1.0D-3

  • Mean anomaly MA>=1.0D10

  • Hyperbolic orbit E2>= 1.0

  • satKey doesn’t exist in the set of loaded satellites

  • GEO model not set to WGS-72 and/or FK model not set to FK5

Parameters
  • satKey (settings.stay_int64) – The unique key of the satellite to propagate.

  • ds50UTC (float) – The time to propagate to, expressed in days since 1950, UTC.

Returns

  • retcode (int) - 0 if the propagation is successful, non-0 if there is an error.

  • llh (float[3]) - Resulting geodetic latitude (deg), longitude(deg), and height (km). (double[3])

dshsaa.raw.sgp4dll.Sgp4PropDs50UtcPos(satKey, ds50UTC)[source]

Propagates a satellite, represented by the satKey, to the time expressed in days since 1950, UTC. Only the ECI position vector is returned by this function.

It is the users’ responsibility to decide what to do with the returned value. For example, if the users want to check for decay or low altitude, they can put that logic into their own code.

This function is similar to Sgp4PropDs50UTC but returns only ECI position vector. This function is designed especially for applications which plot satellite position in 3D.

The following cases will result in an error:

  • Semi major axis A <= 0 or A >1.0D6

  • Eccentricity E >= 1.0 or E < -1.0D-3

  • Mean anomaly MA>=1.0D10

  • Hyperbolic orbit E2>= 1.0

  • satKey doesn’t exist in the set of loaded satellites

  • GEO model not set to WGS-72 and/or FK model not set to FK5

Parameters
  • satKey (settings.stay_int64) –

  • ds50UTC (float) – The unique key of the satellite to propagate.

Returns

  • retcode (int) - 0 if the propagation is successful, non-0 if there is an error.

  • ds50UTC (float) - The time to propagate to, expressed in days since 1950, UTC.

  • pos (float[3]) - Resulting ECI position vector (km) in True Equator and Mean Equinox of Epoch. (double[3])

dshsaa.raw.sgp4dll.Sgp4PropMse(satKey, mse)[source]

Propagates a satellite, represented by the satKey, to the time expressed in minutes since the satellite’s epoch time. The resulting data about the satellite is placed in the various reference parameters.

It is the users’ responsibility to decide what to do with the returned value. For example, if the users want to check for decay or low altitude, they can put that logic into their own code.

This function can be called in random time requests.

The following cases will result in an error:

  • Semi major axis A <= 0 or A >1.0D6

  • Eccentricity E >= 1.0 or E < -1.0D-3

  • Mean anomaly MA>=1.0D10

  • Hyperbolic orbit E2>= 1.0

  • satKey doesn’t exist in the set of loaded satellites

  • GEO model not set to WGS-72 and/or FK model not set to FK5

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key.

  • mse (float) – The time to propagate to, specified in minutes since the satellite’s epoch time.

Returns

  • retcode (int) - 0 if the propagation is successful, non-0 if there is an error.

  • ds50UTC (float) - Resulting time in days since 1950, UTC.

  • pos (float[3]) - Resulting ECI position vector (km) in True Equator and Mean Equinox of Epoch. (double[3])

  • vel (float[3]) - Resulting ECI velocity vector (km/s) in True Equator and Mean Equinox of Epoch. (double[3])

  • llh (float[3]) - Resulting geodetic latitude (deg), longitude(deg), and height (km). (double[3])

dshsaa.raw.sgp4dll.Sgp4ReepochTLE(satKey, reepochDs50UTC)[source]

Reepochs a loaded TLE, represented by the satKey, to a new epoch.

Parameters
  • satKey (settings.stay_int64) – The unique key of the satellite to reepoch.

  • reepochDs50UTC (float) – The new epoch, express in days since 1950, UTC.

Returns

  • retcode (int) - 0 if the reepoch is successful, non-0 if there is an error.

  • line1Out (str) - A string to hold the first line of the reepoched TLE. (byte[512])

  • line2Out (str) - A string to hold the second line of the reepoched TLE. (byte[512])

dshsaa.raw.sgp4dll.Sgp4RemoveAllSats()[source]

Removes all currently loaded satellites from memory.

Calling this function removes all satellites from the set maintained by Sgp4Prop.dll. However, the TLE data loaded by Tle.dll is unaffected by this function.

Returns

retcode (int) - 0 if all satellites are removed successfully from memory, non-0 if there is an error.

dshsaa.raw.sgp4dll.Sgp4RemoveSat(satKey)[source]

Removes a satellite, represented by the satKey, from the set of satellites.

If the specified satKey is not currently loaded into the propagator, an error will be indicated.

Removing a satellite from the propagator’s set of satellites does not affect the corresponding TLE data loaded by calls to routines in Tle.dll.

Parameters

satKey (settings.stay_int64) – The satellite’s unique key.

Returns

retcode (int) - 0 if the satellite is removed successfully, non-0 if there is an error.

dshsaa.raw.sgp4dll.Sgp4SetLicFilePath(licFilePath)[source]

Sets path to the Sgp4 Open License file if the license file is not in the current working folder. ..Note:: Remember to call this function even before calling the Sgp4Init.

The licFilePath can contain either an absolute or relative path to the folder containing the license file, but it must include a trailing path separator. I.e. “./license/” not “./license”

Parameters

licFilePath (str) – The path to the folder containing the license file, ending in a ‘/’ and not the name of the file itself

Returns

None (None) - This is a true void function. Verify license file is loaded by trying to init SGP4.

dshsaa.raw.timedll module

dshsaa.raw.timedll.DTGToUTC(dtg)[source]

Converts a time in one of the DTG formats to a time in ds50UTC. DTG15, DTG17, DTG19, and DTG20 formats are accepted.

..Note:: See “UTCToDTG20” for an example.

During the conversion, this function processes only numbers and the ‘.’ character. This means that you can format dtgStr in a format that makes sense. You can use spaces and the ‘/’ character for example if you wish.

The function can process dates from 1950 to 2049. Any input outside this range will yield “0.0”.

This function supports DTG19 inputs in both “YY DDD HH MM SS.SSS” and “YYYYMonDDHHMMSS.SSS” formats.

Parameters

dtg (str) – A string representation of time in DTG format

Returns

ds50utc (float) - Time as a python float, value in DTG20 format

dshsaa.raw.timedll.Get6P()[source]

Returns prediction control parameters.

Returns

  • startFrEpoch (int) - Indicates whether startTime is expressed in minutes or days since Epoch. If startFrEpoch == 1, then startTime is in minutes since epoch. If startFrEpoch == 0, then startTime is in days since 1950, UTC.

  • stopFrEpoch (int) - Indicates whether stopTime is expressed in minutes or days since Epoch. If stopFrEpoch == 1, then stopTime is in minutes since epoch. If stopFrEpoch == 0, then stopTime is in days since 1950, UTC.

  • startTime (float) - The start time. Depending on the value of startFrEpoch, start time can be expressed in minutes since epoch or days since 1950, UTC.

  • stopTime (float) - The stop time. Depending on the value of stopFrEpoch, stop time can be expressed in minutes since epoch or days since 1950, UTC.

  • interval (float) - The step size (minutes).

dshsaa.raw.timedll.Get6PCardLine()[source]

Returns current prediction control parameters in the form of a 6P-Card string

Returns

card6PLine (str) - String representation of prediction control parameters.

dshsaa.raw.timedll.IsTConFileLoaded()[source]

Checks to see if timing constants have been loaded into memory

..Note:: the integer return type is preserved because I suspect SAA is using undocumented reason codes

Returns

-load_status (int) - 1 if timing constants are loaded, another value if not.

dshsaa.raw.timedll.Set6P(startFrEpoch, stopFrEpoch, startTime, stopTime, stepSize)[source]

Set the prediction control parameters

..Note:: SAA documentation uses the words “interval” and “stepSize” interchangeably

Parameters
  • startFrEpoch (int) – Indicates whether startTime is expressed in minutes since epoch.(startFrEpoch = 1: Value of startTime is in minutes since epoch, startFrEpoch = 0: Value of startTime is in days since 1950, UTC)

  • stopFrEpoch (int) – Indicates whether stopTime is expressed in minutes since epoch. (stopFrEpoch = 1: Value of stopTime is in minutes since epoch, stopFrEpoch = 0: Value of stopTime is in days since 1950, UTC)

  • startTime (float) – The start time. Depending on the value of startFrEpoch, start time can be expressed in minutes since epoch or days since 1950, UTC.

  • stopTime (float) – The stop time. Depending on the value of stopFrEpoch, stop time can be expressed in minutes since epoch or days since 1950, UTC.

  • stepSize (float) – The step size (minutes).

dshsaa.raw.timedll.TAIToUT1(ds50TAI)[source]

Converts a time in ds50TAI to a time in ds50UT1 using timing constants records in memory. If no timing constants records were loaded, ds50TAI and ds50UT1 are the same.

Parameters

ds50TAI (float) – Days since 1950, TAI to be converted.

Returns

ds50UT1 (float) - The number of days since 1950, UT1. Partial days will be represented as decimal days.

dshsaa.raw.timedll.TAIToUTC(ds50TAI)[source]

Converts a time in ds50TAI to a time in ds50UTC using timing constants records in memory. If no timing constants records were loaded, ds50TAI and ds50UTC are the same.

Parameters

ds50TAI (float) – Days since 1950, TAI to be converted.

Returns

ds50UTC (float) - The number of Days since 1950, UTC. Partial days may be returned.

dshsaa.raw.timedll.TConAddARec(refDs50UTC, leapDs50UTC, taiMinusUTC, ut1MinusUTC, ut1Rate, polarX, polarY)[source]

Adds a timing constant record to memory. Note that this function is solely for backward compatible with legacy software. The users should use TConLoadFile or TimeFuncLoadFile to load timing constants file instead.

Parameters
  • refDs50UTC (float) – Reference time (days since 1950, UTC)

  • leapDs50UTC (float) – Leap Second time (days since 1950, UTC)

  • taiMinusUTC (float) – TAI minus UTC offset at the reference time (seconds)

  • ut1MinusUTC (float) – UT1 minus UTC offset at the reference time (seconds)

  • ut1Rate (float) – UT1 rate of change versus UTC at the reference time (msec/day)

  • polarX (float) – Polar wander (X direction) at the reference time (arc-seconds)

  • polarY (float) – Polar wander (Y direction) at the reference time (arc-seconds)

Returns

retcode (int) - 0 if timing constants are added to memory, !0 if there is an error.

dshsaa.raw.timedll.TConAddOne(refDs50UTC, leapDs50UTC, taiMinusUTC, ut1MinusUTC, ut1Rate, polarX, polarY)[source]

Adds one timing constant record to memory. This API can be used to avoid TConLoadFile’s file I/O

Parameters
  • refDs50UTC (float) – Reference time (days since 1950, UTC)

  • leapDs50UTC (float) – Leap Second time (days since 1950, UTC)

  • taiMinusUTC (float) – TAI minus UTC offset at the reference time (seconds)

  • ut1MinusUTC (float) – UT1 minus UTC offset at the reference time (seconds)

  • ut1Rate (float) – UT1 rate of change versus UTC at the reference time (msec/day)

  • polarX (float) – Polar wander (X direction) at the reference time (arc-seconds)

  • polarY (float) – Polar wander (Y direction) at the reference time (arc-seconds)

Returns

retcode (int) - 0 if timing constants are added to memory, !0 if there is an error.

dshsaa.raw.timedll.TConLoadFile(tconfile)[source]

Loads timing constants data from an input file. Time constants can be included directly in the main input file or they can be read from a separate file identified with “TIMFIL=[pathname/filename]”. The input file is read in two passes. The function first looks for “TIMFIL=” lines, then it looks for timing constant data which was included directly. The result of this is that data entered using both methods will be processed, but the “TIMFIL=” data will be processed first. The time constants are also read in from each VCM. However, only the most recent time constants among VCMs are stored in the memory, see VCM.dll documentation. See the “Time Constants Data Description” section in the accompanying TimeFunc documentation file for supported formats.

Parameters

tconfile (str) – The name of the time constant file to load

Returns

retcode (int) - 0 if file successfully loaded, nonzero if file not successfully loaded

dshsaa.raw.timedll.TConRemoveAll()[source]

Removes all the timing constants records in memory.

Returns

retcode (int) - 0 if all timing constants records are successfully removed from memory, non-0 if there is an error.

dshsaa.raw.timedll.TConSaveFile(tconfile, saveMode, saveForm)[source]

Saves currently loaded timing constants data to a file.

TODO: Determine if XML format has been implemented.

Parameters
  • tconfile (str) – The name of the file in which to save the timing constants data, 512 character limit

  • saveMode (int) – Specifies whether to create a new file or append to an existing one. (0 = Create new file, 1= Append to existing file)

  • saveForm (int) – Specifies the format in which to save the file. (0 = SPECTER Print Record format, 1 = XML format (future implementation))

Returns

retcode (int) - 0 if the data is successfully saved to the file, non-0 if there is an error.

dshsaa.raw.timedll.ThetaGrnwch(ds50UT1, envFk)[source]

Computes right ascension of Greenwich at the specified time in ds50UT1. The Fk constants as you currently have them set up in EnvConst.dll are used.

Parameters
  • ds50UT1 (float) – Input days since 1950, UT1.

  • envFk (stay_int64) – A handle to the FK data. Use the value returned from envdll.EnvGetFkPtr()

Returns

thetaGrnwhch (float) - Right ascension of Greenwich in radians at the specified time.

dshsaa.raw.timedll.ThetaGrnwchFK4(ds50UT1)[source]

Computes right ascension of Greenwich at the specified time in ds50UT1 using the Fourth Fundamental Catalogue (FK4). There is no need to load or initialize EnvConst.dll when computing right ascension using this function.

Parameters

ds50UT1 (float) – Input days since 1950, UT1.

Returns

thetaGrnwhchFK4 (float) - Right ascension of Greenwich in radians at the specified time using FK4.

dshsaa.raw.timedll.ThetaGrnwchFK5(ds50UT1)[source]

Computes right ascension of Greenwich at the specified time in ds50UT1 using the Fifth Fundamental Catalogue (FK5). There is no need to load or initialize EnvConst.dll when computing right ascension using this function.

Parameters

ds50UT1 (float) – Input days since 1950, UT1.

Returns

thetaGrnwhchFK5 (float) - Right ascension of Greenwich in radians at the specified time using FK5.

dshsaa.raw.timedll.TimeComps1ToUTC(year, dayOfYear, hh, mm, sss)[source]

Converts a set of time components (year, day of year, hour, minute, second) to a time in ds50UTC. Partial days may be returned. See “timedll.TimeComps2ToUTC” for a function which takes a month and day instead of a day of year value.

Parameters
  • year (int) – The year time component. Either a four digit or two digit year is accepted.

  • dayOfYear (int) – The day of the year

  • hh (int) – The hour of the day

  • mm (int) – The minute of the day

  • sss (float) – The second, including decimal seconds if desired

Returns

ds50UTC (float) - The number of Days since 1950, UTC. Partial days may be returned.

dshsaa.raw.timedll.TimeComps2ToUTC(year, mon, dayOfMonth, hh, mm, sss)[source]

Converts a set of time components (year, month, day of month, hour, minute, second) to a time in ds50UTC. Partial days may be returned. See “TimeComps1ToUTC” for a function which takes a day of year value instead of a month and day.

Parameters
  • year (int) – The year time component. Either a four digit or two digit year is accepted.

  • mon (int) – the month as a number 1-12

  • dayOfMonth (int) – The day of the month

  • hh (int) – The hour of the day

  • mm (int) – The minute of the day

  • sss (float) – The second, including decimal seconds if desired

Returns

ds50UTC (float) - The number of Days since 1950, UTC. Partial days may be returned.

dshsaa.raw.timedll.TimeConvFrTo(funcIdx, frArr)[source]

This function is intended for future use. No information is currently available. Developer note: because the interface has documented types, we “did our best” The documentation incorrectly identifies the frArr data type to be a double instead of a double[]. No big deal. It is unclear what the maximum array length is permitted to be. It is not memory safe to use this function until we constrain the index lengths.

Parameters
  • funcIdx (int) –

    ?

  • frArr (float[]) –

    ?

Returns

toArr (float[]) - ?

dshsaa.raw.timedll.TimeFuncGetInfo()[source]

Returns the information about the TimeFunc DLL.

Returns

infoStr (str) - up to 128 characters describing TimeFunc DLL

dshsaa.raw.timedll.TimeFuncInit(maindll_handle)[source]

Initializes a TimeFuncDLL object attached to the MainDLL object specified by maindll_handle pointer

Parameters

maindll_handle (c.c_int64) – an integer pointer to the location of maindll in memory, returned by maindll.DllMainInit()

Returns

timedll_retcode (int) - 0 on success, !0 on failure

dshsaa.raw.timedll.TimeFuncLoadFile(tconfile)[source]

Loads timing constants data and prediction control (6P-card) from an input file. Time constants can be included directly in the main input file or they can be read from a separate file identified with “TIMFIL=[pathname/filename]”. The input file is read in two passes. The function first looks for “TIMFIL=” lines, then it looks for timing constant data which was included directly. The result of this is that data entered using both methods will be processed, but the “TIMFIL=” data will be processed first. The time constants are also read in from each VCM. However, only the most recent time constants among VCMs are stored in the memory, see VCM.dll documentation.

Parameters

tconfile (str) – the location of the timing constants and prediction control file

Returns

retcode (int) - 0 if input file loaded successfully, !0 otherwise

dshsaa.raw.timedll.UTCToDTG15(ds50UTC)[source]

Converts a ds50UTC time value (numeric double representing time since some epoch, need to locate citable docs) to a string of the form “YYDDDHHMMSS.SSS”

Parameters

ds50UTC (int) – time since epoch

Returns

dtg15 (str) - string representation of time

dshsaa.raw.timedll.UTCToDTG17(ds50UTC)[source]

Converts a ds50UTC time value (numeric double representing time since some epoch, need to locate citable docs) to a string of the form “YYYY/DDD.DDDDDDDD”

Parameters

ds50UTC (int) – time since epoch

Returns

dtg17 (str) - string representation of time

dshsaa.raw.timedll.UTCToDTG19(ds50UTC)[source]

Converts a ds50UTC time value (numeric double representing time since some epoch, need to locate citable docs) to a string of the form “YYYYMonDDHHMMSS.SSS” THIS FUNCTION IS CURRENTLY DISABLED DUE TO AN UNKNOWN COREDUMP ISSUE

Parameters

ds50UTC (int) – time since epoch

Returns

dtg19 (str) - string representation of time

dshsaa.raw.timedll.UTCToDTG20(ds50UTC)[source]

Converts a ds50UTC time value (numeric double representing time since some epoch, need to locate citable docs) to a string of the form “YYYY/DDD HHMM SS.SSS”

Parameters

ds50UTC (int) – time since epoch

Returns

dtg20 (str) - string representation of time

dshsaa.raw.timedll.UTCToET(ds50UTC)[source]

Converts a time in ds50UTC to a time in ds50ET using timing constants records in memory. If no timing constants records were loaded, ds50UTC and ds50UT1 are the same.

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

ds50ET (float) - The number of days since 1950, ET. Partial days may be returned.

dshsaa.raw.timedll.UTCToTAI(ds50UTC)[source]

Converts a time in ds50UTC to a time in ds50TAI using timing constants records in memory. If no timing constants records were loaded, ds50UTC and ds50TAI are the same.

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

ds50TAI (double) - The number of days since 1950, TAI. Partial days may be returned.

dshsaa.raw.timedll.UTCToTConRec(ds50UTC)[source]

Retrieves the timing constants record, if exists, at the requested input time in ds50UTC. If the requested record is not found, 0’s will be returned for all of the constants. You can use this fact to determine whether the record was found or not. Simply check the taiMinusUTC value after calling this function. Since that value can never be 0 for a valid record, if it is 0 the record was not found.

Parameters

ds50UTC (float) – Input days since 1950, UTC

Returns

  • taiMinusUTC (float) - Returned TAI minus UTC offset at requested time (seconds)

  • ut1MinusUTC (float) - Returned UT1 minus UTC offset at requested time (seconds)

  • ut1Rate (float) - Returned UT1 rate of change versus UTC at Reference time (msec/day)

  • polarX (float) - Returned interpolated polar wander (X direction) at requested time (arc-seconds)

  • polarY (float) - Returned interpolated polar wander (Y direction) at requested time (arc-seconds)

dshsaa.raw.timedll.UTCToTimeComps1(ds50UTC)[source]

Converts a time in ds50UTC to its individual components (year, day of year, hour, minute, second).

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

  • year (int) - A reference to a variable in which to store the 4-digit year.

  • dayOfYear (int) - The day of the year referred to by ds50UTC.

  • hh (int) - The hour of the day referred to by ds50UTC.

  • mm (int) - The minute of the hour referred to by ds50UTC.

  • sss (double) - The second of the minute referred to by ds50UTC, with decimal parts if necessary.

dshsaa.raw.timedll.UTCToTimeComps2(ds50UTC)[source]

Converts a time in ds50UTC to its individual components (year, month, day of month, hour, minute, second).

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

  • year (int) - A reference to a variable in which to store the 4-digit year.

  • month (int) - The month of the year referred to by ds50UTC.

  • dayOfMonth (int) - The day of the month referred to by ds50UTC.

  • hh (int) - The hour of the day referred to by ds50UTC.

  • mm (int) - The minute of the hour referred to by ds50UTC.

  • sss (float) - The second of the minute referred to by ds50UTC, with decimal parts if necessary.

dshsaa.raw.timedll.UTCToUT1(ds50UTC)[source]

Converts a time in ds50UTC to a time in ds50UT1 using timing constants records in memory. If no timing constants records were loaded, ds50UTC and ds50UT1 are the same.

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

ds50UT1 (float) - The number of days since 1950, UT1. Partial days may be returned.

dshsaa.raw.timedll.UTCToYrDays(ds50UTC)[source]

Converts a time in ds50UTC to a year and day of year.

Parameters

ds50UTC (float) – Days since 1950, UTC to be converted.

Returns

year (int) - The four digit year referred to by ds50UTC. dayOfYear (float) - The day of the year referred to by ds50UTC. Decimal parts are used if partial days must be expressed.

dshsaa.raw.timedll.YrDaysToUTC(year, dayOfYear)[source]

Converts a year and a number of days to a time in ds50UTC.

Parameters
  • year (int) – Two or four digit years are accepted.

  • dayOfYear (float) – The day of year. Partial days can be specified.

Returns

ds50UTC (float) - The number of days since 1950, UTC. Partial days may be returned.

dshsaa.raw.tledll module

dshsaa.raw.tledll.TleAddSatFrArray(xa_tle, xs_tle)[source]

Adds a TLE (satellite), using its data stored in the input parameters.

Parameters
  • xa_tle (float[64]) – Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) – Input string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (string[512])

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrArrayML(xa_tle, xs_tle)[source]

This function is similar to TleAddSatFrArray but designed to be used in Matlab.

Parameters
  • xa_tle (float[64]) – Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) – Input string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (string[512])

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrFieldsGP(satNum, secClass, satName, epochYr, epochDays, bstar, ephType, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Adds a GP TLE using its individually provided field values.

Parameters
  • satNum (int) – satellite number

  • secClass (str) – security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bstar (float) – B* drag term (1/er)

  • ephType (int) – Satellite ephemeris type (0: SGP, 2: SGP4)

  • elsetNum (int) – element set number

  • incli (float) – orbit inclination (degrees)

  • node (float) – right ascension of ascending node (degrees)

  • eccen (float) – eccentricity

  • omega (float) – argument of perigee (degrees)

  • mnAnomaly (float) – mean anomaly (degrees)

  • mnMotion (float) – mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – revolution number at epoch

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrFieldsGP2(satNum, secClass, satName, epochYr, epochDays, bstar, ephType, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum, nDotO2, n2DotO6)[source]

This function is similar to TleAddSatFrFieldsGP but includes nDotO2 and n2DotO6. nDotO2 and n2DotO6 values are not used in the SGP4 propagator. However, some users still want to preserve the integrity of all input data.

Parameters
  • satNum (int) – satellite number

  • secClass (str) – security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bstar (float) – B* drag term (1/er)

  • ephType (int) – Satellite ephemeris type (0: SGP, 2: SGP4)

  • elsetNum (int) – element set number

  • incli (float) – orbit inclination (degrees)

  • node (float) – right ascension of ascending node (degrees)

  • eccen (float) – eccentricity

  • omega (float) – argument of perigee (degrees)

  • mnAnomaly (float) – mean anomaly (degrees)

  • mnMotion (float) – mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – revolution number at epoch

  • nDotO2 (float) – Mean motion derivative (rev/day /2)

  • n2DotO6 (float) – Mean motion second derivative (rev/day**2 /6)

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrFieldsGP2ML(satNum, secClass, satName, epochYr, epochDays, bstar, ephType, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum, nDotO2, n2DotO6)[source]

This function is similar to TleAddSatFrFieldsGP2 but designed to be used in Matlab. Matlab doesn’t seem to correctly return the 19-digit satellite key using TleAddSatFrFieldsGP2. This method is an alternative way to return the satKey output. This function is similar to TleAddSatFrFieldsGP but includes nDotO2 and n2DotO6. nDotO2 and n2DotO6 values are not used in the SGP4 propagator. However, some users still want to preserve the integrity of all input data.

Parameters
  • satNum (int) – satellite number

  • secClass (str) – security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bstar (float) – B* drag term (1/er)

  • ephType (int) – Satellite ephemeris type (0: SGP, 2: SGP4)

  • elsetNum (int) – element set number

  • incli (float) – orbit inclination (degrees)

  • node (float) – right ascension of ascending node (degrees)

  • eccen (float) – eccentricity

  • omega (float) – argument of perigee (degrees)

  • mnAnomaly (float) – mean anomaly (degrees)

  • mnMotion (float) – mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – revolution number at epoch

  • nDotO2 (float) – Mean motion derivative (rev/day /2)

  • n2DotO6 (float) – Mean motion second derivative (rev/day**2 /6)

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrFieldsSP(satNum, secClass, satName, epochYr, epochDays, bTerm, ogParm, agom, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Adds an SP satellite using the individually provided field values. Only applies to SP propagator. Review https://www.sat.dundee.ac.uk/fle.html for more information on SP 4 line element sets.

Parameters
  • satNum (int) – Satellite number

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bTerm (float) – Ballistic coefficient (m^2/kg)

  • ogParm (float) – Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) – Agom (radiation pressure coefficient) (m^2/kg)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day)

  • revNum (int) – Revolution number at epoch

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrFieldsSPML(satNum, secClass, satName, epochYr, epochDays, bTerm, ogParm, agom, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Adds an SP satellite using the individually provided field values. This function is similar to TleAddSatFrFieldsSP but designed to be used in Matlab. Matlab doesn’t correctly return the 19-digit satellite key using TleAddSatFrFieldsSP. This method is an alternative way to return the satKey output. Only applies to SP propagator. Review https://www.sat.dundee.ac.uk/fle.html for more information on SP 4 line element sets.

Parameters
  • satNum (int) – Satellite number

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bTerm (float) – Ballistic coefficient (m^2/kg)

  • ogParm (float) – Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) – Agom (radiation pressure coefficient) (m^2/kg)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day)

  • revNum (int) – Revolution number at epoch

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrLines(line1, line2)[source]

Adds a TLE (satellite), using its directly specified first and second lines. Note: Adding two sets of TLEs which are exactly the same will cause the second initialization to fail. Make them distinct by modifying the satellite ID.

Parameters
  • line1 (str) – The first line of a two line element set. (string[512])

  • line2 (str) – The second line of a two line element set (string[512])

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleAddSatFrLinesML(line1, line2)[source]

Adds a TLE (satellite), using its directly specified first and second lines.This function is similar to TleAddSatFrLines but designed to be used in Matlab. Matlab doesn’t correctly return the 19-digit satellite key using TleAddSatFrLines. This method is an alternative way to return the satKey output. Note: Adding two sets of TLEs which are exactly the same will cause the second initialization to fail. Make them distinct by modifying the satellite ID.

Parameters
  • line1 (str) – The first line of a two line element set. (string[512])

  • line2 (str) – The second line of a two line element set (string[512])

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleDataToArray(satKey)[source]

Retrieves TLE data and stored it in the passing parameters

Parameters

satKey (settings.stay_int64) – The satellite’s unique key

Returns

  • retcode (int) - 0 if all values are retrieved successfully, non-0 if there is an error

  • xa_tle (float[64]) - Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) - Output string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (byte[512])

dshsaa.raw.tledll.TleFieldsToSatKey(satNum, epochYr, epochDays, ephType)[source]

Computes a satKey from the input data. There is no need for a matching satellite to be loaded prior to using this function. The function simply computes the satKey from the provided fields. This is the proper way to reconstruct a satKey from its fields. If you use your own routine to do this, the computed satKey might be different. A negative value will be returned if there is an error.

Parameters
  • satNum (int) – Satellite number

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • ephType (int) – Ephemeris type

Returns

satKey (settings.stay_int64) - The satKey of the newly added TLE on success, a negative value on error.

dshsaa.raw.tledll.TleFieldsToSatKeyML(satNum, epochYr, epochDays, ephType)[source]

This function is similar to TleFieldsToSatKey but designed to be used in Matlab. Computes a satKey from the input data. There is no need for a matching satellite to be loaded prior to using this function. The function simply computes the satKey from the provided fields. This is the proper way to reconstruct a satKey from its fields. If you use your own routine to do this, the computed satKey might be different. A negative value will be returned if there is an error.

Parameters
  • satNum (int) – Satellite number

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • ephType (int) – Ephemeris type

Returns

satKey (settings.stay_int64) - The resulting satellite key if the computation is successful; a negative value if there is an error.

dshsaa.raw.tledll.TleGPArrayToLines(xa_tle, xs_tle)[source]

Constructs a TLE from GP data stored in the input parameters.

Parameters
  • xa_tle (float[64]) – Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) – Input string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (string[512])

Returns

  • line1 (str) - Returned first line of a TLE. (byte[512])

  • line2 (str) - Returned second line of a TLE (if available, line3 can be extracted from line2’s 101-180th columns). (byte[512])

dshsaa.raw.tledll.TleGPFieldsToLines(satNum, secClass, satName, epochYr, epochDays, nDotO2, n2DotO6, bstar, ephType, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Constructs a TLE from individually provided GP data fields. This function only parses data from the input fields but DOES NOT load/add the TLE to memory. Returned line1 and line2 will be empty if the function fails to construct the lines as requested.

Parameters
  • satNum (int) – Satellite number

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • nDotO2 (float) – N Dot/2 (rev/day /2)

  • n2DotO6 (float) – N Double Dot/6 (rev/day**2 /6)

  • bstar (float) – B* drag term (1/er)

  • ephType (int) – Satellite ephemeris type (0: SGP, 2: SGP4)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – Revolution number at epoch

Returns

  • line1 (str) - Returned first line of a TLE. (byte[512])

  • line2 (str) - Returned second line of a TLE. (byte[512])

dshsaa.raw.tledll.TleGetAllFieldsGP(satKey)[source]

Retrieves all of the data for a GP satellite in a single function call. This function only works for GP satellites. The field values are placed in the corresponding parameters of the function.

Parameters

satKey (settings.stay_int64) – The satellite’s unique key

Returns

  • retcode (int) - 0 if all values are retrieved successfully, non-0 if there is an error.

  • satNum (int) - Satellite number

  • secClass (str) - Security classification

  • satName (str) - Satellite international designator (byte[8])

  • epochYr (int) - Element epoch time - year, [YY]YY

  • epochDays (float) - Element epoch time - day of year, DDD.DDDDDDDD

  • bstar (float) - B* drag term (1/er)

  • ephType (int) - Satellite ephemeris type (0: SGP, 2: SGP4, 6: SP)

  • elsetNum (int) - Element set number

  • incli (float) - Orbit inclination (degrees)

  • node (float) - Right ascension of ascending node (degrees)

  • eccen (float) - Eccentricity

  • omega (float) - Argument of perigee (degrees)

  • mnAnomaly (float) - Mean anomaly (deg)

  • mnMotion (float) - Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) - Revolution number at epoch

dshsaa.raw.tledll.TleGetAllFieldsGP2(satKey)[source]

Retrieves all of the data (including nDotO2 and n2DotO6) for a GP satellite in a single function call. This function only works for GP satellites. The field values are placed in the corresponding parameters of the function. This function is similar to TleGetAllFieldsGP but also includes nDotO2 and n2DotO6.

Parameters

satKey (settings.stay_int64) – The satellite’s unique key

Returns

  • retcode (int) - 0 if all values are retrieved successfully, non-0 if there is an error.

  • satNum (int) - Satellite number

  • secClass (str) - Security classification

  • satName (str) - Satellite international designator (byte[8])

  • epochYr (int) - Element epoch time - year, [YY]YY

  • epochDays (float) - Element epoch time - day of year, DDD.DDDDDDDD

  • bstar (float) - B* drag term (1/er)

  • ephType (int) - Satellite ephemeris type (0: SGP, 2: SGP4, 6: SP)

  • elsetNum (int) - Element set number

  • incli (float) - Orbit inclination (degrees)

  • node (float) - Right ascension of ascending node (degrees)

  • eccen (float) - Eccentricity

  • omega (float) - Argument of perigee (degrees)

  • mnAnomaly (float) - Mean anomaly (deg)

  • mnMotion (float) - Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) - Revolution number at epoch

  • nDotO2 (float) - Mean motion derivative (rev/day /2)

  • n2DotO6 (float) - Mean motion second derivative (rev/day**2 /6)

dshsaa.raw.tledll.TleGetAllFieldsSP(satKey)[source]

Retrieves all of the data for an SP satellite in a single function call. Only applies to SP propagator.

This function only works for SP satellites. The field values are placed in the corresponding parameters of the function.

Parameters

satKey (settings.stay_int64) – The satellite’s unique key

Returns

  • retcode (int) - 0 if all values are retrieved successfully, non-0 if there is an error.

  • satNum (int) - Satellite number

  • secClass (str) - Security classification

  • satname (str) - Satellite international designator (byte[8])

  • epochYr (int) - Element epoch time - year, [YY]YY

  • epochDays (float) - Element epoch time - day of year, DDD.DDDDDDDD

  • bTerm (float) - Ballistic coefficient (m^2/kg)

  • ogParm (float) - Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) - Agom (m^2/kg)

  • elsetNum (int) - Element set number

  • incli (float) - Orbit inclination (degrees)

  • node (float) - Right ascension of ascending node (degrees)

  • eccen (float) - Eccentricity

  • omega (float) - Argument of perigee (degrees)

  • mnAnomaly (float) - Mean anomaly (degrees)

  • mnMotion (float) - Mean motion (rev/day)

  • revNum (int) - Revolution number at epoch

dshsaa.raw.tledll.TleGetCount()[source]

Returns the number of TLEs currently loaded. Note: In other languages, like C, functions such as TleGetLoaded() require that you use TleGetCount() to properly size the input array to the function. In this python module, that sizing is handled automatically by calling this function in a manner that should be transparent to the user. See the source code for tledll.TleGetLoaded() to see how calls to tledll.TleGetCount() are handled automatically.

Returns

tle_count (int) - The number of TLEs currently loaded.

dshsaa.raw.tledll.TleGetField(satKey, xf_Tle)[source]

Retrieves the value of a specific field of a TLE. The table below indicates which index values correspond to which fields. Make sure to use the appropriate field index for GP TLEs and SP TLEs. For indexes 5, 15 and 16, the interpretation depends on the ephemeris type of the TLE.

index

index Interpretation

1

Satellite number

2

Security classification

3

Satellite international designator

4

Epoch

5

Ephemeris type = 0,2: B* drag term (1/er), Ephemeris type = 6 : SP radiation pressure coefficient Agom (m2/kg)

6

Ephemeris type

7

Element set number

8

Orbit inclination (degrees)

9

Right ascension of ascending node (degrees)

10

Eccentricity

11

Argument of perigee (degrees)

12

Mean anomaly (degrees)

13

Mean motion (rev/day)

14

Revolution number at epoch

15

Ephemeris type = 0: SGP mean motion derivative (rev/day /2) or Ephemeris type = 6: SP ballistic coefficient (m2/kg)

16

Ephemeris type = 0: SGP mean motion second derivative (rev/day**2 /6) or Ephemeris type = 6: SP Outgassing parameter/Thrust Acceleration (km/s2)

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key.

  • xf_Tle (int) – Predefined number specifying which field to retrieve. See remarks.

Returns

  • retcode (int) - 0 if the TLE data is successfully retrieved, non-0 if there is an error.

  • valueStr (str) - A string to contain the value of the requested field. (byte[512])

dshsaa.raw.tledll.TleGetInfo()[source]

Returns the information about the Tle DLL. The returned string provides information about the version number, build date, and the platform of the Tle DLL.

Returns

infoStr (str) - A string to hold the information about the Tle DLL. (byte[128])

dshsaa.raw.tledll.TleGetLines(satKey)[source]

Returns the first and second lines representation of a TLE of a satellite.

Parameters

satKey (settings.stay_int64) –

Returns

retcode (int) - 0 if successful, non-0 on error. line1 (str) - A string to hold the first line of the TLE. (byte[512]) line2 (str) - A string to hold the second line of the TLE (if available, line3 can be extracted from line2’s 101-180th columns). (byte[512])

dshsaa.raw.tledll.TleGetLoaded(order=9)[source]

Retrieves all of the currently loaded satKeys. These satKeys can be used to access the internal data for the TLE’s. Various orders (sequences) can be retrieved by setting the “order” parameter appropriately. By default, order will be set to 9 for quickest retrieval.

order

meaning

0

sort in ascending order of satKeys

1

sort in descending order of satKeys

2

sort in the order in which the satKeys were loaded in memory

9

Quickest: sort in the order in which the satKeys were stored in the tree

Parameters

order (int) – Specifies the order in which the satKeys should be returned.

Returns

satKeys (settings.stay_int64[?]) - An array of satKey objects.

dshsaa.raw.tledll.TleGetSatKey(satNum)[source]

Returns the first satKey from the currently loaded set of TLEs that contains the specified satellite number. This function is useful when Tle.dll is used in applications that require only one record (one TLE entry) for one satellite, and which refer to that TLE by its satellite number. This function can be used to retrieve a satKey in that situation, which is useful since the Standardized Astrodynamic Algorithms library works only with satKeys. A negative value will be returned if there is an error.

Parameters

satNum (int) – Satellite number.

Returns

satKey (settings.stay_int64) - The satellite’s unique key.

dshsaa.raw.tledll.TleGetSatKeyML(satNum)[source]

Returns the first satKey from the currently loaded set of TLEs that contains the specified satellite number. This function is useful when Tle.dll is used in applications that require only one record (one TLE entry) for one satellite, and which refer to that TLE by its satellite number. This function can be used to retrieve a satKey in that situation, which is useful since the Standardized Astrodynamic Algorithms library works only with satKeys. A negative value will be returned if there is an error. This function is similar to TleGetSatKey but designed to be used in Matlab. Matlab doesn’t correctly return the 19-digit satellite key using TleGetSatKey. This method is an alternative way to return the satKey output.

Parameters

satNum (int) – Satellite number

Returns

satKey (settings.stay_int64) - The satellite’s unique key.

dshsaa.raw.tledll.TleInit(apPtr)[source]

Initializes Tle DLL for use in the program.

Parameters

apPtr (settings.stay_int64) – The handle that was returned from DllMainInit. See the documentation for DllMain.dll for details.

Returns

retcode (int) - 0 if Tle.dll is initialized successfully, non-0 if there is an error.

dshsaa.raw.tledll.TleLinesToArray(line1, line2)[source]

Parses GP data from the input first and second lines of a two line element set and store that data back into the output parameters. This function only parses data from the input TLE but DOES NOT load/add the input TLE to memory.

Parameters
  • line1 (str) – The first line of the two line element set. (string[512])

  • line2 (str) – The second line of the two line element set (if needed, line3 can be inserted into line2’s 101-180th column). (string[512])

Returns

  • xa_tle (float[64]) - Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) - Output string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (byte[512])

  • retcode (int) - 0 if the TLE is parsed successfully, non-0 if there is an error.

dshsaa.raw.tledll.TleLoadFile(tleFile)[source]

Loads TLEs (satellites) contained in a text file into the TLE DLL’s binary tree. You may use this function repeatedly to load TLEs from different input files. However, only unique satKeys are loaded. Duplicated TLEs won’t be stored. TLEs can be included directly in the specified file, or they can be read from a separate file identified with “ELTFIL=[path/filename]” or “VECFIL=[path/filename]”. The input file is read in two passes. The function first looks for “ELTFIL=” and “VECFIL=” lines, then it looks for TLEs which were included directly. The result of this is that data entered using both methods will be processed, but the “ELTFIL=” and “VECFIL=” data will be processed first.

Parameters

tleFile (str) – The name of the file containing two line element sets to be loaded. (string[512])

Returns

retcode (int) - 0 if the two line element sets in the file are successfully loaded, non-0 if there is an error.

dshsaa.raw.tledll.TleParseGP(line1, line2)[source]

Parses GP data from the input first and second lines of a two line element set. This function only parses data from the input TLE but DOES NOT load/add the input TLE to memory.

Parameters
  • line1 (str) – The first line of the two line element set. (string[512])

  • line2 (str) – The second line of the two line element set. (string[512])

Returns

  • retcode (int) - 0 if the TLE is parsed successfully, non-0 if there is an error.

  • satNum (int) - Satellite number

  • secClass (str) - Security classification

  • satName (str) - Satellite international designator (byte[8])

  • epochYr (int) - Element epoch time - year, [YY]YY

  • epochDays (float) - Element epoch time - day of year, DDD.DDDDDDDD

  • nDotO2 (float) - n-dot/2 (for SGP, ephType = 0)

  • n2DotO6 (float) - n-double-dot/6 (for SGP, ephType = 0)

  • bstar (float) - B* drag term (1/er)

  • ephType (int) - Satellite ephemeris type (0: SGP, 2: SGP4, 6: SP)

  • elsetNum (int) - Element set number

  • incli (float) - Orbit inclination (degrees)

  • node (float) - Right ascension of ascending node (degrees).

  • eccen (float) - Eccentricity

  • omega (float) - Argument of perigee (degrees)

  • mnAnomaly (float) - Mean anomaly (degrees)

  • mnMotion (float) - Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) - Revolution number at epoch

dshsaa.raw.tledll.TleParseSP(line1, line2)[source]

Parses SP data from the input first and second lines of a two line element set. Only applies to SP propagator. This function only parses data from the input TLE but DOES NOT load/add the input TLE to memory.

Parameters
  • line1 (str) – The first line of the two line element set. (string[512])

  • line2 (str) – The second line of the two line element set. (string[512])

Returns

  • retcode (int) - 0 if the TLE is parsed successfully, non-0 if there is an error.

  • satNum (int) - Satellite number

  • secClass (str) - Security classification

  • satName (str) - Satellite international designator (byte[8])

  • epochYr (int) - Element epoch time - year, [YY]YY

  • epochDays (float) - Element epoch time - day of year, DDD.DDDDDDDD

  • bTerm (float) - Ballistic coefficient (m^2/kg).

  • ogParm (float) - Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) - Agom (m^2/kg)

  • elsetNum (int) - Element set number

  • incli (float) - Orbit inclination (degrees)

  • node (float) - Right ascension of ascending node (degrees)

  • eccen (float) - Eccentricity

  • omega (float) - Argument of perigee (degrees)

  • mnAnomaly (float) - Mean anomaly (degrees)

  • mnMotion (float) - Mean motion (rev/day)

  • revNum (int) - Revolution number at epoch

dshsaa.raw.tledll.TleRemoveAllSats()[source]

Removes all the TLEs from memory.

Returns

retcode (int) - 0 if all TLE’s are removed successfully from memory, non-0 if there is an error.

dshsaa.raw.tledll.TleRemoveSat(satKey)[source]

Removes a TLE represented by the satKey from memory. If the users enter an invalid satKey (a non-existing satKey), the function will return a non-zero value indicating an error.

Parameters

satKey (settings.stay_int64) – The unique key of the satellite to be removed.

Returns

retcode (int) - 0 if the TLE is removed successfully, non-0 if there is an error.

dshsaa.raw.tledll.TleSPFieldsToLines(satNum, secClass, satName, epochYr, epochDays, bTerm, ogParm, agom, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Constructs a TLE from individually provided SP data fields. Only applies to SP propagator. This function only parses data from the input fields but DOES NOT load/add the TLE to memory. Returned line1 and line2 will be empty if the function fails to construct the lines as requested.

Parameters
  • satNum (int) – Satellite number

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • epochYr (int) – Element epoch time - year, [YY]YY

  • epochDays (float) – Element epoch time - day of year, DDD.DDDDDDDD

  • bTerm (float) – Ballistic coefficient (m^2/kg)

  • ogParm (float) – Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) – Agom (m^2/kg)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day)

  • revNum (int) – Revolution number at epoch

Returns

  • line1 (str) - Returned first line of a TLE. (byte[512])

  • line2 (str) - Returned second line of a TLE. (byte[512])

dshsaa.raw.tledll.TleSaveFile(tleFile, saveMode, xf_tleForm=0)[source]

Saves currently loaded TLEs to a file. In append mode, if the specified file does not exist it will be created.

Parameters
  • tleFile (str) – The name of the file in which to save the TLE’s. (string[512])

  • saveMode (int) – Specifies whether to create a new file or append to an existing file. (0 = create new file, 1= append to existing file)

  • xf_tleForm = 0 (int) – Specifies the format in which to save the file. (0 = two-line element set format, others = future implementation)

Returns

retcode (int) - 0 if the data is successfully saved to the file, non-0 if there is an error.

dshsaa.raw.tledll.TleSetField(satKey, xf_Tle, valueStr)[source]

Updates the value of a field of a TLE. This function can be used for both GP and SP satellites. The table below indicates which index values correspond to which fields. Make sure to use the appropriate field index for GP TLEs and SP TLEs. For indexes 5, 15 and 16, the interpretation depends on the ephemeris type of the TLE. Satnum (1), Epoch (4), and Ephemeris Type (5) cannot be altered.

index

index Interpretation

1

Satellite number

2

Security classification

3

Satellite international designator

4

Epoch

5

Ephemeris type = 0,2: B* drag term (1/er) Ephemeris type = 6 : SP radiation pressure coefficient Agom (m2/kg)

6

Ephemeris type

7

Element set number

8

Orbit inclination (degrees)

9

Right ascension of ascending node (degrees)

10

Eccentricity

11

Argument of perigee (degrees)

12

Mean anomaly (degrees)

13

Mean motion (rev/day)

14

Revolution number at epoch

15

Ephemeris type = 0: SGP mean motion derivative (rev/day /2) or Ephemeris type = 6: SP ballistic coefficient (m2/kg)

16

Ephemeris type = 0: SGP mean motion second derivative (rev/day**2 /6) or Ephemeris type = 6: SP Outgassing parameter/Thrust Acceleration (km/s2)

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key.

  • xf_Tle (int) – Predefined number specifying which field to set.

  • valueStr (str) – The new value of the specified field, expressed as a string. (string[512])

Returns

retcode (int) - 0 if the TLE is successfully updated, non-0 if there is an error

dshsaa.raw.tledll.TleUpdateSatFrArray(satKey, xa_tle, xs_tle)[source]

Updates existing TLE data with the provided new data stored in the input parameters.

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key

  • xa_tle (float[64]) – Array containing TLE’s numerical fields, see XA_TLE_? for array arrangement (double[64])

  • xs_tle (str) – Input string that contains all TLE’s text fields, see XS_TLE_? for column arrangement (string[512])

Returns

retcode (int) - : 0 if the TLE is successfully updated, non-0 if there is an error.

dshsaa.raw.tledll.TleUpdateSatFrFieldsGP(satKey, secClass, satName, bstar, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Updates a GP satellite’s data in memory by providing its individual field values.

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • bstar (float) – B* drag term (1/er)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – Revolution number at epoch

Returns

retcode (int) - 0 if the TLE is successfully updated, non-0 if there is an error.

dshsaa.raw.tledll.TleUpdateSatFrFieldsGP2(satKey, secClass, satName, bstar, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum, nDot02, n2Dot06)[source]

This function is similar to TleUpdateSatFrFieldsGP but includes nDotO2 and n2DotO6.

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • bstar (float) – B* drag term (1/er)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day) (ephType = 0: Kozai mean motion, ephType = 2: Brouwer mean motion)

  • revNum (int) – Revolution number at epoch

  • nDot02 (float) – Mean motion derivative (rev/day /2)

  • n2Dot06 (float) – Mean motion second derivative (rev/day**2 /6)

Returns

retcode (int) - 0 if the TLE is successfully updated, non-0 if there is an error.

dshsaa.raw.tledll.TleUpdateSatFrFieldsSP(satKey, secClass, satName, bterm, ogParm, agom, elsetNum, incli, node, eccen, omega, mnAnomaly, mnMotion, revNum)[source]

Updates an SP satellite’s data in memory using its individually provided field values.

Parameters
  • satKey (settings.stay_int64) – The satellite’s unique key

  • secClass (str) – Security classification

  • satName (str) – Satellite international designator (string[8])

  • bterm (float) – Ballistic coefficient (m^2/kg). Note: this is inconsistent with “bTerm” in TleAddSatFrFieldsSP. This inconsistency originates from the original documentation for the SAA DLLs. A decision was made to preserve this inconsistency to be consistent with the source material.

  • ogParm (float) – Outgassing parameter/Thrust Acceleration (km/s^2)

  • agom (float) – Agom (m^2/kg)

  • elsetNum (int) – Element set number

  • incli (float) – Orbit inclination (degrees)

  • node (float) – Right ascension of ascending node (degrees)

  • eccen (float) – Eccentricity

  • omega (float) – Argument of perigee (degrees)

  • mnAnomaly (float) – Mean anomaly (degrees)

  • mnMotion (float) – Mean motion (rev/day)

  • revNum (int) – Revolution number at epoch

Returns

retcode (int) - 0 if the TLE is successfully updated, non-0 if there is an error.

Module contents