Um unsere Apps nutzen zu können, müssen die Systemanforderungen erfüllt sein und der entsprechende Filemaker auf dem Computer installiert werden.
An .xrdml file contains the raw intensity counts and 2θ angles. However, its "high quality" comes from the embedded . To create a valid XRDML, you must provide details beyond the raw numbers, including:
A high-quality conversion cannot simply dump raw data points into a file. It must translate your spreadsheet rows into specific XML schemas that modern diffraction software (such as HighScore Plus) can index, read, and analyze without throwing corruption errors. Anatomy of a High-Quality XRDML File convert excel to xrdml high quality
Most "free converters" strip out step time and slit info. 🚫 It must translate your spreadsheet rows into specific
This method provides flexibility and customization options, but can be time-consuming and prone to errors. import pandas as pd import xml
import pandas as pd import xml.etree.ElementTree as ET from xml.dom import minidom def excel_to_xrdml(excel_path, output_xrdml_path, sample_name="Unknown Sample"): # 1. Read the Excel file df = pd.read_excel(excel_path) # Assume Column 0 is 2Theta and Column 1 is Intensity angles = df.iloc[:, 0].tolist() intensities = df.iloc[:, 1].tolist() start_angle = angles[0] end_angle = angles[-1] num_points = len(angles) # Convert lists to space-separated strings required by XML arrays intensities_str = " ".join(map(str, [int(x) for x in intensities])) # 2. Build the XRDML XML structure root = ET.Element("xrdMeasurement", "xmlns": "http://panalytical.com", "status": "Completed" ) # Add Sample Metadata sample = ET.SubElement(root, "sample") id_elem = ET.SubElement(sample, "id") id_elem.text = sample_name # Add Scan Metadata xrd_scan = ET.SubElement(root, "scan", "scanAxis": "Gonio", "status": "Completed" ) data_points = ET.SubElement(xrd_scan, "dataPoints") # Add 2Theta Positions positions = ET.SubElement(data_points, "positions", "axis": "2Theta", "unit": "deg") start_elem = ET.SubElement(positions, "startPosition") start_elem.text = f"start_angle:.4f" end_elem = ET.SubElement(positions, "endPosition") end_elem.text = f"end_angle:.4f" # Add Intensities Array intensities_elem = ET.SubElement(data_points, "intensities", "unit": "counts") intensities_elem.text = intensities_str # 3. Pretty print and save the XML file to maintain high-quality encoding xml_string = ET.tostring(root, encoding="utf-8") parsed_xml = minidom.parseString(xml_string) pretty_xml = parsed_xml.toprettyxml(indent=" ") with open(output_xrdml_path, "w", encoding="utf-8") as f: f.write(pretty_xml) print(f"Successfully converted excel_path to high-quality XRDML at output_xrdml_path") # Example Usage: # excel_to_xrdml("diffraction_data.xlsx", "output_result.xrdml", "Catalyst_Batch_A") Use code with caution. Step 4: Validating Your Converted File
This comprehensive guide outlines the exact parameters, data structures, and methods required to execute a high-quality Excel-to-XRDML conversion. 1. Understanding the Anatomy of a High-Quality XRDML File