if test_name in words[0]: break gms.close() record_name = words[1] Magnitude = float(words[2]) data_csv = test_name+'.csv' test_record = record_name+'_'+str(int(Magnitude*100)) ################################################################################### #call test data channel = cH.calltestdata(frame_type, test_record) time = np.arange(0, len(channel['Load_Cell_Lower_S'])*DT, DT) #call ruaumoko data if ruau_show == 1: Ruaumoko = cH.callruaudata(frame_type, test_record) DT_ruau = 0.01 time_ruau = np.arange(0.1, len(Ruaumoko['floor_displacement_0'])*DT_ruau+0.1, DT_ruau) #call ruaumoko prediction if ruau_pred == 1: Ruaumoko_pred = cH.callruaupred(frame_type, test_record) DT_ruau = 0.01 time_ruau_pred = np.arange(0+offset, len(Ruaumoko['floor_displacement_0'])*DT_ruau+offset, DT_ruau) #call original earthquake data try: Earthquake = cH.calleqdata(record_name) acc_EQo = Earthquake['Data']*Earthquake['Scale_Factor']*Magnitude*9.81 DT_o = Earthquake['DT'] except: acc_EQo = np.array([0, 0, 0])
channel['Velocity_ground_int'] = int_vel channel['Accel_ground_int'] = int_accel if 'fac' in frame_type or 'ult' in frame_type: pots = ['Force_Top_Fass_North', 'Force_Top_Fass_South', 'Force_Bottom_Fass_North', 'Force_Bottom_Fass_South'] for j in range(len(pots)): UFP_force = np.loadtxt(filelocation+'UFP_disp/'+frame_type+'/F_'+test_ID+'_'+str(j)+'.txt', delimiter=',', usecols=[1]) UFP_force = np.ravel(UFP_force) UFP_force = np.delete(UFP_force, -1) channel[pots[j]] = UFP_force Earthquake[i] = channel if ruaumoko == 1: ruau = {'Record': 'Rec'} for k in rec: ruau_rec = cH.callruaudata(frame_type, test_ID, k) ruau_rec['Time'] = np.arange(offset_rec[rec.index(k)], len(ruau_rec['floor_displacement_0'])*0.01+offset_rec[rec.index(k)], 0.01) ruau[k] = ruau_rec Ruau_rec[i] = ruau # Original Acceleration file try: earthquake = cH.calleqdata(test_id[test_name.index(i)][0]) acceleration = earthquake['Data']*earthquake['Scale_Factor']*Magnitude DT_a = earthquake['DT'] except: acceleration = np.array([0, 0, 0, 0]) DT_a = 0.05 eq_time_a = np.arange(offset_eq, len(acceleration)*DT_a+offset_eq, DT_a) orig_earthquake[i] = [acceleration, eq_time_a, DT_a]
DL_avg =[] for mag in range(len(test_sequence)): print test_sequence[mag][0], float(test_sequence[mag][2]) if 'white' in test_sequence[mag][0]: pass elif 'sine' in test_sequence[mag][0]: pass elif 'fv' in test_sequence[mag][0]: pass else: record = test_sequence[mag][1]+'_'+str(int(float(test_sequence[mag][2])*100)) EQlist.append([test_sequence[mag][1], float(test_sequence[mag][2])]) channel = cH.calltestdata(frame_type, record) if ruaumoko == 1: Ruaumoko = cH.callruaudata(frame_type, record, 'imp_recD') # peak drift # Dbuild = max(abs((channel['Drift_North_top']-channel['Table_displacement'])/33.40)) Dtop = max(abs((channel['Drift_North_top']-channel['Drift_North_mid'])/15.80)) Dbot = max(abs((channel['Drift_North_mid']-channel['Table_displacement'])/17.60)) Rtop = abs((channel['Drift_North_top'][-1]-channel['Drift_North_mid'][-1])/15.80) Rbot = abs((channel['Drift_North_mid'][-1]-channel['Table_displacement'][-1])/17.60) peak_drift.append([Dbot, Dtop]) if ruaumoko == 1: Dtop_ruau = max(abs((Ruaumoko['floor_displacement_2']-Ruaumoko['floor_displacement_1'])/1.6*100)) Dbot_ruau = max(abs((Ruaumoko['floor_displacement_1']-Ruaumoko['floor_displacement_0'])/1.6*100)) peak_drift_ruau.append([Dtop_ruau, Dbot_ruau])