Esempio n. 1
0
k = 0
for junk, o, junk, junk, sl, junk in data_800:
    if np.shape(data_700[data_700[:, 0] == o, 1])[0] > 0:
        corrected_700[k] = o, data_700[data_700[:, 0] == o, 4][0] / sl
    else:
        corrected_700[k] = o, data_700[data_700[:, 0] < o, 4][-1] / sl

    if np.shape(data_620[data_620[:, 1] == o, 1])[0] > 0:
        corrected_620[k] = o, data_620[data_620[:, 0] == o, 4][0] / sl
    else:
        corrected_620[k] = o, data_620[data_620[:, 0] < o, 4][-1] / sl

    k += 1

xx = data_800[:, 1] / param.last_orbits[orbit_id] * 365.
xx = figures.convert_date(xx)

fig = plt.figure()
ax = plt.subplot(111)
# zooms
ax.yaxis.set_major_locator(MultipleLocator(0.5))
ax.yaxis.set_minor_locator(MultipleLocator(0.1))

#pax.yaxis.set_major_locator(MultipleLocator(1.))
#pax.yaxis.set_minor_locator(MultipleLocator(0.5))

#ax.xaxis.set_major_locator(MultipleLocator(20.))

ax.xaxis.grid(True, 'minor')
ax.yaxis.grid(True, 'minor')
ax.xaxis.grid(True, 'major', linewidth=2)
Esempio n. 2
0
fig = plt.figure()
ax = plt.subplot(111)

maxy = 0.
miny = 0.

for orbit_id, legend in zip(orbit_ids, legends):
    folder_flux, folder_figures, folder_misc = init_folders(orbit_id)
    data = np.loadtxt('%d_misc/%s' % (orbit_id, error_file), delimiter=',')
    dates = data[:, 0] / param.last_orbits[orbit_id] * 365.
    values = data[:, 1]

    if np.amax(values) > maxy: maxy = np.amax(values)
    if np.min(values) < miny: miny = np.amin(values)

    dates = figures.convert_date(dates)
    ax.plot(dates, values, label=legend, linewidth=2)

fig.autofmt_xdate()
plt.ylim([miny * 0.95, maxy * 1.05])

plt.grid()
ax.xaxis.grid(True, 'major', linewidth=2)
ax.yaxis.grid(True, 'major', linewidth=2)
plt.legend(loc='upper center')

folder_figures = 'all_figures/'
if average == '':
    plt.ylabel(
        r'$\mathrm{Mean\ stray\ light\ flux\ }\left[\frac{\mathrm{ph}}{\mathrm{px}\cdot\mathrm{s}}\right]$'
    )
print >> f, 'error_mean:', np.mean(data[:,3])
print >> f, 'error_std:', np.std(data[:,3])

fig=plt.figure()
ax=plt.subplot(111)

ax.yaxis.set_major_locator(MultipleLocator(5))
ax.yaxis.set_minor_locator(MultipleLocator(1))

ax.xaxis.grid(True,'minor')
ax.yaxis.grid(True,'minor')
ax.xaxis.grid(True,'major',linewidth=2)
ax.yaxis.grid(True,'major',linewidth=2)

xx = data[:,1]/param.last_orbits[orbit_id]*365.
xx = figures.convert_date(xx)
plt.plot(xx, data[:,3]*100, linewidth=1.5)
plt.plot([xx[0],xx[-1]], [p*100., p*100.], color='r', lw=3)
fig.autofmt_xdate()

plt.ylim([0, 15])

plt.ylabel(r'$\mathrm{Error\ to\ previous\ step\ [\%]}$')

# Saves the figure
fname = '%serror_evolution_%d_%d' % (folder_figures,orbit_id,sl_angle)
figures.savefig(fname,fig,fancy)

############ STRAY LIGHT
print >> f, '# STRAY LIGHT'
fig=plt.figure()
ax=plt.subplot(111)

maxy = 0.
miny = 0.

for orbit_id, legend in zip(orbit_ids,legends):
	folder_flux, folder_figures, folder_misc = init_folders(orbit_id)
	data = np.loadtxt('%d_misc/%s' % (orbit_id, error_file), delimiter=',')
	dates = data[:,0]/param.last_orbits[orbit_id]*365.
	values= data[:,1]

	if np.amax(values) > maxy: maxy = np.amax(values)
	if np.min(values) < miny: miny = np.amin(values)

	dates = figures.convert_date(dates)
	ax.plot(dates, values,label=legend, linewidth=2)


fig.autofmt_xdate()
plt.ylim([miny*0.95,maxy*1.05])

plt.grid()
ax.xaxis.grid(True,'major',linewidth=2)
ax.yaxis.grid(True,'major',linewidth=2)
plt.legend(loc='upper center')

folder_figures= 'all_figures/'
if average == '' : plt.ylabel(r'$\mathrm{Mean\ stray\ light\ flux\ }\left[\frac{\mathrm{ph}}{\mathrm{px}\cdot\mathrm{s}}\right]$')
if average == '_max' : plt.ylabel(r'$\mathrm{Mean\ maximum\ stray\ light\ flux\ }\left[\frac{\mathrm{ph}}{\mathrm{px}\cdot\mathrm{s}}\right]$')
if average == '_maxdir' : plt.ylabel(r'$\mathrm{Flux\ in\ worst\ direction}\left[\frac{\mathrm{ph}}{\mathrm{px}\cdot\mathrm{s}}\right]$')