Giter Site home page Giter Site logo

souley / lofar_workflow_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from process-project/lofar_workflow_api

0.0 2.0 0.0 69.19 MB

Continuation of https://github.com/EOSC-LOFAR/lofar_workflow_api for PROCESS

License: Apache License 2.0

Python 21.90% Jupyter Notebook 18.74% HTML 5.93% JavaScript 53.43%

lofar_workflow_api's Introduction

Readme for LOFAR pipeline REST API

This project has been continued as part of PROCESS.

This is an experiment to see if we can make the LOFAR data more accessible. This is a django REST api using the django rest_framework.

Get it working

  • Download this repo
  • Create a venv in which you want to do your things (using python3) or use conda
  • Install django (e.g. pip install django)
  • Install the rest_framework (e.g. pip install djangorestframework)
  • Install all the pipelines (as of 27JUN18 this is: https://github.com/EOSC-LOFAR/LGPPP_LOFAR_pipeline)
  • Navigate to the folder containing the manage.py
  • Start your local host: python manage.py runserver
  • You can now send http requests to the localhost:8000. For example in your browser: localhost:8000/sessions/

Install

Requirements:

Run the following commands to install

git clone https://github.com/EOSC-LOFAR/lofar_workflow_api.git
cd lofar_workflow_api
pipenv install
pipenv shell
cd lofar_workflow_api/

Run

Start web service with following command:

python manage.py runserver

Goto http://localhost:8000/sessions

Follow an example

Check out the jupyter notebook: example_for_lofar_pilot_REST_api.ipynb.

Current models in the api

  • Session: a session that will run a pipeline on an observation
  • pipelineschemas: this gives you a list with implemented pipelines and configuration schemas.
  • A post of a session using the request package could look like this:
	data = {
			"email": "[email protected]",
			"description": "Add your description to figure out later what this is.",
			"pipeline" : "LGPPP_LOFAR_pipeline",
			"config": "{\"avg_freq_step\": 1, \"avg_time_step\": 1, \"do_demix\": 1, \"demix_freq_step\": 1, \"demix_time_step\": 1, \"demix_sources\": 1, \"select_NL\": 1,\"parset\": 1}",
			"observation": "an observation code",
			}
	response = s.post('http://localhost:8000/sessions/', data=data)
  • You can do a get to pipelineschemas to get a json with pipelines and their schemas like this:
	response = s.get('http://localhost:8000/pipelineschemas/')
	response_data = response.json()
	pp.pprint(response_data)

Adding your own pipeline

Please follow the intructions at the pipeline template python package: https://github.com/EOSC-LOFAR/LOFAR_pipeline_template

lofar_workflow_api's People

Contributors

bldevries-escience avatar hannospreeuw avatar sverhoeven avatar vadithya1989 avatar

Watchers

 avatar James Cloos avatar

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.