Example #1
0
    def __init__(self, fileid, simid):
        self.waveforms = {}
        self.id = simid

        ## Read the simulation parameters (temperature, ...)
        ## Try to find simulation sweep variables
        ## First comes three paramaters
        self.params = {}
        self.variablenames = []
        self.variables = {}
        n = jwdb.ams_sim_get_simulation_parameter_number(fileid)
        for i in range(1, n + 1):
            tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(
                fileid, i)

            if name not in reserved_params:
                try:
                    value = float(val)
                except ValueError:
                    continue
                self.variablenames.append(name)
                self.variables[name] = value
            else:
                if name in ('Creation_Date', 'Creation_Time', 'Title'):
                    self.params[name] = val
                else:
                    self.params[name] = float(val)

        ## Get unit of X axis
        self.xunit = jwdb.ams_sim_get_x_unit_name(fileid)

        ## Get first waveform name and identifier by putting 0 at last argument
        wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, 0)
        while wid > 0:
            waveform = _Waveform(fileid, self, wid, wavename)

            self.waveforms[wavename] = waveform

            wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, wid)
Example #2
0
    def __init__(self, fileid, simid):
        self.waveforms = {}
        self.id = simid

        ## Read the simulation parameters (temperature, ...)
        ## Try to find simulation sweep variables
        ## First comes three paramaters 
        self.params = {}
        self.variablenames = []
        self.variables = {}
        n = jwdb.ams_sim_get_simulation_parameter_number(fileid)
        for i in range(1,n+1):
            tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(fileid, i)

            if name not in reserved_params:
                try:
                    value = float(val)
                except ValueError:
                    continue
                self.variablenames.append(name)
                self.variables[name] = value
            else:
                if name in ('Creation_Date', 'Creation_Time', 'Title'):
                    self.params[name] = val
                else:
                    self.params[name] = float(val)

        ## Get unit of X axis
        self.xunit = jwdb.ams_sim_get_x_unit_name(fileid)

        ## Get first waveform name and identifier by putting 0 at last argument
        wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, 0)
        while wid > 0:
            waveform = _Waveform(fileid, self, wid, wavename)
            
            self.waveforms[wavename] = waveform

            wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, wid)
Example #3
0
if fileid < 0:
    raise IOError("Cannot open WDB file %s" % filename)

## Get time and date
date = jwdb.ams_sim_get_creation_date(fileid)
time = jwdb.ams_sim_get_creation_time(fileid)

## Load first simulation results
loadflag = jwdb.ams_sim_load_simu_with_complex(fileid)
while loadflag > 0:
    n = jwdb.ams_sim_get_simulation_parameter_number(fileid)

    ## Read the simulation parameters (temperature, ...)
    params = {}
    for i in range(1, n + 1):
        tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(fileid, i)
        params[name] = val

    ## Get unit of X axis
    xunit = jwdb.ams_sim_get_x_unit_name(fileid)
    print "xunit", xunit

    ## Get first waveform name and identifier by putting 0 at last argument
    wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, 0)
    while wid > 0:
        print wid, wavename

        ## Get unit of Y axis
        yunit = jwdb.ams_sim_get_wave_unit_name(fileid, wid)
        print "yunit", yunit
Example #4
0
if fileid < 0:
    raise IOError("Cannot open WDB file %s"%filename)

## Get time and date
date = jwdb.ams_sim_get_creation_date(fileid)
time = jwdb.ams_sim_get_creation_time(fileid)

## Load first simulation results
loadflag = jwdb.ams_sim_load_simu_with_complex(fileid)
while loadflag > 0:
    n = jwdb.ams_sim_get_simulation_parameter_number(fileid)

    ## Read the simulation parameters (temperature, ...)
    params = {}
    for i in range(1,n+1):
        tmp, name, val = jwdb.ams_sim_get_simulation_parameter_info(fileid, i)
        params[name] = val

    ## Get unit of X axis
    xunit = jwdb.ams_sim_get_x_unit_name(fileid)
    print "xunit", xunit

    ## Get first waveform name and identifier by putting 0 at last argument
    wid, wavename = jwdb.ams_sim_get_next_waveform_name(fileid, 0)
    while wid > 0:
        print wid, wavename

        ## Get unit of Y axis
        yunit = jwdb.ams_sim_get_wave_unit_name(fileid, wid)
        print "yunit", yunit