How to use the atlite.config.cordex_dir function in atlite

To help you get started, we’ve selected a few atlite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PyPSA / atlite / atlite / datasets / cordex.py View on Github external
'influx': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_data_cordex,
                   oldname='rsds', newname='influx',
                   template=os.path.join(cordex_dir, '{model}', 'influx', 'rsds_*_{year}*.nc')),
    'outflux': dict(tasks_func=tasks_yearly_cordex,
                    prepare_func=prepare_data_cordex,
                    oldname='rsus', newname='outflux',
                    template=os.path.join(cordex_dir, '{model}', 'outflux', 'rsus_*_{year}*.nc')),
    'temperature': dict(tasks_func=tasks_yearly_cordex,
                        prepare_func=prepare_data_cordex,
                        oldname='tas', newname='temperature',
                        template=os.path.join(cordex_dir, '{model}', 'temperature', 'tas_*_{year}*.nc')),
    'humidity': dict(tasks_func=tasks_yearly_cordex,
                        prepare_func=prepare_data_cordex,
                        oldname='hurs', newname='humidity',
                        template=os.path.join(cordex_dir, '{model}', 'humidity', 'hurs_*_{year}*.nc')),
    'wnd10m': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_data_cordex,
                   oldname='sfcWind', newname='wnd10m',
                   template=os.path.join(cordex_dir, '{model}', 'wind', 'sfcWind_*_{year}*.nc')),
    'roughness': dict(tasks_func=tasks_yearly_cordex,
                      prepare_func=prepare_static_data_cordex,
                      oldname='rlst', newname='roughness',
                      template=os.path.join(cordex_dir, '{model}', 'roughness', 'rlst_*.nc')),
    'runoff': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_data_cordex,
                   oldname='mrro', newname='runoff',
                   template=os.path.join(cordex_dir, '{model}', 'runoff', 'mrro_*_{year}*.nc')),
    'height': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_static_data_cordex,
                   oldname='orog', newname='height',
                   template=os.path.join(cordex_dir, '{model}', 'altitude', 'orog_*.nc')),
github PyPSA / atlite / atlite / datasets / cordex.py View on Github external
xs = slice(first - 0.1*(second - first), last + 0.1*(second - first))
    if not isinstance(ys, slice):
        first, second, last = ys.values[[0,1,-1]]
        ys = slice(first - 0.1*(second - first), last + 0.1*(second - first))

    return [dict(prepare_func=prepare_func,
                 xs=xs, ys=ys, oldname=oldname, newname=newname,
                 fn=next(glob.iglob(template.format(year=year, model=model))),
                 year=year, months=list(map(itemgetter(1), yearmonths)))
            for year, yearmonths in groupby(yearmonths, itemgetter(0))]

weather_data_config = {
    'influx': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_data_cordex,
                   oldname='rsds', newname='influx',
                   template=os.path.join(cordex_dir, '{model}', 'influx', 'rsds_*_{year}*.nc')),
    'outflux': dict(tasks_func=tasks_yearly_cordex,
                    prepare_func=prepare_data_cordex,
                    oldname='rsus', newname='outflux',
                    template=os.path.join(cordex_dir, '{model}', 'outflux', 'rsus_*_{year}*.nc')),
    'temperature': dict(tasks_func=tasks_yearly_cordex,
                        prepare_func=prepare_data_cordex,
                        oldname='tas', newname='temperature',
                        template=os.path.join(cordex_dir, '{model}', 'temperature', 'tas_*_{year}*.nc')),
    'humidity': dict(tasks_func=tasks_yearly_cordex,
                        prepare_func=prepare_data_cordex,
                        oldname='hurs', newname='humidity',
                        template=os.path.join(cordex_dir, '{model}', 'humidity', 'hurs_*_{year}*.nc')),
    'wnd10m': dict(tasks_func=tasks_yearly_cordex,
                   prepare_func=prepare_data_cordex,
                   oldname='sfcWind', newname='wnd10m',
                   template=os.path.join(cordex_dir, '{model}', 'wind', 'sfcWind_*_{year}*.nc')),