API¶
The gdgps_apps package contains a number of classes designed to take the complexity out of interfacing with APPS. Rich Python applications consisting of anything from GUIs, to automated operational center infrastructure, to the simple command line interface delivered with the library can be developed with APPS as the backend engine using the Python API documented here.
Once you have the library installed and your credential downloaded to your local system, interfacing with APPS is easy using the library! For instance, to upload all files in a directory and then download the results as they become available, while warning about any errors one might write:
#!/usr/bin/env python3
from gdgps_apps.apps import APPS
from gdgps_apps import defines
import os
import time
if __name__ == '__main__':
apps = APPS(log_level=None)
files = {f: None for f in os.listdir(os.getcwd()) if
os.path.isfile(os.path.join(os.getcwd(), f))}
for f in list(files.keys()):
print('Uploading %s...' % f)
files[f] = apps.upload_gipsyx(f)['id']
pause = 30
while len(files) > 0:
apps.list_data()
for f in list(files.keys()):
info = apps.detail(files[f])
if info['state'] == defines.Data.AVAILABLE:
path = apps.download_result(info['id'])
print('Retrieved results for file %s, downloaded to %s. Lat, Lng = (%f, %f)' % (
f,
path,
info['position']['coordinates'][1],
info['position']['coordinates'][0]
)
)
# be kind to |APPS| delete unnecessary data
apps.delete_data(info['id'])
del files[f]
elif info['state'] == defines.Data.ERROR:
for flag in info['flags']:
if flag['level'] == defines.DataFlag.ERROR:
print('APPS encountered an error processing file %s: (%s) %s' % (
f,
flag['header'],
flag['detail']
)
)
apps.delete_data(info['id'])
del files[f]
elif info['state'] == defines.Data.VERIFIED:
# let |APPS| know it can go ahead and process this file with the given settings
# up until we do this we can edit processing settings by calling `gdgps_apps.apps.APPS.update`_
apps.approve(info['id'])
print('Waiting on %d submissions, checking again in %d seconds...' % (len(files), pause))
time.sleep(pause) # pause for 30 seconds so we don't overwhelm |APPS|
Class Reference¶
- APPS
APPS
APPS.MUTABLE_CREDENTIALS
APPS.alerts()
APPS.approve()
APPS.base_url()
APPS.cached_data()
APPS.data_in_states()
APPS.default_settings_path
APPS.delete_alert()
APPS.delete_data()
APPS.delete_flag()
APPS.delete_source()
APPS.detail()
APPS.download_directory
APPS.download_result()
APPS.download_run()
APPS.download_source()
APPS.exists()
APPS.flags()
APPS.format_size()
APPS.get_data_parameter()
APPS.get_processor()
APPS.get_processor_of_data()
APPS.get_source()
APPS.id_for_name()
APPS.is_alert_level()
APPS.is_flag_level()
APPS.is_id()
APPS.is_staff
APPS.is_staff_
APPS.is_state()
APPS.is_superuser
APPS.is_superuser_
APPS.list_data()
APPS.list_processors()
APPS.ping()
APPS.profile()
APPS.profile_cache
APPS.read_settings()
APPS.set_log_level()
APPS.sources()
APPS.stream_chunk_size
APPS.update_credential()
APPS.update_data()
APPS.update_profile()
APPS.upload_gipsyx()
APPS.upload_source()
- Client
- Defines
Data
Data.ACCESS_CHOICES
Data.ACCESS_DEFAULT
Data.APPROVED
Data.AVAILABLE
Data.DONE
Data.EMAIL_NOTIFY_CHOICES
Data.EMAIL_NOTIFY_DEFAULT
Data.ERROR
Data.NASCENT
Data.PRIVATE
Data.PROCESSING
Data.PUBLIC
Data.QUEUED
Data.RETRIEVED
Data.SOURCE_CHANGE_STATES
Data.SOURCE_DELETE_STATES
Data.STATES
Data.SUBMITTED
Data.VERIFIED
Data.WAITING
Data.get_verbose_access()
Data.get_verbose_state()
Data.normalize_access()
Data.normalize_state()
Data.rank_state()
DataFlag
GIPSYData
GIPSYData.ANCILLARY_SOURCE_FIELDS
GIPSYData.ANTENNA_CALIBRATION_FILE
GIPSYData.ARCHIVE_FILE
GIPSYData.ATTITUDE_FILE
GIPSYData.BEST
GIPSYData.DETAIL_FILE
GIPSYData.DUAL_FREQUENCY
GIPSYData.ELEV_ANGLE_CUTOFF_MAX
GIPSYData.ELEV_ANGLE_CUTOFF_MIN
GIPSYData.ELEV_DEP_WEIGHTINGS
GIPSYData.FLAT
GIPSYData.GDCOV_FILE
GIPSYData.GIPSY_FIELDS
GIPSYData.KINEMATIC
GIPSYData.KINEMATIC_FAST
GIPSYData.KINEMATIC_SLOW
GIPSYData.KML_FILE
GIPSYData.MEASUREMENT_TYPES
GIPSYData.PRESSURE_FILE
GIPSYData.PROCESSING_MODES
GIPSYData.PROCESSING_MODE_DEFAULT
GIPSYData.PRODUCTS
GIPSYData.PRODUCT_DEFAULT
GIPSYData.RESULT_TYPES
GIPSYData.RESULT_TYPES_DEFAULT
GIPSYData.RINEX_FILE
GIPSYData.ROOT_SINE
GIPSYData.SINE
GIPSYData.SINGLE_FREQUENCY
GIPSYData.SOLUTION_FILE
GIPSYData.SOLUTION_PERIOD_MIN
GIPSYData.SOURCE_TYPES
GIPSYData.SOURCE_TYPE_DEFAULT
GIPSYData.STATIC
GIPSYData.SUBMISSION_FIELDS
GIPSYData.SUMMARY_FILE
GIPSYData.TDP_FILE
GIPSYData.TROPOSPHERE_MODELS
GIPSYData.TROP_GMF
GIPSYData.TROP_GPT2
GIPSYData.TROP_OFF
GIPSYData.TROP_PROVIDED
GIPSYData.TROP_VMF1
GIPSYData.UNRESOLVED
GIPSYData.get_verbose_elev_dep_weighting()
GIPSYData.get_verbose_measurement_type()
GIPSYData.get_verbose_processing_mode()
GIPSYData.get_verbose_result_type()
GIPSYData.get_verbose_source_type()
GIPSYData.get_verbose_troposphere_model()
GIPSYData.normalize_elev_dep_weighting()
GIPSYData.normalize_measurement_type()
GIPSYData.normalize_processing_mode()
GIPSYData.normalize_result_type()
GIPSYData.normalize_source_type()
GIPSYData.normalize_troposphere_model()
GIPSYXData
OrbitClockProduct
RINEXDefines
RINEXDefines.AIRBORNE
RINEXDefines.ANIMAL
RINEXDefines.BALLISTIC
RINEXDefines.BEIDOU
RINEXDefines.BEIDOU_TIME
RINEXDefines.FIXED_BUOY
RINEXDefines.FLOATING_BUOY
RINEXDefines.FLOATING_ICE
RINEXDefines.GALILEO
RINEXDefines.GALILEO_TIME
RINEXDefines.GEODETIC
RINEXDefines.GLACIER
RINEXDefines.GLONASS
RINEXDefines.GLONASS_TIME
RINEXDefines.GNSS_TYPES
RINEXDefines.GPS
RINEXDefines.GPS_TIME
RINEXDefines.GROUND_CRAFT
RINEXDefines.HUMAN
RINEXDefines.IRNSS
RINEXDefines.IRNSS_TIME
RINEXDefines.MARKER_TYPES
RINEXDefines.MIXED
RINEXDefines.NON_GEODETIC
RINEXDefines.NON_PHYSICAL
RINEXDefines.QZSS
RINEXDefines.QZSS_TIME
RINEXDefines.SBAS
RINEXDefines.SPACEBORNE
RINEXDefines.TIME_STANDARDS
RINEXDefines.WATER_CRAFT
RINEXDefines.get_verbose_gnss_types()
RINEXDefines.get_verbose_marker_type()
RINEXDefines.get_verbose_time_standard()
RINEXDefines.normalize_gnss_types()
RINEXDefines.normalize_marker_type()
RINEXDefines.normalize_time_standard()
Storage
UserAlert
UserProfile
UserProfile.ARCHIVE_PREFERENCES
UserProfile.ARCHIVE_PREFERENCE_DEFAULT
UserProfile.BZIP2
UserProfile.COMPRESSION_PREFERENCES
UserProfile.COMPRESSION_PREFERENCE_DEFAULT
UserProfile.EMAIL_NOTIFY_DEFAULT
UserProfile.GZIP
UserProfile.KEEP_SOURCE_FILES_DEFAULT
UserProfile.NO_PROMPT_PROFESSING_DEFAULT
UserProfile.TAR
UserProfile.TIMEZONE_DEFAULT
UserProfile.UNIX
UserProfile.ZIP
fetch_choice()
get_verbose()
lower()
normalize()
rank_choices()
- Exceptions
- Logging and Output