Beispiel #1
0
 def __init__(self, hangle, phi_period, asurf, system = 'spiral', consts = [], moldy = False): 
     
     #self.consts                     =   consts
     self.consts                     =   None
     self.hangle                     =   hangle
     self.opt, self.sym_op           =   select_option(system, phi_period, hangle) 
     self.phi_period                 =   phi_period
     self.system                     =   system
     self.rps                        =   None
     self.moldy                      =   moldy
     self.set_ainit_surf(asurf)
     
     #if consts != []:
     #    print 'hoo2,' + str(consts)
     #    self.set_const(consts)
     if moldy:
         self.set_moldy(moldy)     
Beispiel #2
0
def read_bender_output(input_file, read_for_moldy = False):
    
    from surface import parse_surf
    
    params      =   parse_input(input_file)
    
    if read_for_moldy:
        folder  =   parse_path(params, False)
    else:
        folder  =   parse_path(params, params[("moldy_opm")])

    
    #print folder
    
    with open(folder + 'params.txt', 'rb') as handle:
        params = pickle.loads(handle.read())
    
    umat_r      =   np.load(folder + 'umat_pol_r.npy') 
    umat_phi    =   np.load(folder + 'umat_pol_phi.npy') 
    umat_z      =   np.load(folder + 'umat_pol_z.npy') 
    
    i_surf_r    =   np.load(folder + 'init_pol_r.npy') 
    i_surf_phi  =   np.load(folder + 'init_pol_phi.npy') 
    i_surf_z    =   np.load(folder + 'init_pol_z.npy') 
    
    norm_r      =   np.load(folder + 'norm_pol_r.npy') 
    norm_phi    =   np.load(folder + 'norm_pol_phi.npy') 
    norm_z      =   np.load(folder + 'norm_pol_z.npy') 
    
    
    E_b_surf    =   np.load(folder + 'E_b_surf.npy') 
    E_s_surf    =   np.load(folder + 'E_s_surf.npy') 
    
    sym_op      =   select_option(params[("system")], \
                    params[("phiperiod")], params[("height")] / 2 / np.pi)[1]
    
    ext_umat, phys_umat, calc_umat \
                =   parse_surf(umat_r, umat_phi, umat_z, params[("phiperiod")], sym_op, 'umat')
    ext_surf, phys_surf, calc_surf \
                =   parse_surf(i_surf_r, i_surf_phi, i_surf_z, params[("phiperiod")], sym_op, 'surf')
    norm_surf   =   parse_surf(norm_r, norm_phi, norm_z, params[("phiperiod")], sym_op, 'surf')[0]
    
    
    return params, [ext_surf, phys_surf, calc_surf], \
                   [ext_umat, phys_umat, calc_umat], [E_b_surf, E_s_surf], norm_surf, folder