polyanskiy / refractiveindex.info-scripts

Python scripts for refractiveindex.info database
GNU General Public License v3.0
68 stars 36 forks source link

Script cleanup and bug fixes #3

Closed tnorth closed 8 years ago

tnorth commented 8 years ago

Hello,

I wanted to look at this parser and cleanup the code a bit, but turns out I also found a bug: sometimes, there are trailing spaces after "OD -", which the parser considered different as just a dash, causing the data from the previous material to be copied to that one. A similar problem occurs with a comment. The concerned materials are the following:

P-LASF50 (line 2798) P-SF69 (line 2901) P-SK58 (line 2990) P-LAF37 (line 2707) P-LAF32 (line 4071)

Therefore, the values removed below are in fact copies of data from other materials.

This pull request cleans the code and fixes this bug.

--- output_ref/schott/N-LAF32.yml       2016-02-05 11:18:44.862061449 +0100
+++ output/schott/N-LAF32.yml   2016-02-05 15:37:15.442411344 +0100
@@ -3,7 +3,6 @@
 # copyright and related rights waived via CC0 1.0

 REFERENCES: "1) <a href=\"http://refractiveindex.info/download/data/2015/schott-optical-glass-collection-datasheets-july-2015-us.pdf\">SCHOTT optical glass data sheets 2015-07-22</a><br>2) <a href=\"http://refractiveindex.info/download/data/2015/schottzemax-20150722.agf\">SCHOTT Zemax catalog 2015-07-22</a>"
-COMMENTS: "was replaced by N-FK51A"
 DATA:
     range: 0.35 2.5
     coefficients:
--- output_ref/schott/P-LAF37.yml       2016-02-05 11:18:44.840061806 +0100
+++ output/schott/P-LAF37.yml   2016-02-05 15:37:15.425411598 +0100
@@ -44,8 +44,3 @@
     coefficient_of_thermal_expansion_1: 6.26e-06 K<sup>-1</sup>
     coefficient_of_thermal_expansion_2: 7.8e-06 K<sup>-1</sup>
     ΔP_gF: -0.008
-    climatic_resistance: 1.0
-    stain_resistance: 0.0
-    acid_resistance: 2.0
-    alkali_resistance: 1.2
-    phosphate_resistance: 2.2
--- output_ref/schott/P-LASF50.yml      2016-02-05 11:18:44.842061773 +0100
+++ output/schott/P-LASF50.yml  2016-02-05 15:37:15.426411583 +0100
@@ -45,8 +45,3 @@
     coefficient_of_thermal_expansion_1: 5.9e-06 K<sup>-1</sup>
     coefficient_of_thermal_expansion_2: 7.32e-06 K<sup>-1</sup>
     ΔP_gF: -0.0078
-    climatic_resistance: 1.0
-    stain_resistance: 1.0
-    acid_resistance: 51.4
-    alkali_resistance: 1.0
-    phosphate_resistance: 2.2
--- output_ref/schott/P-SF69.yml        2016-02-05 11:18:44.843061757 +0100
+++ output/schott/P-SF69.yml    2016-02-05 15:37:15.427411568 +0100
@@ -41,8 +41,3 @@
     coefficient_of_thermal_expansion_1: 8.99e-06 K<sup>-1</sup>
     coefficient_of_thermal_expansion_2: 1.113e-05 K<sup>-1</sup>
     ΔP_gF: 0.0104
-    climatic_resistance: 1.0
-    stain_resistance: 5.0
-    acid_resistance: 53.3
-    alkali_resistance: 2.3
-    phosphate_resistance: 2.3
--- output_ref/schott/P-SK58A.yml       2016-02-05 11:18:44.845061725 +0100
+++ output/schott/P-SK58A.yml   2016-02-05 15:37:15.429411538 +0100
@@ -46,8 +46,3 @@
     coefficient_of_thermal_expansion_1: 6.82e-06 K<sup>-1</sup>
     coefficient_of_thermal_expansion_2: 8.41e-06 K<sup>-1</sup>
     ΔP_gF: -0.0023
-    climatic_resistance: 4.0
-    stain_resistance: 3.0
-    acid_resistance: 52.3
-    alkali_resistance: 2.0
-    phosphate_resistance: 3.0
--- output_ref/schott/SF66.yml  2016-02-05 11:18:44.864061416 +0100
+++ output/schott/SF66.yml      2016-02-05 15:37:15.443411329 +0100
@@ -30,8 +30,6 @@
 INFO:
     n_is_absolute: false
     λ_is_vacuum: false
-    temperature: 20.0 °C
-    coefficients_of_thermal_dispersion: 2.91e-06 1.69e-08 -3.77e-11 1.1e-06 1.07e-09 0.278
     n_d: 1.92286
     V_d: 20.88
     glass_code: 923209.603
polyanskiy commented 8 years ago

The five glasses are updated in the database!