diff --git a/cal/utils.py b/cal/utils.py index ee1c8d96269a5813a09eb92cd0eaa42cb677d8a9..79e24e2e4d7fa68c48590fce2882b3033262e179 100644 --- a/cal/utils.py +++ b/cal/utils.py @@ -180,6 +180,7 @@ def safe_device_setup(setup_dict): def escape_items(item): n = str(item).replace("_", "\_") + n = str(item).replace("&", "\&") return n def get_calibration_data(cal_docs): @@ -594,8 +595,8 @@ def get_customer(doc, countries): short_land = adr.get("Land") lang = get_lang(doc) cust = { - "Name": customer.get("Name"), - "AddName": customer.get("AddName"), + "Name": escape_items(customer.get("Name")), + "AddName": escape_items(customer.get("AddName")), "Street": adr.get("Street"), "Town": adr.get("Town"), "Zipcode": adr.get("Zipcode"), @@ -684,9 +685,12 @@ def get_meas_date(doc): This works for SE3. Other formats follow. """ date = doc.get("Calibration", {}).get("Measurement", {}).get("Date") + if isinstance(date, list): if isinstance(date[0]['Value'], list): return date[0]['Value'][0].split(" ")[0] + else: + return date[0]['Value'].split(" ")[0] def sort_date_list(l): s = sorted([datetime.datetime.strptime(dt, "%Y-%m-%d") for dt in l]) diff --git a/templates/latex/calibration_procedure-ce3-ig/en-para_0-alt_0-method.tex b/templates/latex/calibration_procedure-ce3-ig/en-para_0-alt_0-method.tex index 5cd617c5ca993ac270d3102791b71e008abdcf45..3c7ccd42da6ec0f47d3ced75138814e9b13aca24 100644 --- a/templates/latex/calibration_procedure-ce3-ig/en-para_0-alt_0-method.tex +++ b/templates/latex/calibration_procedure-ce3-ig/en-para_0-alt_0-method.tex @@ -2,59 +2,54 @@ ((*set helper = Helper*)) ((*set lang = Meta["lang"]*)) The calibration was carried out at the laboratory for vacuum metrology at the Physikalisch-Technische Bundesanstalt (PTB). +The device was installed in a vertical orientation. ((*for gas, struct in MeasurementData.items()*)) -((*if loop.index == 1*)) -((* for result_type, measurement_data in MeasurementData[gas].items()*)) -((*if result_type == "expansion"*)) -((*if measurement_data.PressureRangeBegin == measurement_data.PressureRangeEnd *)) -The calibration pressure (((measurement_data.PressureRangeBegin))) -was established in the primary standard SE3 metrologically linked to the primary standard SE2 of PTB applying the static -expansion method. -((*else*)) -In the pressure range from (((measurement_data.PressureRangeBegin))) to (((measurement_data.PressureRangeEnd))), -the calibration pressure was established in the primary standard SE3 -metrologically linked to the primary standard SE2 of PTB applying the static -expansion method. -((*endif*)) -((*endif*)) -((*if result_type == "direct"*)) -((*if measurement_data.PressureRangeBegin == measurement_data.PressureRangeEnd *)) -At (((measurement_data.PressureRangeBegin))) the calibration -was carried out by direct comparison to a secondary standard consisting of 15 diaphragm gauges. -((*else*)) -In the range (((measurement_data.PressureRangeBegin))) to -(((measurement_data.PressureRangeEnd))) -the calibration was carried out by direct comparison to a secondary standard consisting of 15 diaphragm gauges. -((*endif*)) -((*endif*)) -((*if result_type == "pressure_balance"*)) -((*if measurement_data.PressureRangeBegin == measurement_data.PressureRangeEnd *)) -For the pressure (((measurement_data.PressureRangeBegin))) the calibration was carried out by -comparison with the non-rotating pressure balance FRS5 traceable to the SI units (\emph{Metrologia 46 (2009), 389--396}). -((*else*)) -In the range (((measurement_data.PressureRangeBegin))) to -(((measurement_data.PressureRangeEnd))) -the calibration was carried out by comparison with the non-rotating pressure -balance FRS5 traceable to the SI units (\emph{Metrologia 46 (2009), 389--396}). -((*endif*)) -((*endif*)) -((*endfor*)) + +((*if loop.index == 1*)) + + ((*for result_type, measurement_data in MeasurementData[gas].items()*)) + + ((*if measurement_data.BakeoutTemperature*)) + Before calibration, the gauge head was baked at (((measurement_data.BakeoutTemperature))) + for (((measurement_data.BakeoutTime))). At \SI{100}{\degreeCelsius} the head was degassed for + \SI{10}{\minute}. + ((*endif*)) + + ((*if measurement_data.SputterTime*)) + At room temperature, it was exposed for (((measurement_data.SputterTime))) at + (((measurement_data.SputterPressure))) argon for sputtering the ion collector. + ((*endif*)) + + ((*if result_type == "cont_expansion"*)) + In the pressure range (((measurement_data.PressureRangeBegin))) to + (((measurement_data.PressureRangeEnd))) the gauge was calibrated by comparing its reading + with the calibration pressure that was established by the primary standard CE3 of PTB applying + the continuous expansion method. + ((*endif*)) + + ((*if result_type == "srg_vg"*)) + In the range (((measurement_data.PressureRangeBegin))) to + (((measurement_data.PressureRangeEnd))) it was calibrated by comparing its reading + with an calibrated spinning rotor gauge (SRG). + ((*endif*)) + + ((*endfor*)) ((*endif*)) -((*endfor*)) -((*for gas, struct in MeasurementData.items()*)) ((*for result_type, measurement_data in MeasurementData[gas].items()*)) -((*if result_type == "expansion" *)) -The gas temperature during calibration using the static expansion method with (((helper["gas_trans"][gas][lang]))) -was (((measurement_data.GasTemperature))) at a room temperature of (((measurement_data.RoomTemperature))). -((*endif*)) - ((*if result_type == "direct" *)) -During the calibration by direct comparison with (((helper["gas_trans"][gas][lang]))) the temperature of the gas was -(((measurement_data.GasTemperature))). Here, the room temperature was (((measurement_data.RoomTemperature))). - ((*endif*)) + ((*if result_type == "cont_expansion"*)) + The gas temperature during calibration using the continuous expansion method with + (((helper["gas_trans"][gas][lang]))) was (((measurement_data.GasTemperature))) at a + room temperature of (((measurement_data.RoomTemperature))). + ((*endif*)) + + ((*if result_type == "srg_vg"*)) + During the calibration by SRG comparison with (((helper["gas_trans"][gas][lang]))) + the temperature of the gas was (((measurement_data.GasTemperature))). Here, the + room temperature was (((measurement_data.RoomTemperature))). + ((*endif*)) - ((*if result_type == "pressure_balance"*)) -The gas temperature during the measurement with the non-rotating pressure balance is estimated to -(((measurement_data.EstimatedTemperature))). - ((*endif*)) ((*endfor*)) ((*endfor*)) + ((*endfor*)) + +((*endfor*)) diff --git a/templates/latex/calibration_procedure-ce3-ig/en-para_2-alt_0-residual_pressure.tex b/templates/latex/calibration_procedure-ce3-ig/en-para_2-alt_0-residual_pressure.tex index 7380cbe26b658f9bcf5171bdb89e0ab991f2da13..3109eb388cd5b20749b61ba0685267977e891d30 100644 --- a/templates/latex/calibration_procedure-ce3-ig/en-para_2-alt_0-residual_pressure.tex +++ b/templates/latex/calibration_procedure-ce3-ig/en-para_2-alt_0-residual_pressure.tex @@ -12,7 +12,7 @@ ((*-endfor*)) Before each calibration point the offset \(p_\text{ind,r}\) was -recorded (5 readings) at the base pressure and subtracted from the subsequent indication +recorded at the base pressure and subtracted from the subsequent indication \(p_\text{ind}\) to give the corrected indicated value \(p_\text{corr}\). ((*if offsetcontrib["is"] == "true" *)) The contribution of the offset scatter to the total uncertainty was