function [ x,y,values ] = get_maps(unit,source,xmin,xmax,ymin,ymax,coordsys,currentTime);

serverurl='http://deltares:M@TR00$@matroos.deltares.nl/direct/get_subgrid_ascii.php?';

%
% available units, sources and locations
% !!!! at 20080219 may change in the future, TODO read this data from the
% server
%

sources =    {'csm8','zuno','kustfijn','zeedelta','ymo','waddenzee_atlas_oost', ...
            'knmi_dcsm_maps', 'knmi_hirlam_maps', 'knmi_ukmo_maps'};

%- 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).
%            For knmi_hirlam_maps: p, wind_u, wind_v and wind_uv_abs.
%            For knmi_ukmo_maps  : p_msl, u_sfc, v_sfc and uv_sfc_abs.
%
%coordsyss : 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, MN (=m,n co-ordinates).
%            or any epsg-code as epsg:<code>

%
%check input
%

isource = strmatch(source,sources);
if(length(isource)==0), error('could not find source');end;
source=strrep(source,' ','%20'); % %20=<space>

%
% get data from matroos
%

urlChar = sprintf('%sunit=m,n,%s&source=%s&xmin=%f&xmax=%f&ymin=%f&ymax=%f&coordsys=%s&tstart=%s&tstop=%s', ...
    serverurl,unit,source,xmin,xmax,ymin,ymax,coordsys,currentTime,currentTime);

allLines = geturl(urlChar);

%
% parse
%

%skip header
i=0;done=0;
while((done==0)&(i<length(allLines))),
    i=i+1;
    done=(length(findstr(allLines{i},'#'))==0);
end;

%read allLines
done=0;
pointIndex = 1;
while(i<length(allLines)),
    line = allLines{i};
    data = sscanf(line,'%f');
    x(data(4) + 1, data(3) + 1) = data(1);
    y(data(4) + 1, data(3) + 1) = data(2);
    values(data(4) + 1, data(3) + 1) = data(5);
    i=i+1;
end;
