model_catalogs.setup#

model_catalogs.setup(locs='mc_', override=False, boundaries=True)[source]#

Setup reference catalogs for models.

Loops over catalogs that have been previously installed as data packages to intake that start with the string(s) in locs. The default is to read in the required GOODS model catalogs which are prefixed with “mc_”. Alternatively, one or more local catalog files can be input as strings or Paths.

This function calls open_catalog which reads in previously-saved model boundary information (or calculates it if not available) and saves temporary catalog files for each model (called “compiled”), then this function links those together into the returned main catalog. For some models, reading in the original catalogs applies a “today” and/or “yesterday” date Intake user parameter that supplies two example model files that can be used for examining the model output for the example times. Those are rerun each time this function is rerun, filling the parameters using the proper dates.

Note that saved compiled catalog files will be saved under the name inside the catalog, not the name of the file if you input a catalog path.

Parameters:
  • locs (str, Path, list) –

    This can be:

    • a string or Path describing where a Catalog file is located

    • a string of the prefix for selecting catalogs from the default intake catalog, intake.cat. It is expected to be of the form “PREFIX_CATALOGNAME” with an underscore at the end followed by the catalog name, and there could be many catalogs with that “PREFIX_” set up.

    • a list of a combination of the previous options.

  • override (boolean, optional) – Use override=True to compile the catalog files together regardless of freshness.

  • boundaries (boolean, optional) – If True, find previously-saved or calculate domain boundary of model. Intended for testing.

Returns:

Nested Intake catalog with a catalog for each input option. Each model in turn has one or more model_source available (e.g., “coops-forecast-agg”, “coops-forecast-noagg”).

Return type:

Intake catalog

Examples

Set up main catalog:

>>> main_cat = mc.setup()

Examine list of models available in catalog:

>>> list(main_cat)

Examine the model_sources for a specific model in the catalog:

>>> list(main_cat['CBOFS'])

Separate from model_catalogs you can check the default Intake catalog with:

>>> list(intake.cat)