Beispiel #1
0
        start = 1

    infile.close()

data = np.array(data)


# ========== Run xcor function on data ==========================================
# Create array of cross-correlation functions for the data sets

xca = [[] for i in range(len(data))]

for x in range(len(data)):

    xc, tl, nb = xcor(data[x][1], data[x][0], data[xcord][1], data[xcord][0], n_bins, True, trange)

    xca[x].append(tl)
    xca[x].append(xc)


# ======= Plots =================================================================
# plot any figures requested by input params

xp = 1
yp = len(data)

fig = plt.figure()

for x in range(len(data)):
Beispiel #2
0
start = 0

xrayin= open(xraylocation, 'r')

for y in xrayin:
	currtime, currflux,currfluxerr = y.split()
	if start == 1:
		xtime.append(float(currtime))
		xflux.append(float(currflux))
		
	start = 1

xrayin.close()

# run xcor function on data
xc, xce, tl = xcor(rflux, rtime, xflux, xtime, tstart, tend, n_bins)

simtime = [[] for q in range(2)]

# create array of positions of discrete times 
# below each xray time and the time difference
 
for n in xtime:
	simtime[0].append( int(n) - xtime[0] )
	simtime[1].append( n - int(n) )	

# --- simulate and create array of xcor fns of simulated light curves ----------

simarray = [[] for h in range(n_bins)]
first = 1
Beispiel #3
0
start = 0

for y in xrayin:
	currtime, currflux,currfluxerr = y.split()
	if start == 1:
		xtime.append(float(currtime))
		xflux.append(float(currflux))
		
	start = 1

xrayin.close()

# ========== Run xcor function on data ==========================================
# Create cross-correlation function for teh real data sets

xc, tl = xcor(rflux, rtime, xflux, xtime, n_bins)

# ========= Simulate Light Curves ===============================================
# create artificial lighturves, interpolate curve with same sampling pattern
# as data, cross-correlate with one real data set

# --- simulated curve time arrays ---
# create array of integer times from X-ray timing values from the start of the 
# observations, to correspond to the integer time sampling in the simulated 
# lightcurve, and the difference in time between the integer value and the actual
# value, in order to interpolate a value for a simulated curve follwing the same
# sampling pattern as the data 
 
simtime = [[] for q in range(2)]

for n in xtime:
Beispiel #4
0
start = 0

for y in xrayin:
	currtime, currflux,currfluxerr = y.split()
	if start == 1:
		xtime = np.append(xtime, float(currtime))
		xflux = np.append(xflux, float(currflux))
		
	start = 1

xrayin.close()

# ========== Run xcor function on data ==========================================
# Create cross-correlation function for teh real data sets

xc, tl, bav = xcor(rflux, rtime, xflux, xtime, n_bins,t_lim,t_range)
print "average bin count in cross-correlation:",bav

# ========= Simulate Light Curves ===============================================
# create artificial lighturves, interpolate curve with same sampling pattern
# as data, cross-correlate with one real data set

# --- simulated curve time arrays ---
# create array of integer times from X-ray timing values from the start of the 
# observations, to correspond to the integer time sampling in the simulated 
# lightcurve, and the difference in time between the integer value and the actual
# value, in order to interpolate a value for a simulated curve follwing the same
# sampling pattern as the data 
 
simtime = np.array([(xtime - xtime[0]).astype(int),xtime - xtime.astype(int)])