Utility Functions¶
utils
¶
Utility functions for SatKit
update_datafiles(**kwargs)
¶
Download & store data files needed for "satkit" computations
Keyword Args:
overwrite (bool): Download and overwrite files if they already exist dir(string): Target directory for files. Uses existing data directory if not specified. (see "datadir" function)
Notes
-
Files include:
EGM96.gfc: EGM-96 Gravity Model CoefficientsJGM3.gfc: JGM-3 Gravity Model CoefficientsJGM2.gfc: JGM-2 Gravity Model CoefficientsITU_GRACE16.gfc: ITU Grace 16 Gravitytab5.2a.txt: Coefficients for GCRS to GCRF conversiontab5.2b.txt: Coefficients for GCRS to GCRF conversiontab5.2d.txt: Coefficients for GCRS to GCRF conversionSW-ALL.csv: Space weather data, updated dailyleap-seconds.txt: Leap seconds (UTC vs TAI)EOP-All.csv: Earth orientation parameters, updated dailylinux_p1550p2650.440: JPL Ephemeris version 440 (~ 100 MB)
-
The space weather and earth orientation parameters files are updated daily and will always be downloaded regardless of the overwrite flag
datadir()
¶
Return directory currently used to hold necessary data files for the directory
Data directory is 1st of following directories search that contains the data files listed in "update_datafiles"
-
MacOS:
- Directory pointed to by
SATKIT_DATAenvironment variable $DYLIB/satkit-datawhere$DYLIBis location of compiled python satkit library$HOME/LIBRARY/Application Support/satkit-data$HOME/.astro-data$HOME/usr/share/astro-data/Library/Application Support/astro-data
- Directory pointed to by
-
Linux:
- Directory pointed to by
SATKIT_DATAenvironment variable $DYLIB/satkit-datawhere$DYLIBis location of compiled python satkit library$HOME/.astro-data$HOME/usr/share/astro-data
- Directory pointed to by
-
Windows:
- Directory pointed to by
SATKIT_DATAenvironment variable $DYLIB/satkit-datawhere$DYLIBis location of compiled python satkit library$HOME/.astro-data$HOME
- Directory pointed to by
set_datadir(datadir)
¶
Set the data directory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datadir
|
str
|
Path to the data directory |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the directory does not exist |
datafiles_exist()
¶
Check if data files are found
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if data files are found, False otherwise |
dylib_path()
¶
Return path to the compiled satkit library
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Path to the compiled library |
githash()
¶
Return git hash of this satkit build
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Git hash of this satkit build |
build_date()
¶
Return build date of this satkit library as a string
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Build date of this satkit library |
version()
¶
Return version of this satkit library as a string
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Version of this satkit library |