--------------------------
script: get_map2series.php
--------------------------

Purpose
-------
Get timeseries at a specified point (x,y) from Matroos map data.
The map data is interpolated in space to point (x,y).
Take care that retrieving long timeseries will take long time!!
E.g. retrieving a timeserie of 1 month from 'kustfijn' will take about
2 minutes, getting data from about 1440 files.

Usage
-----
http://matroos.deltares.nl/direct/get_map2series.php?source=&unit=&x=&y=&tstart=&tstop=&tinc=&anal=&coordsys=&format=&zip=

The part after '?' is meant to define parameters for the script.
Each parameter should be given as <param>=<value>, the different
parameters are separated by the '&' sign.

Examples
--------
http://matroos.deltares.nl/direct/get_map2series.php?source=dcsm6_kf&unit=SEP&x=3.0&y=52.0&tstart=202105130000&tstop=202105140000

wget --proxy=off -O output.txt \
'http://matroos.deltares.nl/direct/get_map2series.php?source=dcsm6_kf&unit=SEP&x=3.0&y=52.0&tstart=202105130000&tstop=202105140000'

Cut and paste the above URL in the address bar of the browser, or click on the link, to get an example of the output.

Parameters
----------
- source      : The map source as known by Matroos.
                Examples: knmi_harmonie40, dcsm6, dcsm6_kf, ijsselmeer1.

- unit        : A unit as known by Matroos.
                Examples: SEP (=waterlevel), VELU (=water velocity in x-direction),
                VELV (=water velocity in y-direction), RP (=salt), 
                VELUV_abs (=absolute waterspeed).
                Multiple units can be specified, separated by a comma as
                   unit1,unit2,unit3

- x           : The x-coordinate of the requested points.
                It should be given in the coordinate system as specified by 
                parameter 'coordsys' or, when coordsys is empty, the coordinate
                system of the model specified in parameter 'source'.

- y           : The y-coordinate of the requested points.

- loc         : Alternative for parameters x and y.
                Multiple locations can be specified as
                   <x1>,<y1>;<x2>,<y2>;....;<xn>,<yn>
                Parameter 'loc' will be ignored if either x or y is specified.

- tstart      : First time for the timeseries in format YYYYMMDDHHMM.
                Any '-', <space>, or ':' will be ignored, so a format like 
                YYYY-MM-DD HH:MM will be accepted as well.
                Default: the latest analysis time.

- tstop       : Last time for the timeseries in the same format as tstart.
                Default: 50 days after tstart.

- tinc        : Optional. Timestep in minutes.
                Default: all available timesteps between tstart and tstop.

- interp_time : Optional. Interpolate in time when interp_time=1.
                Default: no time interpolation.

- anal        : Optional. Analysis time in format YYYYMMDDhhmm.
                Default: no analysis time, just return the most recent values.

- coordsys    : Optional. The coordinate system in which x and y are given.
                Default: the same coordinate system as the model specified by 'source'.
                Examples: RD (='Rijksdriehoek'), ED50, WGS84, MN (=m,n co-ordinates).
                or any epsg-code as epsg:<code>

- format      : Optional. Output format 'text' or 'netcdf'; default 'text'.

- zip         : Optional. If given and not '0', the NetCDF-file (in case format='netcdf')
                will be zipped before the download starts.