This repository contains the code for the backend of the Helioviewer Timeline Project.
- JDK 8 and set JAVA_HOME to its installation folder.
- Gradle
- Open a terminal, PowerShell, ... and execute
git clone https://github.com/stby4/helioviewer-visualisation.git heliovis-back
. - Install the .editorconfig plugin for your preffered editor (we recommend VSCode or IntelliJ).
- Open the
heliovis-back
directory with your editor. - Execute
gradle runImporter
in your terminal, PowerShell, ... to create your database for the first time.
Project folder | Content |
---|---|
api | Web servlet for a data API to the database. |
config | Stores global settings, e.g. path to database. |
database | Handles access to the memory mapped files, offers read / write access. |
importer | Downloads files with X-ray flux data from various sources, updates database. |
api | Web servlet for a data API to the database. |
gradle runImporter
starts the download of all required data from the NOAA servers. This might take several hours. Only needs to be executed once.gradle runUpdater
updates the database.gradle appRunDebug
starts an Jetty server for the API.- Alternatively,
gradle tomcatRunDebug
starts a Tomcat server for the API. gradle api:war
builds /api/build/libs/api.war for deployment on a server.
After starting a server with gradle appRunDebug
, you can listen on communicate with the server on port 5005. Use the VS Code debugger and the Debug (Attach)
launch configuration to start debugging.
Example request: http://localhost:8080/api/?from=1009843200000&to=1528927023999&points=2926
Parameter | Description | Valid values |
---|---|---|
from | Sets the start date for the time series. | UNIX timestamp in milliseconds, any time |
to | Sets the end date for the time series. | UNIX timestamp in milliseconds, any time larger than "from". |
points | Sets the amount of returned data points. This is only a maximum number, the amount of actually returned data points can be lower. | Any integer value larger than 0. |
The response is json formatted:
[
["timestamp in milliseconds", "flux value in Watts/m^2"],
...
]