Skip to content

Instantly share code, notes, and snippets.

@pukpr
Created October 21, 2025 03:47
Show Gist options
  • Select an option

  • Save pukpr/b3133cecf810601eadf42503494908c9 to your computer and use it in GitHub Desktop.

Select an option

Save pukpr/b3133cecf810601eadf42503494908c9 to your computer and use it in GitHub Desktop.
LTE model for tidal stations, example for Warnemunde (11)
1884.0000000000 0.4205700000
1884.0833333333 0.3868980000
1884.1666666667 0.7086080000
1884.2500000000 0.6610860000
1884.3333333333 0.7397180000
1884.4166666667 0.7168100000
1884.5000000000 0.8215940000
1884.5833333333 1.0048380000
1884.6666666667 1.0588480000
1884.7500000000 1.3143980000
1884.8333333333 1.4037920000
1884.9166666667 1.4316460000
1885.0000000000 1.0102700000
1885.0833333333 0.7211980000
1885.1666666667 0.3428940000
1885.2500000000 0.1138220000
1885.3333333333 0.1539800000
1885.4166666667 0.1341340000
1885.5000000000 0.1173660000
1885.5833333333 0.2329040000
1885.6666666667 0.1745920000
1885.7500000000 0.1947440000
1885.8333333333 0.0164340000
1885.9166666667 -0.5557280000
1886.0000000000 -0.6925020000
1886.0833333333 -0.7738940000
1886.1666666667 -0.9399040000
1886.2500000000 -1.3028360000
1886.3333333333 -1.4011540000
1886.4166666667 -1.6779360000
1886.5000000000 -1.6454880000
1886.5833333333 -1.5730400000
1886.6666666667 -1.5790560000
1886.7500000000 -1.5358420000
1886.8333333333 -1.5464740000
1886.9166666667 -1.6801860000
1887.0000000000 -1.2923600000
1887.0833333333 -0.8306880000
1887.1666666667 -0.4982500000
1887.2500000000 0.0511120000
1887.3333333333 0.2697040000
1887.4166666667 0.1667540000
1887.5000000000 0.2038040000
1887.5833333333 0.3931620000
1887.6666666667 0.4040540000
1887.7500000000 0.4195640000
1887.8333333333 0.1658400000
1887.9166666667 0.0121140000
1888.0000000000 0.1799280000
1888.0833333333 0.2123560000
1888.1666666667 -0.3382980000
1888.2500000000 -0.6258720000
1888.3333333333 -0.9180640000
1888.4166666667 -0.8594880000
1888.5000000000 -0.7778360000
1888.5833333333 -0.6054140000
1888.6666666667 -0.6099200000
1888.7500000000 -0.5682720000
1888.8333333333 -0.5512380000
1888.9166666667 -0.3203620000
1889.0000000000 -0.3756400000
1889.0833333333 -0.6139960000
1889.1666666667 -0.6246620000
1889.2500000000 -0.7353260000
1889.3333333333 -0.9167620000
1889.4166666667 -1.0658920000
1889.5000000000 -1.1196380000
1889.5833333333 -1.0256940000
1889.6666666667 -0.8963660000
1889.7500000000 -0.8501140000
1889.8333333333 -0.8546340000
1889.9166666667 -1.0037720000
1890.0000000000 -1.3467560000
1890.0833333333 -1.3497400000
1890.1666666667 -1.6250340000
1890.2500000000 -1.9249440000
1890.3333333333 -1.5771620000
1890.4166666667 -1.2155380000
1890.5000000000 -1.0708360000
1890.5833333333 -0.8384420000
1890.6666666667 -0.6891280000
1890.7500000000 -0.7044300000
1890.8333333333 -0.7074240000
1890.9166666667 -0.7365740000
1891.0000000000 -0.6011100000
1891.0833333333 -0.1918000000
1891.1666666667 -0.1332620000
1891.2500000000 0.2729680000
1891.3333333333 0.4053520000
1891.4166666667 0.2069620000
1891.5000000000 0.2224200000
1891.5833333333 0.2086460000
1891.6666666667 0.2256400000
1891.7500000000 0.2026320000
1891.8333333333 -0.0342220000
1891.9166666667 -0.1264640000
1892.0000000000 -0.3556280000
1892.0833333333 -0.2832540000
1892.1666666667 -0.5724240000
1892.2500000000 -0.2708220000
1892.3333333333 -0.3399900000
1892.4166666667 -0.2245460000
1892.5000000000 -0.1875640000
1892.5833333333 -0.1551980000
1892.6666666667 0.0079360000
1892.7500000000 0.0572220000
1892.8333333333 0.1126620000
1892.9166666667 0.3327160000
1893.0000000000 0.1635380000
1893.0833333333 0.1312820000
1893.1666666667 -0.0471320000
1893.2500000000 0.0036880000
1893.3333333333 -0.4454940000
1893.4166666667 -0.4285260000
1893.5000000000 -0.5084800000
1893.5833333333 -0.2207420000
1893.6666666667 -0.0714700000
1893.7500000000 -0.1068100000
1893.8333333333 -0.1944620000
1893.9166666667 -0.1051920000
1894.0000000000 0.0040780000
1894.0833333333 0.0379620000
1894.1666666667 0.1856900000
1894.2500000000 0.0272640000
1894.3333333333 0.1196080000
1894.4166666667 0.2011780000
1894.5000000000 0.1135180000
1894.5833333333 0.1535500000
1894.6666666667 0.0828100000
1894.7500000000 0.0228380000
1894.8333333333 0.0351740000
1894.9166666667 0.0398140000
1895.0000000000 -0.2570820000
1895.0833333333 -0.6062880000
1895.1666666667 -0.5524200000
1895.2500000000 -0.3693200000
1895.3333333333 -0.3831460000
1895.4166666667 -0.4938960000
1895.5000000000 -0.3784920000
1895.5833333333 -0.2384740000
1895.6666666667 -0.0230760000
1895.7500000000 0.0369400000
1895.8333333333 0.0431080000
1895.9166666667 -0.1030340000
1896.0000000000 -0.4091740000
1896.0833333333 -0.2907020000
1896.1666666667 -0.2137700000
1896.2500000000 -0.2876080000
1896.3333333333 -0.3983700000
1896.4166666667 -0.2322100000
1896.5000000000 -0.1414360000
1896.5833333333 -0.1091240000
1896.6666666667 -0.1291220000
1896.7500000000 -0.1629660000
1896.8333333333 -0.0752740000
1896.9166666667 0.0693400000
1897.0000000000 0.3616460000
1897.0833333333 0.5631820000
1897.1666666667 0.3031780000
1897.2500000000 0.4031720000
1897.3333333333 0.5447060000
1897.4166666667 0.3846960000
1897.5000000000 0.3246880000
1897.5833333333 0.3569880000
1897.6666666667 0.3077440000
1897.7500000000 0.3461940000
1897.8333333333 0.3938740000
1897.9166666667 0.2292440000
1898.0000000000 -0.0800020000
1898.0833333333 -0.3307880000
1898.1666666667 -0.0846520000
1898.2500000000 0.0953280000
1898.3333333333 -0.1231520000
1898.4166666667 -0.2031740000
1898.5000000000 -0.2047340000
1898.5833333333 -0.1816800000
1898.6666666667 -0.1386280000
1898.7500000000 -0.0971160000
1898.8333333333 0.0536280000
1898.9166666667 -0.0217860000
1899.0000000000 0.0243400000
1899.0833333333 0.1735400000
1899.1666666667 0.0612000000
1899.2500000000 -0.0388320000
1899.3333333333 -0.0250180000
1899.4166666667 0.0287920000
1899.5000000000 0.1318340000
1899.5833333333 0.3133360000
1899.6666666667 0.5763740000
1899.7500000000 0.6194120000
1899.8333333333 0.5270640000
1899.9166666667 0.2085600000
1900.0000000000 0.0931340000
1900.0833333333 -0.1715240000
1900.1666666667 -0.3269560000
1900.2500000000 -0.4331540000
1900.3333333333 -0.6470480000
1900.4166666667 -0.6655580000
1900.5000000000 -0.5671460000
1900.5833333333 -0.6656580000
1900.6666666667 -0.5395560000
1900.7500000000 -0.7257620000
1900.8333333333 -0.8027380000
1900.9166666667 -0.7012560000
1901.0000000000 -0.8382360000
1901.0833333333 -0.9413680000
1901.1666666667 -0.7537360000
1901.2500000000 -0.3491800000
1901.3333333333 0.0830680000
1901.4166666667 0.2014660000
1901.5000000000 0.1767880000
1901.5833333333 0.1290340000
1901.6666666667 0.4228120000
1901.7500000000 0.3458240000
1901.8333333333 0.5380640000
1901.9166666667 0.5272260000
1902.0000000000 0.3610020000
1902.0833333333 0.5978560000
1902.1666666667 0.9316280000
1902.2500000000 1.0700180000
1902.3333333333 0.8468660000
1902.4166666667 0.7575600000
1902.5000000000 0.8236380000
1902.5833333333 1.0389460000
1902.6666666667 1.1157880000
1902.7500000000 1.0818620000
1902.8333333333 1.1556280000
1902.9166666667 1.1063140000
1903.0000000000 1.3785400000
1903.0833333333 1.7799940000
1903.1666666667 1.6522140000
1903.2500000000 1.2967440000
1903.3333333333 1.1135800000
1903.4166666667 0.8304120000
1903.5000000000 0.7841700000
1903.5833333333 0.7056180000
1903.6666666667 0.6393700000
1903.7500000000 0.6700460000
1903.8333333333 0.5099520000
1903.9166666666 0.4898560000
1904.0000000000 0.3589900000
1904.0833333333 0.0035080000
1904.1666666666 -0.4565920000
1904.2500000000 -0.3520780000
1904.3333333333 -0.3921780000
1904.4166666666 -0.5061280000
1904.5000000000 -0.5385380000
1904.5833333333 -0.6478740000
1904.6666666666 -0.6756740000
1904.7500000000 -0.7573180000
1904.8333333333 -0.8451180000
1904.9166666666 -1.0113820000
1905.0000000000 -1.1499540000
1905.0833333333 -1.0023720000
1905.1666666666 -0.8163320000
1905.2500000000 -0.6872140000
1905.3333333333 -0.7504060000
1905.4166666666 -0.7612920000
1905.5000000000 -0.6798700000
1905.5833333333 -0.4584500000
1905.6666666666 -0.2524180000
1905.7500000000 -0.0140760000
1905.8333333333 0.0950340000
1905.9166666666 0.0426020000
1906.0000000000 0.1009400000
1906.0833333333 -0.0945680000
1906.1666666666 -0.3393120000
1906.2500000000 -0.3117460000
1906.3333333333 -0.1934120000
1906.4166666666 0.2187640000
1906.5000000000 0.4232500000
1906.5833333333 0.5400400000
1906.6666666666 0.6675980000
1906.7500000000 0.7582340000
1906.8333333333 0.8473300000
1906.9166666666 0.8195000000
1907.0000000000 1.0655180000
1907.0833333333 1.0715340000
1907.1666666666 0.9390840000
1907.2500000000 0.9727900000
1907.3333333333 0.5988020000
1907.4166666666 0.2478880000
1907.5000000000 -0.1445620000
1907.5833333333 -0.1847080000
1907.6666666666 0.0074520000
1907.7500000000 0.0242280000
1907.8333333333 -0.1866900000
1907.9166666666 -0.4622260000
1908.0000000000 -0.4977600000
1908.0833333333 -0.4532980000
1908.1666666666 -0.3319140000
1908.2500000000 0.1125480000
1908.3333333333 -0.1168380000
1908.4166666666 0.0737740000
1908.5000000000 0.2936160000
1908.5833333333 0.3365340000
1908.6666666666 0.5302200000
1908.7500000000 0.5285200000
1908.8333333333 0.6252820000
1908.9166666666 0.8066540000
1909.0000000000 0.7803360000
1909.0833333333 0.8724800000
1909.1666666666 0.6446180000
1909.2500000000 0.5906040000
1909.3333333333 0.5981280000
1909.4166666666 0.8164180000
1909.5000000000 0.7316320000
1909.5833333333 0.8776140000
1909.6666666666 1.0574380000
1909.7500000000 1.0911100000
1909.8333333333 1.0878580000
1909.9166666666 0.7261420000
1910.0000000000 0.3536560000
1910.0833333333 0.5180920000
1910.1666666666 0.3332960000
1910.2500000000 0.1423440000
1910.3333333333 0.1467780000
1910.4166666666 -0.0411000000
1910.5000000000 0.0325620000
1910.5833333333 0.0739160000
1910.6666666666 0.1552640000
1910.7500000000 0.2366160000
1910.8333333333 0.2995040000
1910.9166666666 0.1177720000
1911.0000000000 -0.0301100000
1911.0833333333 0.0466200000
1911.1666666666 -0.2935760000
1911.2500000000 -0.0768480000
1911.3333333333 -0.1339660000
1911.4166666666 -0.3957040000
1911.5000000000 -0.4482100000
1911.5833333333 -0.4945620000
1911.6666666666 -0.4024560000
1911.7500000000 -0.4749660000
1911.8333333333 -0.6459380000
1911.9166666666 -0.9769120000
1912.0000000000 -1.2740400000
1912.0833333333 -0.9696300000
1912.1666666666 -1.0959940000
1912.2500000000 -0.8577400000
1912.3333333333 -1.2502580000
1912.4166666666 -1.1597000000
1912.5000000000 -1.0676040000
1912.5833333333 -0.9232020000
1912.6666666666 -0.7649560000
1912.7500000000 -0.5297860000
1912.8333333333 -0.5161560000
1912.9166666666 -0.6502220000
1913.0000000000 -0.3550560000
1913.0833333333 -0.1860440000
1913.1666666666 -0.0862680000
1913.2500000000 0.1119720000
1913.3333333333 -0.0267120000
1913.4166666666 0.0915240000
1913.5000000000 0.2805280000
1913.5833333333 0.4187640000
1913.6666666666 0.5339200000
1913.7500000000 0.4890760000
1913.8333333333 0.2842300000
1913.9166666666 0.2132280000
1914.0000000000 0.1745340000
1914.0833333333 -0.2749300000
1914.1666666666 -0.1767040000
1914.2500000000 -0.2600160000
1914.3333333333 -0.1187140000
1914.4166666666 -0.0528000000
1914.5000000000 0.0869620000
1914.5833333333 -0.0240480000
1914.6666666666 0.1264780000
1914.7500000000 0.0754660000
1914.8333333333 0.2429160000
1914.9166666666 0.1749780000
1915.0000000000 0.1024240000
1915.0833333333 0.0791000000
1915.1666666666 0.1526960000
1915.2500000000 0.1047560000
1915.3333333333 -0.0724180000
1915.4166666666 -0.1603640000
1915.5000000000 -0.1052300000
1915.5833333333 -0.0424080000
1915.6666666666 0.0004120000
1915.7500000000 -0.0383040000
1915.8333333333 0.1460540000
1915.9166666666 -0.1218980000
1916.0000000000 -0.1067720000
1916.0833333333 0.0221980000
1916.1666666666 0.2388580000
1916.2500000000 0.3001340000
1916.3333333333 0.3598700000
1916.4166666666 0.5949880000
1916.5000000000 0.4854920000
1916.5833333333 0.5083020000
1916.6666666666 0.6264920000
1916.7500000000 0.8985300000
1916.8333333333 0.8197980000
1916.9166666666 0.4441400000
1917.0000000000 0.5330980000
1917.0833333333 1.0897480000
1917.1666666666 1.1663940000
1917.2500000000 1.2276560000
1917.3333333333 1.3550720000
1917.4166666666 1.2670980000
1917.5000000000 1.2945120000
1917.5833333333 1.4480780000
1917.6666666666 1.4801020000
1917.7500000000 1.3721260000
1917.8333333333 1.2210720000
1917.9166666666 1.4161700000
1918.0000000000 1.2051140000
1918.0833333333 1.0802120000
1918.1666666666 0.5214600000
1918.2500000000 0.1704020000
1918.3333333333 -0.0237360000
1918.4166666666 -0.1624920000
1918.5000000000 -0.1597080000
1918.5833333333 -0.2046160000
1918.6666666666 -0.2510680000
1918.7500000000 -0.1252100000
1918.8333333333 -0.0562780000
1918.9166666666 -0.1611940000
1919.0000000000 -0.5214940000
1919.0833333333 -0.1987180000
1919.1666666666 -0.0897900000
1919.2500000000 0.0360600000
1919.3333333333 0.0649860000
1919.4166666666 0.0246780000
1919.5000000000 0.0489880000
1919.5833333333 0.1102180000
1919.6666666666 0.1252920000
1919.7500000000 0.3295980000
1919.8333333333 0.2523620000
1919.9166666666 0.0751260000
1920.0000000000 -0.0067260000
1920.0833333333 0.0898820000
1920.1666666666 0.1326420000
1920.2500000000 -0.1876760000
1920.3333333333 -0.4618400000
1920.4166666666 -0.4190840000
1920.5000000000 -0.4055580000
1920.5833333333 -0.4597260000
1920.6666666666 -0.4015880000
1920.7500000000 -0.5896040000
1920.8333333333 -0.8145440000
1920.9166666666 -0.9333340000
1921.0000000000 -0.9198140000
1921.0833333333 -0.4970660000
1921.1666666666 -0.4158580000
1921.2500000000 -0.5546500000
1921.3333333333 -0.4303660000
1921.4166666666 -0.3907020000
1921.5000000000 -0.5879580000
1921.5833333333 -0.4590620000
1921.6666666666 -0.2194000000
1921.7500000000 -0.1397380000
1921.8333333333 -0.0354600000
1921.9166666666 0.1149680000
1922.0000000000 0.0100120000
1922.0833333333 -0.1103300000
1922.1666666666 -0.6045220000
1922.2500000000 -0.7817880000
1922.3333333333 -0.9790560000
1922.4166666666 -0.9886360000
1922.5000000000 -1.0505200000
1922.5833333333 -0.6954840000
1922.6666666666 -0.6173740000
1922.7500000000 -0.4931100000
1922.8333333333 -0.5611540000
1922.9166666666 -0.3307400000
1923.0000000000 -0.6634020000
1923.0833333333 -0.5914500000
1923.1666666666 -0.5902700000
1923.2500000000 -0.5044740000
1923.3333333333 -0.3617540000
1923.4166666666 -0.2159640000
1923.5000000000 -0.0547860000
1923.5833333333 0.1940840000
1923.6666666666 0.1583340000
1923.7500000000 0.2625840000
1923.8333333333 0.0714500000
1923.9166666666 -0.1950720000
1924.0000000000 -0.8246720000
1924.0833333333 -0.9604240000
1924.1666666666 -0.9807960000
1924.2500000000 -0.8273220000
1924.3333333333 -0.9030780000
1924.4166666666 -0.8465300000
1924.5000000000 -0.8853660000
1924.5833333333 -0.8272800000
1924.6666666666 -0.7322740000
1924.7500000000 -0.6541920000
1924.8333333333 -0.7453400000
1924.9166666666 -0.6426440000
1925.0000000000 -0.2814880000
1925.0833333333 -0.0803320000
1925.1666666666 0.4992820000
1925.2500000000 0.3004360000
1925.3333333333 0.3154360000
1925.4166666666 0.3458160000
1925.5000000000 0.2038900000
1925.5833333333 0.4788840000
1925.6666666666 0.5908000000
1925.7500000000 0.5904080000
1925.8333333333 0.5761700000
1925.9166666666 0.5065440000
1926.0000000000 0.3661480000
1926.0833333333 0.3626760000
1926.1666666666 0.5422760000
1926.2500000000 0.3926480000
1926.3333333333 0.3399400000
1926.4166666666 -0.0035400000
1926.5000000000 -0.0239400000
1926.5833333333 0.2079640000
1926.6666666666 0.2183280000
1926.7500000000 0.2533080000
1926.8333333333 0.2590540000
1926.9166666666 0.3478760000
1927.0000000000 0.4505440000
1927.0833333333 0.6009040000
1927.1666666666 0.3481840000
1927.2500000000 0.4077720000
1927.3333333333 0.1765900000
1927.4166666666 0.4669420000
1927.5000000000 0.6280660000
1927.5833333333 0.7768800000
1927.6666666666 0.8333840000
1927.7500000000 0.7806580000
1927.8333333333 0.5248540000
1927.9166666666 0.3582760000
1928.0000000000 0.1532400000
1928.0833333333 -0.2041060000
1928.1666666666 -0.3183800000
1928.2500000000 -0.1141900000
1928.3333333333 -0.2315380000
1928.4166666666 -0.2058140000
1928.5000000000 -0.3462440000
1928.5833333333 -0.1143660000
1928.6666666666 -0.1209520000
1928.7500000000 -0.1352300000
1928.8333333333 -0.0125880000
1928.9166666666 0.2639000000
1929.0000000000 0.4265400000
1929.0833333333 0.5184120000
1929.1666666666 0.7041260000
1929.2500000000 0.5421480000
1929.3333333333 0.4201700000
1929.4166666666 0.4828040000
1929.5000000000 0.4946680000
1929.5833333333 0.7003800000
1929.6666666666 0.6737780000
1929.7500000000 0.8010260000
1929.8333333333 0.8390400000
1929.9166666666 0.7416660000
1930.0000000000 0.5058320000
1930.0833333333 0.4238440000
1930.1666666666 0.3433900000
1930.2500000000 0.2660160000
1930.3333333333 0.2686380000
1930.4166666666 0.2466420000
1930.5000000000 0.4292640000
1930.5833333333 0.6657300000
1930.6666666666 0.7775780000
1930.7500000000 0.8509640000
1930.8333333333 0.8181960000
1930.9166666666 0.6961940000
1931.0000000000 0.8418860000
1931.0833333333 0.8260360000
1931.1666666666 0.4855700000
1931.2500000000 0.3820260000
1931.3333333333 0.0907900000
1931.4166666666 0.0887820000
1931.5000000000 0.0375420000
1931.5833333333 -0.0521580000
1931.6666666666 0.0442900000
1931.7500000000 0.1884320000
1931.8333333333 0.2571900000
1931.9166666666 0.3290200000
1932.0000000000 0.3177740000
1932.0833333333 0.2526820000
1932.1666666666 0.2414320000
1932.2500000000 0.2224900000
1932.3333333333 0.1466260000
1932.4166666666 0.4846020000
1932.5000000000 0.5456580000
1932.5833333333 0.6882520000
1932.6666666666 0.7739180000
1932.7500000000 0.6072780000
1932.8333333333 0.5006360000
1932.9166666666 0.4847600000
1933.0000000000 0.3704240000
1933.0833333333 0.1930100000
1933.1666666666 -0.0105620000
1933.2500000000 -0.0818240000
1933.3333333333 -0.0023180000
1933.4166666666 0.1156460000
1933.5000000000 -0.0171580000
1933.5833333333 -0.0745780000
1933.6666666666 0.0033820000
1933.7500000000 0.0074960000
1933.8333333333 -0.0360820000
1933.9166666666 -0.2335080000
1934.0000000000 -0.1878580000
1934.0833333333 -0.2699020000
1934.1666666666 -0.1565640000
1934.2500000000 -0.3632240000
1934.3333333333 -0.3037320000
1934.4166666666 -0.1888580000
1934.5000000000 -0.1601380000
1934.5833333333 0.0085820000
1934.6666666666 0.2619140000
1934.7500000000 0.2860160000
1934.8333333333 0.3916540000
1934.9166666666 0.5572900000
1935.0000000000 0.5906200000
1935.0833333333 0.3177940000
1935.1666666666 0.4188100000
1935.2500000000 0.6844440000
1935.3333333333 0.8208460000
1935.4166666666 0.8526280000
1935.5000000000 0.9213360000
1935.5833333333 1.0392720000
1935.6666666666 1.1648980000
1935.7500000000 1.2074480000
1935.8333333333 1.1438420000
1935.9166666666 1.1202340000
1936.0000000000 0.8581640000
1936.0833333333 0.7945560000
1936.1666666666 0.7309440000
1936.2500000000 0.7319480000
1936.3333333333 0.1852600000
1936.4166666666 0.4077980000
1936.5000000000 0.3934140000
1936.5833333333 0.3713380000
1936.6666666666 0.3754120000
1936.7500000000 0.5087180000
1936.8333333333 0.4850980000
1936.9166666666 0.2707060000
1937.0000000000 0.0793940000
1937.0833333333 0.0342340000
1937.1666666666 -0.2032380000
1937.2500000000 -0.0930160000
1937.3333333333 -0.1597200000
1937.4166666666 -0.2325800000
1937.5000000000 -0.4562060000
1937.5833333333 -0.3890660000
1937.6666666666 -0.2373140000
1937.7500000000 -0.1378680000
1937.8333333333 -0.4168860000
1937.9166666666 -0.5420600000
1938.0000000000 -0.2795400000
1938.0833333333 -0.3970220000
1938.1666666666 -0.5083540000
1938.2500000000 -0.2304540000
1938.3333333333 -0.2894760000
1938.4166666666 -0.2531200000
1938.5000000000 -0.0490680000
1938.5833333333 0.0011360000
1938.6666666666 0.1374900000
1938.7500000000 0.2307680000
1938.8333333333 0.0486600000
1938.9166666666 0.1680880000
1939.0000000000 0.1475160000
1939.0833333333 0.0346360000
1939.1666666666 0.0602140000
1939.2500000000 0.4211780000
1939.3333333333 0.2452180000
1939.4166666666 0.2754080000
1939.5000000000 0.1871380000
1939.5833333333 0.2711740000
1939.6666666666 0.3044380000
1939.7500000000 0.2038560000
1939.8333333333 0.1017360000
1939.9166666666 0.2026880000
1940.0000000000 0.1374880000
1940.0833333333 0.0507480000
1940.1666666666 0.0286200000
1940.2500000000 -0.2288920000
1940.3333333333 -0.4987120000
1940.4166666666 -0.4346900000
1940.4999999999 -0.6060500000
1940.5833333333 -0.6158740000
1940.6666666666 -0.4287780000
1940.7499999999 -0.3032180000
1940.8333333333 -0.3007380000
1940.9166666666 -0.3967220000
1940.9999999999 -0.4173200000
1941.0833333333 -0.4133040000
1941.1666666666 -0.4200620000
1941.2499999999 -0.3298940000
1941.3333333333 0.0433500000
1941.4166666666 0.5319740000
1941.4999999999 0.6682920000
1941.5833333333 0.8599940000
1941.6666666666 1.0670760000
1941.7499999999 0.9480060000
1941.8333333333 0.9012420000
1941.9166666666 0.7652440000
1941.9999999999 0.7415560000
1942.0833333333 0.6055580000
1942.1666666666 0.4080180000
1942.2499999999 0.4381720000
1942.3333333333 0.4206320000
1942.4166666666 0.1830900000
1942.4999999999 -0.2698360000
1942.5833333333 -0.2996880000
1942.6666666666 -0.2833880000
1942.7499999999 -0.3963180000
1942.8333333333 -0.4707860000
1942.9166666666 -0.5775680000
1942.9999999999 -0.9597320000
1943.0833333333 -1.0803580000
1943.1666666666 -1.0240660000
1943.2499999999 -1.1400780000
1943.3333333333 -1.2468620000
1943.4166666666 -1.5151880000
1943.4999999999 -1.5019740000
1943.5833333333 -1.4703000000
1943.6666666666 -1.4709380000
1943.7499999999 -1.3500340000
1943.8333333333 -1.1337480000
1943.9166666666 -1.0436200000
1943.9999999999 -1.1857960000
1944.0833333333 -0.7079760000
1944.1666666666 -0.6024660000
1944.2499999999 -0.7092620000
1944.3333333333 -0.5345200000
1944.4166666666 -0.5736300000
1944.4999999999 -0.5035060000
1944.5833333333 -0.4564600000
1944.6666666666 -0.3109580000
1944.7499999999 -0.3377600000
1944.8333333333 -0.3014880000
1944.9166666666 -0.4452180000
1944.9999999999 -0.6397180000
1945.0833333333 -0.4049860000
1945.1666666666 -0.4533360000
1945.2499999999 -0.7047620000
1945.3333333333 -0.8792640000
1945.4166666666 -1.0414640000
1945.4999999999 -0.9928920000
1945.5833333333 -0.8597060000
1945.6666666666 -0.6557560000
1945.7499999999 -0.7256480000
1945.8333333333 -0.6832360000
1945.9166666666 -0.7346720000
1945.9999999999 -0.7230320000
1946.0833333333 -0.5375440000
1946.1666666666 -0.5612920000
1946.2499999999 -0.6127320000
1946.3333333333 -0.1687860000
1946.4166666666 0.1582320000
1946.4999999999 0.4437120000
1946.5833333333 0.6384220000
1946.6666666666 0.7808220000
1946.7499999999 0.8309140000
1946.8333333333 0.9025460000
1946.9166666666 0.9403260000
1946.9999999999 0.6396460000
1947.0833333333 0.3851180000
1947.1666666666 0.3336640000
1947.2499999999 0.4883660000
1947.3333333333 0.7046060000
1947.4166666666 0.5039180000
1947.4999999999 0.5293840000
1947.5833333333 0.5748500000
1947.6666666666 0.5464660000
1947.7499999999 0.4196240000
1947.8333333333 0.1912400000
1947.9166666666 0.2382380000
1947.9999999999 0.2575440000
1948.0833333333 0.4060800000
1948.1666666666 0.4484600000
1948.2499999999 0.2000700000
1948.3333333333 -0.0129360000
1948.4166666666 -0.0644060000
1948.4999999999 0.0087400000
1948.5833333333 0.0557320000
1948.6666666666 0.1719500000
1948.7499999999 0.3235540000
1948.8333333333 0.3736180000
1948.9166666666 0.5082940000
1948.9999999999 0.4875880000
1949.0833333333 0.5176480000
1949.1666666666 0.5984760000
1949.2499999999 0.8562260000
1949.3333333333 0.9078220000
1949.4166666666 0.9794160000
1949.4999999999 0.8725480000
1949.5833333333 0.8872180000
1949.6666666666 0.8465000000
1949.7499999999 0.7996280000
1949.8333333333 0.6481420000
1949.9166666666 0.6858800000
1949.9999999999 0.3020840000
1950.0833333333 -0.1694080000
1950.1666666666 -0.7116720000
1950.2499999999 -1.1431640000
1950.3333333333 -1.6023500000
1950.4166666666 -1.6015420000
1950.4999999999 -1.8145760000
1950.5833333333 -1.9076120000
1950.6666666666 -1.9868060000
1950.7499999999 -2.0106140000
1950.8333333333 -2.2574980000
1950.9166666666 -2.2720800000
1950.9999999999 -2.4020460000
1951.0833333333 -1.9535500000
1951.1666666666 -1.5281340000
1951.2499999999 -1.1442560000
1951.3333333333 -0.9696100000
1951.4166666666 -0.7949680000
1951.4999999999 -0.6341700000
1951.5833333333 -0.3687580000
1951.6666666666 -0.1156580000
1951.7499999999 0.0851360000
1951.8333333333 0.2274680000
1951.9166666666 0.5636420000
1951.9999999999 0.6352020000
1952.0833333333 0.6159920000
1952.1666666666 0.4429320000
1952.2499999999 0.5098720000
1952.3333333333 0.6891200000
1952.4166666666 0.9145180000
1952.4999999999 1.1229940000
1952.5833333333 1.3653160000
1952.6666666666 1.2599420000
1952.7499999999 1.3314920000
1952.8333333333 1.1522720000
1952.9166666666 0.8422780000
1952.9999999999 0.7092080000
1953.0833333333 0.6946000000
1953.1666666666 0.8492180000
1953.2499999999 0.8838380000
1953.3333333333 0.7384580000
1953.4166666666 0.6238420000
1953.4999999999 0.5276900000
1953.5833333333 0.5084600000
1953.6666666666 0.4723020000
1953.7499999999 0.5638380000
1953.8333333333 0.3676800000
1953.9166666666 0.6653660000
1953.9999999999 0.8753600000
1954.0833333333 0.7945840000
1954.1666666666 0.6707280000
1954.2499999999 0.2161040000
1954.3333333333 0.0168640000
1954.4166666666 -0.0977660000
1954.4999999999 -0.1431620000
1954.5833333333 -0.1716380000
1954.6666666666 -0.0970400000
1954.7499999999 -0.2732100000
1954.8333333333 -0.3001500000
1954.9166666666 -0.5209400000
1954.9999999999 -1.0263420000
1955.0833333333 -1.0579020000
1955.1666666666 -0.8771560000
1955.2499999999 -0.7564100000
1955.3333333333 -0.4772020000
1955.4166666666 -0.4241520000
1955.4999999999 -0.3034100000
1955.5833333333 -0.0657440000
1955.6666666666 0.1042260000
1955.7499999999 0.0141960000
1955.8333333333 0.1733960000
1955.9166666666 0.3233620000
1955.9999999999 0.6733300000
1956.0833333333 0.8571420000
1956.1666666666 0.7271040000
1956.2499999999 0.6770680000
1956.3333333333 0.4578000000
1956.4166666666 0.4877600000
1956.4999999999 0.6254120000
1956.5833333333 0.6353720000
1956.6666666666 0.3930200000
1956.7499999999 0.4752840000
1956.8333333333 0.6406260000
1956.9166666666 0.5951920000
1956.9999999999 0.1713000000
1957.0833333333 0.0074080000
1957.1666666666 0.1542780000
1957.2499999999 -0.2065400000
1957.3333333333 -0.7596680000
1957.4166666666 -0.8081840000
1957.4999999999 -1.0166980000
1957.5833333333 -1.2221360000
1957.6666666666 -1.1321940000
1957.7499999999 -0.9791740000
1957.8333333333 -1.1307700000
1957.9166666666 -1.3839080000
1957.9999999999 -1.3878140000
1958.0833333333 -1.1717220000
1958.1666666666 -1.2402480000
1958.2499999999 -1.2687720000
1958.3333333333 -0.9634520000
1958.4166666666 -0.5596740000
1958.4999999999 -0.3497400000
1958.5833333333 -0.0644240000
1958.6666666666 0.2747360000
1958.7499999999 0.2415880000
1958.8333333333 0.1484400000
1958.9166666666 0.2460580000
1958.9999999999 0.3867540000
1959.0833333333 0.5905260000
1959.1666666666 0.7712160000
1959.2499999999 0.8965240000
1959.3333333333 0.7172160000
1959.4166666666 0.7871340000
1959.4999999999 0.7432080000
1959.5833333333 0.7454340000
1959.6666666666 0.7691940000
1959.7499999999 0.8006500000
1959.8333333333 0.7721040000
1959.9166666666 0.9974000000
1959.9999999999 0.8626980000
1960.0833333333 0.9033780000
1960.1666666666 0.5086720000
1960.2499999999 0.4339660000
1960.3333333333 0.2500280000
1960.4166666666 0.3430100000
1960.4999999999 0.3390700000
1960.5833333333 0.3151280000
1960.6666666666 0.3819540000
1960.7499999999 0.3810860000
1960.8333333333 0.4140660000
1960.9166666666 0.5408860000
1960.9999999999 0.4923240000
1961.0833333333 0.6422240000
1961.1666666666 0.5413480000
1961.2499999999 0.8358600000
1961.3333333333 0.8811400000
1961.4166666666 0.8202620000
1961.4999999999 0.8809240000
1961.5833333333 0.9600460000
1961.6666666666 1.0930100000
1961.7499999999 1.1552080000
1961.8333333333 1.0774040000
1961.9166666666 0.9903640000
1961.9999999999 0.7771740000
1962.0833333333 0.6439820000
1962.1666666666 0.5538620000
1962.2499999999 0.3975900000
1962.3333333333 0.1290100000
1962.4166666666 -0.0488040000
1962.4999999999 -0.0481560000
1962.5833333333 -0.0613540000
1962.6666666666 0.0223660000
1962.7499999999 0.0399340000
1962.8333333333 0.0328860000
1962.9166666666 -0.0757060000
1962.9999999999 -0.3750640000
1963.0833333333 -0.6836540000
1963.1666666666 -0.7476320000
1963.2499999999 -1.1269940000
1963.3333333333 -1.2848200000
1963.4166666666 -1.4980320000
1963.4999999999 -1.5712440000
1963.5833333333 -1.4536860000
1963.6666666666 -1.3976720000
1963.7499999999 -1.2708880000
1963.8333333333 -1.1179500000
1963.9166666666 -1.1973220000
1963.9999999999 -1.2628480000
1964.0833333333 -0.9929900000
1964.1666666666 -0.9200600000
1964.2499999999 -1.0348200000
1964.3333333333 -0.6065040000
1964.4166666666 -0.1889620000
1964.4999999999 0.2316600000
1964.5833333333 0.4968960000
1964.6666666666 0.8359720000
1964.7499999999 1.0381300000
1964.8333333333 1.0433620000
1964.9166666666 0.7008980000
1964.9999999999 0.6753580000
1965.0833333333 0.8944320000
1965.1666666666 0.8858120000
1965.2499999999 1.3910380000
1965.3333333333 1.4362640000
1965.4166666666 1.2337920000
1965.4999999999 1.0051700000
1965.5833333333 0.8934680000
1965.6666666666 0.9186860000
1965.7499999999 0.6946740000
1965.8333333333 0.6952780000
1965.9166666666 0.5020300000
1965.9999999999 0.5964780000
1966.0833333333 0.5847700000
1966.1666666666 0.5607500000
1966.2499999999 0.4613480000
1966.3333333333 0.0234820000
1966.4166666666 -0.2143860000
1966.4999999999 -0.3137920000
1966.5833333333 -0.3978140000
1966.6666666666 -0.4203020000
1966.7499999999 -0.5950960000
1966.8333333333 -0.7252760000
1966.9166666666 -1.0077680000
1966.9999999999 -0.9671800000
1967.0833333333 -0.9358240000
1967.1666666666 -0.9937040000
1967.2499999999 -0.7761960000
1967.3333333333 -0.9448440000
1967.4166666666 -1.0088820000
1967.4999999999 -0.7575320000
1967.5833333333 -0.5769520000
1967.6666666666 -0.3302220000
1967.7499999999 -0.2311840000
1967.8333333333 -0.1321460000
1967.9166666666 -0.0192660000
1967.9999999999 -0.0002320000
1968.0833333333 0.0018800000
1968.1666666666 -0.0344760000
1968.2499999999 0.1999420000
1968.3333333333 -0.0933360000
1968.4166666666 0.0426140000
1968.4999999999 0.1893360000
1968.5833333333 0.1545160000
1968.6666666666 0.3273860000
1968.7499999999 0.3002580000
1968.8333333333 0.2392820000
1968.9166666666 0.0829160000
1968.9999999999 0.1557840000
1969.0833333333 0.0332660000
1969.1666666666 -0.0631020000
1969.2499999999 -0.1640820000
1969.3333333333 -0.3773740000
1969.4166666666 -0.2306680000
1969.4999999999 -0.3055000000
1969.5833333333 -0.1311000000
1969.6666666666 0.1186780000
1969.7499999999 0.0930740000
1969.8333333333 0.1659320000
1969.9166666666 0.2418600000
1969.9999999999 0.1716380000
1970.0833333333 -0.0478160000
1970.1666666666 0.0973400000
1970.2499999999 -0.0375020000
1970.3333333333 0.2030420000
1970.4166666666 0.3112720000
1970.4999999999 0.2533500000
1970.5833333333 0.4138880000
1970.6666666666 0.4898080000
1970.7499999999 0.4380360000
1970.8333333333 0.4370340000
1970.9166666666 0.2760260000
1970.9999999999 0.2380980000
1971.0833333333 0.6186300000
1971.1666666666 0.9360800000
1971.2499999999 1.0150720000
1971.3333333333 1.2017540000
1971.4166666666 1.1099700000
1971.4999999999 1.0074200000
1971.5833333333 0.8633300000
1971.6666666666 0.9546200000
1971.7499999999 0.8182200000
1971.8333333333 0.6479720000
1971.9166666666 0.5177200000
1971.9999999999 0.6736260000
1972.0833333333 0.4479900000
1972.1666666666 -0.1361120000
1972.2499999999 -0.4002100000
1972.3333333333 -0.8366180000
1972.4166666666 -1.0191840000
1972.4999999999 -1.1232880000
1972.5833333333 -1.1181600000
1972.6666666666 -0.9130380000
1972.7499999999 -1.0479140000
1972.8333333333 -1.0027900000
1972.9166666666 -0.8976700000
1972.9999999999 -0.6540880000
1973.0833333333 -0.7735820000
1973.1666666666 -0.8792360000
1973.2499999999 -0.7402720000
1973.3333333333 -0.9628460000
1973.4166666666 -0.6500420000
1973.4999999999 -0.4526200000
1973.5833333333 -0.3567380000
1973.6666666666 -0.2608580000
1973.7499999999 -0.2603620000
1973.8333333333 -0.1383300000
1973.9166666666 -0.1316860000
1973.9999999999 0.0549600000
1974.0833333333 0.0369900000
1974.1666666666 -0.0625220000
1974.2499999999 0.3271980000
1974.3333333333 0.5046080000
1974.4166666666 0.7143220000
1974.4999999999 0.6286540000
1974.5833333333 0.5706780000
1974.6666666666 0.6742340000
1974.7499999999 0.5608700000
1974.8333333333 0.5613520000
1974.9166666666 0.4679820000
1974.9999999999 0.5946160000
1975.0833333333 0.6012460000
1975.1666666666 0.2247960000
1975.2499999999 -0.0562660000
1975.3333333333 -0.6219460000
1975.4166666666 -0.6707060000
1975.4999999999 -0.7302340000
1975.5833333333 -0.6636100000
1975.6666666666 -0.6708360000
1975.7499999999 -0.7334440000
1975.8333333333 -0.5960520000
1975.9166666666 -0.6540520000
1975.9999999999 -0.5628160000
1976.0833333333 -0.7838920000
1976.1666666666 -1.2295860000
1976.2499999999 -1.0629700000
1976.3333333333 -0.7071240000
1976.4166666666 -0.2282060000
1976.4999999999 -0.2400560000
1976.5833333333 -0.1319060000
1976.6666666666 -0.0068380000
1976.7499999999 0.0690020000
1976.8333333333 0.0909960000
1976.9166666666 -0.0516320000
1976.9999999999 0.0211280000
1977.0833333333 0.1246540000
1977.1666666666 0.1404860000
1977.2499999999 0.3517040000
1977.3333333332 0.0506120000
1977.4166666666 -0.1227920000
1977.4999999999 -0.3500380000
1977.5833333332 -0.2003640000
1977.6666666666 0.0969980000
1977.7499999999 0.1635940000
1977.8333333332 0.0332640000
1977.9166666666 0.1998540000
1977.9999999999 0.2510620000
1978.0833333332 0.4161140000
1978.1666666666 0.5042400000
1978.2499999999 0.5939040000
1978.3333333332 0.6389540000
1978.4166666666 0.7993840000
1978.4999999999 0.8890460000
1978.5833333332 1.0971680000
1978.6666666666 1.0437480000
1978.7499999999 0.7995600000
1978.8333333332 0.5307560000
1978.9166666666 0.7388700000
1978.9999999999 0.3146800000
1979.0833333332 0.2058720000
1979.1666666666 0.3293680000
1979.2499999999 -0.1809800000
1979.3333333332 -0.4205600000
1979.4166666666 -0.5509120000
1979.4999999999 -0.5366480000
1979.5833333332 -0.4777700000
1979.6666666666 -0.5019740000
1979.7499999999 -0.4830980000
1979.8333333332 -0.5903780000
1979.9166666666 -0.8145840000
1979.9999999999 -1.2034040000
1980.0833333332 -0.9168400000
1980.1666666666 -1.0333580000
1980.2499999999 -1.5883340000
1980.3333333332 -1.5048500000
1980.4166666666 -1.3952180000
1980.4999999999 -1.4055820000
1980.5833333332 -1.3344100000
1980.6666666666 -1.1755500000
1980.7499999999 -1.1920720000
1980.8333333332 -1.2562880000
1980.9166666666 -1.2205080000
1980.9999999999 -0.8493420000
1981.0833333332 -0.6581760000
1981.1666666666 -0.8054760000
1981.2499999999 -0.8666220000
1981.3333333332 -0.8508440000
1981.4166666666 -0.8473780000
1981.4999999999 -1.0162180000
1981.5833333332 -1.0727520000
1981.6666666666 -1.0046740000
1981.7499999999 -1.0950560000
1981.8333333332 -0.7562080000
1981.9166666666 -0.5789040000
1981.9999999999 -0.4108280000
1982.0833333332 -0.2565980000
1982.1666666666 -0.3100660000
1982.2499999999 -0.2666100000
1982.3333333332 -0.1723840000
1982.4166666666 -0.2673940000
1982.4999999999 -0.2870160000
1982.5833333332 -0.1327940000
1982.6666666666 0.2245000000
1982.7499999999 0.3433360000
1982.8333333332 0.4637080000
1982.9166666666 0.1748460000
1982.9999999999 -0.2417080000
1983.0833333332 -0.2567220000
1983.1666666666 -0.6271280000
1983.2499999999 -0.7652220000
1983.3333333332 -1.0479340000
1983.4166666666 -0.9998800000
1983.4999999999 -0.9241320000
1983.5833333332 -0.7960760000
1983.6666666666 -0.6326420000
1983.7499999999 -0.8768980000
1983.8333333332 -0.9596160000
1983.9166666666 -0.9423380000
1983.9999999999 -0.8789040000
1984.0833333332 -0.5431640000
1984.1666666666 -0.4320440000
1984.2499999999 0.0236940000
1984.3333333332 0.1794320000
1984.4166666666 0.2936260000
1984.4999999999 0.3278220000
1984.5833333332 0.5681700000
1984.6666666666 0.7131300000
1984.7499999999 0.8719380000
1984.8333333332 0.9507460000
1984.9166666666 0.8603160000
1984.9999999999 0.9037360000
1985.0833333332 1.2640780000
1985.1666666666 1.1982620000
1985.2499999999 0.9093720000
1985.3333333332 0.4389400000
1985.4166666666 0.5592760000
1985.4999999999 0.7165340000
1985.5833333332 0.7799460000
1985.6666666666 0.6941240000
1985.7499999999 0.5359960000
1985.8333333332 0.4363260000
1985.9166666666 0.2674240000
1985.9999999999 0.0954460000
1986.0833333332 -0.1473040000
1986.1666666666 -0.4162100000
1986.2499999999 -0.1235760000
1986.3333333332 -0.1955580000
1986.4166666666 -0.0383140000
1986.4999999999 -0.1318380000
1986.5833333332 -0.1745940000
1986.6666666666 -0.0665840000
1986.7499999999 0.0460440000
1986.8333333332 0.1202080000
1986.9166666666 0.0635980000
1986.9999999999 0.5562220000
1987.0833333332 0.7319220000
1987.1666666666 0.8968480000
1987.2499999999 0.5156220000
1987.3333333332 -0.1271440000
1987.4166666666 -0.1776060000
1987.4999999999 -0.2419120000
1987.5833333332 -0.2277580000
1987.6666666666 -0.0797620000
1987.7499999999 -0.1733020000
1987.8333333332 -0.1406900000
1987.9166666666 -0.1957740000
1987.9999999999 -0.3677800000
1988.0833333332 -0.9213240000
1988.1666666666 -0.9425660000
1988.2499999999 -1.0776520000
1988.3333333332 -1.1742780000
1988.4166666666 -0.9462920000
1988.4999999999 -0.7890720000
1988.5833333332 -0.6780080000
1988.6666666666 -0.5407960000
1988.7499999999 -0.6143500000
1988.8333333332 -0.4571360000
1988.9166666666 -0.4937720000
1988.9999999999 -0.4550220000
1989.0833333332 -0.3255040000
1989.1666666666 0.0255500000
1989.2499999999 0.0196820000
1989.3333333332 -0.4277260000
1989.4166666666 -0.2828320000
1989.4999999999 -0.4040880000
1989.5833333332 -0.4361140000
1989.6666666666 -0.3712240000
1989.7499999999 -0.4447900000
1989.8333333332 -0.3383600000
1989.9166666666 -0.3750100000
1989.9999999999 -0.3578100000
1990.0833333332 -0.1236900000
1990.1666666666 0.0165800000
1990.2499999999 -0.1539180000
1990.3333333332 -0.4121080000
1990.4166666666 -0.1641500000
1990.4999999999 -0.0408040000
1990.5833333332 0.1040780000
1990.6666666666 0.2674180000
1990.7499999999 0.3292220000
1990.8333333332 0.4910240000
1990.9166666666 0.3051300000
1990.9999999999 0.2715440000
1991.0833333332 0.2133440000
1991.1666666666 0.0536000000
1991.2499999999 -0.1538340000
1991.3333333332 -0.0858840000
1991.4166666666 0.1497520000
1991.4999999999 0.2007780000
1991.5833333332 0.2087240000
1991.6666666666 0.1982040000
1991.7499999999 0.2723000000
1991.8333333332 0.1587060000
1991.9166666666 0.0389520000
1991.9999999999 0.2084300000
1992.0833333332 0.3532920000
1992.1666666666 0.4473820000
1992.2499999999 0.5753180000
1992.3333333332 0.7217160000
1992.4166666666 0.7558000000
1992.4999999999 0.8683500000
1992.5833333332 1.0224360000
1992.6666666666 1.0949800000
1992.7499999999 1.4644480000
1992.8333333332 1.4216080000
1992.9166666666 1.4972260000
1992.9999999999 1.6128440000
1993.0833333332 1.6376940000
1993.1666666666 1.3317680000
1993.2499999999 1.2673840000
1993.3333333332 1.4276140000
1993.4166666666 1.4632240000
1993.4999999999 1.2742220000
1993.5833333332 1.2606020000
1993.6666666666 1.3762080000
1993.7499999999 1.3933560000
1993.8333333332 1.2274260000
1993.9166666666 1.1614900000
1993.9999999999 1.1478660000
1994.0833333332 0.8034700000
1994.1666666666 0.5036860000
1994.2499999999 0.4377480000
1994.3333333332 0.0195040000
1994.4166666666 -0.4987460000
1994.4999999999 -0.7200700000
1994.5833333332 -0.6352420000
1994.6666666666 -0.5934940000
1994.7499999999 -0.6517460000
1994.8333333332 -0.6499980000
1994.9166666666 -0.7328680000
1994.9999999999 -1.0218920000
1995.0833333332 -1.2186080000
1995.1666666666 -0.9568680000
1995.2499999999 -0.7505100000
1995.3333333332 -0.6164620000
1995.4166666666 -0.3501100000
1995.4999999999 -0.2929860000
1995.5833333332 -0.3343240000
1995.6666666666 -0.3525920000
1995.7499999999 -0.3693180000
1995.8333333332 -0.3552740000
1995.9166666666 -0.5781600000
1995.9999999999 -0.7410440000
1996.0833333332 -0.8239280000
1996.1666666666 -0.9468160000
1996.2499999999 -0.8527800000
1996.3333333332 -0.9956680000
1996.4166666666 -1.1631740000
1996.4999999999 -1.3229880000
1996.5833333332 -1.2089560000
1996.6666666666 -0.9272360000
1996.7499999999 -0.7562820000
1996.8333333332 -0.6484080000
1996.9166666666 -0.8897680000
1996.9999999999 -0.9680500000
1997.0833333332 -1.0971020000
1997.1666666666 -0.9030800000
1997.2499999999 -0.7336720000
1997.3333333332 -1.0888820000
1997.4166666666 -1.0394800000
1997.4999999999 -1.0039220000
1997.5833333332 -0.6975960000
1997.6666666666 -0.7205040000
1997.7499999999 -0.9111040000
1997.8333333332 -1.1355500000
1997.9166666666 -1.2923080000
1997.9999999999 -1.1921420000
1998.0833333332 -1.0073600000
1998.1666666666 -0.6764300000
1998.2499999999 -0.5085760000
1998.3333333332 -0.4591820000
1998.4166666666 -0.0036400000
1998.4999999999 0.0719040000
1998.5833333332 0.1674480000
1998.6666666666 0.1506800000
1998.7499999999 0.1708360000
1998.8333333332 0.1356060000
1998.9166666666 0.1972960000
1998.9999999999 0.4420640000
1999.0833333332 0.3852940000
1999.1666666666 0.1362100000
1999.2499999999 -0.2636400000
1999.3333333332 -0.6711840000
1999.4166666666 -0.9033480000
1999.4999999999 -1.2339700000
1999.5833333332 -1.3261320000
1999.6666666666 -1.1521460000
1999.7499999999 -1.2304640000
1999.8333333332 -1.3164760000
1999.9166666666 -1.3901860000
1999.9999999999 -1.3838920000
2000.0833333332 -1.6683700000
2000.1666666666 -1.7251580000
2000.2499999999 -1.5804060000
2000.3333333332 -1.2633480000
2000.4166666666 -0.7478340000
2000.4999999999 -0.5200080000
2000.5833333332 -0.4921840000
2000.6666666666 -0.4966720000
2000.7499999999 -0.7150040000
2000.8333333332 -0.6041080000
2000.9166666666 -0.2070600000
2000.9999999999 -0.0869340000
2001.0833333332 -0.2021940000
2001.1666666666 -0.1097660000
2001.2499999999 0.0488180000
2001.3333333332 0.3274000000
2001.4166666666 0.2413640000
2001.4999999999 0.0307140000
2001.5833333332 -0.0276300000
2001.6666666666 0.1971000000
2001.7499999999 0.5156760000
2001.8333333332 0.7511760000
2001.9166666666 0.4220560000
2001.9999999999 0.3390900000
2002.0833333332 0.3284320000
2002.1666666666 0.5377700000
2002.2499999999 0.6471100000
2002.3333333332 0.6702940000
2002.4166666666 0.4719360000
2002.4999999999 0.4966580000
2002.5833333332 0.4690700000
2002.6666666666 0.5214780000
2002.7499999999 0.3615800000
2002.8333333332 0.0386040000
2002.9166666666 -0.1105300000
2002.9999999999 0.0818760000
2003.0833333332 -0.2426420000
2003.1666666666 -0.1348560000
2003.2499999999 -0.0486060000
2003.3333333332 0.0145640000
2003.4166666666 -0.0730380000
2003.4999999999 -0.2283300000
2003.5833333332 -0.0913160000
2003.6666666666 0.1995400000
2003.7499999999 0.2980900000
2003.8333333332 0.2643300000
2003.9166666666 0.0274900000
2003.9999999999 -0.2216540000
2004.0833333332 -0.2215700000
2004.1666666666 -0.2861060000
2004.2499999999 -0.4444860000
2004.3333333332 -0.6782520000
2004.4166666666 -1.0535600000
2004.4999999999 -1.0750200000
2004.5833333332 -0.7641740000
2004.6666666666 -0.8348700000
2004.7499999999 -0.9655640000
2004.8333333332 -0.7808740000
2004.9166666666 -0.8208060000
2004.9999999999 -0.2099640000
2005.0833333332 0.1208760000
2005.1666666666 0.2009420000
2005.2499999999 0.6117780000
2005.3333333332 1.0656920000
2005.4166666666 1.0965240000
2005.4999999999 1.2288960000
2005.5833333332 1.3289600000
2005.6666666666 1.3613280000
2005.7499999999 1.4260040000
2005.8333333332 1.4276040000
2005.9166666666 1.1399660000
2005.9999999999 1.2000240000
2006.0833333332 0.5877740000
2006.1666666666 0.4524420000
2006.2499999999 0.2186500000
2006.3333333332 -0.3674500000
2006.4166666666 -0.7350940000
2006.4999999999 -0.8381180000
2006.5833333332 -0.7457600000
2006.6666666666 -0.5995620000
2006.7499999999 -0.6148980000
2006.8333333332 -0.5748520000
2006.9166666666 -0.4701940000
2006.9999999999 -0.5547640000
2007.0833333332 -0.5501060000
2007.1666666666 -0.2454520000
2007.2499999999 -0.1115640000
2007.3333333332 0.0023220000
2007.4166666666 0.2269720000
2007.4999999999 0.2316260000
2007.5833333332 0.4255100000
2007.6666666666 0.5624640000
2007.7499999999 0.4501900000
2007.8333333332 0.3594540000
2007.9166666666 0.3594840000
2007.9999999999 0.2502840000
2008.0833333332 0.3764680000
2008.1666666666 0.6164920000
2008.2499999999 0.8119040000
2008.3333333332 0.5703920000
2008.4166666666 0.4119540000
2008.4999999999 0.3535160000
2008.5833333332 0.4243080000
2008.6666666666 0.4735580000
2008.7499999999 0.4628080000
2008.8333333332 0.5135980000
2008.9166666666 0.3674600000
2008.9999999999 0.2059380000
2009.0833333332 0.2228780000
2009.1666666666 -0.1109580000
2009.2499999999 -0.5109440000
2009.3333333332 -0.9678540000
2009.4166666666 -0.9063060000
2009.4999999999 -0.8339880000
2009.5833333332 -0.7032100000
2009.6666666666 -0.8201280000
2009.7499999999 -0.8370440000
2009.8333333332 -0.9108840000
2009.9166666666 -0.9801120000
2009.9999999999 -0.5601080000
2010.0833333332 -0.4385680000
2010.1666666666 -0.2262620000
2010.2499999999 0.3214300000
2010.3333333332 0.5322000000
2010.4166666666 0.7814240000
2010.4999999999 0.9568060000
2010.5833333332 1.1398800000
2010.6666666666 1.3737160000
2010.7499999999 1.6075560000
2010.8333333332 1.8583180000
2010.9166666666 1.8475360000
2010.9999999999 2.0629120000
2011.0833333332 1.7875160000
2011.1666666666 1.6490400000
2011.2499999999 1.3674880000
2011.3333333332 1.4643960000
2011.4166666666 1.3813000000
2011.4999999999 1.2782080000
2011.5833333332 1.0828060000
2011.6666666666 1.1720140000
2011.7499999999 0.9873780000
2011.8333333332 0.7612040000
2011.9166666666 0.3996400000
2011.9999999999 0.4826920000
2012.0833333332 0.3949760000
2012.1666666666 0.2749480000
2012.2499999999 0.3072280000
2012.3333333332 0.2502780000
2012.4166666666 -0.2651400000
2012.4999999999 -0.3682460000
2012.5833333332 -0.1313540000
2012.6666666666 0.0470700000
2012.7499999999 -0.0021940000
2012.8333333332 0.0100800000
2012.9166666666 0.3115780000
2012.9999999999 0.0761580000
2013.0833333332 -0.0638800000
2013.1666666666 -0.3639240000
2013.2499999999 -0.4901180000
2013.3333333332 -0.4947740000
2013.4166666666 -0.5717440000
2013.4999999999 -0.2948640000
2013.5833333332 -0.0933700000
2013.6666666666 -0.1380360000
2013.7499999999 -0.0626980000
2013.8333333332 -0.0273620000
2013.9166666665 -0.1981840000
2013.9999999999 -0.0859260000
2014.0833333332 0.3063300000
2014.1666666665 0.1878120000
2014.2499999999 0.3416040000
2014.3333333332 0.3200120000
2014.4166666665 0.4307200000
2014.4999999999 0.4060480000
2014.5833333332 0.4013740000
2014.6666666665 0.4551580000
2014.7499999999 0.4104820000
2014.8333333332 0.3273440000
2014.9166666665 0.3411220000
2014.9999999999 0.2610580000
2015.0833333332 -0.0620840000
2015.1666666665 0.1686160000
2015.2499999999 0.0254720000
2015.3333333332 0.0223260000
2015.4166666665 0.3499460000
2015.4999999999 0.2221820000
2015.5833333332 0.3559560000
2015.6666666665 0.2758800000
2015.7499999999 0.1773440000
2015.8333333332 0.3003460000
2015.9166666665 0.4171880000
2015.9999999999 0.3848040000
2016.0833333332 0.4970320000
2016.1666666665 0.4200260000
2016.2499999999 0.0599460000
2016.3333333332 0.1121700000
2016.4166666665 -0.1356080000
2016.4999999999 -0.2849240000
2016.5833333332 -0.3173160000
2016.6666666665 -0.2543300000
2016.7499999999 -0.2513400000
2016.8333333332 -0.2283520000
2016.9166666665 -0.6146000000
2016.9999999999 -0.6300760000
2017.0833333332 -0.6286300000
2017.1666666665 -0.4979580000
2017.2499999999 -0.8580520000
2017.3333333332 -0.9673780000
2017.4166666665 -0.8459400000
2017.4999999999 -0.6521920000
2017.5833333332 -0.6292140000
2017.6666666665 -0.4908560000
2017.7499999999 -0.6278820000
2017.8333333332 -0.6295220000
2017.9166666665 -0.8203980000
2017.9999999999 -0.6958880000
2018.0833333332 -1.1159940000
2018.1666666665 -1.1161040000
2018.2499999999 -1.1485200000
2018.3333333332 -0.8547820000
2018.4166666665 -0.7502820000
2018.4999999999 -0.6980860000
2018.5833333332 -0.5305060000
2018.6666666665 -0.3783160000
2018.7499999999 -0.3368920000
2018.8333333332 -0.3185460000
2018.9166666665 -0.4463600000
2018.9999999999 -0.3849400000
2019.0833333332 -0.1589040000
2019.1666666665 -0.0374900000
2019.2499999999 -0.0314580000
2019.3333333332 -0.2300420000
2019.4166666665 -0.2486320000
2019.4999999999 -0.2610640000
2019.5833333332 -0.4134980000
2019.6666666665 -0.4474760000
2019.7499999999 -0.4645280000
2019.8333333332 -0.5000420000
2019.9166666665 -0.4324840000
2019.9999999999 -0.4556920000
2020.0833333332 -0.3804400000
2020.1666666665 -0.4021160000
2020.2499999999 -0.4837900000
2020.3333333332 -0.6300800000
2020.4166666665 -0.3825300000
2020.4999999999 -0.2918980000
2020.5833333332 -0.1520380000
2020.6666666665 0.1708940000
2020.7499999999 0.1876740000
2020.8333333332 0.1952240000
2020.9166666665 0.2935380000
2020.9999999999 0.4795460000
2021.0833333332 0.7686300000
2021.1666666665 0.7977100000
2021.2499999999 0.6698680000
2021.3333333332 0.7666420000
2021.4166666665 0.6664860000
2021.4999999999 0.4817200000
2021.5833333332 0.3784900000
2021.6666666665 0.2429460000
2021.7499999999 0.0674060000
2021.8333333332 -0.0450580000
2021.9166666665 0.1101640000
2021.9999999999 -0.1730720000
2022.0833333332 -0.5070780000
2022.1666666665 -0.5103200000
2022.2499999999 -0.7120200000
2022.3333333332 -0.6937220000
2022.4166666665 -0.5892760000
2022.4999999999 -0.4294400000
2022.5833333332 -0.3049920000
2022.6666666665 -0.0343940000
2022.7499999999 -0.0807180000
2022.8333333332 -0.0039640000
2022.9166666665 0.1097060000
2022.9999999999 -0.2320040000
2023.0833333332 -0.1860240000
2023.1666666665 0.0384120000
2023.2499999999 0.0243900000
2023.3333333332 0.3272900000
2023.4166666665 0.3394160000
2023.4999999999 0.4761600000
2023.5833333332 0.5082860000
2023.6666666665 0.6142560000
2023.7499999999 0.5663800000
2023.8333333332 0.7185040000
2023.9166666665 0.5829300000
2023.9999999999 0.4565900000
2024.0833333332 0.3902500000
2024.1666666665 0.4869800000
2024.2499999999 0.3437140000
2024.3333333332 0.0850620000
2024.4166666665 0.0402500000
2024.4999999999 -0.0137880000
2024.5833333332 -0.1401360000
2024.6666666665 -0.1741820000
2024.7499999999 -0.1420700000
2024.8333333332 -0.2714980000
2024.9166666665 -0.4070840000
2024.9999999999 -0.1442080000
{
"Aliased": [
0.422362756,
0.368617497,
0.255621397,
0.209019747,
0.322015847,
0.155274488,
0.262765007,
0.375761106,
0.05374526,
0.225992198,
0.172246939,
0.488757205,
0.112996099,
0.00714361,
0.10034691,
0.04660165,
0.481613596,
2,
1
],
"AliasedAmp": [
0.162168508,
0.018437804,
0.080427203,
0.100193077,
-0.13758768,
-0.237395871,
-0.177315945,
-0.112108433,
-0.090758587,
-0.124693774,
0.129941321,
0.05887287,
0.047920509,
-0.02670324,
0.079661958,
-0.170565617,
-0.013872906,
0.031258073,
0.073714152
],
"AliasedPhase": [
12.26665875,
11.41281403,
17.90437492,
9.159760748,
24.87352569,
14.65428835,
10.7419008,
14.19058454,
10.14360775,
8.237883753,
5.232416953,
20.48980669,
5.299072807,
24.21263636,
6.574752375,
6.740362898,
10.45183646,
6.226353584,
3.299100693
],
"Hold": 0.001538141,
"Imp_Amp": 36.63771512,
"Imp_Stride": 12,
"Initial": 0.0212,
"LTE_Amp": 0.752732079,
"LTE_Freq": 188.2119915,
"LTE_Phase": -1.845171154,
"Periods": [
27.2122,
27.3216,
27.5545,
13.63339513,
13.69114014,
13.6061,
13.6608,
13.71877789,
6795.985773,
1616.215172,
2120.513853,
13.77725,
3232.430344,
9.132931547,
9.108450374,
9.120674533,
27.0926041
],
"PeriodsAmp": [
0.306411813,
0.105333615,
0.046157526,
0.052010303,
-0.159651577,
0.116360596,
0.168727625,
0.182906578,
0.041646376,
0.170302166,
0.156154628,
0.066553408,
0.025133677,
0.005700373,
0.048782882,
0.006749513,
-0.182128222
],
"PeriodsPhase": [
13.56978148,
7.87504352,
18.32973237,
7.156452097,
21.01885068,
9.702972954,
6.011334823,
10.17573262,
9.25752208,
7.37083659,
6.278543069,
15.92705949,
5.758181895,
8.262567708,
1.540785851,
6.178219982,
7.925674634
],
"Year": 365.2520198,
"final_state": {
"D_prev": 0.04294
},
"metrics": {
"mse": null,
"pearson_p": null,
"pearson_r": null,
"var_squared_error": null
},
"model_params": {
"Hold": 0.001538141,
"Imp_Amp": 36.63771512,
"Imp_Stride": 12,
"LTE_Amp": 0.752732079,
"LTE_Freq": 188.219915,
"LTE_Phase": -1.845171154,
"Periods": [
27.2122
],
"PeriodsAmp": [
0.306
],
"PeriodsPhase": [
13.57
],
"Year": 365.2520198
},
"model_type": "spreadsheet",
"n_samples": 0,
"notes": "Default .json file for timeseries_modeler.py. Update 'source_csv' to match your CSV filename. The script will overwrite/augment this file with actual n_samples, final_state and metrics after processing.",
"source_csv": "data.csv"
}
#!/usr/bin/env python3
"""
timeseries_modeler.py
Read a two-column CSV (time, value). Read a JSON file with the same filename
appended by ".json" (e.g. data.csv.json) into a data dictionary. Create a clone of the
time-series and run a loop that steps through timestamps, calling a user-
customizable model-step function to produce a modeled series. At the end the
script computes Pearson's correlation coefficient and the variance of the
squared errors (and also MSE), using library routines.
Usage:
python timeseries_modeler.py data.csv [--out fitted.csv] [--params '{"key":value}'] [--model spreadsheet|example|clone] [--plot]
python3 timeseries_modeler.py 11a.csv --plot --model spreadsheet
Notes:
- The CSV must have at least two columns (time, value). Header is tolerated.
- Default model is a simple example; an optional "spreadsheet" model is
included that follows the formulas described in your earlier message:
- impulse every Imp_Stride rows
- C_t = Imp_Amp * impulse_mask * sum_k PeriodsAmp[k] * sin(2*pi*time/Period_k + PeriodsPhase_k)
- D_t = (1-Hold)*D_{t-1} + Hold*C_t
- E_t = LTE_Amp * sin(D_t*LTE_Freq + LTE_Phase)
Provide model parameters via --params as a JSON string (see defaults below).
- The implementation loops over timestamps (explicit for-loop) so the model can
be stateful (sample-and-hold needs previous D).
- Pearson correlation computed using scipy.stats.pearsonr if available,
otherwise a fallback via numpy.corrcoef is used.
- Outputs:
- CSV with columns: time, observed, model, residual
- JSON .json file updated with metadata (metrics, parameters used)
Dependencies:
numpy, pandas, scipy (optional but recommended for Pearson), matplotlib (optional for plotting)
"""
from __future__ import annotations
import argparse
import json
import math
import os
from typing import Any, Dict, Tuple, Callable
import numpy as np
import pandas as pd
# Try to import scipy.stats for pearsonr, else fallback to numpy
try:
from scipy.stats import pearsonr
_HAS_SCIPY = True
except Exception:
pearsonr = None # type: ignore
_HAS_SCIPY = False
# Optional plotting
try:
import matplotlib.pyplot as plt
_HAS_MPL = True
except Exception:
_HAS_MPL = False
TWOPI = 2.0 * math.pi
def read_two_column_csv(path: str) -> Tuple[np.ndarray, np.ndarray]:
"""Read CSV-like file with two columns: time, value. Tolerant to header rows."""
df = pd.read_csv(path, header=0)
if df.shape[1] < 2:
raise ValueError("Input CSV must have at least two columns (time, value).")
t = pd.to_numeric(df.iloc[:, 0], errors='coerce')
y = pd.to_numeric(df.iloc[:, 1], errors='coerce')
mask = (~t.isna()) & (~y.isna())
t = t[mask].to_numpy(dtype=float)
y = y[mask].to_numpy(dtype=float)
return t, y
def read_json_p(path: str) -> Dict[str, Any]:
"""Read JSON file at path (if exists), else return empty dict."""
if not os.path.exists(path):
return {}
with open(path, 'r', encoding='utf-8') as fh:
return json.load(fh)
def write_json_p(path: str, data: Dict[str, Any]) -> None:
"""Write JSON dict to file path."""
with open(path, 'w', encoding='utf-8') as fh:
json.dump(data, fh, indent=2, sort_keys=True)
def clone_series(series: np.ndarray) -> np.ndarray:
"""Return a deep copy (clone) of the series."""
return np.array(series, copy=True)
# ---- Model-step interface ---------------------------------------------------
# A model-step function implements:
# model_value, state = model_step(i, t_i, clone_i, state, params)
# Where:
# i: integer time index (0..N-1)
# t_i: timestamp value (float)
# clone_i: cloned original series value at index i (float)
# state: dict carrying model internal state (mutable or replaced)
# params: dict of user parameters
#
# The runner will set up initial state = {} and call model_step for each i.
# ---------------------------------------------------------------------------
def model_step_clone(i: int, t_i: float, clone_i: float, state: Dict[str, Any], params: Dict[str, Any]):
"""Trivial clone model: model value equals the cloned series value."""
return float(clone_i), state
def model_step_example(i: int, t_i: float, clone_i: float, state: Dict[str, Any], params: Dict[str, Any]):
"""
Simple example model: low-pass sample-and-hold of the clone plus a small sinusoidal
modulation. Demonstrates a stateful update.
Parameters in params:
- alpha: exponential smoothing parameter in [0,1] (default 0.9)
- sin_amp: amplitude of additive sine (default 0.0)
- sin_freq: frequency in cycles per year (default 1.0)
- sin_phase: phase in radians (default 0.0)
"""
alpha = float(params.get('alpha', 0.9))
sin_amp = float(params.get('sin_amp', 0.0))
sin_freq = float(params.get('sin_freq', 1.0))
sin_phase = float(params.get('sin_phase', 0.0))
# stateful accumulator
prev = state.get('acc', 0.0)
# simple exponential smoothing toward the clone value
acc = alpha * prev + (1.0 - alpha) * float(clone_i)
state['acc'] = acc
mod = sin_amp * math.sin(TWOPI * t_i * sin_freq + sin_phase)
model_value = acc + mod
return float(model_value), state
def model_step_spreadsheet(i: int, t_i: float, clone_i: float, state: Dict[str, Any], params: Dict[str, Any]):
"""
Implements the spreadsheet-style model described:
- Impulse mask every Imp_Stride rows (row numbering starts at 1)
- C_t = (Imp_Amp if (row_idx % Imp_Stride == 1) else 0) * SUM_k PeriodsAmp[k]*sin(2*pi * t / Period_k + PeriodsPhase[k])
- D_t = (1-Hold)*D_{t-1} + Hold*C_t (initialize D_0 = Hold*C_0)
- E_t = LTE_Amp * sin(D_t * LTE_Freq + LTE_Phase)
Required params (defaults provided):
- Imp_Stride: int (default 1)
- Imp_Amp: float (default 1.0)
- Periods: list of floats (default [1.0])
- PeriodsAmp: list of floats (len match Periods, default [1.0])
- PeriodsPhase: list of floats (len match Periods, default [0.0])
- Hold: float in [0,1] (default 0.5)
- LTE_Amp: float (default 1.0)
- LTE_Freq: float (default 1.0)
- LTE_Phase: float (default 0.0)
"""
# Prepare and normalize parameters
Initial = float(params.get('Initial', 0.04294))
Year = float(params.get('Year', 365.242))
Imp_Stride = int(params.get('Imp_Stride', 12))
Imp_Amp = float(params.get('Imp_Amp', 1.0))
Periods = list(params.get('Periods', [1.0]))
PeriodsAmp = list(params.get('PeriodsAmp', [1.0] * len(Periods)))
PeriodsPhase = list(params.get('PeriodsPhase', [0.0] * len(Periods)))
Aliased = list(params.get('Aliased', [1.0]))
AliasedAmp = list(params.get('AliasedAmp', [1.0] * len(Aliased)))
AliasedPhase = list(params.get('AliasedPhase', [0.0] * len(Aliased)))
Hold = float(params.get('Hold', 0.5))
LTE_Amp = float(params.get('LTE_Amp', 1.0))
LTE_Freq = float(params.get('LTE_Freq', 1.0))
LTE_Phase = float(params.get('LTE_Phase', 0.0))
# compute sum of sinusoids
ssum = 0.0
for amp, per, ph in zip(PeriodsAmp, Periods, PeriodsPhase):
per = float(per)
if per == 0.0:
continue
ssum += float(amp) * math.sin(TWOPI * float(t_i) * Year / per + float(ph))
# row index as 1..N (i is 0..N-1)
row_idx = i + 2
impulse = 1.0 if (row_idx % max(1, Imp_Stride) == 1) else 0.0
C_t = impulse * Imp_Amp * ssum
# stateful D
if 'D_prev' not in state:
# initialize as Hold * C_0 (spreadsheet initialization)
state['D_prev'] = Initial
D_prev = float(state['D_prev'])
D_t = (1.0 - Hold) * D_prev + Hold * C_t
state['D_prev'] = D_t
# compute sum of aliases
ssum = 0.0
for amp, freq, ph in zip(AliasedAmp, Aliased, AliasedPhase):
freq = float(freq)
ssum += float(amp) * math.sin(TWOPI * float(t_i) * freq + float(ph))
E_t = LTE_Amp * math.sin(D_t * LTE_Freq + LTE_Phase) + ssum
return float(E_t), state
# Runner that loops through timestamps and produces modeled series ----------------
def run_loop_time_series(time: np.ndarray,
observed: np.ndarray,
model_step_fn: Callable,
params: Dict[str, Any]) -> Tuple[np.ndarray, Dict[str, Any]]:
"""
Loop over timestamps and compute model values using model_step_fn.
Returns (model_array, final_state).
"""
N = time.size
clone = clone_series(observed)
state: Dict[str, Any] = {}
model = np.zeros_like(observed, dtype=float)
for i in range(N):
t_i = float(time[i])
clone_i = float(clone[i])
v, state = model_step_fn(i, t_i, clone_i, state, params)
model[i] = float(v)
return model, state
# Metrics -----------------------------------------------------------------------
def compute_metrics(observed: np.ndarray, model: np.ndarray) -> Dict[str, Any]:
"""Compute Pearson correlation, residuals, MSE, and variance of squared errors."""
residuals = model - observed
mse = float(np.mean(residuals ** 2))
# variance of squared errors (i.e., variance of residuals**2)
var_sq_err = float(np.var(residuals ** 2))
# Pearson r (use scipy if available else numpy)
try:
if _HAS_SCIPY:
r_val, p_val = pearsonr(observed, model) # type: ignore
pearson_r = float(r_val)
pearson_p = float(p_val)
else:
# fallback
cov = np.cov(observed, model, ddof=0)
denom = math.sqrt(cov[0, 0] * cov[1, 1]) if cov[0, 0] > 0 and cov[1, 1] > 0 else 0.0
if denom == 0:
pearson_r = float(np.nan)
pearson_p = float(np.nan)
else:
pearson_r = float(cov[0, 1] / denom)
pearson_p = float(np.nan)
except Exception:
pearson_r = float(np.nan)
pearson_p = float(np.nan)
return {
'residuals': residuals,
'mse': mse,
'var_squared_error': var_sq_err,
'pearson_r': pearson_r,
'pearson_p': pearson_p
}
# Utilities ---------------------------------------------------------------------
def parse_json_like_arg(s: str | None) -> Dict[str, Any]:
"""Parse a JSON-like string from CLI --params. Returns dict."""
if s is None:
return {}
try:
return json.loads(s)
except Exception as e:
raise argparse.ArgumentTypeError(f"Invalid JSON for --params: {e}")
def main():
ap = argparse.ArgumentParser(description="Time-series modeler with per-timestamp loop and metrics.")
ap.add_argument('csv', help='Input CSV file (two columns: time, value).')
ap.add_argument('--out', default='fitted_out.csv', help='Output CSV file with time, observed, model, residual.')
ap.add_argument('--model', choices=['clone', 'example', 'spreadsheet'], default='example',
help='Which built-in model-step to use. Default "example".')
ap.add_argument('--plot', action='store_true', help='Show plot of observed vs model (requires matplotlib).')
args = ap.parse_args()
# Read CSV
time, y = read_two_column_csv(args.csv)
if time.size == 0:
raise SystemExit("No data read from CSV.")
# Read JSON file with same name appended by ".json"
json_path = args.csv + '.json'
data_dict = read_json_p(json_path)
params = data_dict
# Choose model function
if args.model == 'clone':
model_fn = model_step_clone
elif args.model == 'example':
model_fn = model_step_example
else:
model_fn = model_step_spreadsheet
# Make a clone of the series (not strictly necessary but requested)
cloned = clone_series(y)
# y = [0.0] * len(y)
# Run the time-stepping loop (explicit loop per timestamp)
model_vals, final_state = run_loop_time_series(time, cloned, model_fn, params)
# Compute metrics
metrics = compute_metrics(y, model_vals)
# Prepare output DataFrame
out_df = pd.DataFrame({
'time': time,
'observed': y,
'model': model_vals,
'residual': metrics['residuals']
})
out_df.to_csv(args.out, index=False)
# Update data dictionary with metadata and save to .json file
data_dict_out = dict(data_dict) # copy existing
data_dict_out.setdefault('source_csv', os.path.basename(args.csv))
data_dict_out.setdefault('n_samples', int(time.size))
data_dict_out.setdefault('model_type', args.model)
data_dict_out.setdefault('model_params', params)
data_dict_out.setdefault('final_state', _serialize_state_for_json(final_state))
data_dict_out.setdefault('metrics', {
'mse': metrics['mse'],
'var_squared_error': metrics['var_squared_error'],
'pearson_r': metrics['pearson_r'],
'pearson_p': metrics['pearson_p']
})
write_json_p(json_path, data_dict_out)
# Print summary
print(f"Processed {time.size} samples from: {args.csv}")
print(f"Model type: {args.model}")
print(f"Output CSV: {args.out}")
print(f"Updated JSON data file: {json_path}")
print("Metrics:")
print(f" MSE = {metrics['mse']:.6e}")
print(f" Variance of squared errors = {metrics['var_squared_error']:.6e}")
print(f" Pearson r = {metrics['pearson_r']}, p-value = {metrics.get('pearson_p', None)}")
# Optional plotting
if args.plot:
if not _HAS_MPL:
print("matplotlib not available; cannot plot.")
else:
plt.figure(figsize=(12, 6))
plt.plot(time, y, label='observed', lw=1)
plt.plot(time, model_vals, label='model', lw=1)
# plt.plot(time, metrics['residuals'], label='residual', lw=0.8, alpha=0.7)
plt.legend()
plt.xlabel('time')
plt.ylabel('value')
plt.title(f"Model: {args.model} Pearson r={metrics['pearson_r']:.4g} MSE={metrics['mse']:.4g}")
plt.grid(True)
plt.show()
def _serialize_state_for_json(state: Dict[str, Any]) -> Dict[str, Any]:
"""Helper to convert final state to JSON-serializable form."""
out = {}
for k, v in state.items():
try:
json.dumps({k: v})
out[k] = v
except Exception:
# try to coerce numpy scalars
if isinstance(v, (np.generic,)):
out[k] = np.asscalar(v) # type: ignore[attr-defined]
else:
out[k] = str(v)
return out
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment