Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions generate_from_data_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def custom_file_loading(target_dir):

def hovmoller(target_dir):
fname = os.path.join(DATA_ZOO, 'PP', 'ostia', 'ostia_sst_200604_201009_N216.pp')
cube = iris.load_strict(fname, iris.Constraint('surface_temperature', latitude=lambda v: -5 < v < 5))
cube = iris.load_cube(fname, iris.Constraint('surface_temperature', latitude=lambda v: -5 < v < 5))

iris_cat.add_month_number(cube, cube.coord('time'), 'month')
iris_cat.add_year(cube, cube.coord('time'), 'year')
Expand All @@ -42,7 +42,7 @@ def hovmoller(target_dir):

def rotated_pole(target_dir):
fname = os.path.join(DATA_ZOO, 'PP', 'aPProt1', 'rotated.pp')
cube = iris.load_strict(fname)
cube = iris.load_cube(fname)
# XXX consider taking a 20x20 window for meaning
cube = cube[::20, ::20]
iris.save(cube, os.path.join(target_dir, 'rotated_pole.nc'))
Expand All @@ -67,7 +67,7 @@ def deriving_phenomena(target_dir):

def cross_section(target_dir):
fname = os.path.join(DATA_ZOO, 'PP', 'COLPEX', 'theta_and_orog_subset.pp')
cube = iris.load_strict(fname, 'air_potential_temperature')
cube = iris.load_cube(fname, 'air_potential_temperature')
cube = cube[0, :15, ...]
iris.save(cube, os.path.join(target_dir, 'hybrid_height.nc'))

Expand Down Expand Up @@ -98,7 +98,7 @@ def COP_1d(target_dir):
fname = os.path.join(DATA_ZOO, 'PP', 'A1B-Image_E1', scenario,
'*.pp'
)
cube = iris.load_strict(fname)
cube = iris.load_cube(fname)
cube = cube.extract(iris.Constraint(longitude=lambda v: 225 <= v <= 315,
latitude=lambda v: 15 <= v <= 60,
)
Expand Down Expand Up @@ -136,7 +136,7 @@ def ukV2_in_userguide(target_dir):
fname = os.path.join(DATA_ZOO, 'PP', 'ukV2', 'THOxayrk.pp')
sa = 'm01s00i033'
ap = 'm01s00i004'
pt, sa = iris.load_strict(fname, ['air_potential_temperature', 'surface_altitude'])
pt, sa = iris.load_cube(fname, ['air_potential_temperature', 'surface_altitude'])
# extract, via indices, an area over the north of England
pt, sa = [cube[..., 290:494, 190:377] for cube in [pt, sa]]
# remove the temporal dimension of the surface altitude
Expand All @@ -151,7 +151,7 @@ def ukV2_in_userguide(target_dir):
target_dir = os.path.join(os.path.dirname(__file__), 'sample_data')

open(os.path.join(target_dir, 'version.txt'), 'w').write('1.0')

global_map(target_dir)
custom_file_loading(target_dir)
hovmoller(target_dir)
Expand All @@ -163,4 +163,4 @@ def ukV2_in_userguide(target_dir):
COP_1d(target_dir)
lagged_ensemble(target_dir)
custom_file_loading(target_dir)
ukV2_in_userguide(target_dir)
ukV2_in_userguide(target_dir)
Binary file modified sample_data/A1B_north_america.nc
Binary file not shown.
Binary file modified sample_data/E1_north_america.nc
Binary file not shown.
Binary file modified sample_data/hybrid_height.nc
Binary file not shown.
Binary file modified sample_data/ostia_monthly.nc
Binary file not shown.
Binary file modified sample_data/rotated_pole.nc
Binary file not shown.