예제 #1
0
파일: wrap2.py 프로젝트: meyerson/BOUT_sims
#! /share/home/01523/meyerson/local/bin/python
import post_bout
a = post_bout.save(path='/scratch/01523/meyerson/Q3/linear/data_eig64_1e-2')
#/scratch/01523/meyerson/Q3/linear/data_eig64_1e-4
예제 #2
0
파일: corral2.py 프로젝트: meyerson/BOUT
 def refresh(self):
    self.refresh = True
    for i,path in enumerate(self.status['runs']):
       a = post_bout.save(path=path) #re post-process a run
예제 #3
0
파일: corral2.py 프로젝트: meyerson/BOUT
 def add(self,path=self.status['current']):
    a = post_bout.save(path=path) #save to current dir
예제 #4
0
파일: pb_corral.py 프로젝트: meyerson/BOUT
def corral(cached=True,refresh=False,debug=False,IConly=1,
           logname='status.log',skew=False):

   print 'in corral'
   log  = read_log(logname=logname) 
   #done = log['done']
   runs = log['runs'] #a list of all directories, we need this,
   # only need 'runs' if the simulation is done 
  
   current = log['current'] #always return the last data_dir    
   
   print log
   print 'current:', current
   
   if refresh==True:
      
      for i,path in enumerate(runs):
         print i,path
         a = post_bout.save(path=path,IConly=IConly,transform=skew) #re post-process a run
         
         
      
   elif cached == False: #if all the ind. simulation pkl files are in place skip this part
  
      a = post_bout.save(path=current) #save to current dir
      #here is really where you shoudl write to status.log
      #write_log('status.log',
      cached = True
  
   #if done:
     
   alldata = []
   alldb =[]
   print 'last_one: '
   for i,val in enumerate(runs):
      print val
      db = post_bout.read(path=val)
      #alldata.append(array)
      alldb.append(db)
         
         #build the end database
         
         
      #remove the read in pickle

   #return alldb
   def islist(input):
      return isinstance(input,list)

   alldb = filter(islist,alldb)

   alldb = sum(alldb,[])
   #alldata = np.array(alldata)
   
   nt = []
   for mode in alldb:
      nt.append(len(mode['amp']))
      nt = [max(nt)]
   
   nt = nt[0]
   t = range(nt)             
   i = 0
    
   if debug:
       return alldb
   else:
       return LinRes(alldb)
예제 #5
0
파일: wrap3.py 프로젝트: meyerson/BOUT_sims
#! /share/home/01523/meyerson/local/bin/python
import post_bout
import sys
print sys.argv
a = post_bout.save(path=sys.argv[1])
예제 #6
0
def corral(cached=True,
           refresh=False,
           debug=False,
           IConly=1,
           logname='status.log',
           skew=False):

    print 'in corral'
    log = read_log(logname=logname)
    #done = log['done']
    runs = log['runs']  #a list of all directories, we need this,
    # only need 'runs' if the simulation is done

    current = log['current']  #always return the last data_dir

    print log
    print 'current:', current

    if refresh == True:

        for i, path in enumerate(runs):
            print i, path
            a = post_bout.save(path=path,
                               IConly=IConly)  #re post-process a run

    elif cached == False:  #if all the ind. simulation pkl files are in place skip this part

        a = post_bout.save(path=current)  #save to current dir
        #here is really where you shoudl write to status.log
        #write_log('status.log',
        cached = True

    #if done:

    all_ave = []
    all_modes = []
    print 'last_one: '
    for i, val in enumerate(runs):
        print val
        mode_db, ave_db = post_bout.read(path=val)
        #alldata.append(array)
        all_modes.append(mode_db)
        all_ave.append(ave_db)

        #build the end database

        #remove the read in pickle

    #return alldb
    def islist(input):
        return isinstance(input, list)

    all_modes = filter(islist, all_modes)
    #all_ave = filter(islist,all_ave)

    #alldb = sum(alldb,[])
    #alldata = np.array(alldata)
    all_modes = sum(all_modes, [])

    nt = []
    for mode in all_modes:
        nt.append(len(mode['amp']))
        nt = [max(nt)]

    nt = nt[0]
    t = range(nt)
    i = 0

    if debug:
        return all_modes, all_ave
    else:
        return LinRes(all_modes)