In [1]:
%matplotlib inline
import numpy as np
import scipy.signal, scipy.stats
import matplotlib.pyplot as plt
import mpld3
import dateutil
from numpy.polynomial.chebyshev import chebfit
from astropy.io import fits
mpld3.enable_notebook()
In [2]:
def getdata(filename,filterwidth=49):
    m = fits.open(filename)[0].data
    t=np.median(m,axis=1)
    dt=t-scipy.signal.medfilt(t,filterwidth)
    ct,clo,chi=scipy.stats.sigmaclip(dt)
    print(filename,len(m),m.mean(),m.std(),np.median(m))
    print(ct.std(),ct.mean(),len(ct),clo,chi)
    k=np.where((clo<dt)&(dt<chi))[0]
    mt = np.array([dateutil.parser.parse(line[-28:-5]) for line in open(filename.replace('.fits','.filenames'))])
    assert len(mt) == len(m), (len(mt),len(m))
    return mt[k],m[k,:]

def normalizepixelwrt1chip(m,chip,xpos):
    scalefactor=np.median(m[:,chip*2144:(chip+1)*2144])
#    print('scalefactor:',scalefactor)
    return m[:,chip*2144+xpos]/scalefactor

def markvstevents(figs):
    import datetime
    for datum,comment in [
        (datetime.date(2012,12,5), 'System throughput increased by 5% due to washing of M1.'),
        (datetime.date(2013,3,24), 'Temporary change in sky flat morphologies due to technical tests with improved baffling.'),
        (datetime.date(2014,1,8),  'Change of flat field morphology due to installation of improved baffling on the VST.'),
        (datetime.date(2014,4,6),  'The installation of the baffle is completed.'),
        (datetime.date(2014,8,16), 'VST is back to normal service.'),
        (datetime.date(2015,4,30), 'A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.'),
    ]:
        for fig in figs:
            if hasattr(fig,'get_ylim'):
                fig.plot([datum,datum],fig.get_ylim())
            else:
                fig.plot([datum,datum],fig.gca().get_ylim())
        print(datum,comment)
In [3]:
tg,g = getdata('dome-g-y2800-73-80.fits')
ti,i = getdata('dome-i-y2800-73-80.fits')
tu,u = getdata('dome-u-y2800-73-80.fits')
tugri,ugri = getdata('dome-ugri-y2800-73-80.fits')
tHa,Ha = getdata('dome-Halpha-y2800-73-80.fits')
dome-g-y2800-73-80.fits 2876 29040.9 7916.97 30632.8
40.4466316223 -1.17658653846 2600 -162.963113028 160.609939951
dome-i-y2800-73-80.fits 2803 123338.0 31676.5 129376.0
149.73022929 -2.54862181958 2594 -601.469538979 596.37229534
dome-u-y2800-73-80.fits 3068 417.294 119.556 442.458
1.14319111452 -0.0276936955477 2865 -4.60045815361 4.54507076252
dome-ugri-y2800-73-80.fits 2771 84484.1 58480.9 39903.0
43.8999213181 0.080111060049 2550 -175.519574212 175.679796332
dome-Halpha-y2800-73-80.fits 1519 12080.1 3425.41 12824.8
16.8305146021 -0.254687786802 1362 -67.5767461952 67.0673706216
In [4]:
f, (ax1, ax2, ax3, ax4, ax5) = plt.subplots(5, sharex=True, sharey=False, figsize=(12,10))
chip, xpos = 2, 500
ax1.plot(tg,g[:,chip*2144+xpos],'.g')
ax2.plot(ti,i[:,chip*2144+xpos],'.r')
ax3.plot(tu,u[:,chip*2144+xpos],'.b')
ax4.plot(tugri,ugri[:,chip*2144+xpos],'.c')
ax5.plot(tHa,Ha[:,chip*2144+xpos],'.m')
chip, xpos = 2, 2144-500
ax1.plot(tg,g[:,chip*2144+xpos],'.g')
ax2.plot(ti,i[:,chip*2144+xpos],'.r')
ax3.plot(tu,u[:,chip*2144+xpos],'.b')
ax4.plot(tugri,ugri[:,chip*2144+xpos],'.c')
ax5.plot(tHa,Ha[:,chip*2144+xpos],'.m')
markvstevents([ax1,ax2,ax3,ax4,ax5])
2012-12-05 System throughput increased by 5% due to washing of M1.
2013-03-24 Temporary change in sky flat morphologies due to technical tests with improved baffling.
2014-01-08 Change of flat field morphology due to installation of improved baffling on the VST.
2014-04-06 The installation of the baffle is completed.
2014-08-16 VST is back to normal service.
2015-04-30 A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.
In [5]:
plt.figure(figsize=(12,4))
plt.ylim(0.8,1.2)
plt.rc('lines',markersize=3)
chip, xpos = 2, 500
plt.plot(tg,normalizepixelwrt1chip(g,chip,xpos),'.g')
plt.plot(ti,normalizepixelwrt1chip(i,chip,xpos),'.r')
plt.plot(tu,normalizepixelwrt1chip(u,chip,xpos),'.b')
plt.plot(tugri,normalizepixelwrt1chip(ugri,chip,xpos),'.c')
plt.plot(tHa,normalizepixelwrt1chip(Ha,chip,xpos),'.m')
markvstevents([plt])
2012-12-05 System throughput increased by 5% due to washing of M1.
2013-03-24 Temporary change in sky flat morphologies due to technical tests with improved baffling.
2014-01-08 Change of flat field morphology due to installation of improved baffling on the VST.
2014-04-06 The installation of the baffle is completed.
2014-08-16 VST is back to normal service.
2015-04-30 A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.
In [6]:
plt.figure(figsize=(12,4))
plt.ylim(0.8,1.2)
plt.rc('lines',markersize=3)
chip, xpos = 2, 2144-500
plt.plot(tg,normalizepixelwrt1chip(g,chip,xpos),'.g')
plt.plot(ti,normalizepixelwrt1chip(i,chip,xpos),'.r')
plt.plot(tu,normalizepixelwrt1chip(u,chip,xpos),'.b')
plt.plot(tugri,normalizepixelwrt1chip(ugri,chip,xpos),'.c')
plt.plot(tHa,normalizepixelwrt1chip(Ha,chip,xpos),'.m')
markvstevents([plt])
2012-12-05 System throughput increased by 5% due to washing of M1.
2013-03-24 Temporary change in sky flat morphologies due to technical tests with improved baffling.
2014-01-08 Change of flat field morphology due to installation of improved baffling on the VST.
2014-04-06 The installation of the baffle is completed.
2014-08-16 VST is back to normal service.
2015-04-30 A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.
In [7]:
f, (ax1, ax2, ax3, ax4, ax5) = plt.subplots(5, sharex=True, sharey=False, figsize=(12,8))
chip, xlo, xhi = 2, 400, 2144-400
ax1.plot(tg,g[:,chip*2144+xlo]-g[:,chip*2144+xhi],'.g')
ax2.plot(ti,i[:,chip*2144+xlo]-i[:,chip*2144+xhi],'.r')
ax3.plot(tu,u[:,chip*2144+xlo]-u[:,chip*2144+xhi],'.b')
ax4.plot(tugri,ugri[:,chip*2144+xlo]-ugri[:,chip*2144+xhi],'.c')
ax5.plot(tHa,Ha[:,chip*2144+xlo]-Ha[:,chip*2144+xhi],'.m')
markvstevents([ax1,ax2,ax3,ax4,ax5])
2012-12-05 System throughput increased by 5% due to washing of M1.
2013-03-24 Temporary change in sky flat morphologies due to technical tests with improved baffling.
2014-01-08 Change of flat field morphology due to installation of improved baffling on the VST.
2014-04-06 The installation of the baffle is completed.
2014-08-16 VST is back to normal service.
2015-04-30 A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.
In [8]:
f, (ax1, ax2, ax3, ax4, ax5) = plt.subplots(5, sharex=True, sharey=False, figsize=(12,8))
chip, xlo, xhi = 5, 500, 2144-500
ax1.plot(tg,g[:,chip*2144+xlo]/g[:,chip*2144+xhi],'.g')
ax2.plot(ti,i[:,chip*2144+xlo]/i[:,chip*2144+xhi],'.r')
ax3.plot(tu,u[:,chip*2144+xlo]/u[:,chip*2144+xhi],'.b')
ax4.plot(tugri,ugri[:,chip*2144+xlo]/ugri[:,chip*2144+xhi],'.c')
ax5.plot(tHa,Ha[:,chip*2144+xlo]/Ha[:,chip*2144+xhi],'.m')
markvstevents([ax1,ax2,ax3,ax4,ax5])
#for fig in [ax1,ax2,ax3,ax4,ax5]: fig.set_ylim(0.95,1.05)
2012-12-05 System throughput increased by 5% due to washing of M1.
2013-03-24 Temporary change in sky flat morphologies due to technical tests with improved baffling.
2014-01-08 Change of flat field morphology due to installation of improved baffling on the VST.
2014-04-06 The installation of the baffle is completed.
2014-08-16 VST is back to normal service.
2015-04-30 A set of baffle with a complete redesign of the inner ribs to reduce oblique reflections have been installed.
In [9]:
chip, xlo, xhi = 2, 500, 2144-500
plt.plot(tg,g[:,chip*2144+xlo]-g[:,chip*2144+xhi],'.g')
#ax2.plot(ti,i[:,chip*2144+xlo]-i[:,chip*2144+xhi],'.r')
#ax3.plot(tu,u[:,chip*2144+xlo]-u[:,chip*2144+xhi],'.b')
#ax4.plot(tugri,ugri[:,chip*2144+xlo]-ugri[:,chip*2144+xhi],'.c')
#ax5.plot(tHa,Ha[:,chip*2144+xlo]-Ha[:,chip*2144+xhi],'.m')
#for fig in [ax1,ax2,ax3,ax4,ax5]: markvstevents(fig)
Out[9]:
[<matplotlib.lines.Line2D at 0x7fb710217978>]