Data Sources

Local Module

local.load_WRF_2d_files(file_path, filename_pattern, variable_name, name='')

Load multiple WRF (or nuWRF) original output files containing 2D fields such as precipitation and surface variables into a Dataset. The dataset can be spatially subset. :param file_path: Directory to the NetCDF file to load. :type file_path: string :param filename_pattern: Path to the NetCDF file to load. :type filename_pattern: :list:`string` :param variable_name: The variable name to load from the NetCDF file. :type variable_name: string :param name: (Optional) A name for the loaded dataset. :type name: string :returns: An OCW Dataset object with the requested variable’s data from

the NetCDF file.
Return type:dataset.Dataset
Raises ValueError:
 
local.load_file(file_path, variable_name, variable_unit=None, elevation_index=0, name='', lat_name=None, lon_name=None, time_name=None)

Load a NetCDF file into a Dataset.

Parameters:
  • file_path (string) – Path to the NetCDF file to load.
  • variable_name (string) – The variable name to load from the NetCDF file.
  • variable_unit (string) – (Optional) The variable unit to load from the NetCDF file.
  • elevation_index (int) – (Optional) The elevation index for which data should be returned. Climate data is often times 4 dimensional data. Some datasets will have readins at different height/elevation levels. OCW expects 3D data so a single layer needs to be stripped out when loading. By default, the first elevation layer is used. If desired you may specify the elevation value to use.
  • name (string) – (Optional) A name for the loaded dataset.
  • lat_name (string) – (Optional) The latitude variable name to extract from the dataset.
  • lon_name (string) – (Optional) The longitude variable name to extract from the dataset.
  • time_name (string) – (Optional) The time variable name to extract from the dataset.
Returns:

An OCW Dataset object with the requested variable’s data from the NetCDF file.

Return type:

dataset.Dataset

Raises ValueError:
 

When the specified file path cannot be loaded by ndfCDF4 or when the lat/lon/time variable name cannot be determined automatically.

local.load_multiple_files(file_path, variable_name, dataset_name='model', variable_unit=None, lat_name=None, lon_name=None, time_name=None)

load multiple netcdf files with common filename pattern and return an array of OCW datasets

Parameters:
  • file_path (string) – directory name and common file name patterns where the NetCDF files to load are stored.
  • dataset_name (:mod:’string’) – a name of dataset when reading a single file
  • variable_name (string) – The variable name to load from the NetCDF file.
  • variable_unit (string) – (Optional) The variable unit to load from the NetCDF file.
  • elevation_index – (Optional) The elevation index for which data should be returned. Climate data is often times 4 dimensional data. Some datasets will have readins at different height/elevation levels. OCW expects 3D data so a single layer needs to be stripped out when loading. By default, the first elevation layer is used. If desired you may specify the elevation value to use.
  • lat_name (string) – (Optional) The latitude variable name to extract from the dataset.
  • lon_name (string) – (Optional) The longitude variable name to extract from the dataset.
  • time_name (string) – (Optional) The time variable name to extract from the dataset.
Returns:

An array of OCW Dataset objects, an array of dataset names

Return type:

list

RCMED Module

Classes:
RCMED - A class for retrieving data from Regional Climate Model Evalutaion Database (JPL).
rcmed.get_parameters_metadata()

Get the metadata of all parameter from RCMED.

Returns:Dictionary of information for each parameter stored in one list
Return type:list of dict
rcmed.parameter_dataset(dataset_id, parameter_id, min_lat, max_lat, min_lon, max_lon, start_time, end_time, name='')

Get data from one database(parameter).

Parameters:
  • dataset_id (int) – Dataset id.
  • parameter_id (int) – Parameter id
  • min_lat (float) – Minimum latitude
  • max_lat (float) – Maximum latitude
  • min_lon (float) – Minimum longitude
  • max_lon (float) – Maximum longitude
  • start_time (datetime.datetime) – Start time
  • end_time (datetime.datetime) – End time
  • name (string) – (Optional) A name for the loaded dataset.
Returns:

An OCW Dataset object contained the requested data from RCMED.

Return type:

dataset.Dataset

DAP Module

dap.load(url, variable, name='')

Load a Dataset from an OpenDAP URL

Parameters:
  • url (string) – The OpenDAP URL for the dataset of interest.
  • variable (string) – The name of the variable to read from the dataset.
  • name (string) – (Optional) A name for the loaded dataset.
Returns:

A dataset.Dataset containing the dataset pointed to by the OpenDAP URL.

Raises:

ServerError

ESGF Module

esgf.load_dataset(dataset_id, variable, esgf_username, esgf_password, search_url='http://esg-datanode.jpl.nasa.gov/esg-search/search', elevation_index=0, name='', save_path='/tmp', **additional_constraints)

Load an ESGF dataset.

Parameters:
  • dataset_id (string) – The ESGF ID of the dataset to load.
  • variable (string) – The variable to load.
  • esgf_username (string) – ESGF OpenID value to use for authentication.
  • esgf_password (string) – ESGF Password to use for authentication.
  • search_url (string) – (Optional) The ESGF node to use for searching. Defaults to the Jet Propulsion Laboratory node.
  • elevation_index (int) – (Optional) The elevation level to strip out when loading the dataset using ocw.data_source.local.
  • name (string) – (Optional) A name for the loaded dataset.
  • save_path (string) – (Optional) Path to where downloaded files should be saved.
  • additional_constraints – (Optional) Additional key,value pairs to pass as constraints to the search wrapper. These can be anything found on the ESGF metadata page for a dataset.
Returns:

A list of dataset.Dataset contained the requested dataset. If the dataset is stored in multiple files each will be loaded into a separate dataset.Dataset.

Raises ValueError:
 

If no dataset can be found for the supplied ID and variable, or if the requested dataset is a multi-file dataset.

Table Of Contents

Previous topic

Utils Module

Next topic

Evaluation UI Webservices

This Page