Giter Club home page Giter Club logo

vat's Introduction

vat

Visualizing Atlantis Tool Build Status

vat is an interactive R package used with the Atlantis ecosystem model.

An example of vat from the Icelandic Atlantis model can be seen here. Note, that the Atlantis model in that example is a work-in-progress.

To install:

library(devtools)
install_github(repo = "mareframe/vat")

If you have installed Atlantis on the machine where you want to run vadt, you should have all necessary tools.

Windows users that are getting errors installing ncdf4, please see this page on the wiki.
If you are a Mac user and are getting installation errors, please make sure that the command line tools for Xcode are installed.

How to run vat

To run the interactive Shiny application for vat, named vadt for visualizing Atlantis diagnostic tool. You need to running the following sequence of functions.

  1. create_vadt(). This creates an object of class vadt containing all the data needed for vadt().

  2. animate_vadt(). This function creates optional animated plots for vadt().

  3. vadt(). This is the function that launches the actual Shiny application.

Please see each functions respective manpage for details on its usage. For example, ?create_vadt and ?vadt in R.

At present vat is a moving target. We welcome all feedback on it's UI as well as any additional features, you would like to see added. Please report issues and feature requests. Once the vadt UI is frozen and when work in the Icelandic Atlantis model moves onto data presentation for stakeholders, then a new function(s) will be added to this package for data presentation.

Please note if you if you are interested in running vat in the manner shown in the example (i.e. on a locally hosted web server), you must install shiny-server and you need to modify vat. If there is interest in this from other Atlantis modelers, please open an issue and I will start maintaining a seperate repository for that code.

Atlantis users may also be interested in the rlantis package. This package contains helper files for Atlantis as well as creating static graphs.

vat's People

Contributors

cddesja avatar chrisgoddard avatar

Stargazers

Ryan Morse avatar  avatar Jemma Stachelek avatar Robert Wildermuth avatar Kelli Johnson avatar

Watchers

James Cloos avatar  avatar Erik Olsen avatar Ryan Morse avatar Hem Nalini Morzaria-Luna avatar

vat's Issues

Numbers vs density

The distribution by box plots show numbers but I think it would also be useful to see the density per m3. Is it possible to add this as an option?

Also, I think the interactive plot would benefit from showing density per m2 in a box and skip the layers.

Add species in each box

Create a trellis plot where you select each box and see which species are present in what layers in the box.

New diagnostic plot?

I wanted to suggest a diagnostic plot that would be extremely useful in the calibration phase.
I am not so sure what would be the best way to implement it, but the basic idea is to visualize whether predator distribution (by box and layer) matches its preys (defined in the diet matrix of the biom.prm). I find that trophic interaction is one of the most critical but also tricky bit in Atlantis.
Maybe a way to do it could be to add in the spatial plots a prey-pred overlap, for which by selecting a predator, you can see in which boxes and layers preys are available.
Please let me know what you think.

look into YOY biomass

The YOY biomass plot looks very strange. Either it's something wrong with Atlantis code or my code.

mat_age error if the biol.prm line has more than one number

If the biol.prm file contains another number (ie, a recommended value, or a previously used value), the code for mat_age joins them together, so you can get a large age at maturity. I edited this (rather clumsily, but it works) to take just the first number
mat_age <- grep("_age_mat", biolprm, value = T)
species_ids <- str_split_fixed(mat_age, "_age_mat", n = 2)[,1]

juvenile_age <- as.numeric(gsub("[^\d]+", "", mat_age, perl=TRUE))[which(species_ids %in% vert_names)]

#test how many numbers there are. Sometimes there is an example value as well as the actual value,
#in which case we only want the first one
get_first_number<-function(x){
yy<-gsub("([^\d])","#",x,perl=TRUE)
yyy<-unlist(str_split(yy,"#"))
xPos<-grep("[^\d]",yyy)[1]
thisNum<-as.numeric(yyy[xPos])
}
temp<-lapply(mat_age,FUN=get_first_number)
juvenile_age<-as.numeric(unlist(temp))

Question on netcdf4 required by vat

Christopher:

Hi, I've tried to install vat but run into an error with dependency on netcdf4. I wanted to see if you had any suggestions.
If I am running R in a 64-bit Windows 7 system. If I run 32-bit R,install netcdf4 for 32bit and try to install vat I get an error that netcdf is not installed on arch x64. Conversely if I run 64-bit R,install netcdf4 for 64bit and try to install vat I get an error that netcdf is not installed on arch xi386.

Thanks!

Hem Nalini Morzaria

install_github(repo = "cddesja/vat", )
Downloading github repo cddesja/vat@master
Installing vat
"C:/Users/HemNalini.MorzariaLu/Documents/R/R-3.1.2/bin/i386/R" --vanilla CMD INSTALL
"C:/Users/HemNalini.MorzariaLu/AppData/Local/Temp/1/RtmpMPyZWR/devtools397c5f011eab/cddesja-vat-5ee7bff"
--library="C:/Users/HemNalini.MorzariaLu/Documents/R/win-library/3.1" --install-tests

  • installing source package 'vat' ...
    ** R
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    *** arch - x64
    Error : package 'ncdf4' is not installed for 'arch = x64'
    Error: loading failed
    Execution halted
    ERROR: loading failed for 'x64'
  • removing 'C:/Users/HemNalini.MorzariaLu/Documents/R/win-library/3.1/vat'
    Error: Command failed (1)

gather dataframe

When I ran it, create_vadt fell over unless I made everything 'gather' was to be used on a data.frame

biomass plots

Create biomass plots over time collapsed over age class in one page using a facet grid. Do this separate for vertebrates and invertebrates.

Remove Age 1 plot

Remove the final plots in Age Disaggregated tab as it's redundant with other plots in this tab.

Running with SETas Example

Hi,

I've tried to run this package with the test files SETas , provided with the Atlantis code.
However, I keep on receiving this error after entering the necessary input files into the create_vadt() function;

Error: Each variable must be named.
Problem variables: 34

What am I doing wrong?

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.