~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to api/index.php

  • Committer: V. Keith Hughitt
  • Date: 2009-04-01 21:08:05 UTC
  • Revision ID: hughitt1@kore-20090401210805-372f7dgih07vxk42
nightly build 04-01-2009

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
        //error_reporting(0); 
 
3
        require_once("lib/helioviewer/API.php");
 
4
        if (isset($_GET['action'])) {
 
5
                new API($_GET, "text");
 
6
        }
 
7
        elseif (isset($_POST['action'])) {
 
8
                new API($_POST, "json");
 
9
        } else {
 
10
                
 
11
        $baseURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
 
12
?>
 
13
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 
14
<html>
 
15
        <head>
 
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;}
 
25
                        
 
26
                        .toc {
 
27
                                background-color: #E3EFFF;
 
28
                                color: #111;
 
29
                                border: 1px solid black;
 
30
                                width: 250px;
 
31
                                height: 404.508497px;
 
32
                                margin-left:30px;
 
33
                        }
 
34
                        
 
35
                        a {
 
36
                                text-decoration: none;
 
37
                                color: #111;                    
 
38
                        }
 
39
                        
 
40
                        a:hover {
 
41
                                text-decoration: underline;
 
42
                                color: #d9759d;                 
 
43
                        }
 
44
                        
 
45
                        ol > li, ul > li {margin: 5px 0px 5px 0px;}
 
46
                
 
47
                        div.content {
 
48
                                color: #000;
 
49
                                width: 90%;
 
50
                                height: 100%;
 
51
                                margin-left:30px;
 
52
                                padding: 10px;
 
53
                        }
 
54
                        
 
55
                        div.content > div { width: 90%; }
 
56
                        
 
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;}
 
59
                        
 
60
                        div.summary-box {
 
61
                                width: 60%;
 
62
                                margin-left: 40px;
 
63
                                background-color: #f0f1f2;
 
64
                                color: #000;
 
65
                                border: 1px solid black;
 
66
                                padding: 10px;
 
67
                        }
 
68
                        
 
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;}
 
72
                        
 
73
                        table.param-list {border: none; margin-left: 10px;}
 
74
                        
 
75
                        div.content h1 {font-size: 18px; font-weight: normal;}
 
76
                        
 
77
                </style>
 
78
        </head>
 
79
        
 
80
        <body>
 
81
                <img alt="Helioviewer.org Logo" src="../images/logos/about.png"/ style="float:left;">
 
82
                <h1 style="position:relative; top:22px;">API</h1><br>
 
83
                
 
84
                <!-- Table of contents -->
 
85
                <div class='toc'>
 
86
                        <ol>
 
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>
 
91
                                        <ul>
 
92
                                                <li><a href="index.php#getEventCatalogs">Catalogs</a></li>
 
93
                                                <li><a href="index.php#getEvents">Catalog Entries</a></li>
 
94
                                        </ul>
 
95
                                </li>
 
96
                                <li><a href="index.php#JPEG2000API">JPEG 2000 API</a>
 
97
                                        <ul>
 
98
                                                <li><a href="index.php#getJP2Image">Image API</a></li>
 
99
                                                <li><a href="index.php#getJP2ImageSeries">MJ2/Image Series API</a></li>
 
100
                                        </ul>
 
101
                                </li>
 
102
                                <li><a href="index.php#MovieAPI">Movie API</a></li>
 
103
                                <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>
 
108
                                                </ol>
 
109
                                </li>
 
110
                        </ol>
 
111
                </div>
 
112
                
 
113
                <br><hr><br>
 
114
                
 
115
                <!-- Main Content -->
 
116
                <div class='content'>
 
117
                        
 
118
                        <!-- Overview -->
 
119
                        <div id="Overview">
 
120
                                <h1>1. Overview</h1> 
 
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>
 
129
                                
 
130
                                The general structure of queries is as follows:</p>
 
131
                                
 
132
                                <div class="summary-box">
 
133
                                        <?php echo $baseURL;?>?action=methodName&param1=value1&param2=value2 ...
 
134
                                </div>
 
135
                                
 
136
                                
 
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>
 
143
                        </div>
 
144
                        
 
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>
 
150
                                
 
151
                                <div class="summary-box">
 
152
                                        <span style="text-decoration: underline;">Usage:</span><br><br>
 
153
                                        
 
154
                                        http://www.helioviewer.org/index.php<br><br>
 
155
                                        
 
156
                                        Supported Parameters:<br><br>
 
157
                                        
 
158
                                        <table class="param-list">
 
159
                                                <tbody valign="top">
 
160
                                                        <tr>
 
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>
 
164
                                                        </tr>
 
165
                                                        <tr>
 
166
                                                                <td><b>img-scale</b></td>
 
167
                                                                <td><i>Float</i></td>
 
168
                                                                <td>Image scale in arc-seconds/pixel</td>
 
169
                                                        </tr>
 
170
                                                        <tr>
 
171
                                                                <td><b>layers</b></td>
 
172
                                                                <td><i>List</i></td>
 
173
                                                                <td>A comma-separated list of the image layers to be displayed</td>
 
174
                                                        </tr>
 
175
                                                </tbody>
 
176
                                        </table>
 
177
                                        
 
178
                                        <br>
 
179
                                        
 
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>
 
183
                                        </span> 
 
184
                                </div>
 
185
                        </div>
 
186
                        
 
187
                        <br>
 
188
                        
 
189
                        <!-- Image API -->
 
190
                        <div id="ImageAPI">
 
191
                                <h1>3. Image API:</h1>
 
192
                                <p><i>Under Development...</i></p>
 
193
                        </div>
 
194
                        
 
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;">
 
202
                                        <!-- Catalog API -->
 
203
                                        <li>
 
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>
 
210
                                                        
 
211
                                                        <br>
 
212
                                                        
 
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>
 
216
                                                                
 
217
                                                                Result:<br><br>
 
218
                                                                
 
219
                                                                An array of catalog objects is returned formatted as JSON. Each catalog object includes the following six parameters:
 
220
                                                                
 
221
                                                                <!-- Feature/Event Catalog Parameter Description -->
 
222
                                                                <table class="param-list" cellspacing="10">
 
223
                                                                        <tbody valign="top">
 
224
                                                                                <tr>
 
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>
 
228
                                                                                </tr>
 
229
                                                                                <tr>
 
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>
 
234
                                                                                </tr>
 
235
                                                                                <tr>
 
236
                                                                                        <td><b>description</b></td>
 
237
                                                                                        <td><i>String</i></td>
 
238
                                                                                        <td>A brief human-readable description of the catalog.</td>
 
239
                                                                                </tr>
 
240
                                                                                <tr>
 
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>
 
244
                                                                                </tr>
 
245
                                                                                <tr>
 
246
                                                                                        <td><b>id</b></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>
 
251
                                                                                </tr>
 
252
                                                                                <tr>
 
253
                                                                                        <td><b>name</b></td>
 
254
                                                                                        <td><i>String</i></td>
 
255
                                                                                        <td>A human-readable name for the catalog.</td>
 
256
                                                                                </tr>
 
257
                                                                        </tbody>
 
258
                                                                </table>
 
259
 
 
260
                                                        </div>
 
261
                                                        
 
262
                                                        <br>
 
263
                                                        
 
264
                                                        <!-- Catalog API Notes -->
 
265
                                                        <div class="summary-box" style="background-color: #E3EFFF;">
 
266
                                                                <span style="text-decoration: underline;">Notes:</span><br><br>
 
267
                                                                <ul>
 
268
                                                                        <li>
 
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>
 
272
                                                                        </li>
 
273
                                                                        <li>
 
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.
 
276
                                                                                </p>
 
277
                                                                        </li>
 
278
                                                                </ul>
 
279
                                                        </div>
 
280
                        
 
281
                                                </div>
 
282
                                        </li>
 
283
                                        
 
284
                                        <br>
 
285
                                        
 
286
                                        <!-- Catalog Entry API -->
 
287
                                        <li>
 
288
                                                <div id="getEvents">
 
289
                                                        Feature/Event Catalog Entries:
 
290
                                                        <p></p>
 
291
                                                        
 
292
                                                        <div class="summary-box">
 
293
                                                                <span style="text-decoration: underline;">Usage:</span><br><br>
 
294
                                                                
 
295
                                                                <?php echo $baseURL;?>?action=getEvents<br><br>
 
296
                                                                
 
297
                                                                Supported Parameters:<br><br>
 
298
                                        
 
299
                                                                <table class="param-list" cellspacing="10">
 
300
                                                                        <tbody valign="top">
 
301
                                                                                <tr>
 
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>
 
305
                                                                                </tr>
 
306
                                                                                <tr>
 
307
                                                                                        <td><b>date</b></td>
 
308
                                                                                        <td><i>ISO 8601 UTC Date</i></td>
 
309
                                                                                        <td>The date about which the feature/event query is centered.</td>
 
310
                                                                                </tr>
 
311
                                                                                <tr>
 
312
                                                                                        <td><b>windowSize</b></td>
 
313
                                                                                        <td><i>Integer</i></td>
 
314
                                                                                        <td>The window-size (in seconds) to search.</td>
 
315
                                                                                </tr>
 
316
                                                                        </tbody>
 
317
                                                                </table>
 
318
                                                                
 
319
                                                                <br>
 
320
                                                                
 
321
                                                                Result:<br><br>
 
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>
 
325
                                                                
 
326
                                                                <!-- Event Parameter Description -->
 
327
                                                                <table class="param-list" cellspacing="10">
 
328
                                                                        <tbody valign="top">
 
329
                                                                                <tr>
 
330
                                                                                        <td width="20%"><b>angularX</b></td>
 
331
                                                                                        <td width="20%"><i>Integer</i></td>
 
332
                                                                                        <td><i>[Optional]</i> ...</td>
 
333
                                                                                </tr>
 
334
                                                                                <tr>
 
335
                                                                                        <td><b>angularY</b></td>
 
336
                                                                                        <td><i>Integer</i></td>
 
337
                                                                                        <td><i>[Optional]</i> ...</td>
 
338
                                                                                </tr>
 
339
                                                                                <tr>
 
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>
 
343
                                                                                </tr>
 
344
                                                                                <tr>
 
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>
 
348
                                                                                </tr>
 
349
                                                                                <tr>
 
350
                                                                                        <td><b>endTime</b></td>
 
351
                                                                                        <td><i>ISO 8601 UTC Date</i></td>
 
352
                                                                                        <td>End event time.</td>
 
353
                                                                                </tr>
 
354
                                                                                <tr>
 
355
                                                                                        <td><b>eventId</b></td>
 
356
                                                                                        <td><i>String</i></td>
 
357
                                                                                        <td>Event identifier: varies depending on the catalog source.</td>
 
358
                                                                                </tr>
 
359
                                                                                <tr>
 
360
                                                                                        <td><b>hlat</b></td>
 
361
                                                                                        <td><i>Integer</i></td>
 
362
                                                                                        <td><i>[Optional]</i> Heliocentric latitudinal coordinate of event...</td>
 
363
                                                                                </tr>
 
364
                                                                                <tr>
 
365
                                                                                        <td><b>hlong</b></td>
 
366
                                                                                        <td><i>Integer</i></td>
 
367
                                                                                        <td><i>[Optional]</i> Heliocentric longitudinal coordinate of event...</td>
 
368
                                                                                </tr>
 
369
                                                                                <tr>
 
370
                                                                                        <td><b>info</b></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>
 
373
                                                                                </tr>
 
374
                                                                                <tr>
 
375
                                                                                        <td><b>polarCpa</b></td>
 
376
                                                                                        <td><i>Integer</i></td>
 
377
                                                                                        <td><i>[Optional]</i> Polar coordinates angle, in degrees.</td>
 
378
                                                                                </tr>
 
379
                                                                                <tr>
 
380
                                                                                        <td><b>polarWidth</b></td>
 
381
                                                                                        <td><i>Integer</i></td>
 
382
                                                                                        <td><i>[Optional]</i> Polar coordinates width...</td>
 
383
                                                                                </tr>
 
384
                                                                                <tr>
 
385
                                                                                        <td><b>properties</b></td>
 
386
                                                                                        <td><i>List</i></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>
 
388
                                                                                </tr>
 
389
                                                                                <tr>
 
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>
 
393
                                                                                </tr>
 
394
                                                                                <tr>
 
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>
 
398
                                                                                </tr>
 
399
                                                                                <tr>
 
400
                                                                                        <td><b>startTime</b></td>
 
401
                                                                                        <td><i>ISO 8601 UTC Date</i></td>
 
402
                                                                                        <td>Start event time.</td>
 
403
                                                                                </tr>
 
404
                                                                                <tr>
 
405
                                                                                        <td><b>sunX</b></td>
 
406
                                                                                        <td><i>Float</i></td>
 
407
                                                                                        <td>Normalized heliocentric cartesian X-coordinate.</td>
 
408
                                                                                </tr>
 
409
                                                                                <tr>
 
410
                                                                                        <td><b>sunY</b></td>
 
411
                                                                                        <td><i>Float</i></td>
 
412
                                                                                        <td>Normalized heliocentric cartesian Y-coordinate.</td>
 
413
                                                                                </tr>
 
414
                                                                        </tbody>
 
415
                                                                </table>
 
416
                                                                
 
417
                                                                <br>
 
418
                                                                
 
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>
 
422
                                                                </span>
 
423
                                                        </div>
 
424
                                                        
 
425
                                                        <br>
 
426
                                                        
 
427
                                                        <!-- Catalog Entry API Notes -->
 
428
                                                        <div class="summary-box" style="background-color: #E3EFFF;">
 
429
                                                                <span style="text-decoration: underline;">Notes:</span><br><br>
 
430
                                                                <ul>
 
431
                                                                        <li>
 
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. 
 
435
                                                                                </p>
 
436
                                                                        </li>
 
437
                                                                </ul>
 
438
                                                        </div>
 
439
                                                        
 
440
                                                </div>
 
441
                                        </li>
 
442
                                </ol>
 
443
                        </div>
 
444
                        
 
445
                        
 
446
                        
 
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 -->
 
454
                                        <li>
 
455
                                                <div id="getJP2Image">
 
456
                                                        JP2 Images:
 
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>
 
459
                                                        
 
460
                                                        <br>
 
461
                                                        
 
462
                                                        <div class="summary-box">
 
463
                                                                <span style="text-decoration: underline;">Usage:</span><br><br>
 
464
                                                                
 
465
                                                                <?php echo $baseURL;?>?action=getJP2Image<br><br>
 
466
                                                                
 
467
                                                                Supported Parameters:<br><br>
 
468
                                        
 
469
                                                                <table class="param-list">
 
470
                                                                        <tbody valign="top">
 
471
                                                                                <tr>
 
472
                                                                                        <td width="25%"><b>observatory</b></td>
 
473
                                                                                        <td width="35%"><i>String</i></td>
 
474
                                                                                        <td>Observatory</td>
 
475
                                                                                </tr>
 
476
                                                                                <tr>
 
477
                                                                                        <td><b>instrument</b></td>
 
478
                                                                                        <td><i>String</i></td>
 
479
                                                                                        <td>Instrument</td>
 
480
                                                                                </tr>
 
481
                                                                                <tr>
 
482
                                                                                        <td><b>detector</b></td>
 
483
                                                                                        <td><i>String</i></td>
 
484
                                                                                        <td>Detector</td>
 
485
                                                                                </tr>
 
486
                                                                                <tr>
 
487
                                                                                        <td><b>measurement</b></td>
 
488
                                                                                        <td><i>String</i></td>
 
489
                                                                                        <td>Measurement</td>
 
490
                                                                                </tr>
 
491
                                                                                <tr>
 
492
                                                                                        <td><b>timestamp</b></td>
 
493
                                                                                        <td><i>Unix Timestamp</i></td>
 
494
                                                                                        <td>Observation time</td>
 
495
                                                                                </tr>
 
496
                                                                                <tr>
 
497
                                                                                        <td><b>getURL</b></td>
 
498
                                                                                        <td><i>Boolean</i></td>
 
499
                                                                                        <td>[Optional] Returns a URL instead of an actual image.</td>
 
500
                                                                                </tr>
 
501
                                                                        </tbody>
 
502
                                                                </table>
 
503
                                                                
 
504
                                                                <br>
 
505
                                                                
 
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&timestamp=1065312000"><?php echo $baseURL;?>?action=getJP2Image&observatory=SOH&instrument=EIT&detector=EIT&measurement=171&timestamp=1065312000</a>
 
509
                                                                </span> 
 
510
                                                                
 
511
                                                        </div>
 
512
                                                </div>
 
513
                                        </li>
 
514
                                        
 
515
                                        <!-- JPEG 2000 Image-Series API -->
 
516
                                        <li>
 
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>
 
521
                                                        
 
522
                                                        <br>
 
523
                                                        
 
524
                                                        <div class="summary-box">
 
525
                                                                <span style="text-decoration: underline;">Usage:</span><br><br>
 
526
                                                                
 
527
                                                                <?php echo $baseURL;?>?action=getJP2ImageSeries<br><br>
 
528
                                                                
 
529
                                                                Supported Parameters:<br><br>
 
530
                                        
 
531
                                                                <table class="param-list">
 
532
                                                                        <tbody valign="top">
 
533
                                                                                <tr>
 
534
                                                                                        <td width="25%"><b>observatory</b></td>
 
535
                                                                                        <td width="35%"><i>String</i></td>
 
536
                                                                                        <td>Observatory</td>
 
537
                                                                                </tr>
 
538
                                                                                <tr>
 
539
                                                                                        <td><b>instrument</b></td>
 
540
                                                                                        <td><i>String</i></td>
 
541
                                                                                        <td>Instrument</td>
 
542
                                                                                </tr>
 
543
                                                                                <tr>
 
544
                                                                                        <td><b>detector</b></td>
 
545
                                                                                        <td><i>String</i></td>
 
546
                                                                                        <td>Detector</td>
 
547
                                                                                </tr>
 
548
                                                                                <tr>
 
549
                                                                                        <td><b>measurement</b></td>
 
550
                                                                                        <td><i>String</i></td>
 
551
                                                                                        <td>Measurement</td>
 
552
                                                                                </tr>
 
553
                                                                                <tr>
 
554
                                                                                        <td><b>startTime</b></td>
 
555
                                                                                        <td><i>Unix Timestamp</i></td>
 
556
                                                                                        <td>Movie start time</td>
 
557
                                                                                </tr>
 
558
                                                                                <tr>
 
559
                                                                                        <td><b>endTime</b></td>
 
560
                                                                                        <td><i>Unix Timestamp</i></td>
 
561
                                                                                        <td>Movie end time</td>
 
562
                                                                                </tr>
 
563
                                                                                <tr>
 
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>
 
567
                                                                                </tr>
 
568
                                                                                <tr>
 
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>
 
572
                                                                                </tr>
 
573
                                                                        </tbody>
 
574
                                                                </table>
 
575
                                                                
 
576
                                                                <br>
 
577
                                                                
 
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>
 
581
                                                                </span>                                                         
 
582
                                                        </div>
 
583
                                                </div>
 
584
                                                
 
585
                                                <br>
 
586
                                                
 
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>
 
590
                                                        <ul>
 
591
                                                                <li>
 
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>
 
594
                                                                </li>
 
595
                                                        </ul>
 
596
                                                </div>
 
597
                                        </li>
 
598
                                </ol>
 
599
                        </div>
 
600
                        
 
601
                        <!-- Movie API -->
 
602
                        <div id="MovieAPI">
 
603
                                <h1>6. Movie API:</h1>
 
604
                                <p><i>Under Development...</i></p>
 
605
                        </div>
 
606
                        
 
607
                        <!-- Appendices -->
 
608
                        <div id="Appendices">
 
609
                                <h1>7. Appendices:</h1>
 
610
                                <p></p>
 
611
                                <ol style="list-style-type: upper-latin;">
 
612
                                        <!-- Appendix A: Identifiers -->
 
613
                                        <li>
 
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;">
 
623
                                                        
 
624
                                                                <!-- Observatories -->
 
625
                                                                <i>Observatories:</i><br><br>
 
626
                                                                <table class="param-list">
 
627
                                                                        <tr>
 
628
                                                                                <td width="140px"><strong>Identifier:</strong></td>
 
629
                                                                                <td><strong>Description:</strong></td>
 
630
                                                                        </tr>
 
631
                                                                        <tr>
 
632
                                                                                <td>SOH</td>
 
633
                                                                                <td>SOHO (Solar and Heliospheric Observatory)</td>
 
634
                                                                        </tr>
 
635
                                                                        <tr>
 
636
                                                                                <td>TRA</td>
 
637
                                                                                <td>TRACE (Transition Region and Coronal Explorer)</td>
 
638
                                                                        </tr>
 
639
                                                                </table>
 
640
                                                                
 
641
                                                                <br>
 
642
                                                                
 
643
                                                                <!-- Instruments -->
 
644
                                                                <i>Instruments:</i><br><br>
 
645
                                                                <table class="param-list">
 
646
                                                                        <tr>
 
647
                                                                                <td width="140px"><strong>Identifier:</strong></td>
 
648
                                                                                <td><strong>Description:</strong></td>
 
649
                                                                        </tr>
 
650
                                                                        <tr>
 
651
                                                                                <td>EIT</td>
 
652
                                                                                <td>EIT (Extreme ultraviolet Imaging Telescope)</td>
 
653
                                                                        </tr>
 
654
                                                                        <tr>
 
655
                                                                                <td>LAS</td>
 
656
                                                                                <td>LASCO (Large Angle and Spectrometric Coronagraph Experiment)</td>
 
657
                                                                        </tr>
 
658
                                                                        <tr>
 
659
                                                                                <td>MDI</td>
 
660
                                                                                <td>MDI (The Michelson Doppler Imager)</td>
 
661
                                                                        </tr>
 
662
                                                                        <tr>
 
663
                                                                                <td>TRA</td>
 
664
                                                                                <td>TRACE (Transition Region and Coronal Explorer)</td>
 
665
                                                                        </tr>
 
666
                                                                </table>
 
667
                                                                
 
668
                                                                <br>
 
669
                                                                
 
670
                                                                <!-- Detectors -->
 
671
                                                                <i>Detectors:</i><br><br>
 
672
                                                                <table class="param-list">
 
673
                                                                        <tr>
 
674
                                                                                <td width="140px"><strong>Identifier:</strong></td>
 
675
                                                                                <td><strong>Description:</strong></td>
 
676
                                                                        </tr>
 
677
                                                                        <tr>
 
678
                                                                                <td>0C2</td>
 
679
                                                                                <td>LASCO C2</td>
 
680
                                                                        </tr>
 
681
                                                                        <tr>
 
682
                                                                                <td>0C3</td>
 
683
                                                                                <td>LASCO C3</td>
 
684
                                                                        </tr>
 
685
                                                                        <tr>
 
686
                                                                                <td>EIT</td>
 
687
                                                                                <td>EIT (Extreme ultraviolet Imaging Telescope)</td>
 
688
                                                                        </tr>
 
689
                                                                        <tr>
 
690
                                                                                <td>MDI</td>
 
691
                                                                                <td>MDI (The Michelson Doppler Imager)</td>
 
692
                                                                        </tr>
 
693
                                                                </table>
 
694
                                                                                                                                
 
695
                                                                <br>
 
696
                                                                
 
697
                                                                <!-- Measurements -->
 
698
                                                                <i>Measurements:</i><br><br>
 
699
                                                                <table class="param-list">
 
700
                                                                        <tr>
 
701
                                                                                <td width="140px"><strong>Identifier:</strong></td>
 
702
                                                                                <td><strong>Description:</strong></td>
 
703
                                                                        </tr>
 
704
                                                                        <tr>
 
705
                                                                                <td>171</td>
 
706
                                                                                <td>171 Ångström</td>
 
707
                                                                        </tr>
 
708
                                                                        <tr>
 
709
                                                                                <td>195</td>
 
710
                                                                                <td>195 Ångström</td>
 
711
                                                                        </tr>
 
712
                                                                        <tr>
 
713
                                                                                <td>284</td>
 
714
                                                                                <td>284 Ångström</td>
 
715
                                                                        </tr>
 
716
                                                                        <tr>
 
717
                                                                                <td>304</td>
 
718
                                                                                <td>304 Ångström</td>
 
719
                                                                        </tr>
 
720
                                                                        <tr>
 
721
                                                                                <td>0WL</td>
 
722
                                                                                <td>White-light</td>
 
723
                                                                        </tr>
 
724
                                                                        <tr>
 
725
                                                                                <td>INT</td>
 
726
                                                                                <td>Intensity spectrogram</td>
 
727
                                                                        </tr>
 
728
                                                                        <tr>
 
729
                                                                                <td>MAG</td>
 
730
                                                                                <td>Magnetogram</td>
 
731
                                                                        </tr>
 
732
                                                                </table>
 
733
                                                                
 
734
                                                                <br>
 
735
                                                                
 
736
                                                                <!-- Event Types -->
 
737
                                                                <i>Event Types:</i><br><br>
 
738
                                                                <table class="param-list">
 
739
                                                                        <tr>
 
740
                                                                                <td width="140px"><strong>Identifier:</strong></td>
 
741
                                                                                <td><strong>Description:</strong></td>
 
742
                                                                        </tr>
 
743
                                                                                <td>CME</td>
 
744
                                                                                <td>Coronal Mass Ejection</td>
 
745
                                                                        </tr>
 
746
                                                                        <tr>
 
747
                                                                                <td>Solar Flare</td>
 
748
                                                                                <td>Solar Flare</td>
 
749
                                                                        </tr>
 
750
                                                                        <tr>
 
751
                                                                                <td>Type II Radio Burst</td>
 
752
                                                                                <td>Type II Radio Burst</td>
 
753
                                                                        </tr>
 
754
                                                                        <tr>
 
755
                                                                                <td>Active Region</td>
 
756
                                                                                <td>Active Region</td>
 
757
                                                                        </tr>
 
758
                                                                        <tr>
 
759
                                                                                <td>GeneralActivityReport</td>
 
760
                                                                                <td>SOHO General Activity Report</td>
 
761
                                                                        </tr>
 
762
                                                                </table>
 
763
                                                        </div>                                                  
 
764
                                                </div>                                          
 
765
                                        </li>
 
766
                                        
 
767
                                        <br>
 
768
                                        
 
769
                                        <!-- Appendix B: Variable Types -->
 
770
                                        <li>
 
771
                                                <div id="VariableTypes">
 
772
                                                        Variable Types
 
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;">
 
775
                                                        
 
776
                                                                <!-- Observatories -->
 
777
                                                                <i>Observatories:</i><br><br>
 
778
                                                                <table class="param-list" cellspacing="10">
 
779
                                                                <tbody valign="top">
 
780
                                                                        <tr>
 
781
                                                                                <td width="25%"><strong>Type:</strong></td>
 
782
                                                                                <td width="45%"><strong>Description:</strong></td>
 
783
                                                                                <td><strong>Example:</strong></td>                                                                              
 
784
                                                                        </tr>
 
785
                                                                        <tr>
 
786
                                                                                <td>Integer</td>
 
787
                                                                                <td>An integer.</td>
 
788
                                                                                <td>12</td>
 
789
                                                                        </tr>
 
790
                                                                        <tr>
 
791
                                                                                <td>Float</td>
 
792
                                                                                <td>A floating point number.</td>
 
793
                                                                                <td>2.63</td>
 
794
                                                                        </tr>
 
795
                                                                        <tr>
 
796
                                                                                <td>String</td>
 
797
                                                                                <td>A string.</td>
 
798
                                                                                <td>SOH</td>
 
799
                                                                        </tr>
 
800
                                                                        <tr>
 
801
                                                                                <td>List</td>
 
802
                                                                                <td>A comma-separated list of some other type, usually strings or integers</td>
 
803
                                                                                <td>VSOService::noaa,GOESXRayService::GOESXRay</td>
 
804
                                                                        </tr>
 
805
                                                                        <tr>
 
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>                                                                                                                                            
 
809
                                                                        </tr>
 
810
                                                                        <tr>
 
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>
 
814
                                                                        </tr>
 
815
                                                                </tbody>
 
816
                                                                </table>
 
817
                                                                
 
818
                                                                <br><br>
 
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>
 
824
                                                                        <br>
 
825
                                                                </div>
 
826
                                                        </div>                                                  
 
827
                                                </div>                                          
 
828
                                        </li>
 
829
                                </ol>
 
830
                        </div>
 
831
                                        
 
832
                </div>
 
833
 
 
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>
 
836
                </div>
 
837
        
 
838
        </body>
 
839
</html> 
 
840
<?php
 
841
        }
 
842
?>