read.osunpp: Read ocean productivity data from Oregon State University...

View source: R/read.osunpp.R

read.osunppR Documentation

Read ocean productivity data from Oregon State University files

Description

Read, for a user defined area, net primary production data from hdf files downloaded from OSU's Ocean Productivity home page.

Usage

read.osunpp(h5, lons, lats)

Arguments

h5

name of the hdf file(s) to be read.

lons

a vector with western- and eastern-most longitudes.

lats

a vector with southern- and northern-most latitudes.

Details

This function reads Oregon State University ocean productivity data files (http://sites.science.oregonstate.edu/ocean.productivity/standard.product.php). However, downloaded files should be first converted from hdf version 4 to version 5 with h4h5tools (https://portal.hdfgroup.org/display/support/Download+h4h5tools). The user must specify the minimum and maximum latitude and longitude limits within the interval (-90, 90) and (-180, 180) respectively.

Value

An object of class "satin". See satin-class for details.

Author(s)

Héctor Villalobos and Eduardo González-Rodríguez

See Also

read.nasaoc for reading NASA's oceancolor web page data, read.ghrsst for JPL MUR SST data, and read.cmems for data from Copernicus Marine Service.

Examples

if(interactive()){
 # read a single file, look at its structure and plot
 npp <- read.osunpp("vgpm.2013089.h5", 
                        lats=c(20, 30), lons=c(-130, -105))
 npp
 str(npp)
 plot(npp)

 # read several files residing in the working directory 
 files <- list.files(pattern = glob2rx("*.h5"))
 lats <- c(20, 30)
 lons <- c(-130, -105)
 mNPP <- read.osunpp(files, lats, lons)      

 # plotting the first processed file
 plot(mNPP) 

 # plotting the second processed file
 plot(mNPP, period = 2)
}

satin documentation built on Sept. 23, 2022, 1:06 a.m.