コード例 #1
0
def get_jobids_from_file(direct,
                         circuit_name=None,
                         run_type=None,
                         timestamp=None):
    '''
    The jobids are loaded from the last saved file if direct=True.
    If not,they are loaded from the file specified by circuit name and run type and timestamp
    returns a 2-length list of the jobids and the data corresponding to the jobid stored in the pickle file.
    See Functions.Data_storage.save_jobdata() for more info of the data
    '''
    if direct == True:
        loaded_jobiddata = store.load_last()
    elif direct == False:
        if circuit_name == None:
            circuit_name = input('Circuit name: ')
        if run_type == None:
            run_type = input('Run Type: ')
        if timestamp == None:
            date = input('Date of experiment (mm_dd):')
            time = input('Time of experiment (hh_mm_ss):')
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  date + '-' + time)
        else:
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  timestamp)
    nr_batches = loaded_jobiddata['Batchnumber']
    jobids = [''] * nr_batches
    for job in loaded_jobiddata['Data']:
        jobids[job['batchno']] = job['Jobid']
    return [jobids, loaded_jobiddata]
コード例 #2
0
def get_tomoset_from_file(direct,
                          circuit_name=None,
                          run_type=None,
                          timestamp=None):
    if direct == True:
        loaded_jobiddata = store.load_last()
    elif direct == False:
        if circuit_name == None:
            circuit_name = input('Circuit name: ')
        if run_type == None:
            run_type = input('Run Type: ')
        if timestamp == None:
            date = input('Date of experiment (mm_dd):')
            time = input('Time of experiment (hh_mm_ss):')
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  date + '-' + time)
        else:
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  timestamp)
    return loaded_jobiddata['tomoset']
コード例 #3
0
def get_jobids_from_file(direct,
                         circuit_name=None,
                         run_type=None,
                         timestamp=None):
    if direct == True:
        loaded_jobiddata = store.load_last()
    elif direct == False:
        if circuit_name == None:
            circuit_name = input('Circuit name: ')
        if run_type == None:
            run_type = input('Run Type: ')
        if timestamp == None:
            date = input('Date of experiment (mm_dd):')
            time = input('Time of experiment (hh_mm_ss):')
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  date + '-' + time)
        else:
            loaded_jobiddata = store.load_jobdata(circuit_name, run_type,
                                                  timestamp)
    nr_batches = loaded_jobiddata['Batchnumber']
    jobids = [''] * nr_batches
    for job in loaded_jobiddata['Data']:
        jobids[job['batchno']] = job['Jobid']
    return [jobids, loaded_jobiddata]
コード例 #4
0
import Functions.Data_storage as store
import Analysis.Analysefunc as an
import Analysis.tomography_functions as tomoself
import Functions.Plotting as pt
import numpy as np


fit_method = 'own'
n = 2


direct = False

#%% Gather the results from file
if direct == True:
    timestamp = store.load_last()['Experiment time']
    run_type = store.load_last()['Type']
    circuit_name = store.load_last()['Circuit name']
else:
    run_type = input('Run Type is (enter as string): ')
    circuit_name = input('Circuit name is(enter as string): ')
    timestamp = None
results_loaded = store.load_results(circuit_name, run_type, timestamp)


#%% Gather the tomo set and its outcomes from the results
tomo_set = results_loaded['Tomoset']
results = results_loaded['Results']
tomo_data = an.tomo.tomography_data(results, circuit_name, tomo_set)

#%% Tomography;