本文整理汇总了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)
示例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
示例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(