Learn R Programming

satin (version 1.1.0)

read.osunpp: 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)

Value

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

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.

Author

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

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.

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

Run this code
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)
}

Run the code above in your browser using DataLab