R/get_var_atts.R

Defines functions get_var_atts

get_var_atts <- function(attributes, var_name) {
  if (is.null(attributes$`_FillValue`)) {
    attributes$`_FillValue` <- -999
  }
  if (is.null(attributes$missing_value)) {
    attributes$missing_value <- -999
  }
  if (is.null(attributes$units)) {
    attributes$units <- UNDEFINED
  }
  if (is.null(attributes$standard_name)) {
    attributes$standard_name <- UNDEFINED
  }
  if (is.null(attributes$long_name)) {
    attributes$long_name <- var_name
  }
  return(attributes)
}

Try the cmsafops package in your browser

Any scripts or data that you put into this service are public.

cmsafops documentation built on Sept. 18, 2023, 5:16 p.m.