def write_arb_n(file_name, path): tally = Tally( "Current", "Neutron", 14, "Surface", "Surface 14", "Neutron Current Across surface 14", 100.0, ) tally.write_hdf5(file_name, path)
def test_tally38(): clean(["test_tally.h5"]) tally = Tally("Current", ["Neutron", "Proton"], 14, "Surface", "Surface 14", "Neutron Current Across surface 14", 100.0) tally.write_hdf5("test_tally.h5", "tally") new_tally = Tally() new_tally.from_hdf5("test_tally.h5", "tally") assert_not_equal(tally.particle_names, new_tally.particle_names)
def write_photon(file_name): tally = Tally( "Flux", "Photon", 12, "Volume", "Volume 12", "Photon Flux in Cell 12", 35.0, 123.0, ) tally.write_hdf5(file_name, "tally")
def write_tally_h5m(tally_list, filename): """ Function that writes tally objects to ouptut .h5m file ------- tally_list: list of volume id tally pairs of PyNE Material Objects filename: filename to write the objects to """ # tally list contains elements of the form ('photon', ('current', ['Surface:4', 'Volume:1'])) # loop over list for tally in tally_list: particle_name = tally[0].capitalize() tally_type = tally[1][0] for k in range(len(tally[1][1])): tally_object = tally[1][1][k].split(':')[0] object_id = tally[1][1][k].split(':')[1] tally_name = particle_name[ 0:2].upper() + tally_type[0: 7 - len(object_id)] + str(object_id) new_tally = Tally(tally_type, particle_name, int(object_id), tally_object, str(object_id), tally_name, 0.0, 1.0) new_tally.write_hdf5(filename, "/tally")
def write_arb_p(file_name, path): tally = Tally( "Flux", "Photon", 12, "Volume", "Volume 12", "Photon Flux in Cell 12", 35.0 ) tally.write_hdf5(file_name, path)
def write_neutron(file_name): tally = Tally("Current", "Neutron", 14, "Surface", "Surface 14", "Neutron Current Across surface 14", 100.0) tally.write_hdf5(file_name, "tally")
def write_arb_p(file_name,path): tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0) tally.write_hdf5(file_name,path)
def write_arb_n(file_name,path): tally = Tally("Current","Neutron",14,"Surface","Surface 14","Neutron Current Across surface 14",100.0) tally.write_hdf5(file_name,path)
def write_photon(file_name): tally = Tally("Flux","Photon",12,"Volume","Volume 12","Photon Flux in Cell 12",35.0,123.0) tally.write_hdf5(file_name,"/tally")