%NC_CF_HARVEST2FEWS_LOCATIONS make FEWS locations file from a catalog.nc produced before by nc_cf_harvest
%
% These file sneed to be edited manually into 
% \Config\RegionConfigFiles\Locations.xml
% \Config\RegionConfigFiles\LocationSets.xml
% \Config\IdMapFiles\
%
%See also: nc_cf_harvest, fews

%% NOAA NDBC ocean
%  https://svn.oss.deltares.nl/repos/openearthrawdata/trunk/noaa/ndbc/

   %CATALOG = nc2struct('d:\checkouts\OpenEarthRawData\noaa\ndbc\ndbc_dart_locations.nc');
   [~,CATALOG,~]=noaa.dart('getcapabilities');

fews.locations_write(...
    CATALOG.geospatialCoverage_eastwest_start,...
    CATALOG.geospatialCoverage_northsouth_start,...
    'internal_name'   ,CATALOG.platform_id,...
    'external_name'   ,CATALOG.platform_id,...
    'display_name'    ,CATALOG.platform_name,...
    'timeIn'          ,CATALOG.timeCoverage_start,...
    'timeOut'         ,CATALOG.timeCoverage_end,...
    'locationSet_id'  ,'NOAA.ndbc.dart',...
    'locationSet_name','NOAA National Data Buoy Centre - dart program (all)',...
    'xml_Id'          ,'Id.NOAA.ndbc.dart.all.xml',...
    'xml_Locations'   ,'NOAA.ndbc.dart.Locations.xml',...
    'xml_LocationSets','NOAA.ndbc.dart.LocationSets.xml')


%% KNMI potwind
%  OET: knmi_all

   CATALOG = nc2struct(['http://opendap.deltares.nl/thredds/dodsC/opendap/knmi/potwind/catalog.nc']);

fews.locations_write(...
    CATALOG.geospatialCoverage_eastwest_start,...
    CATALOG.geospatialCoverage_northsouth_start,...
    'internal_name'   ,CATALOG.platform_id,...
    'external_name'   ,CATALOG.platform_id,...
    'display_name'    ,CATALOG.platform_name,...
    'timeIn'          ,CATALOG.timeCoverage_start,...
    'timeOut'         ,CATALOG.timeCoverage_end,...
    'locationSet_id'  ,'KNMI.potwind.all',...
    'locationSet_name','KNMI - potential wind (all)',...
    'xml_Id'          ,'Id.KNMI.potwind.all.xml',...
    'xml_Locations'   ,'KNMI.potwind.Locations.xml',...
    'xml_LocationSets','KNMI.potwind.LocationSets.xml')

%% KNMI etmgeg
%  OET: knmi_all

   CATALOG = nc2struct(['http://opendap.deltares.nl/thredds/dodsC/opendap/knmi/etmgeg/catalog.nc']);

fews.locations_write(...
    CATALOG.geospatialCoverage_eastwest_start,...
    CATALOG.geospatialCoverage_northsouth_start,...
    'internal_name'   ,CATALOG.platform_id,...
    'external_name'   ,CATALOG.platform_id,...
    'display_name'    ,CATALOG.platform_name,...
    'timeIn'          ,CATALOG.timeCoverage_start,...
    'timeOut'         ,CATALOG.timeCoverage_end,...
    'locationSet_id'  ,'KNMI.etmgeg.all',...
    'locationSet_name','KNMI - etmaal gegevens (all)',...
    'xml_Id'          ,'Id.KNMI.etmgeg.all.xml',...
    'xml_Locations'   ,'KNMI.etmgeg.Locations.xml',...
    'xml_LocationSets','KNMI.etmgeg.LocationSets.xml')

%% RWS waterbase sea_surface_height
%  OET: rws_waterbase_all

   CATALOG = nc2struct(['http://opendap.deltares.nl/thredds/dodsC/opendap/rijkswaterstaat/waterbase/sea_surface_height/catalog.nc']);

fews.locations_write(...
    CATALOG.geospatialCoverage_eastwest_start,...
    CATALOG.geospatialCoverage_northsouth_start,...
    'internal_name'   ,CATALOG.platform_id,...
    'external_name'   ,CATALOG.platform_id,...
    'display_name'    ,CATALOG.platform_name,...
    'timeIn'          ,CATALOG.timeCoverage_start,...
    'timeOut'         ,CATALOG.timeCoverage_end,...
    'locationSet_id'  ,'RWS.waterbase.all',...
    'locationSet_name','Rijkswaterstaat - Waterbase (all)',...
    'xml_Id'          ,'Id.RWS.waterbase.all.xml',...
    'xml_Locations'   ,'RWS.waterbase.Locations.xml',...
    'xml_LocationSets','RWS.waterbase.LocationSets.xml')

%% NOAA NDBC ocean
%  https://svn.oss.deltares.nl/repos/openearthrawdata/trunk/noaa/ndbc/

   CATALOG = nc2struct('d:\checkouts\OpenEarthRawData\noaa\ndbc\ndbc_ocean_locations.nc');

fews.locations_write(...
    CATALOG.geospatialCoverage_eastwest_start,...
    CATALOG.geospatialCoverage_northsouth_start,...
    'internal_name'   ,CATALOG.platform_id,...
    'external_name'   ,CATALOG.platform_id,...
    'display_name'    ,CATALOG.platform_name,...
    'timeIn'          ,CATALOG.timeCoverage_start,...
    'timeOut'         ,CATALOG.timeCoverage_end,...
    'locationSet_id'  ,'NOAA.ndbc.ocean.all',...
    'locationSet_name','NOAA National Data Buoy Centre - ocean program (all)',...
    'xml_Id'          ,'Id.NOAA.ndbc.ocean.all.xml',...
    'xml_Locations'   ,'NOAA.ndbc.ocean.Locations.xml',...
    'xml_LocationSets','NOAA.ndbc.ocean.LocationSets.xml')
