mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
added utility to read off particle velocities
This commit is contained in:
parent
d3554b0732
commit
b466730c42
1 changed files with 24 additions and 0 deletions
|
@ -105,6 +105,30 @@ def loadPart(workDir, sampleDir, sample):
|
|||
|
||||
return partData, boxLen, volNorm, isObservationData
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def loadPartVel(workDir, sampleDir, sample):
|
||||
#print " Loading particle velocities..."
|
||||
sys.stdout.flush()
|
||||
|
||||
infoFile = workDir+"/"+sampleDir+"/zobov_slice_"+sample.fullName+".par"
|
||||
File = NetCDFFile(infoFile, 'r')
|
||||
isObservation = getattr(File, 'is_observation')
|
||||
|
||||
if isObservation:
|
||||
print "No velocities for observations!"
|
||||
return -1
|
||||
|
||||
vx = File.variables['vel_x'][0:]
|
||||
vy = File.variables['vel_y'][0:]
|
||||
vx = File.variables['vel_z'][0:]
|
||||
|
||||
File.close()
|
||||
|
||||
partVel = np.column_stack((vx,vy,vz))
|
||||
|
||||
return partVel
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def shiftPart(inPart, newCenter, periodicLine, boxLen):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue