Making it easy to work with large climate datasets (e.g., CMIP5)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


baspy is a python package to make it easier to analyse large climate datasets using Xarray (, Iris (, or any other python package that can read in netcdf/PP/grib/HDF files.

1. Setup package

Setup your PYTHONPATH to point to your directory of python scripts. Then download (or git clone) baspy python package.

    $> mkdir ~/PYTHON
    $> export PYTHONPATH="$HOME/PYTHON"  # <- add to ~/.bashrc
    $> cd $PYTHONPATH
    $> git clone

2. Define the directory and filename structures of your local datasets

see and edit

Once you have set this up all file loading should become transparent

3. Usage


    import baspy as bp
    import xarray as xr

    ### Retrieve a filtered version of the CMIP5 catalogue as a Pandas DataFrame
    df = bp.catalogue(dataset='cmip5', Model='HadGEM2-CC', RunID='r1i1p1', 
                        Experiment='historical', Var=['tas', 'pr'], 

    ### Iterate over rows in catalogue
    for index, row in df.iterrows():

        ### In Xarray
        ds = xr.open_mfdataset(bp.get_files(row))

        ### Or... In Iris
        cubes = bp.get_cube(row)

Jupyter Notebook