Skip to content

Example for Discussion

Bryan Lawrence edited this page Nov 9, 2022 · 1 revision

Here is a simple example of how we can hide file complexity using the simple CFIndex class in the util folder:

#!/usr/bin/env python
from index import CFIndex
index = CFIndex('u-cn134/19500101T0000Z/')

print('Here is the total expected volume for the entire SMLE for these files')
index.volume()
print('(Units were GB)')

print('\nHere is that list of files again',  index._files.keys())

fld_key = 'sea_ice_temperature:SEA-ICE TEMPERATURE AFTER TIMESTEP'
print('\nHow about we look for this', fld_key)

print('These are the files with that key in them (they may have other stuff)')
print(index[fld_key])

print('\nHere is a CF aggregation of that field from those files')
print(index.get_fields(fld_key))

results in

Screenshot 2022-11-09 at 15 15 37

Clone this wiki locally