~gcg/splithopkinsontools/trunk

« back to all changes in this revision

Viewing changes to SHTB_AnalyseExperiment.py

  • Committer: gcg
  • Date: 2017-10-06 12:29:59 UTC
  • Revision ID: gcg-20171006122959-ppqs0y22z341ezbb
shtb tools

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
         
58
58
        """
59
59
        
60
 
        indices = np.where(np.logical_and(self.time >= 0.0, self.time < 2.0))
 
60
        indices = np.where(np.logical_and(self.time >= 0.0, self.time < 60.0))
61
61
        time_subset = self.time[indices]
62
62
        force_subset = self.F_tra[indices]
63
63
        outData = np.column_stack((time_subset, force_subset))
353
353
        
354
354
        
355
355
        
356
 
        #deltaT = tRiseTra - tRiseInc
 
356
        deltaT = tRiseTra - tRiseInc
357
357
        
358
358
        
359
359
        gageDistance = 3100
360
 
        deltaT = gageDistance / 5090.0
 
360
        #deltaT = gageDistance / 5090.0
361
361
        print "inc signal starts at %f [ms], tra signal starts at %f [ms], delta=%f [ms]" % (tRiseInc, tRiseTra, deltaT)
362
362
        print "Assuming distance between gauges of %d [mm], speed of sound in bar is %f [m/s])" % (gageDistance, gageDistance / deltaT)
363
363
        assert(deltaT > 0.0)
398
398
        """
399
399
        self.barProperties["cross section area"] = np.pi * 0.25 * self.barProperties["diameter"]**2
400
400
        self.barProperties["c0"] = np.sqrt(self.barProperties["YoungsE"] / self.barProperties["rho"])
 
401
        print "computed bar c0 is ", self.barProperties["c0"] 
401
402
        
402
403
        
403
404
    def readData(self):
447
448
        self.sampleDt = self.time[1] - self.time[0]
448
449
        flash_idx = tools.find_TTL(self.flash)
449
450
        if flash_idx > 0.0:
450
 
            flash_time = self.time[flash_idx] + 0.03 # additional delay of 0.03 observed in two experiments
 
451
            flash_time = self.time[flash_idx]
451
452
            print "line scan start delay is %g msec" % (flash_time)
452
453
            print "offsetting entire time axis"
453
454
            self.time -= flash_time
490
491
if __name__ == "__main__":
491
492
    
492
493
    calibrationDataFile = "calQS.ini"
493
 
    datafile_in = "/home/gcg/SHTB/20170804_Puls_Flash/2/export.txt"
 
494
    datafile_in = "/home/gcg/SHTB/20171005_PP/export.txt"
494
495
    barProperties = { "YoungsE" : 69.0,
495
496
                      "rho" : 2700.0e-9,
496
 
                      "knownBarVelocity" : 9.14,
 
497
                      "knownBarVelocity" : 11.8,
497
498
                      "diameter" : 16.0}
498
499
     
499
 
    sampleProperties = {"Ls" : 3.0,
500
 
                        "cross_section" : np.pi * 8.0**2}
 
500
    sampleProperties = {"Ls" : 16.0,
 
501
                        "cross_section" : 18}
501
502
    
502
503
    shiftThreshold = 0.1 # approx. 10% of failure force, used for shifting inc wave to tra wave 
503
504