num_delays = [63,46]
   abc_correlation_mean = np.zeros(num_delays[abc_baseline])
   def_correlation_mean = np.zeros(num_delays[def_baseline])
   ghi_correlation_mean = np.zeros(num_delays[ghi_baseline])
   abc_correlation_mean_uncor = np.zeros(num_delays[abc_baseline])
   def_correlation_mean_uncor = np.zeros(num_delays[def_baseline])
   ghi_correlation_mean_uncor = np.zeros(num_delays[ghi_baseline])
   
   SNR_counter = 0
   threshold_counter = 0
   
   ############ Run trials to get noise average #######################
   
   # Read in thermal data for avg. subtraction
   if(debug==True): print "Reading thermal noise data"
   time,a_uncor_therm,b_uncor_therm,c_uncor_therm,d_uncor_therm,e_uncor_therm,f_uncor_therm,a_therm,b_therm,c_therm,d_therm,e_therm,f_therm = ttb.read_data_from_data_file(100.00,samples_to_read,0)
   if(debug==True): print "Finished reading first thermal noise data"
   time,d_uncor_therm,e_uncor_therm,f_uncor_therm,g_uncor_therm,h_uncor_therm,i_uncor_therm,d_therm,e_therm,f_therm,g_therm,h_therm,i_therm = ttb.read_data_from_data_file(100.00,samples_to_read,1)
   if(debug==True): print "Finished reading second thermal noise data"
   num_thermal_samples = len(a_therm)

   num_trials = 100#int(num_thermal_samples/TISC_sample_length)
   for timestep in range(1,num_trials+1):
      if(debug==True and timestep % 100==0):
         print "\nStarting trial: "+str(timestep)
      start = timestep*num_samples_per_window
      end = start+num_samples_per_window
      if(end>=num_thermal_samples):
         break
      d1,d2,d3,abc_correlation_mean,d4,d5,d6,d7,d8,d9 = sum_correlate(num_samples_per_window,a_therm[start:end],b_therm[start:end],c_therm[start:end],100,abc_baseline,TISC_sample_length=16,delay_type_flag=1,average_subtract_flag=1,correlation_mean=abc_correlation_mean,trial_run_number=timestep)
      d1,d2,d3,def_correlation_mean,d4,d5,d6,d7,d8,d9 = sum_correlate(num_samples_per_window,d_therm[start:end],e_therm[start:end],f_therm[start:end],100,def_baseline,TISC_sample_length=16,delay_type_flag=1,average_subtract_flag=1,correlation_mean=def_correlation_mean,trial_run_number=timestep)
 #if(boresight==0):
 # Start working on data with impulses
 center_SNR_index,center_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter])
 if(SNR[SNR_counter]==0): center_SNR_value=0.00
 if(debug==True): print "Center SNR: %1.2f"%center_SNR_value
 abc_SNR_index,abc_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter]*abc_impulse_amp)
 abc_atten_value = array_of_impulse_atten[abc_SNR_index]
 if(debug==True): print "ABC SNR: %1.2f"%abc_SNR_value
 def_SNR_index,def_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter]*def_impulse_amp)
 def_atten_value = array_of_impulse_atten[def_SNR_index]
 if(debug==True): print "DEF SNR: %1.2f"%def_SNR_value
 #ghi_SNR_index,ghi_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter]*ghi_impulse_amp)
 #ghi_atten_value = array_of_impulse_atten[ghi_SNR_index]
 #if(debug==True): print "GHI SNR: %1.2f"%ghi_SNR_value
 if(SNR[SNR_counter]!=0):
    time,a_uncor,b_uncor,c_uncor,d_uncor,e_uncor,f_uncor,a,b,c,d,e,f = ttb.read_data_from_data_file(abc_atten_value,samples_to_read,0)
    #time,d_uncor,e_uncor,f_uncor,d1,d2,d3,d,e,f,d4,d5,d6 = ttb.read_data_from_data_file(def_atten_value,samples_to_read,1)
    #time,g_uncor,h_uncor,i_uncor,d1,d2,d3,g,h,i,d4,d5,d6 = ttb.read_data_from_data_file(ghi_atten_value,samples_to_read,2)
    """
    elif(boresight==1):
       # Start working on data with impulses
       center_SNR_index,center_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter])
       center_atten_value = array_of_impulse_atten[center_SNR_index]
       if(debug==True): print "Center SNR: %1.2f"%center_SNR_value
       side_SNR_index,side_SNR_value = ttb.find_nearest(array_of_SNR_values,center_SNR_value*0.9235)
       side_atten_value = array_of_impulse_atten[side_SNR_index]
       if(debug==True): print "Side SNR: %1.2f"%side_SNR_value
       far_side_SNR_index,far_side_SNR_value = ttb.find_nearest(array_of_SNR_values,center_SNR_value*0.6500)
       far_side_atten_value = array_of_impulse_atten[far_side_SNR_index]
       if(debug==True): print "Far Side SNR: %1.2f"%far_side_SNR_value
       # Read in impulsive data
Example #3
0
   num_delays = [63,46]
   abc_correlation_mean = np.zeros(num_delays[abc_baseline])
   def_correlation_mean = np.zeros(num_delays[def_baseline])
   ghi_correlation_mean = np.zeros(num_delays[ghi_baseline])
   abc_correlation_mean_uncor = np.zeros(num_delays[abc_baseline])
   def_correlation_mean_uncor = np.zeros(num_delays[def_baseline])
   ghi_correlation_mean_uncor = np.zeros(num_delays[ghi_baseline])
   
   SNR_counter = 0
   threshold_counter = 0
   
   ############ Run trials to get noise average #######################
   
   # Read in thermal data for avg. subtraction
   if(debug==True): print "Reading thermal noise data"
   time,a_uncor_therm,b_uncor_therm,c_uncor_therm,d_uncor_therm,e_uncor_therm,f_uncor_therm,a_therm,b_therm,c_therm,d_therm,e_therm,f_therm = ttb.read_data_from_data_file(100.00,samples_to_read,0)
   if(debug==True): print "Finished reading first thermal noise data"
   time,d_uncor_therm,e_uncor_therm,f_uncor_therm,g_uncor_therm,h_uncor_therm,i_uncor_therm,d_therm,e_therm,f_therm,g_therm,h_therm,i_therm = ttb.read_data_from_data_file(100.00,samples_to_read,1)
   if(debug==True): print "Finished reading second thermal noise data"
   num_thermal_samples = len(a_therm)

   num_trials = 100#int(num_thermal_samples/TISC_sample_length)
   for timestep in range(1,num_trials+1):
      if(debug==True and timestep % 100==0):
         print "\nStarting trial: "+str(timestep)
      start = timestep*num_samples_per_window
      end = start+num_samples_per_window
      if(end>=num_thermal_samples):
         break
      d1,d2,d3,abc_correlation_mean,d4,d5,d6,d7,d8,d9 = sum_correlate(num_samples_per_window,a_therm[start:end],b_therm[start:end],c_therm[start:end],100,abc_baseline,TISC_sample_length=16,delay_type_flag=1,average_subtract_flag=1,correlation_mean=abc_correlation_mean,trial_run_number=timestep)
      d1,d2,d3,def_correlation_mean,d4,d5,d6,d7,d8,d9 = sum_correlate(num_samples_per_window,d_therm[start:end],e_therm[start:end],f_therm[start:end],100,def_baseline,TISC_sample_length=16,delay_type_flag=1,average_subtract_flag=1,correlation_mean=def_correlation_mean,trial_run_number=timestep)
   center_SNR_index, center_SNR_value = ttb.find_nearest(
       array_of_SNR_values, SNR[SNR_counter])
   if (SNR[SNR_counter] == 0): center_SNR_value = 0.00
   if (debug == True): print "Center SNR: %1.2f" % center_SNR_value
   abc_SNR_index, abc_SNR_value = ttb.find_nearest(
       array_of_SNR_values, SNR[SNR_counter] * abc_impulse_amp)
   abc_atten_value = array_of_impulse_atten[abc_SNR_index]
   if (debug == True): print "ABC SNR: %1.2f" % abc_SNR_value
   def_SNR_index, def_SNR_value = ttb.find_nearest(
       array_of_SNR_values, SNR[SNR_counter] * def_impulse_amp)
   def_atten_value = array_of_impulse_atten[def_SNR_index]
   if (debug == True): print "DEF SNR: %1.2f" % def_SNR_value
   #ghi_SNR_index,ghi_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter]*ghi_impulse_amp)
   #ghi_atten_value = array_of_impulse_atten[ghi_SNR_index]
   #if(debug==True): print "GHI SNR: %1.2f"%ghi_SNR_value
   time, a_uncor, b_uncor, c_uncor, d_uncor, e_uncor, f_uncor, a, b, c, d, e, f = ttb.read_data_from_data_file(
       abc_atten_value, samples_to_read, 0)
   #time,d_uncor,e_uncor,f_uncor,d1,d2,d3,d,e,f,d4,d5,d6 = ttb.read_data_from_data_file(def_atten_value,samples_to_read,1)
   #time,g_uncor,h_uncor,i_uncor,d1,d2,d3,g,h,i,d4,d5,d6 = ttb.read_data_from_data_file(ghi_atten_value,samples_to_read,2)
   """
 elif(boresight==1):
    # Start working on data with impulses
    center_SNR_index,center_SNR_value = ttb.find_nearest(array_of_SNR_values,SNR[SNR_counter])
    center_atten_value = array_of_impulse_atten[center_SNR_index]
    if(debug==True): print "Center SNR: %1.2f"%center_SNR_value
    side_SNR_index,side_SNR_value = ttb.find_nearest(array_of_SNR_values,center_SNR_value*0.9235)
    side_atten_value = array_of_impulse_atten[side_SNR_index]
    if(debug==True): print "Side SNR: %1.2f"%side_SNR_value
    far_side_SNR_index,far_side_SNR_value = ttb.find_nearest(array_of_SNR_values,center_SNR_value*0.6500)
    far_side_atten_value = array_of_impulse_atten[far_side_SNR_index]
    if(debug==True): print "Far Side SNR: %1.2f"%far_side_SNR_value
    # Read in impulsive data