Coder Social home page Coder Social logo

2021-climatearchive's Introduction

2021-ClimateArchive

Overview

The goal of this project is to give researchers easy access to complex climate data with the climatearchive.org web
application as a front end and our software solution as the backend to provide access to the data. The website
currently visualises the research data in 3D, however quantitative access to the underlying data is needed to improve
interdisciplinary research. We will provide a solution which filters the database and produces smaller data subsets
which could then be downloaded/visualised from the browser.

Stakeholders

The typical stakeholders for this project will be researchers, or other people who may be interested in the data,
who may not be particularly tech savy.

Researchers
Individulas interested in the data

Sebastian
Coders (us)

User Stories

A researcher / individual interested in the data, I should be able to:
    -select a point on the globe on the alreadyprovided climate change model in order to extract point data for a selected location and time period.
    -view and compare graphs generated from comparing these data points.
    -download datasets generated from certain parameters
    -share datasets/graphs generated at specific points with other individuals

Note: we are mainly working on our client's private repository to add features to climatearchive.org and on a backend server to provide access to underlying climate data.


Usage

The server can be downloaded from the releases tab or built from source.

Building from source

Download the source code using

git clone https://github.com/spe-uob/2021-ClimateArchive.git

Compile into a jar file using

cd 2021-ClimateArchive

mvn package -DskipTests

This will save climateArchive.jar in the target directory

Running

First place climateArchive.jar into your chosen directory.

Create a config folder using in the same directory with mkdir config

Create the file application.properties in the config file

In this file enter the config

data_location=<path to climate data>

Add additional config

The server can now be started by running java -jar climateArchive.jar

Running as a service

To have the program running in the background on a linux machine you can use a service. These instructions are only tested on ubuntu but should work on other distributions, maybe with some small modifications

Create the file /lib/systemd/system/climate_archive.service and paste the following

[Unit]
Description=climate archive data api

[Service]
WorkingDirectory=<path to climateArchive.jar>
ExecStart=java -jar climateArchive.jar
User=<user>

[Install]
WantedBy=multi-user.target

Now the service can be started by running

systemctl daemon-reload
systemctl start climate_archive.service

Adding models to the server

The server can only access models which have been added to the database. They can be added through the commandline using the command

java -jar climateArchive.jar --add_models --models=<models to add seperated by ",">

The separator used can be changed by setting the model_sep property in application.properties

Model template formats are taken from the model_templates property in application.properties with the template fulfilling the most fields being picked.

Templates should be in the following format

<Climate_Archive_Model_Template>/climate/<Climate_Archive_Field_Template>.nc

<Climate_Archive_Model_Template> will be replaced with the name of the model and <Climate_Archive_Field_Template> will be replaced with the field being requested

The filled in template will be added to the data_location path when fetching data

Additionally:

  • <Climate_Archive_Model_Template> is the model name with case as given from the command line
  • <CLIMATE_ARCHIVE_MODEL_TEMPLATE> is the model in upper case
  • <climate_archive_model_template> is the model in lower case
  • <Climate_Archive_Field_Template> is the field with case as given
  • <CLIMATE_ARCHIVE_FIELD_TEMPLATE> is the field in upper case
  • <climate_archive_field_template> is the field in lower case

The separator used can be changed by setting the model_templates_sep property in application.properties


Examples of templates

For example given that the model is Model and the field is Example using the following template

<Climate_Archive_Model_Template>/climate/<climate_archive_model_template>.pdcl<Climate_Archive_Field_Template>.nc

The filled in template will be

Model/climate/model.pdclExample.nc

For a more extreme example given that the model is Model and the field is Example using the following template

<Climate_Archive_Model_Template>/<CLIMATE_ARCHIVE_MODEL_TEMPLATE>/<climate_archive_model_template>/<Climate_Archive_Field_Template>/<CLIMATE_ARCHIVE_FIELD_TEMPLATE>/<climate_archive_field_template>.nc

The filled in template will be

Model/MODEL/model/Example/EXAMPLE/example.nc

This will then be added to the data location path when reading the file

Config

The following properties can be specified in the config file.

Property Description Default Value
data_location The path to the folder containing all models ./data
model_separator The separator used for splitting the list of models (regex) ,
allowed_cors A list of origins which can call the api. They must be seperated by the allowed_cors_separator and formatted according to the spring documentation *
allowed_cors_separator The separator used for splitting the list of origins in allowed_cors (regex) ,
server.port The port that will be used by the api 8080
model_templates The list of model templates which should be used when adding new models <Climate_Archive_Model_Template>/<Climate_Archive_Field_Template>.nc
model_templates_separator The separator used for splitting the list of model templates (regex) ,
fields The list of fields the server will use to fetch model .nc files ann,jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
fields_separator The separator used for splitting the list of fields (regex) ,
variables The list of variables the server fetches for each model temp_mm_1_5m,precip_mm_srf
variables_separator The separator used for splitting the list of variables (regex) ,

When making any changes to the config file any instances of the server must be restarted for the changes to have any effect. If using a linux service this can be done by running systemctl restart <service name>

HTTPS

To enable HTTPS on the server a security certificate must be created. This must be saved in a keystore in the same directory as the .jar file.

Then in the application.properties file set the following properties:

Property Description
server.ssl.key-store-type The format of the keystore
server.ssl.key-store The path to the keystore containing the certificate
server.ssl.key-store-password The password for the keystore
server.ssl.key-alias The alias mapped to the certificate
server.ssl.key-password The password used to generate the certificate
server.ssl.enabled Whether to enable https. Set this to true

This will now block all requests using HTTP and require HTTPS

2021-climatearchive's People

Contributors

hn20191 avatar ikennaoais avatar matthewjackswann avatar navratilj avatar patrick1ee avatar

Stargazers

 avatar

Watchers

 avatar

2021-climatearchive's Issues

Secure your application

This week you should begin to secure your application with whatever security you deem appropriate and can justify, this could be an SLL certificate, properly setting up CORS for an API, using JWT to identify users etc.

Click functionality

double-click on globe should trigger THREDDS data server query to get 12 monthly mean values of surface temperature and precipitation at the selected location (we will add more variables later on).

Response from query should be passed to function which will display data

Add persistent storage

If applicable - Connect your frontend and backend via something such as a REST API.

Also add persistent storage to your backend, likely in the form of a database. The type of database you choose to use is up to you.

Prepare for presentation/MVP

This is the last week before your presentations are due, try to fix any bugs and finish features before creating your presentation and submitting your MVP checklist.

Create documentation

This week you should aim to create some documentation for your project, specifically an architecture, class and sequence diagram.

You should think about creating a ‘docs’ directory to keep your repo organised.

Sign appropriate contract

Contracts can be found in the SPE2021 repo under "Project Initiation". You need to select the appropriate contact for your project, have everyone on the team sign it, and then send it to the client to sign.

Custom Paths for NC files

Allow the datasets to have different structures rather than just the provided ones. Save this in the SQLite DB

Displaying received data

data received from THREDDS server should be displayed next to the globe (maybe split bootrstrap row 2/3 (globe) vs 1/3 (THREDDS data)

a good start would be to have a xy-plot (a line) of temperature or precipitation against calendar month
plotting should be done with D3.js (library already installed); example: https://climatecharts.net/

Add CI to your project

Add continuous integration (CI) to your project. circleci.com is a popular option which you may want to look at.

If you do not have permission to add this, have the team secretary message me on teams and I will sort it out.

Add license to GitHub

Between the team and client you should choose a license that suits for your project and add it to your GitHub repo. This website gives some basic guidance but don’t feel limited to licenses shown here https://choosealicense.com

Hello World! Running in your chosen stack

This week you should aim to have a “Hello World!” program running in your chosen technology stack. All team members should have this running on their machine to identify any issues.

A README.md with setup and deployment instructions should also be created.

IBM Cloud Deployments

Hi all,

As you know, we are using IBM cloud this year for hosting web-apps and back-ends.
Some of you have already encountered issues where you are unable to access your apps from the provided URL.

The script has been updated to resolve this.
It now provisions a subdomain per project which will prevent conflicts.

You can download the new script here

The deployment instructions are the same as before.

If you've already created a pipeline then all you need to do is download the new script and commit it and everything will get updated.

If you have any queries or issues with this please feel free to reach out to me either by [emailing [email protected]](mailto:[email protected]?subject=IBM Cloud ) or creating and issue and @-ing me (@danjones1618)

Thanks,
Dan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.