当前位置: 首页>>代码示例>>Python>>正文


Python PostProcess.save_as_svg方法代码示例

本文整理汇总了Python中common.PostProcess.save_as_svg方法的典型用法代码示例。如果您正苦于以下问题:Python PostProcess.save_as_svg方法的具体用法?Python PostProcess.save_as_svg怎么用?Python PostProcess.save_as_svg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common.PostProcess的用法示例。


在下文中一共展示了PostProcess.save_as_svg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from common import PostProcess [as 别名]
# 或者: from common.PostProcess import save_as_svg [as 别名]
def main():
    mat_file_name = sys.argv[1]
    limits_dict, filter = read_limits()
    
    filter.append('SpeedSensor.v')
    # loads results with the filtered out variables (and 'time' which is default)
    pp = PostProcess(mat_file_name, filter)
    metrics = {}
    # No need to convert values into string that is done in update_metrics_in_report_json
    metrics.update({'MaxSpeed' : {'value': pp.global_abs_max('SpeedSensor.v'), 'unit': 'm/s'}})
    
    cwd = os.getcwd()
    os.chdir('..')
    print 'Plot saved to : {0}'.format(pp.save_as_svg('SpeedSensor.v', 
                                                  pp.global_abs_max('SpeedSensor.v'),
                                                  'MaxSpeed',
                                                  'max(SpeedSensor.v)',
                                                  'm/s'))
    update_metrics_in_report_json(metrics)
    check_limits_and_add_to_report_json(pp, limits_dict)
    os.chdir(cwd)
开发者ID:cephdon,项目名称:meta-core,代码行数:23,代码来源:get_max_speed.py

示例2: variables

# 需要导入模块: from common import PostProcess [as 别名]
# 或者: from common.PostProcess import save_as_svg [as 别名]
        filter.append('road_Wheel_Load_Both_Sides.Accel_40kph')

        # loads results with the filtered out variables (and 'time' which is default)
        pp = PostProcess(mat_file_name, filter)
        #pressure_variable_name = [var_name for var_name in filter if var_name.endswith('hot_fluid_out.p')][0]
        metrics = {}
        metrics.update({'VehicleSpeed': {'value': pp.global_abs_max("road_Wheel_Load_Both_Sides.vehicleSpeed"), 'unit': 'kph'}})
        metrics.update({'Acc20kph': {'value': pp.last_value('road_Wheel_Load_Both_Sides.Accel_20kph'), 'unit': 's'}})
        metrics.update({'Acc40kph': {'value': pp.last_value('road_Wheel_Load_Both_Sides.Accel_40kph'), 'unit': 's'}})
        #metrics.update({'EngineAirPressure': {'value': pp.last_value(pressure_variable_name), 'unit': 'Pascal'}})

        cwd = os.getcwd()
        os.chdir('..')
        print 'Plot saved to : {0}'.format(pp.save_as_svg('road_Wheel_Load_Both_Sides.vehicleSpeed', 
                                                          pp.global_abs_max("road_Wheel_Load_Both_Sides.vehicleSpeed"),
                                                          'VehicleSpeed',
                                                          'max(road_Wheel_Load_Both_Sides.vehicleSpeed)',
                                                          'km/h'))
        print 'Plot saved to : {0}'.format(pp.save_as_svg('road_Wheel_Load_Both_Sides.Accel_20kph', 
                                                          pp.last_value('road_Wheel_Load_Both_Sides.Accel_20kph'),
                                                          'Acc20kph',
                                                          'last_value(road_Wheel_Load_Both_Sides.Accel_20kph)',
                                                          's'))
        print 'Plot saved to : {0}'.format(pp.save_as_svg('road_Wheel_Load_Both_Sides.Accel_40kph', 
                                                          pp.last_value('road_Wheel_Load_Both_Sides.Accel_40kph'),
                                                          'Acc40kph',
                                                          'last_value(road_Wheel_Load_Both_Sides.Accel_40kph)',
                                                          's'))
        update_metrics_in_report_json(metrics)
        ## end of postprocessing part
开发者ID:dyao-vu,项目名称:meta-core,代码行数:32,代码来源:full_speed_forward_v2.py

示例3:

# 需要导入模块: from common import PostProcess [as 别名]
# 或者: from common.PostProcess import save_as_svg [as 别名]
        # pressure_variable_name = [var_name for var_name in filter if var_name.endswith('hot_fluid_out.p')][0]
        metrics = {}
        metrics.update(
            {"VehicleSpeed": {"value": pp.global_abs_max("road_Wheel_Load_Both_Sides.vehicleSpeed"), "unit": "kph"}}
        )
        metrics.update({"Acc20kph": {"value": pp.last_value("road_Wheel_Load_Both_Sides.Accel_20kph"), "unit": "s"}})
        metrics.update({"Acc40kph": {"value": pp.last_value("road_Wheel_Load_Both_Sides.Accel_40kph"), "unit": "s"}})
        # metrics.update({'EngineAirPressure': {'value': pp.last_value(pressure_variable_name), 'unit': 'Pascal'}})

        cwd = os.getcwd()
        os.chdir("..")
        print "Plot saved to : {0}".format(
            pp.save_as_svg(
                "road_Wheel_Load_Both_Sides.vehicleSpeed",
                pp.global_abs_max("road_Wheel_Load_Both_Sides.vehicleSpeed"),
                "VehicleSpeed",
                "max(road_Wheel_Load_Both_Sides.vehicleSpeed)",
                "km/h",
            )
        )
        print "Plot saved to : {0}".format(
            pp.save_as_svg(
                "road_Wheel_Load_Both_Sides.Accel_20kph",
                pp.last_value("road_Wheel_Load_Both_Sides.Accel_20kph"),
                "Acc20kph",
                "last_value(road_Wheel_Load_Both_Sides.Accel_20kph)",
                "s",
            )
        )
        print "Plot saved to : {0}".format(
            pp.save_as_svg(
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:33,代码来源:full_speed_forward_v2.py


注:本文中的common.PostProcess.save_as_svg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。