Y = P.set_construct(cf.DomainAxis(3)) X = P.set_construct(cf.DomainAxis(2)) # Set the data for the field P.set_data(cf.Data(array), axes=[T, Y, X]) # End of code block P print(P.data.array) P.data.get_compression_type() print(P.data.compressed_array) list_variable = P.data.get_list() list_variable print(list_variable.array) cf.write(P, 'P_gathered.nc') pp = cf.read('umfile.pp') pp print(pp[0]) cf.write(pp, 'umfile1.nc') stash = cf.stash2standard_name() stash[(1, 4)] stash[(1, 7)] stash[(1, 2)] stash[(1, 152)] (1, 999) in stash with open('new_STASH.txt', 'w') as new: new.write('1!999!My STASH code!1!!!ultraviolet_index!!') cf.load_stash2standard_name('new_STASH.txt', merge=True) new_stash = cf.stash2standard_name() new_stash[(1, 999)]
def test_stash2standard_name(self): d = cf.stash2standard_name() self.assertIsInstance(d, dict) d["test"] = None e = cf.stash2standard_name() self.assertNotEqual(d, e)