Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.




::: content [;{.source}]{.comments} {.source}[; NOSA HEADER START{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; The contents of this file are subject to the terms of the NASA Open{.source}]{.comments} {.source}[; Source Agreement (NOSA), Version 1.3 only (the "Agreement"). You may{.source}]{.comments} {.source}[; not use this file except in compliance with the Agreement.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; You can obtain a copy of the agreement at{.source}]{.comments} {.source}[; docs/NASA_Open_Source_Agreement_1.3.txt{.source}]{.comments} {.source}[; or{.source}]{.comments} {.source}[; https://sscweb.gsfc.nasa.gov/WebServices/NASA_Open_Source_Agreement_1.3.txt.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; See the Agreement for the specific language governing permissions{.source}]{.comments} {.source}[; and limitations under the Agreement.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; When distributing Covered Code, include this NOSA HEADER in each{.source}]{.comments} {.source}[; file and include the Agreement file at{.source}]{.comments} {.source}[; docs/NASA_Open_Source_Agreement_1.3.txt. If applicable, add the{.source}]{.comments} {.source}[; following below this NOSA HEADER, with the fields enclosed by{.source}]{.comments} {.source}[; brackets "[]" replaced with your own identifying information:{.source}]{.comments} {.source}[; Portions Copyright [yyyy] [name of copyright owner}{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; NOSA HEADER END{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; Copyright (c) 2021 United States Government as represented by{.source}]{.comments} {.source}[; the National Aeronautics and Space Administration. No copyright is{.source}]{.comments} {.source}[; claimed in the United States under Title 17, U.S.Code. All Other{.source}]{.comments} {.source}[; Rights Reserved.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[;+{.source}]{.comments} {.source}[; This program is an example to demonstrate calling the{.source}]{.comments} {.source}[; <a href="https://sscweb.gsfc.nasa.gov/">Satellite Situation Center's</a>{.source}]{.comments} {.source}[; <a href="https://sscweb.gsfc.nasa.gov/WebServices/REST/">{.source}]{.comments} {.source}[; REST Web Services</a> from an{.source}]{.comments} {.source}[; <a href="https://www.l3harrisgeospatial.com/Software-Technology/IDL">{.source}]{.comments} {.source}[; L3Harris Interactive Data Language (IDL)</a> program. It demonstrates the{.source}]{.comments} {.source}[; following:{.source}]{.comments} {.source}[; <ul>{.source}]{.comments} {.source}[; <li>Using the IDL/Python bridge to find magnetic field line{.source}]{.comments} {.source}[; conjunctions using the Python {.source}]{.comments} {.source}[; <a href="https://pypi.org/project/sscws/">sscws library</a>.{.source}]{.comments} {.source}[; The python sscws library is used because, at this time, the IDL{.source}]{.comments} {.source}[; <a href="https://sscweb.gsfc.nasa.gov/WebServices/REST/SscIdlLibrary.html">{.source}]{.comments} {.source}[; sscws library</a> lacks support for conjunction query requests.</li>{.source}]{.comments} {.source}[; </ul>{.source}]{.comments} {.source}[; To successfully run this program, you must do the following:{.source}]{.comments} {.source}[; <ul>{.source}]{.comments} {.source}[; <li>Configure your IDL environment to support the IDL to Python bridge{.source}]{.comments} {.source}[; as described in the IDL documentation.</li>{.source}]{.comments} {.source}[; <li>Configure your Python environment to support the sscws library. That{.source}]{.comments} {.source}[; is, <code>$ pip install sscws</code>.</li>{.source}]{.comments} {.source}[; </ul>{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @copyright Copyright (c) 2021 United States Government as{.source}]{.comments} {.source}[; represented by the National Aeronautics and Space Administration.{.source}]{.comments} {.source}[; No copyright is claimed in the United States under Title 17,{.source}]{.comments} {.source}[; U.S.Code. All Other Rights Reserved.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @author B. Harris{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[;+{.source}]{.comments} {.source}[; Creates an example conjunction query request. The object returned is a{.source}]{.comments} {.source}[; Python <a href="https://pypi.org/project/sscws/">sscws</a>.request {.source}]{.comments} {.source}[; QueryRequest object for use in the sscws.sscws.get_conjunctions() method.{.source}]{.comments} {.source}[; The query is for magnetic field line conjunctions of at least 2 THEMIS{.source}]{.comments} {.source}[; satellites with one of 4 THEMIS ground stations duing 2008 doy = 1 - 5.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns an example Python sscws.request QueryRequest.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfGetExampleConjunctionRequest:source}function SpdfGetExampleConjunctionRequest compile_opt idl2 np = Python.Import('numpy') cj = Python.Import('sscws.conjunctions') co = Python.Import('sscws.coordinates') req = Python.Import('sscws.request') ti = Python.Import('sscws.timeinterval') tr = Python.Import('sscws.tracing') sats = Python.Wrap(List($ cj.Satellite('themisa', tr.BFieldTraceDirection.SAME_HEMISPHERE), $ cj.Satellite('themisb', tr.BFieldTraceDirection.SAME_HEMISPHERE), $ cj.Satellite('themisc', tr.BFieldTraceDirection.SAME_HEMISPHERE), $ cj.Satellite('themisd', tr.BFieldTraceDirection.SAME_HEMISPHERE), $ cj.Satellite('themise', tr.BFieldTraceDirection.SAME_HEMISPHERE) $ )) satellite_condition = cj.SatelliteCondition(sats, 2) box_conjunction_area = cj.BoxConjunctionArea(cj.TraceCoordinateSystem.GEO, 3.0, 10.0) ground_stations = Python.Wrap(List($ cj.GroundStationConjunction('FSMI', 'THM_Fort Smith',$ co.SurfaceGeographicCoordinates(59.98, -111.84),$ box_conjunction_area),$ cj.GroundStationConjunction('WHIT', 'THM_White Horse',$ co.SurfaceGeographicCoordinates(61.01, -135.22),$ box_conjunction_area),$ cj.GroundStationConjunction('FSIM', 'THM_Fort Simpson',$ co.SurfaceGeographicCoordinates(61.80, -121.20),$ box_conjunction_area),$ cj.GroundStationConjunction('GAK', 'THM_HAARP/Gakona',$ co.SurfaceGeographicCoordinates(62.40, -145.20),$ box_conjunction_area)$ )) ground_station_condition = $ cj.GroundStationCondition(ground_stations,$ cj.TraceCoordinateSystem.GEO, tr.TraceType.B_FIELD) conditions = Python.Wrap(List(satellite_condition, ground_station_condition)) query_request = $ req.QueryRequest('Magnetic conjunction of at least 2 THEMIS satellites with one of 4',$ ti.TimeInterval('2008-01-05T10:00:00Z', '2008-01-05T11:59:59Z'),$ cj.ConditionOperator.ALL, conditions) return, query_request end {.source}[;+{.source}]{.comments} {.source}[; Prints a Python Dict representation of a QueryResult as defined in{.source}]{.comments} {.source}[; <a href="https://sscweb.gsfc.nasa.gov/WebServices/REST/SSC.xsd">{.source}]{.comments} {.source}[; SSC.xsd</a>.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param result {in} {type=hash}{.source}]{.comments} {.source}[; QueryResult to print.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfPrintConjunctionResult:source}pro SpdfPrintConjunctionResult, result compile_opt idl2 foreach conjunction, result['Conjunction'] do begin print, (conjunction['TimeInterval'])['Start'].isoformat(), ' to ', $ (conjunction['TimeInterval'])['End'].isoformat() print, 'Satellite', 'Lat', 'Lon', 'Radius', 'Ground Station', $ 'Lat', 'Lon', 'ArcLen', $ format='%10s %7s %7s %9s %20s %7s %7s %9s' foreach sat, conjunction['SatelliteDescription'] do begin foreach description, sat['Description'] do begin trace = description['TraceDescription'] print, sat['Satellite'], $ (description['Location'])['Latitude'], $ (description['Location'])['Longitude'], $ (description['Location'])['Radius'], $ (trace['Target'])['GroundStation'], $ (trace['Location'])['Latitude'], $ (trace['Location'])['Longitude'], $ trace['ArcLength'], $ format='%10s %7.2f %7.2f %9.2f %20s %7.2f %7.2f %9.2f' endforeach endforeach endforeach end {.source}[;+{.source}]{.comments} {.source}[; This procedure is an example to demonstrate calling the SSC REST Web {.source}]{.comments} {.source}[; Services from an IDL program. It demonstrates the following:{.source}]{.comments} {.source}[; <ul>{.source}]{.comments} {.source}[; <li>Using the IDL/Python bridge to find magnetic field line{.source}]{.comments} {.source}[; conjunctions using the Python {.source}]{.comments} {.source}[; <a href="https://pypi.org/project/sscws/">sscws library</a>.{.source}]{.comments} {.source}[; The python sscws library is used because, at this time, the IDL{.source}]{.comments} {.source}[; <a href="https://sscweb.gsfc.nasa.gov/WebServices/REST/SscIdlLibrary.html">{.source}]{.comments} {.source}[; sscws library</a> lacks support for conjunction query requests.</li>{.source}]{.comments} {.source}[; </ul>{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfSscWsConjunctionExample:source}pro SpdfSscWsConjunctionExample compile_opt idl2 sscws = Python.Import('sscws.sscws') ssc = sscws.SscWs() {.source}[;observatories = ssc.get_observatories(){.source}]{.comments} {.source}[;foreach observatory,observatories['Observatory'] do print, observatory['Name']{.source}]{.comments}result = ssc.get_conjunctions(SpdfGetExampleConjunctionRequest()) SpdfPrintConjunctionResult, result end{.source} :::