Code Monkey home page Code Monkey logo

biositing's Introduction

BioSiting_tool_LBL

The tool is located at https://biositing-tool-heroku.herokuapp.com/.

Input Data

All the input data are currently stored in the GIS_data folder.

The data is stored in excel form inside the data_biositingtool_withwetweight.xlsx file. Each sheet of the excel file represents various biomass and energy data. The sheet labeled key includes information on the traslation of the column names and data sources. The sheet labeled file transfer includes the name of the shapefile that stores the information of the location of each point.

You can change the values in any sheet of the excel file BUT you cannot alter the column names or add new sheets without editing the code.

The location data is stored in shapefiles in the Shapefile_Drafts folder. They are combined with the data in the data_biositingtool_withwetweight.xlsx automatically through the Data_processing.py script. The Data_processing.py reads all the data from the data_biositingtool_withwetweight.xlsx and merges each sheet with its corresponding shapefile. It also does some data preprocessing, e.g. calculating total biomass for each county and total biomass of each type so it can be easily accessible to the user when hovering over counties and exporting data. The output of this script is stored as csv files in the final_data folder. This is where the biositing tools reads the information from.

Update Data

  • To save your changes into the remote Heroku repository, you need to be added as a collaborator first. Follow steps in the Run on Heroku server section. Once you have access to the heroku repository edit the data as needed and follow the steps below.
  • Update any of the data directly into the data_biositingtool_withwetweight.xlsx.
  • Open your terminal window and navigate into the BioSiting_tool folder.
  • Run python Data_processing.py. This will take a few minutes.
  • To save your changes into the remote Heroku repository, run git add ., git commit -m "data update" and git push heroku master to send the updated data on the server.
  • If you are running the tool locally with Docker, you will need to uninstall and reinstall your docker to include the new data before re-running (see Run Locally with Docker section).

Run on Heroku server

The tool is currently hosted on heroku server.

To access the code on the server please email [email protected] to be added as a collaborator. Once access has been grated you can get a local copy of the code to make changes.

  • Open your terminal and inside the local repository run heroku git:remote -a biositing-tool-heroku. This will connect the heroku server to your local computer.
  • Once edits are made add, commit and push your edits back to the heroku server (see Update Data section).

Run Locally with Docker

Model Dependencies

The core of the Biositing model is written in Python 2.7. The model can be run through docker. Docker will take care of the dependencies and will create an instance of the tool locally on your computer. Please install Docker to be able to run the model.

Start a local instance

The tool can be run through docker. After you have installed the dependencies you can run a local instance of the webtool. Follow these steps:

  • Install Docker.
  • Run Docker on your computer. Double-click Docker.app to run and if successfull, a whale icon will appear in the top status bar that indicates that Docker is running, and accessible from a terminal.
  • Clone this repository.
  • Navigate your terminal inside the repository.
  • Generate a docker image by running docker build -t flask-biositing-model:latest . in your terminal. You only need to perform this stem ONCE - only the first time you install the Biositing model (this will take a few minutes). To run the model skip to the next step.
  • Start your container by running docker run -d -p 5000:5000 flask-biositing-model in your terminal.
  • Navigate to localhost:5000 in Chrome or your favorite browser.
  • and Done! Easy!

Uninstall

As it is a work in progress you would need to uninstall this version before updating to an up-to-date future version. To completely uninstall please follow the steps in your terminal:

  • Navigate your terminal inside the repository.
  • Run docker kill $(docker ps -q) and docker rm $(docker ps -a -q) to remove all the containers.
  • Run docker rmi $(docker images -a -q) to remove the current version.
  • To reinstall redo all the steps detailed in the Start a local instance section

biositing's People

Contributors

okavvada avatar

Watchers

James Cloos avatar  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.