Giter VIP home page Giter VIP logo

ereefs's Introduction

ereefs eReefs Logo

Lifecycle: experimental

pkgdown license Ask Us Anything ! Open Source Love

Overview

What is eReefs?

eReefs is a project that combines government commitment to reef protection, world-class science innovation and contributions from leading Australian businesses. It is a collaborative information system created (the Great Barrier Reef Foundation, CSIRO, the Australian Institute of Marine Science, Bureau of Meteorology, and Queensland Government) that provides a picture of what is currently happening on the reef, and what will likely happen in the future.

Focused on the protection and preservation of the iconic Great Barrier Reef, it forms the first step in building comprehensive coastal information systems for Australia. Using the latest technologies to collate data, and new and integrated modelling, eReefs will produce powerful visualisation, communication and reporting tools. It will provide for the Reef information akin to that provided by the Bureau of Meteorology for weather. This information will benefit government agencies, Reef managers, policy makers, researchers, industry and local communities.

What does the ereefs R package do?

The ereefs R package provides easy access to eReefs and other CSIRO-EMS output files. ereefs focuses on accessing eReefs data model in its original format, including eReefs data from the National Computational Infrastructure (NCI) eReefs data services, not the gridded AIMS eReefs model data provided via the eReefs data service. It can also be used to explore and visualise other CSIRO-EMS model output data, including output from RECOM model runs. CSIRO-EMS is the hydrodynamic-biogeochemical modelling software that underpins the eReefs models for the Great Barrier Reef. RECOM is an online interface that helps registered users to set up higher-resolution instances of CSIRO-EMS for small areas such as individual reefs that are nested within the eReefs models.

ereefs is designed to assist R users who need more customised access to eReefs data. This includes things like:

  • Accessing data from versions of the eReefs model that are not available through the web-based data service;

  • Accessing data for less commonly-used variables that are not included in the web-based data service or visualisation portal;

  • Generating customised maps or animations for a specified region at a specified depth over a specified period of time, including (for example) true colour maps and animations from modelled optical data, maps that combine two or more eReefs variables (e.g., to get total zooplankton concentrations), maps with labelled points of interest such as Marine Monitoring Program (MMP) sampling locations, and maps with outlines of reef areas shown. Maps are created as ggplot2 figures and can be further adjusted as required by R users familiar with that package.

  • Extracting and visualising data in different ways, for example:

    • Taking a vertical profile of a variable over the depth of the water column and displaying it either as a single profile at a point in time or as a depth-vs-time contour plot;
    • Taking a two-dimensional vertical slice through the three-dimensional model data;
    • Calculating vertically integrated results (i.e., the average value of a variable over the depth of the water column rather than the value at a particular depth);
    • Extracting data along the path of a boat or glider.

How does this R package compare to the existing eReefs services?

Please see our online vignette to learn more about how this package compares to the multiple sources of eReefs exploration tools and platforms.

Installation

To install the latest release from GitHub use

if (!requireNamespace("remotes")) {
  install.packages("remotes")
}
remotes::install_github("open-aims/ereefs")

The current development version can be downloaded from GitHub via

if (!requireNamespace("remotes")) {
  install.packages("remotes")
}
remotes::install_github("open-aims/ereefs", ref = "dev")

Usage

Usage and further information about ereefs can be seen on the vignettes. Help files for the individual functions can be found on the reference page.

Further Information

ereefs is provided by the Australian Institute of Marine Science under the MIT License (MIT).

ereefs's People

Contributors

barbararobson avatar dbarneche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ereefs's Issues

Create functions to interrogate data, variables, dates etc -- something that creates a metadata

A novice user who does not know much about eReefs will be lost about the types of data that are out there.
It would be nice to create a function which scrapes exisiting metadata from netCDF files, and provides a table to users with things like:

  • spatial coverage and level of aggregation
  • temporal coverage and level of aggregation
  • variables and their string names

The above should help people navigate the nuances of the multiple products.

Tentative name suggestions for such function: navigate_ereeefs_data or interrogate_ereeefs_data

Duplication of for loop code in multiple functions

Most functions have similar code at the start to set things up (start and end dates, file names and locations) and then loop through the required time-steps and files, month by month or day by day. Each function has its main code inside these loops. We should be able to simplify this by having a function to do all the set-up and call a specified function passed in by name inside the loop. The R package, purrr should be useful here.

Consider switching to tidync

The tidync package is more elegant and intuitive for reading netcdf into data frames, with less chance of errors, but would require substantial code refactoring.

Improving transparency in sysdata

Write how-to vignette

This should cover most common usage of the package. Starting from scripts that Barbara created.

Merge `map_ereefs` and `map_ereefs_movie`?

Would this be a viable thing? Allow map_ereefs to take multiple time stamps as an argument and an additional argument to whether it should generate static maps, return data, or produce a gif.

Duplicated set-up code in each function

Most functions start by setting up a bunch of variables, including start_date, start_day, start_month, start_year, end_date, end_day, end_month, end_year, input_file, input_stem, latitude, longitude, and sometimes mths, years, var_list, ereefs_origin. We should put all these variables into a list and then call a function to set them up.

CRAN updates to ncdf4 sometimes break functionality in Windows

The official CRAN version of the ncdf4 package sometimes supports OPeNDaP-served netcdf4 files under Windows and sometimes doesn't. When it doesn't, the work-around is to install mdsumner/ncdf4 fork from github.

We could require this version, but might need to check it periodically. In the longer term, we might want to move to tidync instead.

Remove suppress_print functionality from plotting functions

For some functions such as map_ereefs the map gets plotted twice, unless the user sets suppress_print, e.g.

This only happens when you do, e.g.

map_ereefs(target_date = c(2019, 2, 28))

instead of e.g.

p <- map_ereefs(target_date = c(2019, 2, 28))

The current solution to this is

map_ereefs(target_date = c(2019, 2, 28), suppress_print = TRUE)

But that goes against ggplots default behaviour to not print when assigned to an object

Add tests to functions

We need to add a series of tests to make sure intended functionality is correct, as well as anticipation of corner cases. Maybe a meeting could help discuss these through.

Add functions to work with AIMS data?

Would it be possible to also work with AIMS eReefs data service?
This is probably a high priority function as this might affect a lot the inner working of multiple functions.
If so we could create a function for this, or expand capacity of all functions.

get_ereefs_ts: "Error in if (location_latlon[[1]] == "mmp") { : the condition has length > 1"

The three examples in the get_ereefs_ts() function are throwing seperate errors:


get_ereefs_ts('Chl_a_sum', location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer='surface', start_date=c(2010,12,31),end_date=c(2011,1,5), input_file=2)

> Error in if (location_latlon[[1]] == "mmp") { : 
>   the condition has length > 1

get_ereefs_ts(var_names=c('Tricho_N', 'DIP', 'TP'), location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer='bottom', start_date="2012-07-03",end_date="2012-07-05", input_file='GBR4_BGC-v2.0 Chyb Dcrt')

> Error in if (start_date > end_date) { : 
>   missing value where TRUE/FALSE needed
> In addition: Warning messages:
> 1: In convert.dates(dates., format = format[[1]], origin. = origin.) :
>   days(s) out of range in positions 1 set to NA
> 2: In convert.dates(dates., format = format[[1]], origin. = origin.) :
>   days(s) out of range in positions 1 set to NA

get_ereefs_ts(var_names=c('ZooL_N', 'ZooS_N'), location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5)), layer=45, start_date=c(2010,12,31),end_date=c(2011,1,5), input_file="http://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_bgc_GBR4_H2p0_B2p0_Cpre_Dcrt/gbr4_bgc_simple_2016-06.nc")

> Error in if (location_latlon[[1]] == "mmp") { : 
>   the condition has length > 1

The third example still gives an error with the location_latlon when correcting latitide with latitude - changing location_latlon[[1]] to location_latlon[[1]][1] on line 19 is a temp fix to get around the data.frame issue:

 location_latlon=data.frame(latitide=c(-23.39189,-18), longitude=c(150.88852, 147.5))

 if (location_latlon[[1]][1] == "mmp") {
        location_latlon <- data.frame(latitude = mmp_sites$latitude, 
            longitude = mmp_sites$longitude)
        mmp <- TRUE
    }
    else {
        mmp <- FALSE
    }

> Error in if (location_latlon[[1]] == "mmp") { : 
>   the condition has length > 1

sessionInfo() below:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ereefs_3.2.4

loaded via a namespace (and not attached):
 [1] fansi_1.0.4      assertthat_0.2.1 utf8_1.2.3       dplyr_1.0.10     R6_2.5.1         DBI_1.1.3        lifecycle_1.0.3  magrittr_2.0.3   pillar_1.8.1     rlang_1.0.6      cli_3.6.0        vctrs_0.5.2     
[13] generics_0.1.3   glue_1.6.2       compiler_4.2.1   pkgconfig_2.0.3  tidyselect_1.2.0 tibble_3.1.8    

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.