Exercise 2: Print the result of iris.sample_data_path('uk_hires.pp') to verify that it returns a string pointing to a file on your system. Use this string directly in the call to iris.load and confirm the result is the same as in the previous example e.g.:

print iris.load('/path/to/iris/sampledata/uk_hires.pp', 'air_potential_temperature')

Exercise 2 continued: Read in the files found at iris.sample_data_path('GloSea4', 'ensemble_010.pp') and iris.sample_data_path('GloSea4', 'ensemble_011.pp') using a single load call. Do this by:

1. Providing a list of the two filenames.


In [1]:
import iris
print(iris.load([iris.sample_data_path('GloSea4', 'ensemble_010.pp'),
                 iris.sample_data_path('GloSea4', 'ensemble_011.pp')]))


0: surface_temperature / (K)           (realization: 2; time: 6; latitude: 145; longitude: 192)

2. Providing a suitable glob pattern.


In [2]:
print(iris.load(iris.sample_data_path('GloSea4', 'ensemble_01[12].pp')))


0: surface_temperature / (K)           (time: 6; forecast_reference_time: 2; latitude: 145; longitude: 192)