Overview
In order to facilitate third-party application developers who wish to use content from and interact with
Helioviewer.org, a number of APIs have been developed,
offering access to a variety of components used by Helioviewer. All of the interfaces are accessed using HTML query
strings. The simplest APIs require only a single URI, and result in some resource being returned, e.g. a movie or
JP2 image series, or some action being performed, e.g. loading a particular "view"
into Helioviewer. Some API methods are more complex and involve two steps. For example, in order to get a
list of solar events for a certain period of time, first a query is usually made to see which Feature Recognition
Methods (or FRMs) include events for that time period. A second query then returns a list of features/events are
fetched using a second query.
The general structure of queries is as follows:
The base URL is the same for each of the API methods (http://helioviewer.org/api/index.php). The "action" parameter is required for all requests and specifies the specific functionality to access. In addition, other parameters may also be required depending on the specific API being accessed. The one exception to this rule is the Custom View API which is accessed from http://www.helioviewer.org/index.php and does not require an "action" to be specified. Finally, the queries may be sent using either a GET or POST request. In both cases the result is a JSON object
Custom View API:
The custom view API enables the user to load a specific set of parameters into Helioviewer.org: "view," here, simply means a given set of observation parameters. This is useful for dynamically loading a specific view or observation into Helioviewer using a URL.
http://helioviewer.org/index.php?
Supported Parameters:
| date | ISO 8601 UTC Date | Date and time to display |
| imageScale | Float | Image scale in arc-seconds/pixel |
| imageLayers | 2d List | A comma-separated list of the image layers to be displayed. Each image layer should be of the form: [OBSERVATORY, INSTRUMENT, DETECTOR, MEASUREMENT, VISIBLE, OPACITY]. |
Example: http://helioviewer.org/index.php?date=2011-06-01T00:00:00Z&imageScale=2.4204409&imageLayers=[SDO,AIA,AIA,171,1,100],[SOHO,LASCO,C2,white-light,1,100]
Screenshots
The Screenshot API provides a way for users to create custom single-layer and composite images using Helioviewer.org. Depending on how you plan to use the screenshot, the process can be handled in either one or two steps. In the simplest case, takeScreenshot is called with "display=true" and an image is returned directly. Alternatively, when the display parameter is not set to true in the request an identifier is returned which can then be used by the downloadScreenshot method to display the image. This is useful when you want to provide a reusable link to the image you create.-
Creating a Screenshot
Returns a single image containing all layers/image types requested. If an image is not available for the date requested the closest available image is returned.
Usage:
http://helioviewer.org/api/index.php?action=takeScreenshot
Supported Parameters:
date ISO 8601 UTC Date Timestamp of the output image. The closest timestamp for each layer will be found if an exact match is not found. imageScale Float The zoom scale of the image. Default scales that can be used are 0.6, 1.2, 2.4, and so on, increasing or decreasing by a factor of 2. The full-res scale of an AIA image is 0.6. layers String A string of layer information in the following format:
Each layer is comma-separated with these values: [sourceId,visible,opacity].
If you do not know the sourceId, you can alternately send this layer string: [obs,inst,det,meas,opacity]. Layer strings are separated by commas: [layer1],[layer2],[layer3].y1 Integer The offset of the image's top boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversion. x1 Integer The offset of the image's left boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversions. y2 Integer The offset of the image's bottom boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversion. x2 Integer The offset of the image's right boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversions. display Boolean [Optional] If display is true, the screenshot will display on the page when it is ready. If display is false, the filepath to the screenshot will be returned. If display is not specified, it will default to true (Default=false). watermark Boolean [Optional] Whether or not the include the timestamps and the Helioviewer.org logo in the screenshot (Default=true).
Examples: http://helioviewer.org/api/index.php?action=takeScreenshot&date=2011-03-01T12:12:12Z&imageScale=10.52&layers=[3,1,100],[4,1,100]&x1=-5000&y1=-5000&x2=5000&y2=5000&display=true
http://helioviewer.org/api/index.php?action=takeScreenshot&date=2011-03-01T12:12:12Z&imageScale=10.52&layers=[SOHO,EIT,EIT,171,1,100],[SOHO,LASCO,C2,white-light,1,100]&x1=-5000&y1=-5000&x2=5000&y2=5000
-
Retrieving an Existing Screenshot
Displays the screenshot associated with the specified id.
Usage:
http://helioviewer.org/api/index.php?action=downloadScreenshot
Supported Parameters:
id int The screenshot id as returned from takeScreenshot.
Example: http://helioviewer.org/api/index.php?action=takeScreenshot&id=181
Feature/Event API:
Solar feature/event data used by Helioviewer is retrieved through the Heliophysics Event Knowledgebase (HEK). While the HEK includes a very rich and full-featured API of it's own, Helioviewer provides only a few simple but useful feature/event query methods. Each of these types of queries are described below.
-
Event Feature Recognition Methods (FRM):
Each event stored in the HEK has an associated Feature Recognition Method or "FRM" which corresponds with the mechanism used to locate the event. This could be either an automated feature recognition method such as Computer Aided CME Tracking (CACTus) or a simple user-submitted event. To query the list of available FRMs, simply call the "getEventFRMs" API method and specify a startDate and endDate. This will return a list of the FRMs for which event data exists in the requested time range, as well as some meta-information describing each of the FRMs.
Usage:
http://helioviewer.org/api/index.php?action=getEventFRMs
Supported Parameters:
startDate ISO 8601 UTC Date Beginning of query window. endDate ISO 8601 UTC Date End of query window.
Result:
The result includes a list of event types denoted by their two-letter acronym as listed at the HEK. Within each event type is a list of all FRMs for which events were found in the specified query window. Finally, for each FRM some basic information including the FRM name, id, url and contact information, along with the number of events matched are returned.
count Integer The number of events found for the associated FRM frm_contact String [Optional]E-mail address or name associated with the FRM frm_url String [Optional] The URL associated with the FRM
Example: http://helioviewer.org/api/index.php?action=getEventFRMs&startDate=2010-07-01T00:00:00.000Z&endDate=2010-07-02T00:00:00.000Z
Example Result:
{ "AR": { "NOAA SEC Observer": { "frm_url": "N/A", "frm_contact": "http://www.sec.noaa.gov/", "frm_identifier": "NOAA SEC", "count": 14 } }, "SS": { "EGSO_SFC": { "frm_url": "n/a", "frm_contact": "s.zharkov at sheffield dot ac dot uk", "frm_identifier": "EGSO_SFC", "count": 45 } }, "FL": { "SSW Latest Events": { "frm_url": "http://sohowww.nascom.nasa.gov/solarsoft/packages/gevloc/idl/ssw_flare_locator.pro", "frm_contact": "Samuel L. Freeland", "frm_identifier": "SolarSoft", "count": 13 }, "SEC standard": { "frm_url": "http://www.sec.noaa.gov/", "frm_contact": "SEC.Webmaster@noaa.gov", "frm_identifier": "SEC", "count": 13 }, "TRACE observer": { "frm_url": "http://hea-www.harvard.edu/trace/flare_catalog/", "frm_contact": "trace_planner at lmsal dot com", "frm_identifier": "TRACE flare catalog", "count": 1 } }, "FA": { "Karel Schrijver": { "frm_url": "n/a", "frm_contact": "Karel Schrijver", "frm_identifier": "Karel Schrijver", "count": 4 } } } -
Fetching or Creating Event Screenshots
Returns a collection of filepaths to screenshots of an event. If no screenshot files exist yet, it will create one or more depending on parameters, or will return an empty array if getOnly is set to true.
Usage:
http://helioviewer.org/api/index.php?action=getScreenshotsForEvent
Supported Parameters:
eventId String The unique ID of the event, as obtained from querying HEK.
Examples: http://helioviewer.org/api/index.php?action=getScreenshotsForEvent&eventId=AR211_TomBerger_20100630_175443
http://helioviewer.org/api/index.php?action=getScreenshotsForEvent&eventId=AR211_TomBerger_20100630_175443 -
Fetching or Creating Event Movies
Returns a collection of filepaths to movies of an event. If no movie files exist yet, it will create one or more depending on parameters.
Usage:
http://helioviewer.org/api/index.php?action=getMoviesForEvent
Supported Parameters:
eventId String The unique ID of the event, as obtained from querying HEK. ipod Boolean [Optional] Whether or not you are looking for the iPod-compatible movie or the regular movie. Defaults to false if not specified.
Examples: http://helioviewer.org/api/index.php?action=getMoviesForEvent&eventId=AR_SPoCA_20101007_085532_20100904T014848_1
http://helioviewer.org/api/index.php?action=getMoviesForEvent&eventId=AR211_TomBerger_20100630_175443&ipod=true
JPEG 2000 API:
Helioviewer's JPEG 2000 API's enable access to the raw JPEG 2000 images used to generate the tiles seen on the site, as well as real-time generation of JPEG 2000 Image Series (JPX).
-
JP2 Images:
Returns a single JPEG 2000 (JP2) image. If an image is not available for the date request the closest available image is returned.
Usage:
http://helioviewer.org/api/index.php?action=getJP2Image
Supported Parameters:
observatory String Observatory instrument String Instrument detector String Detector measurement String Measurement date ISO 8601 UTC Date Observation date and time sourceId Integer [Optional] The image source ID (can be used in place of observatory, instrument, detector and measurement parameters). jpip Boolean [Optional] Returns a JPIP URI instead of an actual image.
Examples: http://helioviewer.org/api/index.php?action=getJP2Image&observatory=SOHO&instrument=EIT&detector=EIT&measurement=171&date=2003-10-05T00:00:00Z
http://helioviewer.org/api/index.php?action=getJP2Image&observatory=SOHO&instrument=LASCO&detector=C2&measurement=white-light&date=2003-10-05T00:00:00Z&jpip=true -
JPX API
Returns a JPEG 2000 Image Series (JPX) file. The movie frames are chosen by matching the closest image available at each step within the specified range of dates.
Usage:
http://helioviewer.org/api/index.php?action=getJPX
Supported Parameters:
observatory String Observatory instrument String Instrument detector String Detector measurement String Measurement startTime ISO 8601 UTC Date Movie start time endTime ISO 8601 UTC Date Movie end time cadence Integer [Optional] The desired amount of time between each movie-frame, in seconds. If no cadence is specified, the server will attempt to select an optimal cadence. sourceId Integer [Optional] The image source ID (can be used in place of observatory, instrument, detector and measurement parameters). verbose Boolean [Optional] In addition to the JPX file URI, timestamps for each frame in the resulting movie and any warning messages generated are included in a JSON response. jpip Boolean [Optional] Returns a JPIP URI instead of an actual movie. linked Boolean [Optional] Returns a linked JPX file containing image pointers instead of data for each individual frame in the series. Currently, only JPX image series support this feature.
Result:
The default action is to simply return the requested JPX file. If additional information is needed, for example, then a JSON result will be returned with the file URI plus any additional parameters requested.
uri String [Optional] Location of the requested file. frames List [Optional] List of timestamps. error String [Optional] Any fatal error messages generated during the request warning String [Optional] Any non-fatal warning messages generated during the request
Examples: http://helioviewer.org/api/index.php?action=getJPX&observatory=SOHO&instrument=EIT&detector=EIT&measurement=171&startTime=2003-10-05T00:00:00Z&endTime=2003-10-20T00:00:00Z
http://helioviewer.org/api/index.php?action=getJPX&observatory=SOHO&instrument=MDI&detector=MDI&measurement=magnetogram&startTime=2003-10-05T00:00:00Z&endTime=2003-10-20T00:00:00Z&cadence=3600&linked=true&jpip=true
Notes:
-
If no cadence is specified Helioviewer.org attempts to choose an optimal cadence for the requested range and data source.
Movie API:
The movie API allows users to create time-lapse videos of what they are viewing on the website.
-
Movie API
Returns filepaths to a flash video and a high quality video consisting of 10-100 movie frames. The movie frames are chosen by matching the closest image available at each step within the specified range of dates, and are automatically generated using the Screenshot API calls.
Usage:
http://helioviewer.org/api/index.php?action=queueMovie
Supported Parameters:
startTime ISO 8601 UTC Date Desired starting timestamp of the movie. The timestamps for the subsequent frames are incremented by a certain timestep. endTime ISO 8601 UTC Date Desired ending timestamp of the movie. Time step and number of frames will be figured out from the range between startTime and endTime. imageScale Float The zoom scale of the images. Default scales that can be used are 0.6, 1.2, 2.4, and so on, increasing or decreasing by a factor of 2. The full-res scale of an AIA image is 0.6. layers String A string of layer information in the following format:
Each layer is comma-separated with these values: [sourceId,visible,opacity].
If you do not know the sourceId, you can alternately send this layer string: [obs,inst,det,meas,opacity]. Layer strings are separated by commas: [layer1],[layer2],[layer3].y1 Integer The offset of the image's top boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversion. x1 Integer The offset of the image's left boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversions. y2 Integer The offset of the image's bottom boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversion. x2 Integer The offset of the image's right boundary from the center of the sun, in arcseconds. This can be calculated, if necessary, with pixel-to-arcsecond conversions. numFrames Integer [Optional] The maximum number of frames that will be used during movie creation. You may have between 10 and 300 frames. The default value is 300. frameRate Integer [Optional] The number of frames per second. The default value is 8. display Boolean [Optional] If display is true, the movie will display on the page when it is ready. If display is false, the filepath to the movie's flash-format file will be returned as JSON. If display is not specified, it will default to true. watermark Boolean [Optional] Enables turning watermarking on or off. If watermark is set to false, the images will not be watermarked, which will speed up movie generation time but you will have no timestamps on the movie. If left blank, it defaults to true and images will be watermarked.
Examples: http://helioviewer.org/api/index.php?action=queueMovie&startTime=2010-03-01T12:12:12Z&endTime=2010-03-04T12:12:12Z&imageScale=21.04&layers=[3,1,100],[4,1,100]&x1=-5000&y1=-5000&x2=5000&y2=5000
http://helioviewer.org/api/index.php?action=queueMovie&startTime=2010-03-01T12:12:12Z&endTime=2010-03-04T12:12:12Z&imageScale=21.04&layers=[SOHO,EIT,EIT,304,1,100],[SOHO,LASCO,C2,white-light,1,100]&x1=-5000&y1=-5000&x2=5000&y2=5000
Appendices:
-
Supported Identifiers
This appendice contains a list of the identifiers supported by Helioviewer. For some queries, complex identifiers may be built up from the simpler ones below. For example, to uniquely identify a specific type of image, you must specify a comma-separated set of four identifiers: Observatory, Instrument, Detector, and Measurement. For example, to refer to an EIT 171 image, the identifier SOHO,EIT,EIT,171 is used.
Observatories:
Identifier: Description: SDO SDO (Solar Dynamics Observatory) SOHO SOHO (Solar and Heliospheric Observatory) STEREO_A STEREO_A (Solar Terrestrial Relations Observatory Ahead) STEREO_B STEREO_B (Solar Terrestrial Relations Observatory Behind)
Instruments:
Identifier: Description: AIA AIA (Atmospheric Imaging Assembly) EIT EIT (Extreme ultraviolet Imaging Telescope) HMI HMI (Helioseismic and Magnetic Imager) LASCO LASCO (Large Angle and Spectrometric Coronagraph Experiment) MDI MDI (The Michelson Doppler Imager) SECCHI SECCHI (Sun Earth Connection Coronal and Heliospheric Investigation)
Detectors:
Identifier: Description: AIA AIA (Atmospheric Imaging Assembly) C2 LASCO C2 C3 LASCO C3 COR1 Coronagraph 1 COR2 Coronagraph 2 EIT EIT (Extreme ultraviolet Imaging Telescope) EUVI EUVI (Extreme ultraviolet Imager) HMI HMI (Helioseismic and Magnetic Imager) MDI MDI (The Michelson Doppler Imager)
Measurements:
Identifier: Description: 94 94 Ångström 131 131 Ångström 171 171 Ångström 193 193 Ångström 195 195 Ångström 211 211 Ångström 284 284 Ångström 304 304 Ångström 335 335 Ångström 1600 1600 Ångström 1700 1700 Ångström 4500 4500 Ångström white-light White-light continuum Intensity spectrogram magnetogram Magnetogram
Event Types:
Identifier: Description: CME Coronal Mass Ejection Solar Flare Solar Flare Type II Radio Burst Type II Radio Burst Active Region Active Region GeneralActivityReport SOHO General Activity Report -
Variable Types
This appendice contains a list of some of the variable types used by the Helioviewer API's.
Type: Description: Example: Boolean A boolean value. true Integer An integer. 12 Float A floating point number. 2.4 String A string. SOHO List A comma-separated list of some other type, usually strings or integers VSOService::noaa, GOESXRayService::GOESXRay 2d List This is similar to a list except that each item of the list is a bracket-delineated list itself. [SOHO,EIT,EIT,171,1,100],[SOHO,LASCO,C2,white-light,0,100],[SOHO,MDI,MDI,continuum,1,50] Unix Timestamp The number of seconds since January 1, 1970, midnight UTC. (see [1]) 1065512000 // October 7th 2003, 7:33:20 UTC ISO 8601 UTC Date ISO 8601 is a widely supported standarized date format. (See [2], [3]) 2003-10-05T00:00:00Z // Note the "Z" at the end. This specifies that this is a UTC datetime
References:
[1] Epoch Converter - Unix Timestamp Converter
[2] ISO 8601 - Wikipedia
[3] Date and Time Formats - W3.org
-
Working with Coordinates in Helioviewer.org
Overview
Several of the API methods supported by Helioviewer.org require you to specify a rectangular region of interest or "ROI", which is simply the portion of the image or movie you are interested in.
There are two different methods for specifying region of interest (ROI) in Helioivewer.org API requests. The first method is to specify the coordinates for the top-left and bottom-right corners of the ROI in arcseconds. The other option is to specify the position of the center of your ROI in arcseconds and the dimensions for the ROI in pixels. In either case you will also need to specify an image scale in arcseconds per pixel. This appendix provides a description of how each of these methods can be used in API requests, and how to determine the appropriate arcsecond values to use to reach a desired effect.Arcseconds
The first method for specifying an ROI in a Helioviewer.org API request is to specify the coordinates for the top-left (x1, y1) and bottom-right (x2, y2) corners of the ROI in arcseconds, with the origin at the center of the Sun. The below image depicts the location of the origin, and the direction of the axes, for this style request.
To makes things more clear, below are some example requests, and the imageScale and ROI corresponding with that request.
Examples:
1) A complete AIA image at 1/16 its natural resolution (zoomed out four times)In this case the desired image scale is 2^4 x (natural scale) = 16 x 0.6 = 9.6. Now to determine the ROI coordinates, we must first determine how large the image will be at the specified scale. AIA is normally 4096x4096, so at 1/16 its natural resolution it will be 256x256 pixels. Since the origin is in the middle of the Sun (which here is in the middle of the Sun), there top-left corner is 128 pixels up and to the left (-128, -128), and the bottom-right corner is 128 pixels down and to the right (128, 128). Since the ROI must be specified in arcseconds, and not in pixels, we multiply by the desired imageScale: 128 x 9.6 = 1228.8.
URL: http://helioviewer.org/api/?action=takeScreenshot&date=2011-06-21T00:00:00.000Z&layers=[SDO,AIA,AIA,304,1,100]&imageScale=9.6&x1=-1228.8&y1=-1228.8&x2=1228.8&y2=1228.8&display=true
2) The top-right quadrant of an EIT image at 200% magnificationFirst, determine the desired image scale = 1 / 2^1 x (EIT native image scale) = 1/2 x 2.63 = 1.315. At this scale, the image which would normally be 1024x1024 pixels is now 2048x2048 pixels, and the coordinates for the ROI in pixels would is (0,-1024), (1024,0). To convert to arcseconds we multiple the pixel values by the arcsecond/pixel ratio (the imageScale) to get (0, -1346.56), (1346.56, 0).
URL: http://helioviewer.org/api/?action=takeScreenshot&date=2011-06-21T00:00:00.000Z&layers=[SOHO,EIT,EIT,171,1,100]&imageScale=1.315&x1=0&y1=-1346.56&x2=1346.56&y2=0&display=trueFinally, don't forget that you can use Helioviewer.org to check the coordinates and see if they are as you expect. Pressing the "m" key will return the position of the mouse pointer in Helioviewer.org viewport. Initially, the coordinates will be displayed in arcseconds. Note, however, that the y-axis value displayed for mouse-coordinates has the opposite sign to that passed in API requests. This is because the mouse position is returned in a coordinate system which is commonly used in solar physics. To get around this you can simply flip the sign for the y-coordinate you see on Helioviewer.org when mouse-coordinates are being displayed.
Pixels
Alternatively, if you prefer to explicityly specify the pixel dimensions for the image or movie, you can specify the center of your ROI in arc-seconds (x0, y0), relative to the center of the sun, and the width and height of the ROI in pixels. Although you are still required to work with Arcseconds for this method for some of the parameters, this provides a simple way to ensure that the resulting image or movie is a specific size in pixels.
Similar to the first method, you will also need to specify the image scale to use, in arcseconds/pixel.
Examples:
1) A complete EIT image at it's natural resolutionAccording to the table of image scales shown below, the native image scale for EIT is 2.63 arcseconds/pixel, and the image dimensions are 1024 x 1024 pixels.
URL: http://helioviewer.org/api/?action=takeScreenshot&date=2011-07-07T00:00:00.000Z&layers=[SOHO,EIT,EIT,171,1,100]&imageScale=2.63&x0=0&y0=0&width=1024&height=1024&display=true
2) A 1024 x 768 sub-region centered at the top-right corner of an AIA 131 image, centered at the top-right quadrant, and the natural scale of AIA.Since we want to center the image in the top-right corner, we need to figure out what arcsecond coordinates correspond to the pixel coordinates (1024, -1024). At its native resolution, AIA images have an image scale of 0.6 arcseconds/pixel, so we multiple the pixel coordinates by this ratio to get the corresponding arcsecond values.
URL: http://helioviewer.org/api/?action=takeScreenshot&date=2011-07-07T00:00:00.000Z&layers=[SDO,AIA,AIA,131,1,100]&imageScale=0.6&x0=614.4&y0=-614.4&width=1024&height=768&display=trueImage Scale
When working with coordinates in Helioviewer.org, it is also important to understand the spatial scale of the images you are viewing and requesting. Each type of image (AIA, LASCO, etc) shows the Sun at some spatial scale or resolution. That is, each image pixel represents a certain number of arcseconds, and that ratio of arcseconds to pixels is refered to as the "image scale" for that image. Each of the different image types have their own native image scale, which is the number of arcseconds a pixel of the image represents when viewed at its native resolution. Below is a table listing the average native image scales and dimensions (in pixels) for images found on Helioviewer:
Image Type: Dimensions (pixels) Image Scale (arcseconds/pixel) AIA 4096 x 4096 0.6 COR-1 512 x 512 15.0 COR-2 2048 x 2048 14.7 EIT 1024 x 1024 2.63 HMI 4096 x 4096 0.6 LASCO C2 1024 x 1024 11.9 LASCO C3 1024 x 1024 56 MDI 1024 x 1024 1.985707
Note: The values listed above are average values. Often, the image scale and dimensions for a given type of image tends to stay the same over time, and as such you can often use the above values as-is. Occasionally, however, the scale or dimensions will vary. If you find that you are getting unexpected results, or would like a higher level of precision, you should first use the getClosestImage method to determine the exact dimensions and scale for the image you are requesting.The smaller the (native) image scale is, the more detail you can see. For example, AIA has a much smaller native image scale (0.6"/px) than EIT does (2.63"/px) which is why you can see a lot more detail in AIA images.
You are not limited to creating screenshots and movies at an image's native resolution, however, and so in an API request the imageScale specified need not (and in the case of composite images, often cannot) be the same as an images native resolution.
For example, suppose you wanted to request an AIA image that is "zoomed out" by a factor of two. In this case, you would double the imageScale, so instead of 0.6, you would request an image scale of 1.2. Simiarly, when making a request which includes multiple layers, each of the layers will be scaled to match the imageScale you requested.
-