3
require_once("lib/helioviewer/API.php");
4
if (isset($_GET['action'])) {
5
new API($_GET, "text");
7
elseif (isset($_POST['action'])) {
8
new API($_POST, "json");
11
$baseURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
13
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
16
<title>Helioviewer.org API</title>
17
<link rel="shortcut icon" href="../favicon.ico">
18
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
19
<meta http-equiv="Cache-Control" content="No-Cache">
20
<meta name="author" content="Keith Hughitt">
21
<meta name="description" content="Helioviewer - Solar and heliospheric image visualization tool">
22
<meta name="keywords" content="Helioviewer, hv, solar image viewer, sun, solar, heliosphere, solar physics, viewer, visualization, space, astronomy, API">
23
<style type="text/css">
24
body {font-size: 0.85em;}
27
background-color: #E3EFFF;
29
border: 1px solid black;
36
text-decoration: none;
41
text-decoration: underline;
45
ol > li, ul > li {margin: 5px 0px 5px 0px;}
55
div.content > div { width: 90%; }
57
div.content > div > p { margin-left: 20px; text-indent: 20px; font-family: verdana, sans-serif }
58
div > p:first-letter {color:red; font-size:large;}
63
background-color: #f0f1f2;
65
border: 1px solid black;
69
span.example-header {display: block; color: #3366FF}
70
span.example-url {display: block; margin-left: 20px; font-size: 12px;}
71
span.example-url > a {color: #3399ff;}
73
table.param-list {border: none; margin-left: 10px;}
75
div.content h1 {font-size: 18px; font-weight: normal;}
81
<img alt="Helioviewer.org Logo" src="../images/logos/about.png"/ style="float:left;">
82
<h1 style="position:relative; top:22px;">API</h1><br>
84
<!-- Table of contents -->
87
<li><a href="index.php#Overview">Overview</a></li>
88
<li><a href="index.php#CustomView">Loading a Custom View</a></li>
89
<li><a href="index.php#ImageAPI">Image API</a></li>
90
<li><a href="index.php#FeatureEventAPI">Feature/Event API</a>
92
<li><a href="index.php#getEventCatalogs">Catalogs</a></li>
93
<li><a href="index.php#getEvents">Catalog Entries</a></li>
96
<li><a href="index.php#JPEG2000API">JPEG 2000 API</a>
98
<li><a href="index.php#getJP2Image">Image API</a></li>
99
<li><a href="index.php#getJP2ImageSeries">MJ2/Image Series API</a></li>
102
<li><a href="index.php#MovieAPI">Movie API</a></li>
104
<a href="index.php#Appendices">Appendices</a>
105
<ol style="list-style-type: upper-latin;">
106
<li><a href="index.php#Identifiers">Identifiers</a></li>
107
<li><a href="index.php#VariableTypes">Variable Types</a></li>
115
<!-- Main Content -->
116
<div class='content'>
121
<p>In order to facilitate third-party application developers who wish to use content from and interact with Helioviewer.org,
122
a number of <abbr title="Application Programming Interface">APIs</abbr> have been developed, offering access to a variety of components used
123
by Helioviewer. All of the interfaces are accessed using HTML query strings. The simplest APIs require only a single URI, and result in
124
some resource being returned, e.g. a movie or <abbr title="JPEG 2000">JP2</abbr> image series, or some action being performed, e.g. loading
125
a particular "view" into Helioviewer. Some of the API's are somewhat more complex, and involve two steps. For example, in order to get a list
126
of events from some catalogs for a certain period of time, first a query is usually made to see which catalogs are available and functional. A second
127
query then returns a list of features/events are fetched using a second query. If you know the ID's for the desired catalogs and are confident that
128
they are available, you can skip the first query and go straight to the second query. More on that later though.<br><br>
130
The general structure of queries is as follows:</p>
132
<div class="summary-box">
133
<?php echo $baseURL;?>?action=methodName¶m1=value1¶m2=value2 ...
137
<p>The base URL is the same for each of the APIs (<a href="<?php echo $baseURL;?>"><?php echo $baseURL;?></a>).
138
The "action" parameter is required and specifies the specific functionality to access. In addition, other parameters may also be required depending
139
on the specific API being accessed. The one exception to this rule is the <a href="index.php#CustomView">Custom View API</a> which is accessed from
140
<a href="http://www.helioviewer.org/index.php">http://www.helioviewer.org/index.php</a> and does not require an "action" to be specified. Finally,
141
the queries may be sent using either a GET or POST request. In cases where the result is a JSON object, using a POST request will return JSON using
142
the proper headers and using GET will simply output the JSON as plain-text. Plain-text results may be useful for debugging purposes.</p>
145
<!-- Custom View API-->
146
<div id="CustomView">
147
<h1>2. Custom View API:</h1>
148
<p>The custom view API enables the user to load a specific set of parameters into Helioviewer: "view," here, simply means a given set of observation
149
parameters. This is useful for dynamically loading a specific view or observation into Helioviewer using a URL.</p>
151
<div class="summary-box">
152
<span style="text-decoration: underline;">Usage:</span><br><br>
154
http://www.helioviewer.org/index.php<br><br>
156
Supported Parameters:<br><br>
158
<table class="param-list">
161
<td width="25%"><b>obs-date</b></td>
162
<td width="35%"><i>Unix Timestamp</i></td>
163
<td>Date and time to display</td>
166
<td><b>img-scale</b></td>
167
<td><i>Float</i></td>
168
<td>Image scale in arc-seconds/pixel</td>
171
<td><b>layers</b></td>
173
<td>A comma-separated list of the image layers to be displayed</td>
180
<span class="example-header">Example:</span>
181
<span class="example-url">
182
<a href="http://www.helioviewer.org/index.php?obs-date=1065512000&img-scale=2.63&layers=SOHEITEIT171,SOHLAS0C20WL">http://www.helioviewer.org/index.php?obs-date=1065512000&img-scale=2.63&layers=SOHEITEIT171,SOHLAS0C20WL</a>
191
<h1>3. Image API:</h1>
192
<p><i>Under Development...</i></p>
195
<!-- Feature/Event API -->
196
<div id="FeatureEventAPI">
197
<h1>4. Feature/Event API:</h1>
198
<p>There are two ways to use Helioviewer's Feature/Event API. The first is to query the available catalogs, and then query for specific
199
features/events within each catalog. The second method is to go straight to querying for features/events, skipping the catalog step. This
200
requires that you already know the identifiers for each specific catalog you wish you query. Both steps are described below.</p>
201
<ol style="list-style-type: upper-latin;">
204
<div id="getEventCatalogs">
205
Feature/Event Catalogs:
206
<p>To query the list of available catalogs, simply call the "getEvents" API with no parameters. This will return a list
207
of the available catalogs, as well as some meta-information describing each of the catalogs. The most important parameters
208
returned are the "id", the identifier used to query the specific catalog for features/events, and "eventType" which specified
209
the type of feature/event the catalog described, e.g. "CME" or "Active Region."</p>
213
<div class="summary-box">
214
<span style="text-decoration: underline;">Usage:</span><br><br>
215
<a href="<?php echo $baseURL;?>?action=getEventCatalogs"><?php echo $baseURL;?>?action=getEventCatalogs</a><br><br>
219
An array of catalog objects is returned formatted as JSON. Each catalog object includes the following six parameters:
221
<!-- Feature/Event Catalog Parameter Description -->
222
<table class="param-list" cellspacing="10">
225
<td width="25%"><b>adjustRotation</b></td>
226
<td width="15%"><i>Boolean</i></td>
227
<td>Specifies whether the position of the events has been adjusted to account for solar rotation.</td>
230
<td><b>coordinateSystem</b></td>
231
<td><i>String</i></td>
232
<td>The type of coordinate system used by the catalog provider. Recognized coordinate systems include "HELIOGRAPHIC,"
233
"PRINCIPAL_ANGLE," and "ANGULAR."</td>
236
<td><b>description</b></td>
237
<td><i>String</i></td>
238
<td>A brief human-readable description of the catalog.</td>
241
<td><b>eventType</b></td>
242
<td><i>String</i></td>
243
<td>The type of event described. See <a href="index.html#Identifiers">Appendix A</a> for a list of the supported event types.</td>
247
<td><i>String</i></td>
248
<td>The identifier for a specific catalog. The identifier consists of two parts separate by double-colons. The left-side
249
of the double-colons identifies the catalog provider, which may be the same for several catalogs. The right-side identifies
250
the specific catalog.</td>
254
<td><i>String</i></td>
255
<td>A human-readable name for the catalog.</td>
264
<!-- Catalog API Notes -->
265
<div class="summary-box" style="background-color: #E3EFFF;">
266
<span style="text-decoration: underline;">Notes:</span><br><br>
269
<p>The identifiers for working with the feature/event API do not follow the three-character used for most of the other API's on
270
Helioviewer. Although it may be switched to follow this convention in the future, the Feature/Event identifiers are currently variable
271
length. Refer to the table in the following section, <a href="index.html#CatalogEntries">Catalog Entries</a> for the specific IDs used.</p>
274
<p>Results are returned as <abbr name="JSON" title="JavaScript Object Notation">JSON</abbr>. Future versions will provide the ability
275
to request results in either JSON or VOEvent format.
286
<!-- Catalog Entry API -->
289
Feature/Event Catalog Entries:
292
<div class="summary-box">
293
<span style="text-decoration: underline;">Usage:</span><br><br>
295
<?php echo $baseURL;?>?action=getEvents<br><br>
297
Supported Parameters:<br><br>
299
<table class="param-list" cellspacing="10">
302
<td width="25%"><b>catalogs</b></td>
303
<td width="35%"><i>List</i></td>
304
<td>A comma-separated list of catalog identifiers identifying the catalogs to be included in the search.</td>
308
<td><i>ISO 8601 UTC Date</i></td>
309
<td>The date about which the feature/event query is centered.</td>
312
<td><b>windowSize</b></td>
313
<td><i>Integer</i></td>
314
<td>The window-size (in seconds) to search.</td>
322
An array of event objects is returned formatted as JSON. Each event object includes 12 required parameters as well as an array, "properties",
323
which contains additional parameters which vary from catalog to catalog. Among the 12 required parameters, two of the parameters relating to
324
the coordinates of the event may vary, but every event object will include a set of coordinates.<br><br>
326
<!-- Event Parameter Description -->
327
<table class="param-list" cellspacing="10">
330
<td width="20%"><b>angularX</b></td>
331
<td width="20%"><i>Integer</i></td>
332
<td><i>[Optional]</i> ...</td>
335
<td><b>angularY</b></td>
336
<td><i>Integer</i></td>
337
<td><i>[Optional]</i> ...</td>
340
<td><b>catalogId</b></td>
341
<td><i>String</i></td>
342
<td>The ID of the catalog from which the event came from.</td>
345
<td><b>detail</b></td>
346
<td><i>String</i></td>
347
<td>Miscellaneous event-related details. The variable properties array is derived primarily from this.</td>
350
<td><b>endTime</b></td>
351
<td><i>ISO 8601 UTC Date</i></td>
352
<td>End event time.</td>
355
<td><b>eventId</b></td>
356
<td><i>String</i></td>
357
<td>Event identifier: varies depending on the catalog source.</td>
361
<td><i>Integer</i></td>
362
<td><i>[Optional]</i> Heliocentric latitudinal coordinate of event...</td>
365
<td><b>hlong</b></td>
366
<td><i>Integer</i></td>
367
<td><i>[Optional]</i> Heliocentric longitudinal coordinate of event...</td>
371
<td><i>String</i></td>
372
<td>A shorter version of the "detail" parameter: lists some basic parameters of the event which vary from catalog to catalog.</td>
375
<td><b>polarCpa</b></td>
376
<td><i>Integer</i></td>
377
<td><i>[Optional]</i> Polar coordinates angle, in degrees.</td>
380
<td><b>polarWidth</b></td>
381
<td><i>Integer</i></td>
382
<td><i>[Optional]</i> Polar coordinates width...</td>
385
<td><b>properties</b></td>
387
<td>An array of parameters which vary depending on the specific catalog queried: each catalog is associated with a separate set of parameters.</td>
390
<td><b>shortInfo</b></td>
391
<td><i>String</i></td>
392
<td>An even shorter version of the "detail" parameter: lists some very basic parameters of the event which vary from catalog to catalog.</td>
395
<td><b>sourceUrl</b></td>
396
<td><i>String</i></td>
397
<td>Source URL for the individual event, or a link to the catalog search interface if no individual URL can be generated.</td>
400
<td><b>startTime</b></td>
401
<td><i>ISO 8601 UTC Date</i></td>
402
<td>Start event time.</td>
406
<td><i>Float</i></td>
407
<td>Normalized heliocentric cartesian X-coordinate.</td>
411
<td><i>Float</i></td>
412
<td>Normalized heliocentric cartesian Y-coordinate.</td>
419
<span class="example-header">Example:</span>
420
<span class="example-url">
421
<a href=<?php echo $baseURL;?>?action=getEvents&date=2003-10-05T00:00:00Z&windowSize=86400&catalogs=VSOService::noaa,GOESXRayService::GOESXRay"><?php echo $baseURL;?>?action=getEvents&date=2003-10-05T00:00:00Z&windowSize=86400&catalogs=VSOService::noaa,GOESXRayService::GOESXRay</a>
427
<!-- Catalog Entry API Notes -->
428
<div class="summary-box" style="background-color: #E3EFFF;">
429
<span style="text-decoration: underline;">Notes:</span><br><br>
432
<p>The coordinate parameters returned will vary depending on the specific catalog queried. For catalogs which use the "PRINCIPAL_ANGLE"
433
coordinate system, the parameters "polarCpa" and "polarWidth" are returned. For catalogs which use the "HELIOGRAPHIC" coordinate system, "hlat"
434
and "hlong" parameters are return.
447
<!-- JPEG 2000 API -->
448
<div id="JPEG2000API">
449
<h1>5. JPEG 2000 API:</h1>
450
<p>Helioviewer's JPEG 2000 API's enable access to the raw JPEG 2000 images used to generate the tiles seen on the site, as
451
well as real-time generation of JPEG 2000 Image Series (JPX) and MJ2 Movies.</p>
452
<ol style="list-style-type: upper-latin;">
453
<!-- JPEG 2000 Image API -->
455
<div id="getJP2Image">
457
<p>Returns a single JPEG 2000 (JP2) image. If an image is not available for the date request the closest available
458
image is returned.</p>
462
<div class="summary-box">
463
<span style="text-decoration: underline;">Usage:</span><br><br>
465
<?php echo $baseURL;?>?action=getJP2Image<br><br>
467
Supported Parameters:<br><br>
469
<table class="param-list">
472
<td width="25%"><b>observatory</b></td>
473
<td width="35%"><i>String</i></td>
477
<td><b>instrument</b></td>
478
<td><i>String</i></td>
482
<td><b>detector</b></td>
483
<td><i>String</i></td>
487
<td><b>measurement</b></td>
488
<td><i>String</i></td>
492
<td><b>timestamp</b></td>
493
<td><i>Unix Timestamp</i></td>
494
<td>Observation time</td>
497
<td><b>getURL</b></td>
498
<td><i>Boolean</i></td>
499
<td>[Optional] Returns a URL instead of an actual image.</td>
506
<span class="example-header">Example:</span>
507
<span class="example-url">
508
<a href="<?php echo $baseURL;?>?action=getJP2Image&observatory=SOH&instrument=EIT&detector=EIT&measurement=171×tamp=1065312000"><?php echo $baseURL;?>?action=getJP2Image&observatory=SOH&instrument=EIT&detector=EIT&measurement=171×tamp=1065312000</a>
515
<!-- JPEG 2000 Image-Series API -->
517
<div id="getJP2ImageSeries">
518
MJ2/Image Series API:
519
<p>Returns either a Motion JPEG 2000 (MJ2) or JPEG 2000 Image Series (JPX) depending on the parameters specified. The movie frames are
520
chosen by matching the closest image available at each step of a specified range of dates and image cadence.</p>
524
<div class="summary-box">
525
<span style="text-decoration: underline;">Usage:</span><br><br>
527
<?php echo $baseURL;?>?action=getJP2ImageSeries<br><br>
529
Supported Parameters:<br><br>
531
<table class="param-list">
534
<td width="25%"><b>observatory</b></td>
535
<td width="35%"><i>String</i></td>
539
<td><b>instrument</b></td>
540
<td><i>String</i></td>
544
<td><b>detector</b></td>
545
<td><i>String</i></td>
549
<td><b>measurement</b></td>
550
<td><i>String</i></td>
554
<td><b>startTime</b></td>
555
<td><i>Unix Timestamp</i></td>
556
<td>Movie start time</td>
559
<td><b>endTime</b></td>
560
<td><i>Unix Timestamp</i></td>
561
<td>Movie end time</td>
564
<td><b>cadence</b></td>
565
<td><i>Integer</i></td>
566
<td>The desired amount of time between each movie-frame, in seconds</td>
569
<td><b>format</b></td>
570
<td><i>String</i></td>
571
<td>[MJ2|JPX] Whether a MJ2 movie or a JPX file should be returned</td>
578
<span class="example-header">Example:</span>
579
<span class="example-url">
580
<a href="<?php echo $baseURL;?>?action=getJP2ImageSeries&observatory=SOH&instrument=EIT&detector=EIT&measurement=171&startTime=1065312000&endTime=1066673880&cadence=27000&format=MJ2"><?php echo $baseURL;?>?action=getJP2ImageSeries&observatory=SOH&instrument=EIT&detector=EIT&measurement=171&startTime=1065312000&endTime=1065402792&cadence=1800&format=MJ2</a>
587
<!-- JPEG 2000 Image-Series API Notes -->
588
<div class="summary-box" style="background-color: #E3EFFF;">
589
<span style="text-decoration: underline;">Notes:</span><br><br>
592
<p>During MJ2/JPX movie generation it is possible that for lower cadences some redundent image frames will be used. In order
593
to avoid this a sufficiently large cadence should be specified.</p>
603
<h1>6. Movie API:</h1>
604
<p><i>Under Development...</i></p>
608
<div id="Appendices">
609
<h1>7. Appendices:</h1>
611
<ol style="list-style-type: upper-latin;">
612
<!-- Appendix A: Identifiers -->
614
<div id="Identifiers">
615
Supported Identifiers
616
<p>This appendice contains a list of the identifiers supported by Helioviewer. Many of the identifiers consist of three alphanumeric
617
characters. Where an appropriate abbreviation is short than three characters, 0's are filled in from the left (e.g. "C2" -> "0C2").
618
For some queries, complex identifiers may be built up from the simpler ones below. E.g. to uniquely identify a specific type of
619
image, you must specify a 12-character concatenated set of four identifiers: Observatory, Instrument, Detector, and Measurement.
620
For example, to refer to an EIT 171 image, the identifier <i>SOHEITEIT171</i> is used. Note that not all identifiers follow the
621
three-character convention. The Feature/Event API identifiers in particular use a different system for naming.</p>
622
<div class="summary-box" style="background-color: #E3EFFF;">
624
<!-- Observatories -->
625
<i>Observatories:</i><br><br>
626
<table class="param-list">
628
<td width="140px"><strong>Identifier:</strong></td>
629
<td><strong>Description:</strong></td>
633
<td>SOHO (Solar and Heliospheric Observatory)</td>
637
<td>TRACE (Transition Region and Coronal Explorer)</td>
644
<i>Instruments:</i><br><br>
645
<table class="param-list">
647
<td width="140px"><strong>Identifier:</strong></td>
648
<td><strong>Description:</strong></td>
652
<td>EIT (Extreme ultraviolet Imaging Telescope)</td>
656
<td>LASCO (Large Angle and Spectrometric Coronagraph Experiment)</td>
660
<td>MDI (The Michelson Doppler Imager)</td>
664
<td>TRACE (Transition Region and Coronal Explorer)</td>
671
<i>Detectors:</i><br><br>
672
<table class="param-list">
674
<td width="140px"><strong>Identifier:</strong></td>
675
<td><strong>Description:</strong></td>
687
<td>EIT (Extreme ultraviolet Imaging Telescope)</td>
691
<td>MDI (The Michelson Doppler Imager)</td>
697
<!-- Measurements -->
698
<i>Measurements:</i><br><br>
699
<table class="param-list">
701
<td width="140px"><strong>Identifier:</strong></td>
702
<td><strong>Description:</strong></td>
706
<td>171 Ångström</td>
710
<td>195 Ångström</td>
714
<td>284 Ångström</td>
718
<td>304 Ångström</td>
726
<td>Intensity spectrogram</td>
737
<i>Event Types:</i><br><br>
738
<table class="param-list">
740
<td width="140px"><strong>Identifier:</strong></td>
741
<td><strong>Description:</strong></td>
744
<td>Coronal Mass Ejection</td>
751
<td>Type II Radio Burst</td>
752
<td>Type II Radio Burst</td>
755
<td>Active Region</td>
756
<td>Active Region</td>
759
<td>GeneralActivityReport</td>
760
<td>SOHO General Activity Report</td>
769
<!-- Appendix B: Variable Types -->
771
<div id="VariableTypes">
773
<p>This appendice contains a list of some of the variable types used by the Helioviewer API's.</p>
774
<div class="summary-box" style="background-color: #E3EFFF;">
776
<!-- Observatories -->
777
<i>Observatories:</i><br><br>
778
<table class="param-list" cellspacing="10">
781
<td width="25%"><strong>Type:</strong></td>
782
<td width="45%"><strong>Description:</strong></td>
783
<td><strong>Example:</strong></td>
792
<td>A floating point number.</td>
802
<td>A comma-separated list of some other type, usually strings or integers</td>
803
<td>VSOService::noaa,GOESXRayService::GOESXRay</td>
806
<td>Unix Timestamp</td>
807
<td>The number of seconds since January 1, 1970, midnight UTC. (see <a href="#variable-type-resources">[1]</a>)</td>
808
<td>1065512000 <span style="color:grey">// October 7th 2003, 7:33:20 UTC</span></td>
811
<td>ISO 8601 UTC Date</td>
812
<td>ISO 8601 is a widely supported standarized date format. (See <a href="#variable-type-resources">[2]</a>, <a href="#variable-type-resources">[3]</a>)</td>
813
<td>2003-10-05T00:00:00Z <span style="color:grey">// Note the "Z" at the end. This specifies that this is a UTC datetime</span></td>
819
<div id="variable-type-resources">
820
<strong>References:</strong><br><br>
821
[1] <a href="http://www.epochconverter.com/">Epoch Converter - Unix Timestamp Converter</a><br>
822
[2] <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601 - Wikipedia</a><br>
823
[3] <a href="http://www.w3.org/TR/NOTE-datetime">Date and Time Formats - W3.org</a><br>
834
<div style="font-size: 0.7em; text-align: center; margin-top: 20px;">
835
Last Updated: 2009-02-25 | <a href="mailto:webmaster@helioviewer.org">Questions?</a>