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

View source: R/Get_Ocean_Prod2.R

Get_Ocean_Prod2R Documentation

Download SeaWiFS or MODIS HDF4 file from Ocean Productivity Web page using ncdf4 package

Description

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

Usage

Get_Ocean_Prod2(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 nc_open and ncvar_get functions. Detailed description of the usage can be found in https://hdfeos.org/software/r.php

Value

a raster object

Author(s)

Chih-Lin Wei <chihlinwei@gmail.com>

References

https://hdfeos.org/software/r.php

Examples

# Download July 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_Prod2(url)

# Download July 2002 chl as example
url <- "http://orca.science.oregonstate.edu/data/1x2/monthly/chl.modis.r2018/hdf/chl.2002182.hdf.gz"
Get_Ocean_Prod2(url)

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