Beispiel #1
0
 def callback(cube, field, filename):
     self.assertEqual(filename, file)
     lbvc = field.lbvc
     if lbvc == 1:
         # reject the height level data (accept only pressure).
         raise IgnoreCubeException()
     else:
         # Record the LBVC value.
         cube.attributes['LBVC'] = lbvc
Beispiel #2
0
 def callback(cube, collation, filename):
     self.assertEqual(filename, file)
     lbvcs = [fld.lbvc for fld in collation.fields]
     lbvc0 = lbvcs[0]
     if not np.all(lbvcs == lbvc0):
         msg = 'Fields have different LBVCs : {}'
         raise ValueError(msg.format(set(lbvcs)))
     if lbvc0 == 1:
         # reject the height level data (accept only pressure).
         raise IgnoreCubeException()
     else:
         # Record the LBVC values.
         cube.attributes['A_LBVC'] = lbvcs