get_ereefs_case: Determines whether the file provided looks like a THREDDS...

View source: R/data_extraction_functions.R

get_ereefs_caseR Documentation

Determines whether the file provided looks like a THREDDS catalog, or an example of daily (e.g. GBR1), monthly (e.g. GBR4) or other (e.g. RECOM) netcdf file output

Description

If the filename contains "catalog.html", it's a THREDDS catalog. If not, if it ends with ".nc", it's a netcdf file. Any trailing ".html" after the ".nc" part is clipped off. If there are two dashes ('-') in the last 13 characters of the netcdf filename, it is assumed to be a daily output file. If there is one, it is assumed to be monthly. If there are no dashes, it's something else, such as a RECOM file. If the output is not consistently in monthly or daily netcdf files but switches between the two, it is best to provide a THREDDS catalog URI.

Usage

get_ereefs_case(filename)

Arguments

filename

Name of the file to examine

Value

a vector of strings. 1st value is either "nc" (for an individual netcdf file), "mnc" for a meta-netcdf file (list of .nc files), "xlm" or "ncml" (for catalogs). If the first value is "nc", the second value is "1km" for GBR1, "4km" for GBR4 or "recom" (anything else). Otherwise, second value is "unknown".


BarbaraRobson/ereefs documentation built on April 23, 2023, 5:47 a.m.