Get_Ocean_Prod: Download SeaWiFS or MODIS HDF4 file from Ocean Productivity...

View source: R/Get_Ocean_Prod.R

Get_Ocean_ProdR Documentation

Download SeaWiFS or MODIS HDF4 file from Ocean Productivity Web page

Description

Download SeaWiFS or MODIS HDF4 file from Ocean Productivity Web page and then convert to a raster object

Usage

Get_Ocean_Prod(url, outdir = NULL)

Arguments

url

A character string naming the URL of a HDF4 file to be downloaded

outdir

output directory to write raster file

x

Raster* object defining the spatial extent, resolution and projection of climatology data to be retrived. If not provide, returning full data set.

plot

Logical, whether or not to plot the output raster

Details

This function dowloads HDF4 file from Ocean Productivity Web page http://www.science.oregonstate.edu/ocean.productivity/ This is an R wrapper for the gdal_translate function that is part of the Geospatial Data Abstraction Library (GDAL), which assumes the user has a working GDAL on their system. However, if the GDAL not working, Get_Ocean_Prod2 can be used as alternative.

Value

a raster object

Author(s)

Chih-Lin Wei <chihlinwei@gmail.com>

References

http://www.gdal.org/gdal_translate.html

Examples

# Download August 2002 VGPM as example
url <- "http://orca.science.oregonstate.edu/data/2x4/monthly/vgpm.r2018.m.chl.m.sst/hdf/vgpm.2002182.hdf.gz"
Get_Ocean_Prod(url)

chihlinwei/OceanData documentation built on Sept. 26, 2022, 2:47 p.m.