Skip to content

das2c_readhttp

C. Piker edited this page Dec 18, 2023 · 4 revisions

FUNCTION

das2c_readhttp

PURPOSE

This function sends an HTTP GET query string to a das2 server, parses the resulting data stream and stores the values and metadata.

CALLING SEQUENCE

Result = das2c_readhttp(Url, Agent)

INPUTS

Parameter Type Purpose
Url string A string containing a full HTTP GET URL. This looks like like it would in your web browser's address bar. In fact you can test the URL just by pasting it into a browser window.

OPTIONAL INPUTS

Parameter Type Purpose
Agent string Set your preferred user-agent string. User-agent string are typically saved in web-logs. If parameter is not specified, then 'das2dlm/VERSION' is sent as the user agent.

OUTPUT

This function returns a structure of type DAS2C_RESULT if it succeeds, or !NULL on failure. The result structure is small. It does not contain the actual data but may be used to get data and metadata on the result. See das2c_results for a description of the DAC2_RESULT structure fields.

SIDE EFFECTS

Output data from the query are loaded into RAM. Use the function das2c_free to release the results after you are done with them.

EXAMPLE

Load 60 second resolution Galileo PWS low-frequency electric field spectra collected from noon Jan. 1st 2001 to 2:35 pm Jan 2nd 2001 UTC.

sSrv   = 'http://planet.physics.uiowa.edu/das/das2Server'
sDs    = 'Galileo/PWS/Survey_Electric'
sBeg   = '2001-001T12:00'
sEnd   = '2001-002T14:35'
sRes   = '60'
sFmt   = '%s?server=dataset&dataset=%s&start_time=%s&end_time=%s&resolution=%s'
sUrl   = string(sSrv, sDs, sBeg, sEnd, sRes, format=sFmt)

result = das2c_readhttp(sUrl, "IDL/8.9")

Now get information about the query:

ds = das2c_datasets(result, 0)
das2c_dsinfo(ds)

MODIFICATION HISTORY

C. Piker, 2020-03-11 - Initial Version

Clone this wiki locally