Skip to content
Damien Irving edited this page Aug 4, 2022 · 2 revisions
import iris
import dask.diagnostics

local_cluster = False
if local_cluster:
    dask.config.set(temporary_directory='/g/data/wp00/dbi599/')
    cluster = LocalCluster(n_workers=args.nworkers)
    client = Client(cluster)
    print("Watch progress at http://localhost:8787/status")
else:
    dask.diagnostics.ProgressBar().register()

tn_file = '/g/data/wp00/users/rb4844/qqscale/GFDL-ESM2M/tasmin/rcp26/tasmin_AUS_GFDL-ESM2M_rcp26_r1i1p1_CSIRO-QQS-AGCD-1981-2010_day_wrt_1986-2005_2016-2045.nc'
tn_cube = iris.load_cube(tn_file)
tn_cube.units = 'C'

tx_file = '/g/data/wp00/users/rb4844/qqscale/GFDL-ESM2M/tasmax/rcp26/tasmax_AUS_GFDL-ESM2M_rcp26_r1i1p1_CSIRO-QQS-AGCD-1981-2010_day_wrt_1986-2005_2016-2045.nc'
tx_cube = iris.load_cube(tx_file)
tx_cube.units = 'C'

tas_cube = (tn_cube + tx_cube.data) / 2
tas_cube.name = 'tas'
tas_cube.units = 'C'

iris.save(tas_cube, '/g/data/wp00/dbi599/test_tas_iris.nc')
Clone this wiki locally