Giter Club home page Giter Club logo

rvc_rails's Introduction

RVC Rails Backend

Dependencies

  1. Postgresql-9.4 (http://www.postgresql.org).
  2. Ruby-2.2.X (http://www.ruby-lang.org).
  3. Rails-4.2.X (http://www.rubyonrails.org)

Setting up the database

You must have Postgresql-9.4 installed, and have the PG gem installed. Run Bundle install in your command line to install the PG gem.

The database configuration does not have a username and password set (see config/database.yml). Depending on how you have configured Postgresql, this may cause problems in creating a database. In order to create and update the database it is suggested that you create a user with login and createdb privileges, then set the PGUSER and PGPASSWORD environmental variables to that username and password. You can add the following to your .bashrc or .bash_profiles file if you want:

export PGUSER=<your username>
export PGPASSWORD=<your password>

If you are using Ubuntu, you might want to look at this help article to install Postgres and get it set up with md5 authentication.

Adding Data to the Database

Adding Sample (AR) Data

  1. Create a csv (comma seperated values) file of analysis ready data (AR2.0). use the analysisready package (http://github.com/harryganz/analysisready) if necessary. Each file should contain sample data for all species in a given year and region. DO NOT include more than one year or region in an individual AR2.0 file.
  2. Compress each file into a zip file. DO NOT include more than one csv in a zip file.
  3. Rename the csv and zip files to match the following convention: <region_abbreviation><year>.<file_extension>. The region abbreviations are: fk - Florida Keys, dt - Dry Tortugas, sefcri - Southeast Florida Coral Reef Initiative. For example, sample data from the Florida Keys in 2012 in zip format will be names "fk2012.zip". Sample data from 2004 in the Dry Tortugas in csv format will be names "dt2004.csv". NOTE: Each region/year should have two files: a csv file, and a zip file.
  4. Place the csv and zip files directly into the sample_data subdirectory of the public directory of this Rails application.

Adding Stratum (NTOT) Data

  1. Create a csv file with columns named: "YEAR","REGION", "STRAT", "PROT", "NTOT" (number of possible primary sampling units), and "GRID_SIZE" (side length of a primary sample unit, in meters). DO NOT include more than one year and region in a single ntot file.
  2. Rename the file according to the following convention: ntot_<region_abbreviation><year>.csv.
  3. Place the csv file(s) directly into the stratum_data directory of the public folder of this Rails application.

Adding Taxonomic Data

  1. Create a csv file with columns named: "SPECIES_CD","SCINAME","COMNAME","LC", "LM","WLEN_A","WLEN_B". Where SPECIES_CD is the first three letters of the generic name and first four letters of the specific name, SCINAME and COMNAME are the scientific and common name, respectively, LC is the length at capture (in cm), LM is the median length at maturity (in cm), WLEN_A is the alpha coefficient of the allometric growth equation in g/mm, and WLEN_B is the beta coefficient of the allometric growth equation.
  2. Rename the file to taxonomic_data.csv
  3. Save the file to the taxonomic_data subdirectory of the public folder of this Rails application.

rvc_rails's People

Contributors

jeremiaheb avatar

Watchers

Harry Ganz 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.