Beispiel #1
0
def EnvGetGeoStr():
    """
	Returns the name of the current Earth constants (GEO) model. 
	
	:return:
		**geo_str** (*str*) - The geoStr parameter may contain one of the following values: 

			+------+
			|WGS-84|
			+------+
			|EGM-96|
			+------+
			|WGS-72|
			+------+
			|JGM2  |
			+------+
			|SEM68R|
			+------+
			|GEM5  |
			+------+
			|GEM9  |
			+------+
	
	"""
    geo_str = c.c_char_p(bytes(6))
    C_ENVDLL.EnvGetGeoStr(geo_str)
    geo_str = settings.byte_to_str(geo_str)
    return geo_str
Beispiel #2
0
def Sgp4GetLicFilePath():
    """
	Returns the current path to the Sgp4 Open License File

	:return:
		**LicFilePath** (*str*) - The path to the current license file.
	"""
    licFilePath = c.c_char_p(bytes(512))
    C_SGP4DLL.Sgp4GetLicFilePath(licFilePath)
    licFilePath = settings.byte_to_str(licFilePath)
    return licFilePath
Beispiel #3
0
def AstroFuncGetInfo():
    """
	Retrieves information about the current version of AstroFunc.dll.

	:return:
		**infoStr** (*str*) - A string describing version number, build date, and platform
	"""
    infoStr = c.c_char_p(bytes(128))
    C_ASTRODLL.AstroFuncGetInfo(infoStr)
    infoStr = settings.byte_to_str(infoStr)
    return infoStr
Beispiel #4
0
def Get6PCardLine():
    """
	Returns current prediction control parameters in the form of a 6P-Card string
	
	:return:
		**card6PLine** (*str*) - String representation of prediction control parameters.
	"""
    card6PLine = c.c_char_p(bytes(512))
    C_TIMEDLL.Get6PCardLine(card6PLine)
    card6PLine = settings.byte_to_str(card6PLine)
    return card6PLine
Beispiel #5
0
def TimeFuncGetInfo():
    """
	Returns the information about the TimeFunc DLL. 
	
	:returns:
		**infoStr** (*str*) - up to 128 characters describing TimeFunc DLL
	"""
    infoStr = c.c_char_p(bytes(128))
    C_TIMEDLL.TimeFuncGetInfo(infoStr)
    infoStr = settings.byte_to_str(infoStr)
    return infoStr
Beispiel #6
0
def DllMainGetInfo():
	"""
	Returns information about DllMain DLL

	:return:
		**info** (*str*) - a regular python string describing DllMain DLL
	"""
	info = c.c_char_p(bytes(512))
	C_MAINDLL.DllMainGetInfo(info)
	info = settings.byte_to_str(info) 
	return info
Beispiel #7
0
def EnvGetInfo():
    """
	Returns information about the EnvConst DLL. The returned string provides information about the version number, build date, and the platform of the EnvConst DLL. 
	
	:return:
		**info** (*str*) - A string containing information abou the EnvConst DLL
	"""
    info = c.c_char_p(bytes(128))
    C_ENVDLL.EnvGetInfo(info)
    info = settings.byte_to_str(info)
    return info
Beispiel #8
0
def Sgp4GetInfo():
    """
	Returns information about the current version of Sgp4Prop.dll.
	
	:retrun:
		**infoStr** (*str*) - A string containing information about Sgp4.
	
	"""
    infoStr = c.c_char_p(bytes(128))
    C_SGP4DLL.Sgp4GetInfo(infoStr)
    infoStr = settings.byte_to_str(infoStr)
    return infoStr
Beispiel #9
0
def Sgp4ReepochTLE(satKey, reepochDs50UTC):
    """
	Reepochs a loaded TLE, represented by the satKey, to a new epoch. 
	
	:param settings.stay_int64 satKey: The unique key of the satellite to reepoch.
	:param float reepochDs50UTC: The new epoch, express in days since 1950, UTC.
	:return:
		- **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])
	"""
    if not isinstance(satKey, settings.stay_int64):
        raise TypeError("satKey is type %s, should be type %s" %
                        (type(satKey), settings.stay_int64))
    reepochDs50UTC = c.c_double(reepochDs50UTC)
    line1Out = c.c_char_p(bytes(512))
    line2Out = c.c_char_p(bytes(512))
    retcode = C_SGP4DLL.Sgp4ReepochTLE(satKey, reepochDs50UTC, line1Out,
                                       line2Out)
    line1Out = settings.byte_to_str(line1Out)
    line2Out = settings.byte_to_str(line2Out)
    return (retcode, line1Out, line2Out)
Beispiel #10
0
def GetInitDllNames():
	"""
	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. 
	
	:return:
		**initdllnames** (*str*) - a string representation of the DLLs that were successfully initialized. (byte[512])
	"""
	initdllnames = c.c_char_p(bytes(512))
	C_MAINDLL.GetInitDllNames(initdllnames)
	initdllnames = settings.byte_to_str(initdllnames)
	return initdllnames
Beispiel #11
0
def UTCToDTG20(ds50UTC):
    """
	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"

	:param int ds50UTC: time since epoch
	:return:
		**dtg20** (*str*) - string representation of time
	"""
    if ds50UTC < 2192.0:
        raise Exception(
            "ds50UTC must be greater than 2192.0, which cooresponds to Jan 1 1956."
        )
    dtg20 = c.c_char_p(bytes(20))
    C_TIMEDLL.UTCToDTG20(ds50UTC, dtg20)
    dtg20 = settings.byte_to_str(dtg20)
    return dtg20
Beispiel #12
0
def GetLastErrMsg():
	"""
	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. 

	:return:
		**lastErrMsg** (*str*) - a string representation of the last error message (byte[128])
	"""
	lastErrMsg = c.c_char_p(bytes(128))
	C_MAINDLL.GetLastErrMsg(lastErrMsg)
	lastErrMsg = settings.byte_to_str(lastErrMsg)
	return lastErrMsg
Beispiel #13
0
def GetLastInfoMsg():
	"""
	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. 

	:return:
		**lastInfoMsg** (*str*) - A string representation of the last logged informational message. (byte[128])
	"""
	lastInfoMsg = c.c_char_p(bytes(128))
	C_MAINDLL.GetLastInfoMsg(lastInfoMsg)
	lastInfoMsg = settings.byte_to_str(lastInfoMsg)
	return lastInfoMsg
Beispiel #14
0
def UTCToDTG19(ds50UTC):
    """
	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**
	
	:param int ds50UTC: time since epoch
	:return:
		**dtg19** (*str*) - string representation of time
	"""
    if ds50UTC < 2192.0:
        raise Exception(
            "ds50UTC must be greater than 2192.0, which cooresponds to Jan 1 1956."
        )
    raise Exception(
        "raw.timedll.UTCToDTG19(ds50UTC) function is disabled until I can figure out why C_TIMEDLL.UTCToDTG19(ds50UTC,dtg19) is causing a core dump"
    )
    dtg19 = c.c_char_p(bytes(19))
    C_TIMEDLL.UTCToDTG19(ds50UTC, dtg19)
    dtg19 = settings.byte_to_str(dtg19)
    return dtg19