Giter Site home page Giter Site logo

fmu_storage's Introduction

libecl Build Status

This is a small start of a WEB application which can be used to store and manage FMU simulations. The only app in the project currently is 'simulation', which can store one Eclipse simulation. Further work will typically include an 'ensemble' app with realisations and so on.

Getting started

Before the web application can start you need to install the requirements:

pip install -r requirements

Then you need to set the environment variables DJANGO_SETTINSG_MODULE, DATABASE_URL and STORAGE_ROOT. See the template file init_env_template which can be used as starting point for a file to source.

The default setup assumes that you are just using sqlite, if you wish to use another database like e.g. postgres you will need to install driver for that and also create the database first.

When you have set up your environment correctly you can run the tests with:

./manage.py test

And then afterwards you can start a webserver on localhost with:

./manage.py runserver

Configure postgres

Change identity to user posgtgres:

cmd% sudo su - postgres
  1. Create a new user (role):

    cmd% createuser fmu-storage -P
    Enter password for new role: <password>
    Enter it again: <password>

    As indicated the createuser program will prompt for a password.

  2. Create a new database - owned by the new user:

    cmd% createdb fmu-storage --owner=fmu-storage

After these steps you should have made a database with name fmu-storage and user with credentials (fmu-storge, password). These three values should be part of the DATABASE_URL connection string - see the section about environment variables. Log out of the postgres account and test the connection:

bash% psql fmu-storage -U fmu-storage  -h localhost

To actually get contact to the postgres database server you probably also have to configure access through the pg_hba.conf file.

URLs

/simulation/view/$ID/           : View a simulation - just a "summary" of the results available
/simulation/upload/             : A web form to upload results.

Very simple views to look at summary, data, init, restart and grid files.

/simulation/summary/view/$ID/
/simulation/data/view/$ID/
/simulation/init/view/$ID/
/simulation/restart/view/$ID/
/simulation/grid/view/$ID/

Download files:

/simulation/data/download/$ID/
/simulation/grid/download/$ID/
/simulation/init/download/$ID/
/simulation/restart/download/$ID/

API urls:

/api/simulation/summary/data/$ID/?key=FOPT&key=WWCT:OP_1&key=RPR:3&time_interval=1M
/api/simulation/parameters/data/$ID/
/api/simulation/upload/

For the /api/simulation/summary/data/$ID/ url the query parameters are:

key='FOPT' - this a valid summary key, you can have multiple of these. You will get Http404 if you ask for a non-existing key,

keys='F*' - this will expand to all keys matching the pattern 'F*'.

time_interval=1M - this specifies the time resolution. It understands the strings 'D', 'M' and 'Y' for days, months and years respectively - with a numeric prefix. So the following query string will get the total oil prodction (FOPT) and all the watercuts (WWCT:*) sampled at 3 month intervals:

key=FOPT&keys=WWCT:*&time_interval=6M

Admin: auto generated DJango admin:

/amdin/

Adding simulation results

You can add simulation results interactively with the management command:

./manage.py add_simulation /path/to/case

or only summary data with:

./manage.py add_summary /path/to/case

fmu_storage's People

Contributors

joakim-hove avatar

Watchers

 avatar  avatar

Forkers

thorvaldj

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.