Example RESTful space weather service implemented as drupal module

This is an example drupal module which provides a "RESTful" space weather service. It is used to provide data for the JavaFx Planetary Kp barchart.

If you are unfamiliar with the process of developing a drupal module,  you might want to first read the article "Creating modules - a tutorial:Drupal 6.x".

Download file: 

A JavaFx Planetary Kp barchart applet - Part 3

This article discusses the code to retrieve Planetary Kp data from a drupal webservice.  Previously in Part 1 was a discussion of Planetary Kp data itself. Part 2 was a discussion of the code to create a bargraph to display the data.

A couple classes are defined to represent the data to be retrieved.  The first is called SpaceWeatherData which is a container for the time series data. Class variables start and end are used to store the start and end times of the data retrieved. The variable dataType is used to represent the type of data contained is in this case equal to  "Kp".
 The variable vals is an array containing TimeSeriesData

A JavaFx Planetary Kp barchart applet - Part 2

In the previous article in this series, a Planetary Kp bar chart graph was presented and there was brief description of the Kp index.

The Planetary Kp bar chart displays time-series data. A Planetary Kp data item consists of a date-time and an index value  -- nothing more, nothing less. On this chart, we want to display data for an interval of 4 days with a bar for each 3 hour period. Here a Barchart.Series is defined for each 3 hour interval:

A JavaFx Planetary Kp barchart applet - Part 1

The JavaFx platform includes components that support creation of several types of charts for visualizing data.  In this series of articles I'll take a look at how the charting components can be used to display data that changes over time. 

For example, the bar chart below is displaying the Planetary K Index for the last four days. The Planetary K index shows the disturbance of the geomagnetic field measured by an instrument called a magnetometer. The K-index scale has a range from 0 to 9 and is directly related to the maximum amount of fluctuation (relative to a quiet day) of the geomagnetic field over a three-hour interval. The estimated Kp index is computed by the United States Airforce Weather Agency and distributed to the public by the NOAA Space Weather Prediction Center in Boulder, CO.

 

 

 

 

 

The Kp index is useful information for people who are interested in viewing aurora. The higher the index the further south the aurora may be observed. 

 

JavaFx within a drupal page

Below is a simple test JavaFX applet that confirms that JavaFx applets can indeed run within a drupal page.  I'm hesitant to admit that I had more difficulty with this than I should have -- it is fairly easy to get wrong and difficult to figure out why it doesn't work.

Here is my approach:

Syndicate content