示例#1
0
def runGUI(filename, camname, imgnum, verbose=False, loglevel=0):
    # ======================================
    # Set up logging
    # ======================================
    logger = mt.mylogger(filename='runGUI')  # noqa

    # ======================================
    # Load data and run program
    # ======================================

    data = E200.E200_load_data(filename, local=False)
    
    # Generate or retrieve qt app
    app = mt.qt.get_app()

    window = ButterflyGUI(
        analyzefcn = analyze_matlab ,
        savefcn    = save_analysis  ,
        dataset    = data           ,
        camname    = camname        ,
        imgnum     = imgnum         ,
        verbose    = verbose
        )
    # img = np.random.randn(10, 10)
    # window = ButterflyGUI(analyze_matlab, image=img)
    # window.ui.imageview_mpl.img.image=img
    window.show()
    app.exec_()
示例#2
0
import analyze_matlab as analyze_matlab

from save_analysis import save_analysis

sets = [
    ['20140625', '13438'],
    ['20140625', '13449'],
    ['20140625', '13450'],
    ['20140629', '13537']
    ]

#  sets = [['20140625', '13438'],
sets = [['20140629', '13537']]
#  sets = [['20140625', '13450']]

logger = mt.mylogger(filename='reprocess')
logger.setLevel(51)
logger.debug('Beginning reprocessing...')

for pair in sets:
    setdate   = pair[0]
    setnumber = pair[1]

    loadfile     = 'nas/nas-li20-pm00/E200/2014/{}/E200_{}'.format(setdate, setnumber)
    data         = E200.E200_load_data(loadfile, local=True)
    wf           = data.write_file
    data_wf      = wf['data']
    processed_wf = data_wf['processed']
    arrays_wf    = processed_wf['arrays']
    vectors_wf   = processed_wf['vectors']
示例#3
0
#!/usr/bin/env python -m pdb

import E200 as E200
import mytools as mt

mt.mylogger('basictest')

try:
    data_a.close()  # noqa
    data_b.close()  # noqa
except:
    pass

# ======================================
# Diagnose set A
# ======================================
set_a        = ['20140625', '13438']
emit_n_str_a = 'ss_ELANEX_emit_n'

setdate     = set_a[0]
setnumber   = set_a[1]
loadfile    = 'nas/nas-li20-pm00/E200/2014/{}/E200_{}'.format(setdate, setnumber)
data_a      = E200.E200_load_data(loadfile)
wf_a        = data_a.write_file
processed_a = wf_a['data']['processed']
vectors_a   = processed_a['vectors']
arrays_a    = processed_a['arrays']
scalars_a   = processed_a['scalars']

emit_n_a_str = scalars_a[emit_n_str_a]
emit_n_a     = E200.E200_api_getdat(emit_n_a_str)
示例#4
0
#!/usr/bin/env python
import ButterflyEmittancePython as bt
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import mytools as mt
import numpy as np
import os
import ElegantPy
import shlex
import slactrac as sltr
import subprocess

logger = mt.mylogger(filename='worksheet')
# Set up initial beam
energy_offset = np.float(3)
energy0       = np.float(20.35)
gamma         = sltr.GeV2gamma(energy0+energy_offset)
emitx         = np.float(100e-6)
emity         = emitx

QS1_K1_default = 3.8743331090707228e-1
QS2_K1_default = -2.5439067538354171e-1
PEXT_Z = 1994.97
QS1_Z = 1998.71
AL_Z = 2015.16
BE_Z = 1996.34
ELANEX_Z = 2015.22
# IP2QS1_length = 5.4217
IP2QS1_length = QS1_Z-PEXT_Z

beam_x = sltr.BeamParams(
示例#5
0
#         wf.close()
# except:
#         pass

sets = [['20140625', '13438'],
    # ['20140625', '13449'],
    ['20140629', '13537'],
    ['20140625', '13450']]
# sets = [['20140625', '13438'],
sets = [['20140629', '13537']]
# sets = [['20140625', '13450']]

# ======================================
# Set up logging
# ======================================
logger = mt.mylogger(filename='postproc')

logger.critical('Logging set up')

for pair in sets:
    setdate   = pair[0]
    setnumber = pair[1]

    loadfile = 'nas/nas-li20-pm00/E200/2014/{}/E200_{}'.format(setdate, setnumber)
    
    data      = E200.E200_load_data(loadfile)
    wf        = data.write_file
    processed = wf['data']['processed']
    vectors   = processed['vectors']
    arrays    = processed['arrays']
    scalars   = processed['scalars']
示例#6
0
#!/usr/bin/env python
# #!/usr/bin/env python #-m pdb

# import sys
# from IPython.core import ultratb
# sys.excepthook = ultratb.FormattedTB(mode='Verbose',
# color_scheme='Linux', call_pdb=1)

import E200
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import mytools as mt
import numpy as np
import scipy.io

logger = mt.mylogger(filename='compare_SCorde')

filebase = 'E200_13450'
dataset = '13438'
filebase = 'E200_{}'.format(dataset)
filename = '{}.mat'.format(filebase)

f = scipy.io.loadmat(filename)

# g = h5.File(filename, 'r', driver='core', backing_store=False)

camname = f[filebase].dtype.names[0]
cam     = f[filebase][camname][0, 0]

# ======================================
# Get Sebastien's emittance, UID