arctichoke.path.model_paths

Functions

list_available_models([data_dir, project, ...])

List the names of the models available alphabetically.

get_model_path(source_id[, data_dir, project, activity_id])

Find the file path for the specified model.

Module Contents

arctichoke.path.model_paths.list_available_models(data_dir: str = '/arctichoke_data/bergybits/data', project: str = 'CMIP6', activity_id: str = 'HighResMIP', institution_id: str, [str] = None)

List the names of the models available alphabetically.

Search the data directory that has been populated by esgpull and return a list of all the available models, or source_id’s. This assumes the esgpull convention of subdirectories: data/project/activity_id/institution_id/source_id.

Parameters:
  • data_dir (str, optional) – The absolute file path to the data directory. The esgpull convention means this should end in /data. Default is /arctichoke_data/bergybits/data.

  • project (str, optional) – The name of the project in which to search for available models. Default is CMIP6.

  • activity_id (str, optional) – The name of the activity ID in which to search for available models. Default is HighResMIP.

  • institution_id (str, list of str, or None, optional) – The name(s) of the institution ID(s) in which to search for available models. If None is given, all available institutions are included. Default is None.

Returns:

model_names – A list, sorted alphabetically, of the names of the available models.

Return type:

List of str

Examples

>>> from arctichoke.path.find_data import list_available_models
>>> list_available_models()
['AWI/AWI-CM-1-1-HR', 'AWI/AWI-CM-1-1-LR', 'BCC/BCC-CSM2-HR', 'EC-Earth-Consortium/EC-Earth3P', 'EC-Earth-Consortium/EC-Earth3P-HR', 'MOHC/HadGEM3-GC31-HH', 'MOHC/HadGEM3-GC31-HM', 'MOHC/HadGEM3-GC31-LL', 'MOHC/HadGEM3-GC31-MM', 'NCAR/CESM1-CAM5-SE-HR', 'NCAR/CESM1-CAM5-SE-LR', 'NERC/HadGEM3-GC31-HH', 'NERC/HadGEM3-GC31-HM']
>>> list_available_models(institution_id = 'EC-Earth-Consortium')
['EC-Earth-Consortium/EC-Earth3P', 'EC-Earth-Consortium/EC-Earth3P-HR']
>>> list_available_models(institution_id = 'MOHC')
['MOHC/HadGEM3-GC31-HH', 'MOHC/HadGEM3-GC31-HM', 'MOHC/HadGEM3-GC31-LL', 'MOHC/HadGEM3-GC31-MM']
>>> list_available_models(institution_id = ['MOHC', 'NERC'])
['MOHC/HadGEM3-GC31-HH', 'MOHC/HadGEM3-GC31-HM', 'MOHC/HadGEM3-GC31-LL', 'MOHC/HadGEM3-GC31-MM', 'NERC/HadGEM3-GC31-HH', 'NERC/HadGEM3-GC31-HM']
arctichoke.path.model_paths.get_model_path(source_id: str, data_dir: str = '/arctichoke_data/bergybits/data', project: str = 'CMIP6', activity_id: str = 'HighResMIP')

Find the file path for the specified model.

Search the data directory that has been populated by esgpull for a model’s source_id and return the file path. This assumes the esgpull convention of subdirectories: data/project/activity_id/institution_id/source_id.

Parameters:
  • source_id (str) – The name of the source ID (model) for which to find the file path.

  • data_dir (str, optional) – The absolute file path to the data directory. The esgpull convention means this should end in /data. Default is /arctichoke_data/bergybits/data.

  • project (str, optional) – The name of the project in which to search for available models. Default is CMIP6.

  • activity_id (str, optional) – The name of the activity ID in which to search for available models. Default is HighResMIP.

Returns:

model_filepaths – A list of the file path(s) for the specified model.

Return type:

List of str

Examples

>>> from arctichoke.path.find_data import get_model_path
>>> get_model_path(source_id='AWI-CM-1-1-HR')
['/arctichoke_data/bergybits/data/CMIP6/HighResMIP/AWI/AWI-CM-1-1-HR']
>>> get_model_path('HadGEM3-GC31-HM')
['/arctichoke_data/bergybits/data/CMIP6/HighResMIP/MOHC/HadGEM3-GC31-HM', '/arctichoke_data/bergybits/data/CMIP6/HighResMIP/NERC/HadGEM3-GC31-HM']