:py:mod:`curve_data.create_vuln_xml_cov` ======================================== .. py:module:: curve_data.create_vuln_xml_cov .. autoapi-nested-parse:: This is a script to convert curve info in other formats to NRML, v0.5. It is being modified on a needs basis. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: curve_data.create_vuln_xml_cov.xml_write_variable curve_data.create_vuln_xml_cov.write_nrml_top curve_data.create_vuln_xml_cov.write_nrml_curve curve_data.create_vuln_xml_cov.write_nrml_close curve_data.create_vuln_xml_cov.csv_curve2nrml curve_data.create_vuln_xml_cov.validate_excel_curve_data curve_data.create_vuln_xml_cov.check_identical_depths curve_data.create_vuln_xml_cov.read_excel_curve_data curve_data.create_vuln_xml_cov.read_excel_worksheet curve_data.create_vuln_xml_cov.excel_curve2nrml Attributes ~~~~~~~~~~ .. autoapisummary:: curve_data.create_vuln_xml_cov.FLOOD_HOUSE_FABRIC curve_data.create_vuln_xml_cov.FLOOD_HOUSE_CONTENTS curve_data.create_vuln_xml_cov.LOSS_CAT_FABRIC curve_data.create_vuln_xml_cov.LOSS_CAT_CONTENTS curve_data.create_vuln_xml_cov.FLOOD_IMT curve_data.create_vuln_xml_cov.parser .. py:data:: FLOOD_HOUSE_FABRIC :annotation: = structural_domestic_flood_2012 .. py:data:: FLOOD_HOUSE_CONTENTS :annotation: = contents_domestic_flood_2012 .. py:data:: LOSS_CAT_FABRIC :annotation: = structural_loss_ratio .. py:data:: LOSS_CAT_CONTENTS :annotation: = contents_loss_ratio .. py:data:: FLOOD_IMT :annotation: = water depth above ground floor (m) .. py:function:: xml_write_variable(xml_h, name, value) Add a variable name and value to an xml file. :param xml_h: A handle to the xml file. :param name: The name of the variable. :param value: The value of the variable. .. py:function:: write_nrml_top(xml_h, vulnerability_set_id, asset_category, loss_category) Write the top section of an nrml file. :param xml_h: A handle to the xml file. :param vulnerability_set_id: String name of the vulnerability set. :param asset_category: String name of the assert category. :param loss_category: String name of the loss category. :param imt: String name of the intensity measure type. :param imls: 1D vector of the intensity measure values (x-axis) of the vuln curve. .. py:function:: write_nrml_curve(xml_h, vulnerability_function_id, imls: list, imt: str, loss_ratio, coef_var) Write the curve info of an nrml file. :param xml_h: A handle to the xml file. :param vulnerability_function_id: String name of the vuln function. :param imls: 1D vector of the intensity measure values (x-axis) of the vuln curve. :param imt: intensity measure type :param loss_ratio: 1D vector of the loss ratio values (y-axis) of the vuln curve. :param coef_var: 1D vector of the coefficient of variation values (y-axis) of the vuln curve. .. py:function:: write_nrml_close(xml_h) Write the final section of an nrml file and close it. :param xml_h: A handle to the xml file. .. py:function:: csv_curve2nrml(csv_filename, cov_filename, xml_filename) Read in a csv hazard curve file and convert it to an NRML file. :param csv_filename: The csv file to be read. :param xml_filename: The NRML file to be written. .. py:function:: validate_excel_curve_data(excel_file) Check that the titles and the water depths do not change from sheet to sheet. The first 2 rows are titles. The first coulmn is the water depth. :param excel_file: The excel file to validate. .. py:function:: check_identical_depths(wb) Check that the depth values are the same for all workbooks. Check that the first colum, starting at the 4th row, is identical. :param wb: The excel workbook xlrd object. .. py:function:: read_excel_curve_data(excel_file) Read in the excel file info. Specific, undocumented format. :param excel_file: The excel workbook. .. py:function:: read_excel_worksheet(wb) Read an excel worksheet :param wb: The excel workbook xlrd object. .. py:function:: excel_curve2nrml(contents_filename, fabric_filename, xls_filename) Read in an excel flood curve file and convert it to an NRML file. The excel file format is specific and best understood by looking at the file flood_2012_test.xlsx. :param contents_filename: The contents NRML file to be created. :param fabric_filename: The fabric NRML file to be created. :param xls_filename: The excel file that is the basis of the NRML files. .. py:data:: parser