get_latlon <- function(latitude, longitude) {
  # Adds dimensions and metadata to lat and lon
  # latitude: array containing the latitude values
  # longitude: array containing the longitude values
  dim(longitude) <- length(longitude)
  metadata <- list(longitude = list(units = 'degrees_east'))
  attr(longitude, 'variables') <- metadata
  names(dim(longitude)) <- 'longitude'

  dim(latitude) <- length(latitude)
  metadata <- list(latitude = list(units = 'degrees_north'))
  attr(latitude, 'variables') <- metadata
  names(dim(latitude)) <- 'latitude'

  return(list(lat=latitude, lon=longitude))

}
