{
  "domain": "MANW",
  "shape": [
    734,
    1101
  ],
  "netcdfAttributes": {
    "production": "constructed around line 66 of ../src/comodo-detidor.cpp of tools 2.2.3 Mercurial revision 1145:2c4ace44f605 of 2013-02-07 17:32 +0100",
    "creation_date": "2013-02-14 09:00:45 CET",
    "Conventions": "CF-1.5 COMODO-0.1"
  },
  "files": [
    {
      "filename": "2N2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "2480a71f6e406df77a7167580cda495540fd6fc4226607d364a7a127ec433802"
    },
    {
      "filename": "2Q1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "d4069c0748e391cf6d04662dbaa1f132d546d128b19a8cffe4377898250aa705"
    },
    {
      "filename": "E2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "3bfc3302293a1ba18109000696a53043e4028de4604d6ec78b91c082ac317da3"
    },
    {
      "filename": "J1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "37eb8fc86e1d96d27bb2f01c40f7829d1e03aa5edfd0b3e249df245e70c5da72"
    },
    {
      "filename": "K1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "da56d4bd78513ce6ff7f0ebeec540377758347d67bd2ce60711c4d88dd2831d8"
    },
    {
      "filename": "K2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "34c807aef3f6095ed09b801b111adc2382ba4743f607171ac337fa6c837a660b"
    },
    {
      "filename": "KJ2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "5af1f33642125aff7cd131e7a3ada7dcaf23be2add36ceee327c18578b773cd3"
    },
    {
      "filename": "KQ1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "75ecd503c123dc3286224d4c52ff50da70cbdcb1af7cab18fb2f3bb6119565ac"
    },
    {
      "filename": "Ki1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "7b95e02b216cc4eca70c42f2321835ecd58bae985eb53f60d1178cf6276f7c9c"
    },
    {
      "filename": "L2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "cd25f18f6494990196a8eb5fc1ad4790343b0f374907f01e6d6dcaca3308315a"
    },
    {
      "filename": "La2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "e8434c83afeb8d45b76a070b34c65864ade78a072bccd38c8f68fb8c68321242"
    },
    {
      "filename": "M1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "4ca48a622c5790ab0cdeb494c5d77aa5c3994d38d3b51a9930bba9b68910df40"
    },
    {
      "filename": "M2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "608d57e88d3f8a3710d16ea6fe6f67eb7dc1ddd1c08dd345f8e0cd8c5b1718eb"
    },
    {
      "filename": "M4-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "22c66583a6b3190abd2b4d779f0e3f91d31158573dbdd38500224b2e307df730"
    },
    {
      "filename": "M6-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "51bc1a61c951ab1e0a09dbcc1dd9dc20fe9287bdef213563322ba18a4e4f29af"
    },
    {
      "filename": "MK4-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "95bb76b9c09b632272295541971e4250299db28a6bf4be52d5be06db101f0a96"
    },
    {
      "filename": "MN4-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "b4da808f3f1cc7c73f09896efa5ed95fe6e32654989e17504b637cae30bebcd2"
    },
    {
      "filename": "MP1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "9335428de3489141d13d878deb46a68966fa147ce602cf5884830ae3b80d2690"
    },
    {
      "filename": "MS4-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "45deeb98b8f86623a3545edc96a8490fdaac53ebd6bba2dc20bb11395e7a11d5"
    },
    {
      "filename": "Mf-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "9258f34d64ec7522b15c341f73836fe4f912e5ff0cf785ccd9f9fc002a1ff788"
    },
    {
      "filename": "Mm-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "713f73efc59dd0fb7609ceabb36551a7d892d6bb03563cbdc82c413b3fae66fb"
    },
    {
      "filename": "Mu2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "5dfaeb83d67d94029063c1c39bc70f1e72c21c362cf1dc3a3648f7ad4ee48eed"
    },
    {
      "filename": "N2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "326a6a2007368ef9863f27bf9c65eff74694240f7e5ee0d5aa2d9422c0fab4d0"
    },
    {
      "filename": "Nu2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "2830477a17b2dad63ae360044e5adef8027656f5a7f682168471c664f4b8ecd0"
    },
    {
      "filename": "O1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "a94353198736ee7e887701add2934612cfd157b66ab0254feef90809e3804da0"
    },
    {
      "filename": "OO1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "2be8ab4016f9030d7f67a2516f68dbed7e97b0786c6d413f722d96f468aebf2b"
    },
    {
      "filename": "P1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "31244cc0da782ab28d15c531a294abb55c5f864427e0efdd565fc97ad2b1e602"
    },
    {
      "filename": "Phi1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "d9d5c3032626064f9b6d7c0793b8095a09fca3dd1273a10747a3e58affcd6cc2"
    },
    {
      "filename": "Pi1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "650d27e94077dcf838d35727c7993ffea81c8805f9d70a154a2bb3f257c25f43"
    },
    {
      "filename": "Psi1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "2f21f67226c7075cd39f6b49e3c327cf427433fb674da623e2a22cc8306d9cfa"
    },
    {
      "filename": "Q1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "8bf6ee7016a054a7b378c55eae677910b37cfc06eb7c47cb10bd3ad4b26de6fa"
    },
    {
      "filename": "R2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "a7f11917e40d259046e9740a3fccba015637f7f9ae2909abd4d719f7e57544a8"
    },
    {
      "filename": "Ro1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "eec6ee60d95775625c1b5b42a68e17fcc4f4b206f51a6d8e400ce3de2650a8a5"
    },
    {
      "filename": "S2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "ba482b1405b2596265a92957be45ef2869ef6143326868c5db4c92dd43ad153f"
    },
    {
      "filename": "Sig1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "e7e73b31328b00e348f160f09b319f808bdc70ab3b80d8f27f656bc84783a004"
    },
    {
      "filename": "T2-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "8dbf747b975a6134ad3c4cb109171a2bec1c400a8e7f9868bd3bc5d0208d8c47"
    },
    {
      "filename": "Tta1-XE-MANW-atlas.nc",
      "bytes": 19404452,
      "sha256": "31073bfa46762bfcb1a7f30133fe4479027e823aa667071bcf3d3487df6039e0"
    }
  ],
  "ftpDirectory": "/MARC_L1-ATLAS-AHRMONIQUES/V1_MANW",
  "waves": [
    {
      "name": "Mm",
      "darwin": [
        0,
        1,
        0,
        -1,
        0,
        0
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 73
    },
    {
      "name": "Mf",
      "darwin": [
        0,
        2,
        0,
        0,
        0,
        0
      ],
      "nodal": [
        -2,
        0,
        0,
        0,
        0
      ],
      "formula": 74
    },
    {
      "name": "2Q1",
      "darwin": [
        1,
        -4,
        1,
        2,
        0,
        90
      ],
      "nodal": [
        2,
        -1,
        0,
        0,
        0
      ],
      "formula": 75
    },
    {
      "name": "Sig1",
      "darwin": [
        1,
        -4,
        3,
        0,
        0,
        90
      ],
      "nodal": [
        2,
        -1,
        0,
        0,
        0
      ],
      "formula": 75
    },
    {
      "name": "Q1",
      "darwin": [
        1,
        -3,
        1,
        1,
        0,
        90
      ],
      "nodal": [
        2,
        -1,
        0,
        0,
        0
      ],
      "formula": 75
    },
    {
      "name": "Ro1",
      "darwin": [
        1,
        -3,
        3,
        -1,
        0,
        90
      ],
      "nodal": [
        2,
        -1,
        0,
        0,
        0
      ],
      "formula": 75
    },
    {
      "name": "O1",
      "darwin": [
        1,
        -2,
        1,
        0,
        0,
        90
      ],
      "nodal": [
        2,
        -1,
        0,
        0,
        0
      ],
      "formula": 75
    },
    {
      "name": "MP1",
      "darwin": [
        1,
        -2,
        3,
        0,
        0,
        -90
      ],
      "nodal": [
        0,
        -1,
        0,
        0,
        0
      ],
      "formula": 76
    },
    {
      "name": "M1",
      "darwin": [
        1,
        -1,
        1,
        1,
        0,
        -90
      ],
      "nodal": [
        1,
        -1,
        0,
        0,
        0
      ],
      "formula": 144
    },
    {
      "name": "Ki1",
      "darwin": [
        1,
        -1,
        3,
        -1,
        0,
        -90
      ],
      "nodal": [
        0,
        -1,
        0,
        0,
        0
      ],
      "formula": 76
    },
    {
      "name": "Pi1",
      "darwin": [
        1,
        0,
        -2,
        0,
        1,
        90
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "P1",
      "darwin": [
        1,
        0,
        -1,
        0,
        0,
        90
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "K1",
      "darwin": [
        1,
        0,
        1,
        0,
        0,
        -90
      ],
      "nodal": [
        0,
        0,
        -1,
        0,
        0
      ],
      "formula": 227
    },
    {
      "name": "Psi1",
      "darwin": [
        1,
        0,
        2,
        0,
        -1,
        -90
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "Phi1",
      "darwin": [
        1,
        0,
        3,
        0,
        0,
        -90
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "Tta1",
      "darwin": [
        1,
        1,
        -1,
        1,
        0,
        -90
      ],
      "nodal": [
        0,
        -1,
        0,
        0,
        0
      ],
      "formula": 76
    },
    {
      "name": "J1",
      "darwin": [
        1,
        1,
        1,
        -1,
        0,
        -90
      ],
      "nodal": [
        0,
        -1,
        0,
        0,
        0
      ],
      "formula": 76
    },
    {
      "name": "OO1",
      "darwin": [
        1,
        2,
        1,
        0,
        0,
        -90
      ],
      "nodal": [
        -2,
        -1,
        0,
        0,
        0
      ],
      "formula": 77
    },
    {
      "name": "KQ1",
      "darwin": [
        1,
        3,
        1,
        -1,
        0,
        -90
      ],
      "nodal": [
        -2,
        -1,
        0,
        0,
        0
      ],
      "formula": 15
    },
    {
      "name": "E2",
      "darwin": [
        2,
        -5,
        4,
        1,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "2N2",
      "darwin": [
        2,
        -4,
        2,
        2,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "Mu2",
      "darwin": [
        2,
        -4,
        4,
        0,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "N2",
      "darwin": [
        2,
        -3,
        2,
        1,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "Nu2",
      "darwin": [
        2,
        -3,
        4,
        -1,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "M2",
      "darwin": [
        2,
        -2,
        2,
        0,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "La2",
      "darwin": [
        2,
        -1,
        0,
        1,
        0,
        180
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 78
    },
    {
      "name": "L2",
      "darwin": [
        2,
        -1,
        2,
        -1,
        0,
        180
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        -1
      ],
      "formula": 215
    },
    {
      "name": "T2",
      "darwin": [
        2,
        0,
        -1,
        0,
        1,
        0
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "S2",
      "darwin": [
        2,
        0,
        0,
        0,
        0,
        0
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "R2",
      "darwin": [
        2,
        0,
        1,
        0,
        -1,
        180
      ],
      "nodal": [
        0,
        0,
        0,
        0,
        0
      ],
      "formula": 0
    },
    {
      "name": "K2",
      "darwin": [
        2,
        0,
        2,
        0,
        0,
        0
      ],
      "nodal": [
        0,
        0,
        0,
        -2,
        0
      ],
      "formula": 235
    },
    {
      "name": "KJ2",
      "darwin": [
        2,
        1,
        2,
        -1,
        0,
        0
      ],
      "nodal": [
        0,
        0,
        0,
        -2,
        0
      ],
      "formula": 79
    },
    {
      "name": "MN4",
      "darwin": [
        4,
        -5,
        4,
        1,
        0,
        0
      ],
      "nodal": [
        4,
        -4,
        0,
        0,
        0
      ],
      "formula": 1
    },
    {
      "name": "M4",
      "darwin": [
        4,
        -4,
        4,
        0,
        0,
        0
      ],
      "nodal": [
        4,
        -4,
        0,
        0,
        0
      ],
      "formula": 1
    },
    {
      "name": "MS4",
      "darwin": [
        4,
        -2,
        2,
        0,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        0,
        0
      ],
      "formula": 2
    },
    {
      "name": "MK4",
      "darwin": [
        4,
        -2,
        4,
        0,
        0,
        0
      ],
      "nodal": [
        2,
        -2,
        0,
        -2,
        0
      ],
      "formula": 4
    },
    {
      "name": "M6",
      "darwin": [
        6,
        -6,
        6,
        0,
        0,
        0
      ],
      "nodal": [
        6,
        -6,
        0,
        0,
        0
      ],
      "formula": 4
    }
  ],
  "models": {
    "billou": {
      "name": "Plage du Bilou",
      "targetLatitude": 48.704765,
      "targetLongitude": -4.050046,
      "targetSource": "https://www.roscoff-tourisme.com/fr/fiche/equipements-de-loisirs/plage-du-billou-santec_TFOLOIBRE029V527UHR/",
      "latitude": 48.70981147657565,
      "longitude": -4.057455323443989,
      "distanceM": 781.327138237042,
      "cell": {
        "j": 117,
        "i": 44,
        "indexBase": 0
      },
      "amplitudeM": [
        0.015762582421302795,
        0.018021073192358017,
        0.0019686648156493902,
        0.003843797603622079,
        0.017587559297680855,
        0.005751709919422865,
        0.06984429061412811,
        0.005836380645632744,
        0.0029769015964120626,
        0.002322003012523055,
        0.002213414292782545,
        0.030763687565922737,
        0.07931654900312424,
        0.00021463906159624457,
        0.0005746350507251918,
        0.001789216184988618,
        0.004989517852663994,
        0.0038006342947483063,
        0.00023544509895145893,
        0.01838478073477745,
        0.06987069547176361,
        0.11512639373540878,
        0.5203403234481812,
        0.09611315280199051,
        2.6477150917053223,
        0.04897664487361908,
        0.08981439471244812,
        0.05208488926291466,
        0.9838212728500366,
        0.012895694002509117,
        0.26707133650779724,
        0.010286376811563969,
        0.04290570691227913,
        0.11471913754940033,
        0.0732702761888504,
        0.029506901279091835,
        0.014700115658342838
      ],
      "phaseDegrees": [
        -171.59710693359375,
        149.8251190185547,
        -114.88200378417969,
        -69.53424835205078,
        -76.77172088623047,
        -83.86786651611328,
        -25.42091941833496,
        -172.3923797607422,
        78.81768035888672,
        -40.16556167602539,
        35.065208435058594,
        62.273765563964844,
        79.01480865478516,
        129.54847717285156,
        -40.13491439819336,
        110.88683319091797,
        154.33033752441406,
        -157.6350860595703,
        -156.54124450683594,
        136.60916137695312,
        102.21680450439453,
        143.66757202148438,
        118.81581115722656,
        109.92666625976562,
        137.5320587158203,
        115.18244934082031,
        113.510009765625,
        170.61538696289062,
        -176.89198303222656,
        -125.94319915771484,
        177.67420959472656,
        -108.61054992675781,
        102.32795715332031,
        129.6264190673828,
        -176.7958984375,
        177.35426330566406,
        100.94699096679688
      ],
      "weights": [
        [
          -0.0155933703968416,
          0.002303433145387107
        ],
        [
          -0.015579132132371708,
          -0.009058130105404101
        ],
        [
          -0.000828317485559837,
          0.0017859258941769326
        ],
        [
          0.0013439739389366923,
          0.003601182315444447
        ],
        [
          0.004024585208656349,
          0.017120892381756996
        ],
        [
          0.0006144075132278869,
          0.005718799734636326
        ],
        [
          0.06308187021986132,
          0.029981704103592206
        ],
        [
          -0.005785008482430457,
          0.0007726680392795753
        ],
        [
          0.0005773154038548991,
          -0.002920385255268993
        ],
        [
          0.0017744372037285588,
          0.0014976884189276875
        ],
        [
          0.001811676777620955,
          -0.0012716249780981056
        ],
        [
          0.014312725611807353,
          -0.027231422258391556
        ],
        [
          0.015114187033917878,
          -0.0778631896088823
        ],
        [
          -0.00013666731288457107,
          -0.0001655052033980419
        ],
        [
          0.000439325016192417,
          0.0003704037954307115
        ],
        [
          -0.0006378972690944813,
          -0.0016716404011350727
        ],
        [
          -0.004497084937395988,
          -0.002161368887510606
        ],
        [
          -0.0035147476006290716,
          0.0014461570959923887
        ],
        [
          -0.00021598482628624639,
          9.372806108291293e-05
        ],
        [
          -0.013359935643693687,
          -0.012629817190371644
        ],
        [
          -0.014785439706140898,
          -0.06828839475638596
        ],
        [
          -0.09274502710062917,
          -0.0682088446070151
        ],
        [
          -0.2508016831836036,
          -0.4559085082759798
        ],
        [
          -0.03275700952958496,
          -0.09035882064423736
        ],
        [
          -1.9531008967712453,
          -1.787677849579023
        ],
        [
          -0.020839665630470374,
          -0.044321778839378614
        ],
        [
          -0.03582779519808346,
          -0.08235893751626241
        ],
        [
          -0.051387784466158576,
          -0.008493014611415297
        ],
        [
          -0.9823741639511561,
          0.05334134337953463
        ],
        [
          -0.0075695523158877745,
          0.010440344895806251
        ],
        [
          -0.2668513310104008,
          -0.010838169681203755
        ],
        [
          -0.0032827306990391514,
          0.009748498708368733
        ],
        [
          -0.00916067326172224,
          -0.041916366147775316
        ],
        [
          -0.07316548039128754,
          -0.08835888749407357
        ],
        [
          -0.07315573757248958,
          0.004095294008426594
        ],
        [
          -0.029475448109779454,
          -0.001362050594423771
        ],
        [
          -0.0027915626928829954,
          -0.014432622010582836
        ]
      ],
      "meanOffsetM": 0,
      "datum": "mean-relative"
    },
    "theven": {
      "name": "Le Théven",
      "targetLatitude": 48.710312,
      "targetLongitude": -4.035724,
      "targetSource": "https://www.roscoff-tourisme.com/fr/fiche/equipements-de-loisirs/plage-de-theven-santec_TFOLOIBRE000FS0004D/",
      "latitude": 48.71882347657565,
      "longitude": -4.033871623443988,
      "distanceM": 956.1409196827301,
      "cell": {
        "j": 121,
        "i": 51,
        "indexBase": 0
      },
      "amplitudeM": [
        0.01676652766764164,
        0.018158381804823875,
        0.0019784055184572935,
        0.0038264791946858168,
        0.017614303156733513,
        0.005782220046967268,
        0.06987791508436203,
        0.005883693229407072,
        0.0029780366457998753,
        0.002307517919689417,
        0.0022058337926864624,
        0.030844729393720627,
        0.079423688352108,
        0.00020146623137407005,
        0.0005815746262669563,
        0.0017805128591135144,
        0.004982020705938339,
        0.003796697361394763,
        0.0002414354239590466,
        0.018546896055340767,
        0.07038754969835281,
        0.11577971279621124,
        0.5228838920593262,
        0.09639190882444382,
        2.6609761714935303,
        0.04947233572602272,
        0.09030182659626007,
        0.05233953520655632,
        0.9889087677001953,
        0.012988898903131485,
        0.26851749420166016,
        0.010333124548196793,
        0.041947197169065475,
        0.11196146160364151,
        0.07070764154195786,
        0.02874923124909401,
        0.017535310238599777
      ],
      "phaseDegrees": [
        -170.5831756591797,
        150.92799377441406,
        -116.44437408447266,
        -69.01947784423828,
        -76.7623291015625,
        -84.03089904785156,
        -25.476688385009766,
        -172.26605224609375,
        79.31707763671875,
        -39.955204010009766,
        35.86267852783203,
        62.24705123901367,
        78.94422912597656,
        122.82173156738281,
        -38.07857894897461,
        111.00164794921875,
        154.20172119140625,
        -157.54457092285156,
        -151.2933349609375,
        137.39779663085938,
        102.36541748046875,
        143.85646057128906,
        118.91069793701172,
        110.05353546142578,
        137.63018798828125,
        115.21745300292969,
        113.5707778930664,
        170.73243713378906,
        -176.77748107910156,
        -125.66116333007812,
        177.7790985107422,
        -108.16654205322266,
        102.02765655517578,
        129.26927185058594,
        -176.07241821289062,
        177.81011962890625,
        109.56380462646484
      ],
      "weights": [
        [
          -0.016540584623698253,
          0.002743266362581214
        ],
        [
          -0.01587060245462573,
          -0.008823310461328364
        ],
        [
          -0.0008810408587565482,
          0.0017713992775949176
        ],
        [
          0.0013700730025342294,
          0.0035727920447585887
        ],
        [
          0.004033515670737814,
          0.017146265687642444
        ],
        [
          0.0006013052762386225,
          0.0057508695547993215
        ],
        [
          0.06308301242698643,
          0.030057554119954377
        ],
        [
          -0.005830173031476286,
          0.0007917881287422954
        ],
        [
          0.000552049756940641,
          -0.002926421591225152
        ],
        [
          0.0017688203951480852,
          0.0014818614508097393
        ],
        [
          0.0017876593690926772,
          -0.001292275783667215
        ],
        [
          0.014363158728860851,
          -0.027296465022075687
        ],
        [
          0.015230636449298904,
          -0.07794966314745731
        ],
        [
          -0.00010920013450164929,
          -0.0001693043797687822
        ],
        [
          0.0004577955726905746,
          0.0003586812784945135
        ],
        [
          -0.0006381265521186647,
          -0.001662233601197415
        ],
        [
          -0.004485471896681622,
          -0.0021681956042935166
        ],
        [
          -0.003508820172201462,
          0.00145020407294079
        ],
        [
          -0.0002117606671926732,
          0.00011596759794183231
        ],
        [
          -0.013651833376140734,
          -0.012554473256879589
        ],
        [
          -0.015073197392502066,
          -0.06875467891645452
        ],
        [
          -0.09349697117217598,
          -0.06828805369024991
        ],
        [
          -0.252786040594084,
          -0.45771910846705444
        ],
        [
          -0.03305259415520599,
          -0.09054792160194033
        ],
        [
          -1.9659571740976158,
          -1.7932670115937788
        ],
        [
          -0.021077930719837174,
          -0.04475748919184418
        ],
        [
          -0.036110040290464704,
          -0.08276765598252761
        ],
        [
          -0.051656349755256126,
          -0.008429025780064894
        ],
        [
          -0.9873450533172791,
          0.05559043554621776
        ],
        [
          -0.007572406284216351,
          0.010553206042835087
        ],
        [
          -0.26831579622664703,
          -0.010405680544732053
        ],
        [
          -0.0032216628926826276,
          0.009818062493916964
        ],
        [
          -0.008741117034098583,
          -0.04102633572885405
        ],
        [
          -0.07086777223292624,
          -0.08667830030155058
        ],
        [
          -0.07054157907055965,
          0.004843159573871621
        ],
        [
          -0.028728235136742938,
          -0.001098546012642142
        ],
        [
          -0.005871810480032373,
          -0.01652298238365351
        ]
      ],
      "meanOffsetM": 0,
      "datum": "mean-relative"
    },
    "laber": {
      "name": "Le Laber · Perharidy",
      "targetLatitude": 48.72022,
      "targetLongitude": -4.0066,
      "targetSource": "https://www.openstreetmap.org/way/163078411",
      "targetNote": "Western side of the Laber inlet, Perharidy; selected by the user. Nominal centre of the mapped beach, not a surveyed prediction point.",
      "latitude": 48.73008847657565,
      "longitude": -4.013657023443988,
      "distanceM": 1213.2932233147678,
      "cell": {
        "j": 126,
        "i": 57,
        "indexBase": 0
      },
      "amplitudeM": [
        0.01786050572991371,
        0.018147636204957962,
        0.0019262534333392978,
        0.003773411503061652,
        0.017551833763718605,
        0.005774765275418758,
        0.06986647844314575,
        0.005965887568891048,
        0.002978554693982005,
        0.00229814276099205,
        0.002235784661024809,
        0.03079204075038433,
        0.07945717126131058,
        0.0001800103927962482,
        0.0006618914194405079,
        0.001741720363497734,
        0.005035191774368286,
        0.0038165648002177477,
        0.00023878861975390464,
        0.018517527729272842,
        0.07064741104841232,
        0.11545124650001526,
        0.5232276916503906,
        0.09663218259811401,
        2.6653146743774414,
        0.04995401203632355,
        0.09084074199199677,
        0.05236658826470375,
        0.9897488355636597,
        0.013020390644669533,
        0.26878848671913147,
        0.010307405143976212,
        0.04002441465854645,
        0.10672787576913834,
        0.06730357557535172,
        0.0274470504373312,
        0.017253119498491287
      ],
      "phaseDegrees": [
        -169.22157287597656,
        151.9048614501953,
        -115.2921142578125,
        -68.2400131225586,
        -76.73186492919922,
        -83.75170135498047,
        -25.446712493896484,
        -172.17063903808594,
        79.4092788696289,
        -39.78268814086914,
        36.076534271240234,
        62.364646911621094,
        79.06368255615234,
        116.53551483154297,
        -37.978885650634766,
        110.93431091308594,
        155.44406127929688,
        -157.3500518798828,
        -146.5648956298828,
        138.5169677734375,
        102.75257873535156,
        144.7144775390625,
        119.19144439697266,
        110.33557891845703,
        137.89773559570312,
        115.69031524658203,
        113.85677337646484,
        171.0304412841797,
        -176.4833221435547,
        -125.36265563964844,
        178.06837463378906,
        -107.39604949951172,
        103.0759506225586,
        130.93048095703125,
        -173.62620544433594,
        -179.86720275878906,
        105.25037384033203
      ],
      "weights": [
        [
          -0.017545405927718572,
          0.003340119123602998
        ],
        [
          -0.01600924265583711,
          -0.008546393942127084
        ],
        [
          -0.0008229598584877116,
          0.0017416053975482845
        ],
        [
          0.0013988765729134097,
          0.0035045368745658862
        ],
        [
          0.004028294516714368,
          0.017083316766829015
        ],
        [
          0.0006285101901628513,
          0.005740460689443291
        ],
        [
          0.06308840212505565,
          0.030019632365400895
        ],
        [
          -0.005910274540757969,
          0.0008126926464026341
        ],
        [
          0.0005474350156031524,
          -0.002927815391846592
        ],
        [
          0.0017660696178046203,
          0.0014705299231799417
        ],
        [
          0.0018070307495724057,
          -0.001316576211456674
        ],
        [
          0.01428266514090095,
          -0.02727920911694879
        ],
        [
          0.015074441974583875,
          -0.07801412220876515
        ],
        [
          -8.04200845626931e-05,
          -0.00016104766845126587
        ],
        [
          0.000521727691034111,
          0.0004073088110232646
        ],
        [
          -0.000622312110094364,
          -0.0016267505839103237
        ],
        [
          -0.004579788718755049,
          -0.002092532316651296
        ],
        [
          -0.003522211680446225,
          0.0014697590797097724
        ],
        [
          -0.00019927159477300978,
          0.0001315706518969798
        ],
        [
          -0.013872441425614682,
          -0.012265977421195522
        ],
        [
          -0.015594803648388804,
          -0.06890470801775109
        ],
        [
          -0.09424095652072617,
          -0.06669057229073601
        ],
        [
          -0.2551934789133165,
          -0.45677511494160333
        ],
        [
          -0.033581421368588535,
          -0.09060941922637268
        ],
        [
          -1.9775284748943358,
          -1.7869760615167203
        ],
        [
          -0.021655402336091454,
          -0.045016073442573405
        ],
        [
          -0.0367406939338579,
          -0.08307925020674597
        ],
        [
          -0.05172621374808575,
          -0.008164458204458701
        ],
        [
          -0.9878851245640371,
          0.06071028055212023
        ],
        [
          -0.0075355480085384395,
          0.010618196115669096
        ],
        [
          -0.26863575119239724,
          -0.009060009605798617
        ],
        [
          -0.003081656426113788,
          0.009835954171988546
        ],
        [
          -0.009055222433145667,
          -0.038986622262585445
        ],
        [
          -0.06992200255490925,
          -0.08063344854899789
        ],
        [
          -0.0668875585730207,
          0.007471666036956166
        ],
        [
          -0.027446976715123656,
          6.361531940155796e-05
        ],
        [
          -0.004538217583011221,
          -0.016645561378291453
        ]
      ],
      "meanOffsetM": 0,
      "datum": "mean-relative"
    },
    "roscoffDiagnostic": {
      "name": "Roscoff tide-gauge diagnostic",
      "targetLatitude": 48.718426,
      "targetLongitude": -3.965679,
      "latitude": 48.71882347657565,
      "longitude": -3.9664896234439886,
      "distanceM": 74.09408977455175,
      "cell": {
        "j": 121,
        "i": 71,
        "indexBase": 0
      },
      "amplitudeM": [
        0.015455164015293121,
        0.01799054630100727,
        0.002146810991689563,
        0.0037120599299669266,
        0.017899176105856895,
        0.0055319336242973804,
        0.07179862260818481,
        0.0064435116946697235,
        0.00314997136592865,
        0.002422697376459837,
        0.002322879619896412,
        0.031965382397174835,
        0.0818258672952652,
        0.00029687726055271924,
        0.00044880100176669657,
        0.0017398311756551266,
        0.005068411119282246,
        0.003939500544220209,
        0.00020545539155136794,
        0.021302731707692146,
        0.07160528749227524,
        0.12615206837654114,
        0.5351860523223877,
        0.09834138303995132,
        2.7356386184692383,
        0.05612124875187874,
        0.09658980369567871,
        0.05400736257433891,
        1.0187433958053589,
        0.013363846577703953,
        0.27664774656295776,
        0.010833734646439552,
        0.043086353689432144,
        0.11298131942749023,
        0.07206814736127853,
        0.030574345961213112,
        0.01575346477329731
      ],
      "phaseDegrees": [
        -172.358642578125,
        149.4652557373047,
        -114.67736053466797,
        -65.15933990478516,
        -75.48393249511719,
        -80.60162353515625,
        -24.122657775878906,
        -172.20819091796875,
        90.49787902832031,
        -40.31732177734375,
        36.566162109375,
        64.44916534423828,
        81.20098876953125,
        127.83158111572266,
        -45.799800872802734,
        113.81436920166016,
        157.4067840576172,
        -155.07493591308594,
        -134.31919860839844,
        148.85377502441406,
        108.8716049194336,
        153.824951171875,
        124.09612274169922,
        113.53361511230469,
        142.1973419189453,
        117.40455627441406,
        115.49488067626953,
        175.47714233398438,
        -171.54556274414062,
        -120.65673828125,
        -177.0911865234375,
        -99.32847595214844,
        114.55298614501953,
        140.06716918945312,
        -165.5081024169922,
        -168.03245544433594,
        141.30252075195312
      ],
      "weights": [
        [
          -0.015317919319809185,
          0.002055101567180542
        ],
        [
          -0.0154956394660723,
          -0.009140290681711875
        ],
        [
          -0.0008963108911166676,
          0.0019507496560309243
        ],
        [
          0.001559422208990618,
          0.003368618603785962
        ],
        [
          0.0044864552087441716,
          0.017327787652450348
        ],
        [
          0.0009033537336779398,
          0.005457677313242518
        ],
        [
          0.06552863775788945,
          0.029343480400727078
        ],
        [
          -0.006384020246347206,
          0.0008735722371815898
        ],
        [
          -2.737173591645357e-05,
          -0.003149852440074507
        ],
        [
          0.0018472407456684968,
          0.0015675344351711936
        ],
        [
          0.001865665958814365,
          -0.0013838570224742781
        ],
        [
          0.013787044378990618,
          -0.028839262804193834
        ],
        [
          0.012516803266360553,
          -0.08086286041572842
        ],
        [
          -0.00018208743808820915,
          -0.00023447872552485386
        ],
        [
          0.0003128895147747776,
          0.0003217491114685394
        ],
        [
          -0.0007024998915280999,
          -0.0015916992247860485
        ],
        [
          -0.004679439520693141,
          -0.0019472126350861241
        ],
        [
          -0.0035725744591141037,
          0.0016602338004018868
        ],
        [
          -0.00014354244886489553,
          0.0001469948410366662
        ],
        [
          -0.018231944598769517,
          -0.011018283639356512
        ],
        [
          -0.023160623563398004,
          -0.06775620055025194
        ],
        [
          -0.11321524335031923,
          -0.05564757882251039
        ],
        [
          -0.30001618011579884,
          -0.44318664495802
        ],
        [
          -0.03926643917972206,
          -0.09016193416489918
        ],
        [
          -2.1615007785547693,
          -1.676792484229163
        ],
        [
          -0.0258309487234077,
          -0.049823254104072054
        ],
        [
          -0.041575192665133064,
          -0.08718425048612172
        ],
        [
          -0.0538391811526987,
          -0.0042588478539384925
        ],
        [
          -1.0076728046610264,
          0.14977858740025282
        ],
        [
          -0.006814138944254977,
          0.011496082193547388
        ],
        [
          -0.2762913033566741,
          0.014038923314584225
        ],
        [
          -0.001756086282341977,
          0.010690461512883111
        ],
        [
          -0.0179038699546985,
          -0.039190372732293415
        ],
        [
          -0.0866337900717221,
          -0.07252147928293635
        ],
        [
          -0.06977515784798458,
          0.018034556034895736
        ],
        [
          -0.029909819164448095,
          0.006339822434892162
        ],
        [
          -0.012294916261494924,
          -0.009849197250859937
        ]
      ],
      "meanOffsetM": 0,
      "datum": "mean-relative"
    }
  },
  "format": "marees-atlas-source",
  "formatVersion": 1,
  "amplitudeUnit": "m",
  "phaseUnit": "degrees Universal-Time Greenwich lag",
  "adaptation": "37 unchanged values per nearest finite wet cell; no spatial interpolation, datum offset, minor inference or benchmark fitting.",
  "sourceLicense": {
    "source": "Ifremer / PREVIMER / MARC",
    "dataset_title": "Atlas de composantes harmoniques de hauteurs et courants de marée en Manche et Atlantique",
    "catalogue_uuid": "1bc4a49d-d4cd-469e-827c-bd3bd0eeabba",
    "catalogue_url": "https://sextant.ifremer.fr/geonetwork/srv/api/records/1bc4a49d-d4cd-469e-827c-bd3bd0eeabba/formatters/xsl-view",
    "catalogue_xml_url": "https://sextant.ifremer.fr/geonetwork/srv/api/records/1bc4a49d-d4cd-469e-827c-bd3bd0eeabba/formatters/xml",
    "retrieved_at_utc": "2026-10-29T16:57:30.1121636Z",
    "catalogue_xml_sha256": "724c22341162d0a44c37aa55647f3be9d8844f198bf415a9124774976db73af9",
    "licence_name": "Creative Commons Attribution (CC BY)",
    "licence_version": null,
    "licence_url_as_published": "http://creativecommons.fr/licences/",
    "licence_version_note": "The catalogue does not specify a CC BY version. Do not silently label this atlas CC BY 4.0; TICON-4 is a separate dataset with its own explicit version.",
    "legal_constraints_as_published": [
      "Données sous Licence Creative Commons - Attribution (BY) : http://creativecommons.fr/licences/",
      "Données Ifremer. Accès gratuit, formulaire de demande d'accès sur http://marc.ifremer.fr/produits/atlas_de_composantes_harmoniques"
    ],
    "dataset_attribution": "Ifremer / PREVIMER, Atlas de composantes harmoniques de hauteurs et courants de marée en Manche et Atlantique, MARC V0 (février 2013). Source catalogue Sextant UUID 1bc4a49d-d4cd-469e-827c-bd3bd0eeabba. Licence CC BY (version non précisée dans le catalogue).",
    "validation_report": {
      "author": "Lucia Pineau-Guillou",
      "year": 2013,
      "publication_date": "2013-06-01",
      "title": "PREVIMER. Validation des atlas de composantes harmoniques de hauteurs et courants de marée",
      "url": "https://archimer.ifremer.fr/doc/00157/26801/",
      "pdf_url": "https://archimer.ifremer.fr/doc/00157/26801/24912.pdf"
    },
    "spatial_interpretation_note": "250 m is the model grid spacing, not an accuracy guarantee and not the distance of the sampled wet cells from each beach. State the actual extraction/interpolation method, coordinate and coastal distance per beach after validation.",
    "adaptation_attribution_note": "The final app should describe extraction of the 37 sea-level constituents and its own astronomical prediction/adaptation, retaining the source attribution. Coefficient and datum sources must remain separately identified."
  },
  "scientificImplementation": {
    "name": "NumPy reconstruction of the original TTB 2013 numerical convention",
    "license": "GPL-2.0-only",
    "upstreamAttribution": "SIROCCO/T-UGOm tools. Florent Lyard and Damien Allain, LEGOS/CNRS, Toulouse. Historical revision 2013-02-07.",
    "licenseFile": "TTB-COPYING.txt",
    "sourceFile": "atlas_predict.py",
    "licenseText": "\t\t    GNU GENERAL PUBLIC LICENSE\n\t\t       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\t\t\t    Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Library General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\f\n\t\t    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\f\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\f\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\f\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n\t\t\t    NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n\t\t     END OF TERMS AND CONDITIONS\n\f\n\t    How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year  name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Library General\nPublic License instead of this License.\n",
    "sourceFiles": [
      {
        "name": "atlas_predict.py",
        "content": "# SPDX-License-Identifier: GPL-2.0-only\n# Astronomical compatibility implementation after SIROCCO/T-UGOm 2013.\n# Upstream scientific work: Florent Lyard and Damien Allain, LEGOS/CNRS.\n# Original GPL-2.0 text: ../dist/data/TTB-COPYING.txt.\n\"\"\"Reconstruct the 2013 PREVIMER atlas in its original TTB convention.\n\nNo fitting, datum offset, inferred tide or network access is performed. The\nsource NetCDF identifies tools 2.2.3, Hg 1145:2c4ace44f605, 2013-02-07 17:32.\nThat exact historical revision is preserved in the producer's public Git repo:\nhttps://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools/-/tree/119b33e963f7c508d87e4642c4d725201e573771\nWave definitions: src/tides.def; formulae/astronomy: src/tides.cpp.\n\nThese numerical definitions intentionally reproduce the ORIGINAL analysis,\nincluding M1, KJ2, KQ1 and MK4 conventions later changed by the producer. The\nmodern pyTMD/FES aliases are not equivalent. This is a compatibility model,\nnot a new astronomical theory or a correction to the historical atlas.\n\"\"\"\nfrom __future__ import annotations\n\nimport hashlib\nimport json\nimport sys\nfrom pathlib import Path\n\nROOT = Path(__file__).resolve().parents[2] / 'essai-calcul-local'\nsys.path.insert(0, str(ROOT / '.deps'))\nimport numpy as np\nimport xarray as xr\n\n\ndef configure_experiment_root(path):\n    \"\"\"Select local input NetCDF files; no network I/O or implicit downloads.\"\"\"\n    global ROOT\n    ROOT = Path(path).resolve()\n\nTTB_REVISION = '119b33e963f7c508d87e4642c4d725201e573771'\n# Each row: name, T,s,h,p,p1,shift_deg, xi,nu,nu_prime,nu_sec,R, f_formula.\n# The five fast arguments use the historic Darwin solar angle T=UT*15+180.\n_ROWS = '''\nMm    0  1  0 -1  0    0  0  0  0  0  0 73\nMf    0  2  0  0  0    0 -2  0  0  0  0 74\n2Q1   1 -4  1  2  0   90  2 -1  0  0  0 75\nSig1  1 -4  3  0  0   90  2 -1  0  0  0 75\nQ1    1 -3  1  1  0   90  2 -1  0  0  0 75\nRo1   1 -3  3 -1  0   90  2 -1  0  0  0 75\nO1    1 -2  1  0  0   90  2 -1  0  0  0 75\nMP1   1 -2  3  0  0  -90  0 -1  0  0  0 76\nM1    1 -1  1  1  0  -90  1 -1  0  0  0 144\nKi1   1 -1  3 -1  0  -90  0 -1  0  0  0 76\nPi1   1  0 -2  0  1   90  0  0  0  0  0 0\nP1    1  0 -1  0  0   90  0  0  0  0  0 0\nK1    1  0  1  0  0  -90  0  0 -1  0  0 227\nPsi1  1  0  2  0 -1  -90  0  0  0  0  0 0\nPhi1  1  0  3  0  0  -90  0  0  0  0  0 0\nTta1  1  1 -1  1  0  -90  0 -1  0  0  0 76\nJ1    1  1  1 -1  0  -90  0 -1  0  0  0 76\nOO1   1  2  1  0  0  -90 -2 -1  0  0  0 77\nKQ1   1  3  1 -1  0  -90 -2 -1  0  0  0 15\nE2    2 -5  4  1  0    0  2 -2  0  0  0 78\n2N2   2 -4  2  2  0    0  2 -2  0  0  0 78\nMu2   2 -4  4  0  0    0  2 -2  0  0  0 78\nN2    2 -3  2  1  0    0  2 -2  0  0  0 78\nNu2   2 -3  4 -1  0    0  2 -2  0  0  0 78\nM2    2 -2  2  0  0    0  2 -2  0  0  0 78\nLa2   2 -1  0  1  0  180  2 -2  0  0  0 78\nL2    2 -1  2 -1  0  180  2 -2  0  0 -1 215\nT2    2  0 -1  0  1    0  0  0  0  0  0 0\nS2    2  0  0  0  0    0  0  0  0  0  0 0\nR2    2  0  1  0 -1  180  0  0  0  0  0 0\nK2    2  0  2  0  0    0  0  0  0 -2  0 235\nKJ2   2  1  2 -1  0    0  0  0  0 -2  0 79\nMN4   4 -5  4  1  0    0  4 -4  0  0  0 1\nM4    4 -4  4  0  0    0  4 -4  0  0  0 1\nMS4   4 -2  2  0  0    0  2 -2  0  0  0 2\nMK4   4 -2  4  0  0    0  2 -2  0 -2  0 4\nM6    6 -6  6  0  0    0  6 -6  0  0  0 4\n'''\nWAVES = []\nfor line in _ROWS.strip().splitlines():\n    parts = line.split()\n    x = [int(v) for v in parts[1:]]\n    WAVES.append({'name': parts[0], 'darwin': x[:6], 'nodal': x[6:11], 'formula': x[11]})\nNAMES = [wave['name'] for wave in WAVES]\nDARWIN = np.array([wave['darwin'][:5] for wave in WAVES])\nSHIFT = np.radians([wave['darwin'][5] for wave in WAVES])\nNODAL = np.array([wave['nodal'] for wave in WAVES])\nRATES_DEG_PER_CENTURY = np.array([13149000.0, 481267.892, 36000.76892, 4069.0322056, 1.719175])\nOMEGA = np.radians(DARWIN @ RATES_DEG_PER_CENTURY) / (36525 * 86400)\n\nPLACES = {\n    'billou': {'name': 'Plage du Bilou', 'targetLatitude': 48.704765, 'targetLongitude': -4.050046,\n               'targetSource': 'https://www.roscoff-tourisme.com/fr/fiche/equipements-de-loisirs/plage-du-billou-santec_TFOLOIBRE029V527UHR/',\n               'MANW': [117, 44]},\n    'theven': {'name': 'Le Théven', 'targetLatitude': 48.710312, 'targetLongitude': -4.035724,\n               'targetSource': 'https://www.roscoff-tourisme.com/fr/fiche/equipements-de-loisirs/plage-de-theven-santec_TFOLOIBRE000FS0004D/',\n               'MANW': [121, 51]},\n    'laber': {'name': 'Le Laber · Perharidy', 'targetLatitude': 48.72022, 'targetLongitude': -4.0066,\n              'targetSource': 'https://www.openstreetmap.org/way/163078411', 'MANW': [126, 57],\n              'targetNote': 'Western side of the Laber inlet, Perharidy; selected by the user. Nominal centre of the mapped beach, not a surveyed prediction point.'},\n    'roscoffDiagnostic': {'name': 'Roscoff tide-gauge diagnostic', 'targetLatitude': 48.718426,\n                         'targetLongitude': -3.965679, 'MANW': [121, 71]},\n}\n\n\ndef astronomical_basis(dates):\n    \"\"\"Return f and (V+u) radians under the atlas's historical 2013 convention.\"\"\"\n    days = (np.asarray(dates, dtype='datetime64[ns]') - np.datetime64('1900-01-01', 'ns')) / np.timedelta64(1, 'D')\n    centuries = np.asarray(days, dtype=float).reshape(-1) / 36525\n    angles_deg = np.array([180.0, 277.0256206, 280.1895015, 334.3837214, 281.2208568])[None, :] + centuries[:, None] * RATES_DEG_PER_CENTURY\n    angles = np.radians(np.remainder(angles_deg, 360))\n    node = np.remainder(np.radians(259.1560563 - 1934.1423972 * centuries), 2 * np.pi)\n    inclination = np.arccos(.913694997 - .035692561 * np.cos(node))\n    a = np.arctan(1.01883 * np.tan(node / 2))\n    b = np.arctan(.64412 * np.tan(node / 2))\n    xi = node - a - b\n    xi = np.where(node > np.pi, xi - 2 * np.pi, xi)\n    nu = a - b\n    t2 = np.tan(inclination / 2) ** 2\n    P = angles[:, 3] - xi\n    x1ra = np.sqrt(1 - 12 * t2 * np.cos(2 * P) + 36 * t2 ** 2)\n    R = np.arctan(np.sin(2 * P) / (1 / (6 * t2) - np.cos(2 * P)))\n    nu_prime = np.arctan(np.sin(2 * inclination) * np.sin(nu) / (np.sin(2 * inclination) * np.cos(nu) + .3347))\n    nu_sec = .5 * np.arctan(np.sin(inclination) ** 2 * np.sin(2 * nu) / (np.sin(inclination) ** 2 * np.cos(2 * nu) + .0727))\n    si, ch, sh = np.sin(inclination), np.cos(inclination / 2), np.sin(inclination / 2)\n    factors = {\n        0: np.ones(len(centuries)),\n        73: (2 / 3 - si ** 2) / .5021,\n        74: si ** 2 / .1578,\n        75: si * ch ** 2 / .3800,\n        76: np.sin(2 * inclination) / .7214,\n        77: si * sh ** 2 / .0164,\n        78: ch ** 4 / .9154,\n        79: si ** 2 / .1565,\n        144: (1 - 10 * sh ** 2 + 15 * sh ** 4) * ch / .5873,\n        227: np.sqrt(.8965 * np.sin(2 * inclination) ** 2 + .6001 * np.sin(2 * inclination) * np.cos(nu) + .1006),\n        235: np.sqrt(19.0444 * si ** 4 + 2.7702 * si ** 2 * np.cos(2 * nu) + .0981),\n    }\n    factors.update({1: factors[78] ** 2, 2: factors[78], 4: factors[78] ** 3,\n                    15: factors[235] * factors[75], 215: factors[78] * x1ra})\n    f = np.column_stack([factors[wave['formula']] for wave in WAVES])\n    nodal_angles = np.column_stack([xi, nu, nu_prime, nu_sec, R])\n    phase = angles @ DARWIN.T + SHIFT + nodal_angles @ NODAL.T\n    return f, phase\n\n\ndef haversine_m(latitude, longitude, target_lat, target_lon):\n    lat, lon, tlat, tlon = np.radians([latitude, longitude, target_lat, target_lon])\n    a = np.sin((lat - tlat) / 2) ** 2 + np.cos(lat) * np.cos(tlat) * np.sin((lon - tlon) / 2) ** 2\n    return float(6371000 * 2 * np.arctan2(np.sqrt(a), np.sqrt(1 - a)))\n\n\ndef extract_points(domain='MANW'):\n    \"\"\"Extract exact unmodified amplitudes/phases at nearest fully wet cells.\"\"\"\n    folder = ROOT / 'data' / 'ifremer' / domain\n    manifest = json.loads((folder / 'download-manifest.json').read_text(encoding='utf-8'))\n    paths = [folder / f'{name}-XE-{domain}-atlas.nc' for name in NAMES]\n    with xr.open_dataset(paths[NAMES.index('M2')], engine='scipy') as ds:\n        latitude = ds.latitude.values\n        longitude = ds.longitude.values\n        wet = np.isfinite(ds.XE_a.values) & np.isfinite(ds.XE_G.values)\n        shape = list(ds.XE_a.shape)\n        attrs = dict(ds.attrs)\n    arrays = []\n    for path in paths:\n        with xr.open_dataset(path, engine='scipy') as ds:\n            a, g = ds.XE_a.values.copy(), ds.XE_G.values.copy()\n            wet &= np.isfinite(a) & np.isfinite(g)\n            arrays.append((a, g))\n    points = {}\n    for key, place in PLACES.items():\n        target_lat, target_lon = place['targetLatitude'], place['targetLongitude']\n        la, lo = np.radians(latitude), np.radians(longitude)\n        tla, tlo = np.radians([target_lat, target_lon])\n        h = np.sin((la - tla) / 2) ** 2 + np.cos(la) * np.cos(tla) * np.sin((lo - tlo) / 2) ** 2\n        j, i = np.unravel_index(np.argmin(np.where(wet, h, np.inf)), wet.shape)\n        if domain in place and [int(j), int(i)] != place[domain]:\n            raise ValueError(f'Nearest wet point changed for {key}: {(j, i)}')\n        amp = np.array([a[j, i] for a, g in arrays], dtype=float)\n        phase = np.array([g[j, i] for a, g in arrays], dtype=float)\n        weights = amp * np.exp(-1j * np.radians(phase))\n        points[key] = {k: v for k, v in place.items() if k != 'MANW'}\n        points[key].update(latitude=float(latitude[j, i]), longitude=float(longitude[j, i]),\n                           distanceM=haversine_m(latitude[j, i], longitude[j, i], target_lat, target_lon),\n                           cell={'j': int(j), 'i': int(i), 'indexBase': 0},\n                           amplitudeM=amp.tolist(), phaseDegrees=phase.tolist(),\n                           weights=[[z.real, z.imag] for z in weights],\n                           meanOffsetM=0, datum='mean-relative')\n    return {'domain': domain, 'shape': shape, 'netcdfAttributes': attrs, 'files': manifest['files'],\n            'ftpDirectory': manifest['directory'], 'waves': WAVES, 'models': points}\n\n\ndef reconstruct(point, dates):\n    f, phase = astronomical_basis(dates)\n    weights = np.array([complex(*z) for z in point['weights']])\n    return np.real(f * np.exp(1j * phase) * weights[None, :]).sum(axis=1)\n\n\ndef main():\n    import argparse\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('--domain', choices=['MANW', 'FINIS'], default='MANW')\n    parser.add_argument('--extract', type=Path)\n    parser.add_argument('--experiment-root', type=Path, default=ROOT)\n    args = parser.parse_args()\n    configure_experiment_root(args.experiment_root)\n    source = extract_points(args.domain)\n    if args.extract:\n        args.extract.write_text(json.dumps(source, indent=2, ensure_ascii=False) + '\\n', encoding='utf-8')\n    # Independent pre-existing event comparison against the 355 SHOM benchmarks.\n    from predict_local import extrema\n    from validate_local import compare, DATES, benchmarks\n    events = extrema(DATES, reconstruct(source['models']['roscoffDiagnostic'], DATES))\n    result = {'domain': args.domain, 'convention': 'TTB-2.2.3-exact-2013', 'ttbRevision': TTB_REVISION,\n              'sourceConstantsFitted': False, 'diagnostic': source['models']['roscoffDiagnostic'], 'sources': {}}\n    for reference in benchmarks['sources']:\n        timing_reference = {**reference, 'events': [{**event, 'coef': None} for event in reference['events']]}\n        _, summary = compare(events, timing_reference, [])\n        result['sources'][reference['id']] = summary\n    target = ROOT / 'results' / f'atlas-{args.domain.lower()}-validation.json'\n    target.write_text(json.dumps(result, indent=2, ensure_ascii=False) + '\\n', encoding='utf-8')\n    print(json.dumps({'report': str(target), 'domain': args.domain,\n                      'points': {key: {k: value for k, value in point.items() if k in ['cell', 'distanceM', 'latitude', 'longitude']} for key, point in source['models'].items()},\n                      'sources': result['sources']}, ensure_ascii=False))\n\n\nif __name__ == '__main__':\n    main()\n"
      },
      {
        "name": "export_atlas.py",
        "content": "# SPDX-License-Identifier: GPL-2.0-only\n# Scientific compatibility implementation after SIROCCO/T-UGOm 2013.\n# Upstream scientific work: Florent Lyard and Damien Allain, LEGOS/CNRS.\n\"\"\"Export the original 2013 Ifremer MANW tide atlas for local browser sums.\n\nRun with the bundled Python and the existing scientific experiment directory:\n  python scripts/export_atlas.py\n  python scripts/export_atlas.py --experiment-root ../essai-calcul-local\n\nRequires numpy/xarray in EXPERIMENT/.deps and the downloaded 37 MANW NetCDF files.\nThe scientific implementation is tracked next to this script in atlas_predict.py.\nThere is no network I/O. Outputs retain\nall 37 explicit constituents, with no inferred tide or mean-level correction.\n\"\"\"\nfrom __future__ import annotations\n\nimport argparse\nimport hashlib\nimport json\nimport sys\nfrom datetime import datetime, timezone\nfrom pathlib import Path\n\nREPO = Path(__file__).resolve().parents[1]\nparser = argparse.ArgumentParser(description=__doc__)\nparser.add_argument('--experiment-root', type=Path, default=REPO.parent / 'essai-calcul-local')\nparser.add_argument('--out-dist', type=Path, default=REPO / 'dist')\nparser.add_argument('--start', default='2025-01-01')\nparser.add_argument('--end', default='2037-01-01')\nargs = parser.parse_args()\nexperiment = args.experiment_root.resolve()\nsys.path.insert(0, str(experiment / '.deps'))\nsys.path.insert(0, str(REPO / 'scripts'))\nimport numpy as np\nfrom atlas_predict import extract_points, astronomical_basis, reconstruct, configure_experiment_root, OMEGA, NAMES, TTB_REVISION\nconfigure_experiment_root(experiment)\n\nMS_DAY = 86400000\n\n\ndef ms(value):\n    return int(np.datetime64(value, 'ms').astype(np.int64))\n\n\ndef iso(value):\n    return datetime.fromtimestamp(value / 1000, tz=timezone.utc).isoformat(timespec='seconds').replace('+00:00', 'Z')\n\n\ndef digest(path):\n    return hashlib.sha256(path.read_bytes()).hexdigest()\n\n\ndef main():\n    start_ms, end_ms = ms(args.start), ms(args.end)\n    if end_ms <= start_ms:\n        raise ValueError('End must follow start')\n    data_dir = args.out_dist.resolve() / 'data'\n    data_dir.mkdir(parents=True, exist_ok=True)\n    scientific_source = (REPO / 'scripts' / 'atlas_predict.py').read_bytes()\n    (data_dir / 'atlas_predict.py').write_bytes(scientific_source)\n    license_path = REPO / 'dist' / 'data' / 'TTB-COPYING.txt'\n    if data_dir != license_path.parent:\n        (data_dir / license_path.name).write_bytes(license_path.read_bytes())\n    source = extract_points('MANW')\n    licensing = json.loads((experiment / 'data' / 'ifremer' / 'catalog-license.json').read_text(encoding='utf-8'))\n    validation = json.loads((experiment / 'results' / 'atlas-manw-validation.json').read_text(encoding='utf-8'))\n    source.update({\n        'format': 'marees-atlas-source', 'formatVersion': 1,\n        'amplitudeUnit': 'm', 'phaseUnit': 'degrees Universal-Time Greenwich lag',\n        'adaptation': '37 unchanged values per nearest finite wet cell; no spatial interpolation, datum offset, minor inference or benchmark fitting.',\n        'sourceLicense': licensing,\n        'scientificImplementation': {\n            'name': 'NumPy reconstruction of the original TTB 2013 numerical convention',\n            'license': 'GPL-2.0-only',\n            'upstreamAttribution': 'SIROCCO/T-UGOm tools. Florent Lyard and Damien Allain, LEGOS/CNRS, Toulouse. Historical revision 2013-02-07.',\n            'licenseFile': 'TTB-COPYING.txt',\n            'sourceFile': 'atlas_predict.py',\n            'licenseText': license_path.read_text(encoding='utf-8'),\n            'sourceFiles': [\n                {'name': 'atlas_predict.py', 'content': scientific_source.decode('utf-8')},\n                {'name': 'export_atlas.py', 'content': Path(__file__).read_text(encoding='utf-8')},\n            ],\n            'runtimeNote': 'No upstream TTB program code is embedded in the browser runtime. Its local model asset stores numerical astronomical envelopes; the browser engine performs a generic harmonic sum.',\n        },\n        'astronomicalConvention': {\n            'name': 'TTB 2.2.3 original 2013 analysis convention',\n            'gitRevision': TTB_REVISION, 'mercurialRevision': '1145:2c4ace44f605',\n            'definitions': f'https://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools/-/blob/{TTB_REVISION}/src/tides.def',\n            'formulae': f'https://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools/-/blob/{TTB_REVISION}/src/tides.cpp',\n            'epoch': '1900-01-01T00:00:00Z', 'julianCenturyDays': 36525,\n            'linearRatesDegreesPerCentury': {'T': 13149000.0, 's': 481267.892, 'h': 36000.76892, 'p': 4069.0322056, 'p1': 1.719175, 'N': -1934.1423972},\n            'notes': [\n                'Reproduce the original historical convention, including its then-current rare-wave definitions, so coefficients retain their original meaning.',\n                'Modern pyTMD/FES aliases are not used: M1 f144 and xi-nu; MP1 f76; KQ1 f235*f75; KJ2 f79 and -2nu_sec; MK4 f78 cubed.',\n                'No 18.6-year or beach accuracy claim follows from the numerical support horizon.',\n            ],\n        },\n    })\n    source_path = data_dir / 'atlas-source.json'\n    source_path.write_text(json.dumps(source, indent=2, ensure_ascii=False) + '\\n', encoding='utf-8')\n    sample_start_ms = start_ms - 2 * MS_DAY\n    sample_ms = np.arange(sample_start_ms, end_ms + 2 * MS_DAY + MS_DAY, MS_DAY, dtype=np.int64)\n    dates = sample_ms.astype('datetime64[ms]').astype('datetime64[ns]')\n    f, phase = astronomical_basis(dates)\n    elapsed = (sample_ms - sample_start_ms) / 1000\n    envelope = f * np.exp(1j * (phase - elapsed[:, None] * OMEGA[None, :]))\n    packed = np.stack((envelope.real, envelope.imag), axis=-1).astype('<f4')\n    if not np.all(np.isfinite(packed)):\n        raise ValueError('Non-finite astronomical envelope')\n\n    def reconstruct_export(instants, weights):\n        position = (instants - sample_start_ms) / MS_DAY\n        lower = np.floor(position).astype(int)\n        alpha = (position - lower)[:, None]\n        z0 = packed[lower, :, 0].astype(float) + 1j * packed[lower, :, 1].astype(float)\n        z1 = packed[lower + 1, :, 0].astype(float) + 1j * packed[lower + 1, :, 1].astype(float)\n        z = z0 + alpha * (z1 - z0)\n        rotation = np.exp(1j * ((instants - sample_start_ms) / 1000)[:, None] * OMEGA[None, :])\n        return np.real(z * rotation * weights).sum(axis=1)\n\n    rng = np.random.default_rng(144852)\n    checks_ms = np.unique(np.r_[start_ms, start_ms + 1, end_ms - 1, rng.integers(start_ms, end_ms, 1024)])\n    checks_dates = checks_ms.astype('datetime64[ms]').astype('datetime64[ns]')\n    errors = {}\n    for key, point in source['models'].items():\n        weights = np.array([complex(*z) for z in point['weights']])\n        direct = reconstruct(point, checks_dates)\n        errors[key] = float(np.max(np.abs(reconstruct_export(checks_ms, weights) - direct)))\n    if max(errors.values()) > .002:\n        raise ValueError(f'Export differs from direct reconstruction by more than 2 mm: {errors}')\n    binary = data_dir / 'atlas-v1.bin'\n    binary.write_bytes(packed.tobytes(order='C'))\n    manifest = {\n        'format': 'marees-atlas-envelope', 'formatVersion': 1,\n        'modelVersion': 'ifremer-previmer-manw37-ttb-2.2.3-original-2013-v1',\n        'createdAt': datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z'),\n        'start': iso(start_ms), 'end': iso(end_ms), 'startMs': start_ms, 'endMs': end_ms,\n        'sampleStartMs': int(sample_ms[0]), 'sampleStepMs': MS_DAY, 'sampleCount': len(sample_ms),\n        'timeStandard': 'UTC', 'predictionUnit': 'm', 'datum': 'mean-relative', 'meanOffsetM': 0,\n        'binary': {'file': binary.name, 'bytes': binary.stat().st_size, 'sha256': digest(binary),\n                   'type': 'float32-le', 'layout': 'sample,constituent,real-imag',\n                   'envelope': 'f * exp(i * (V + u - omega * seconds_since_sample_start))'},\n        'constituents': NAMES, 'omegaRadPerSecond': OMEGA.tolist(),\n        'models': {key: point for key, point in source['models'].items() if key != 'roscoffDiagnostic'},\n        'sourceAsset': {'file': source_path.name, 'sha256': digest(source_path)},\n        'numerics': {'nodalCorrections': 'Original TTB 2.2.3 (2013) Schureman factors, historical wave definitions retained',\n                      'astronomicalArguments': 'Original linear Darwin UT arguments, epoch 1900-01-01',\n                      'minorInference': False, 'sourceDataFittedToBenchmarks': False,\n                      'interpolation': 'Daily complex slow-envelope interpolation with exact frequency rotation and fresh harmonic sum per instant',\n                      'events': '5-minute UTC grid, three-point parabolic refinement, same-kind separation 3 hours',\n                      'exportCheck': {'sampleCount': len(checks_ms), 'randomSeed': 144852, 'maxDifferenceM': errors}},\n        'validation': {'location': 'Nearest wet MANW cell 74 m from Roscoff tide gauge; not the three beaches',\n                       'period': '2026-10-01 through 2026-12-31 for SHOM; 2026-10/11 for InfosVent',\n                       'sources': {key: {'time_minutes': value['time_minutes'], 'missed_events': value['missed_events'],\n                                          'extra_events': value['extra_events']} for key, value in validation['sources'].items()},\n                       'beachValidation': False},\n        'sources': [\n            {'name': licensing['dataset_title'], 'url': licensing['catalogue_url'],\n             'license': licensing['licence_name'], 'licenseVersion': None, 'licenseUrl': licensing['licence_url_as_published'],\n             'attribution': licensing['dataset_attribution'], 'adaptation': source['adaptation']},\n            {'name': 'PREVIMER validation report, Pineau-Guillou 2013', 'url': licensing['validation_report']['url']},\n            {'name': 'Original TTB astronomical convention', 'url': source['astronomicalConvention']['definitions'],\n             'revision': TTB_REVISION, 'use': 'Numerical definitions read to preserve the source analysis convention; no third-party runtime code is embedded.'},\n        ],\n        'limitations': [\n            'Nominal beach coordinates are masked. Each place uses the nearest fully finite offshore grid cell, 781 to 1213 m away; no values are invented on dry cells.',\n            '250 m is model grid spacing, not an accuracy guarantee. Port comparisons do not validate timing or heights inside the beach/inlet.',\n            'Heights are relative to the atlas mean sea level only. No chart datum conversion is applied and no depth or safe access can be inferred.',\n            'Source model and bathymetry date from 2013. Atmospheric surge, waves and morphological change are excluded.',\n            'The 2025–2036 numerical support range is not an accuracy claim over that horizon.',\n        ],\n    }\n    target = data_dir / 'atlas-v1.json'\n    target.write_text(json.dumps(manifest, indent=2, ensure_ascii=False) + '\\n', encoding='utf-8')\n    print(json.dumps({'metadata': str(target), 'binaryBytes': binary.stat().st_size,\n                      'source': str(source_path), 'checks': manifest['numerics']['exportCheck']}, ensure_ascii=False))\n\n\nif __name__ == '__main__':\n    main()\n"
      }
    ],
    "runtimeNote": "No upstream TTB program code is embedded in the browser runtime. Its local model asset stores numerical astronomical envelopes; the browser engine performs a generic harmonic sum."
  },
  "astronomicalConvention": {
    "name": "TTB 2.2.3 original 2013 analysis convention",
    "gitRevision": "119b33e963f7c508d87e4642c4d725201e573771",
    "mercurialRevision": "1145:2c4ace44f605",
    "definitions": "https://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools/-/blob/119b33e963f7c508d87e4642c4d725201e573771/src/tides.def",
    "formulae": "https://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools/-/blob/119b33e963f7c508d87e4642c4d725201e573771/src/tides.cpp",
    "epoch": "1900-01-01T00:00:00Z",
    "julianCenturyDays": 36525,
    "linearRatesDegreesPerCentury": {
      "T": 13149000.0,
      "s": 481267.892,
      "h": 36000.76892,
      "p": 4069.0322056,
      "p1": 1.719175,
      "N": -1934.1423972
    },
    "notes": [
      "Reproduce the original historical convention, including its then-current rare-wave definitions, so coefficients retain their original meaning.",
      "Modern pyTMD/FES aliases are not used: M1 f144 and xi-nu; MP1 f76; KQ1 f235*f75; KJ2 f79 and -2nu_sec; MK4 f78 cubed.",
      "No 18.6-year or beach accuracy claim follows from the numerical support horizon."
    ]
  }
}
