This notebook demonstrates using the sscws IDL library to access data from sscweb in the IDL programming language. This notebook is for the IDL version of cdasws. A notebook for the Python version is available at python sscws notebook. This notebook contains the following sections:
If you have an old version of the SPDF_SSC package already installed, remove the old version.
ipm, /remove, 'SPDF_SSC'
Package "SPDF_SSC" was removed
If the lastest version of the SPDF_SSC package is not already installed, install it as shown below.
ipm, /install, 'https://sscweb.gsfc.nasa.gov/WebServices/REST/SPDF_SSC.zip'
Package: SPDF_SSC, Version: 2.3.13 installed
You only need to install a particular version of the package once. You will need to restore the package everytime you restart your IDL session. Restore the package as shown below.
restore, !package_path + '/SPDF_SSC/spdfssc.sav'
Download and restore spdfssc.sav. You will need to restore the package everytime you restart your IDL session.
savFilename = filepath('spdfssc.sav', /tmp)
oUrl = obj_new('IDLnetUrl')
; For IDL installations with old root certificates
oUrl->setProperty, SSL_VERIFY_PEER=0
savFilename = oUrl->get(filename=savFilename, url='https://sscweb.gsfc.nasa.gov/WebServices/REST/spdfssc.sav')
restore, savFilename
Create an SpdfSsc object that will be used in the code that follows.
ssc = obj_new('SpdfSsc')
The following code demonstrates how to get the list of available observatories.
foreach obs, (ssc->getObservatories())[0:4] do begin
caldat, obs->getStartTime(), m, d, y, h, m, s
print, obs->getId(), obs->getName(), y, m, d, h, m, s, $
format='%15s %25s %4d-%02d-%02dT%02d:%02d:%02dZ'
endforeach
print, '...'
end
ace ACE 1997-48-25T17:48:00Z active Active 1989-00-29T00:00:00Z aec AE-C 1973-01-17T08:01:00Z aed AE-D 1975-00-17T00:00:00Z aee AE-E 1975-04-20T21:04:00Z ...
The following code demonstrates how to get the list of available ground stations.
foreach station, (ssc->getGroundStations())[0:4] do begin
location = station->getLocation()
lat = location->getLatitude()
lon = location->getLongitude()
print, station->getId(), station->getName(), lat, lon, $
format='%5s %25s %7.2f %7.2f'
endforeach
print, '...'
end
SPA South Pole -89.99 -13.32 MCM McMurdo -77.85 166.70 SBF Scott Base -77.85 166.75 SPL Siple -76.00 -84.00 HBA Halley Bay -75.52 -26.60 ...
The following code gets location information for the International Space Station (ISS) spacecraft and plots the ISS location information.
l = spdfGetLocations('iss', ['2013-01-01T00:00:00.000Z', '2013-01-01T01:00:00.000Z'])
p = plot3d(l->getX(), l->getY(), l->getZ(), window_title='Orbit')
View the sscsws API for additional functions.