예제 #1
0
  ax.scatter(y[step, 0, 0:nsources, 0], y[step, 0, 0:nsources, 1], y[step, 0, 0:nsources, 2])
  
  plt.show()
  return
  
#-----------------------------------------------------------
# Run code
#-----------------------------------------------------------

# the input directory the directory for input data

input_dir = '/home/namdi/Documents/School/UNC/Parallel_Time/Data/test_fmm/t_0'

# read parameters
fname = input_dir + str("/info.txt")
nsources, ntargets, distribution, dt, nsteps = mu.load_parameters(fname)

N = nsources + ntargets

# create data array
y 	= np.zeros( (nsteps+1, 2, N, 3) )

# load initial data
y0, charge_src, charge_targ, dipstr_src, dipvec_src   = mu.load_initial_data(input_dir)
y[0,:] = y0[:]

# plot the data
plot3D_timestep(y, nsources, 0)

uu =1
예제 #2
0
파일: leastSq.py 프로젝트: namdi/electro


"""----------------------------------------------------------"""
# run
#-------------------------------------------

# this only works if one ran $ source my_activate
x		= commands.getstatusoutput("echo $MY_DATA_DIR")
data_path	= x[1] 
#fpath 		= data_path + "/kd/test_fe"
fpath 		= data_path + "/Results/2014_10/14/least_sq_dt"
fname	= "/t_0/info.txt"

# read in the parameters
nsources, ntargets, distribution, dt, nsteps = my_utils.load_parameters(fpath + fname)

# get the times
t = np.linspace(start=0.0, stop=dt*nsteps, num=nsteps+1, endpoint = True)

save = False

doTarget = False
# this is the actual data
if doTarget:
  pot_far	= lu.load_cplex_potential(fpath, "/pot_far_target.txt", ntargets, nsteps)
  pot_near	= lu.load_cplex_potential(fpath, "/pot_near_target.txt", ntargets, nsteps)
else:
  pot_far	= lu.load_cplex_potential(fpath, "/pot_far_source.txt", nsources, nsteps)
  pot_near	= lu.load_cplex_potential(fpath, "/pot_near_source.txt", nsources, nsteps)