Query apiso:ServiceType on geoport pycsw


In [1]:
from owslib.csw import CatalogueServiceWeb
from owslib import fes
import numpy as np

In [2]:
#endpoint = 'http://geoport.whoi.edu/csw' 
endpoint = 'http://gamone.whoi.edu/csw/'
#endpoint = 'http://data.nodc.noaa.gov/geoportal/csw'
#endpoint = 'http://data.ioos.us/csw' 
#endpoint = 'https://dev-catalog.ioos.us/csw'
csw = CatalogueServiceWeb(endpoint,timeout=60)
print csw.version


2.0.2

In [3]:
csw.get_operation_by_name('GetRecords').constraints


Out[3]:
[Constraint: AdditionalQueryables - ['apiso:AccessConstraints', 'apiso:Classification', 'apiso:ConditionApplyingToAccessAndUse', 'apiso:Contributor', 'apiso:Creator', 'apiso:Degree', 'apiso:Lineage', 'apiso:OtherConstraints', 'apiso:Publisher', 'apiso:Relation', 'apiso:ResponsiblePartyRole', 'apiso:SpecificationDate', 'apiso:SpecificationDateType', 'apiso:SpecificationTitle'],
 Constraint: SupportedDublinCoreQueryables - ['csw:AnyText', 'dc:contributor', 'dc:creator', 'dc:date', 'dc:format', 'dc:identifier', 'dc:language', 'dc:publisher', 'dc:relation', 'dc:rights', 'dc:source', 'dc:subject', 'dc:title', 'dc:type', 'dct:abstract', 'dct:modified', 'ows:BoundingBox'],
 Constraint: SupportedISOQueryables - ['apiso:Abstract', 'apiso:AlternateTitle', 'apiso:AnyText', 'apiso:BoundingBox', 'apiso:CRS', 'apiso:CouplingType', 'apiso:CreationDate', 'apiso:Denominator', 'apiso:DistanceUOM', 'apiso:DistanceValue', 'apiso:Format', 'apiso:GeographicDescriptionCode', 'apiso:HasSecurityConstraints', 'apiso:Identifier', 'apiso:KeywordType', 'apiso:Language', 'apiso:Modified', 'apiso:OperatesOn', 'apiso:OperatesOnIdentifier', 'apiso:OperatesOnName', 'apiso:Operation', 'apiso:OrganisationName', 'apiso:ParentIdentifier', 'apiso:PublicationDate', 'apiso:ResourceLanguage', 'apiso:RevisionDate', 'apiso:ServiceType', 'apiso:ServiceTypeVersion', 'apiso:Subject', 'apiso:TempExtent_begin', 'apiso:TempExtent_end', 'apiso:Title', 'apiso:TopicCategory', 'apiso:Type']]

In [4]:
try:
    csw.get_operation_by_name('GetDomain')
    csw.getdomain('apiso:ServiceType', 'property')
    print(csw.results['values'])
except:
    print('GetDomain not supported')


[None, 'OPeNDAP:OPeNDAP,file', 'THREDDS OPeNDAP', 'THREDDS OPeNDAP,Open Geospatial Consortium Web Coverage Service (WCS),Open Geospatial Consortium Web Map Service (WMS),THREDDS NetCDF Subset Service', 'THREDDS OPeNDAP,Open Geospatial Consortium Web Coverage Service (WCS),Open Geospatial Consortium Web Map Service (WMS),THREDDS NetCDF Subset Service,THREDDS HTTP Service', 'THREDDS OPeNDAP,Open Geospatial Consortium Web Map Service (WMS),THREDDS NetCDF Subset Service', 'THREDDS OPeNDAP,Open Geospatial Consortium Web Map Service (WMS),THREDDS NetCDF Subset Service,THREDDS HTTP Service']

In [5]:
val = 'ROMS'
#val = 'COADS'
#val = 'William Jones'
filter1 = fes.PropertyIsLike(propertyname='apiso:AnyText',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')
filter_list = [ filter1 ]

In [6]:
val = 'Warner'
#val = 'COADS'
#val = 'William Jones'
filter2 = fes.PropertyIsLike(propertyname='apiso:AnyText',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')
filter_list = [ filter1 ]

In [7]:
csw.getrecords2(constraints=filter_list,maxrecords=15,esn='full')
print(len(csw.records.keys()))
for rec in list(csw.records.keys()):
    print(csw.records[rec].title)


10
USGS Barnegat Bay Model for Hurricane Sandy : run076
COAWST Hindcast:Barnegat Bay:ADCIRC tides, real rivers, plume, lowpass Espresso bdry, NAM, new bathy
USGS Chincoteague Bay Model for Hurricane Sandy
USGS Chincoteague Bay Model for EPR
COAWST Forecast System : USGS : US East Coast and Gulf of Mexico (Experimental)
Hudson River and Jamaica Bay Model for Hurricane Sandy
COAWST Hindcast:MVCO/CBlast 2007:ripples with SWAN-40m res
Regional Ocean Modeling System (ROMS): Main Hawaiian Islands: Data Assimilating
Regional Ocean Modeling System (ROMS): Oahu: Data Assimilating
Regional Ocean Modeling System (ROMS): Main Hawaiian Islands

In [8]:
for rec in list(csw.records.keys()):
    print(csw.records[rec].references[2]['url'])


http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml
http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/bbleh/spring2012/00_dir_roms.ncml
http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml
http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml
http://geoport-dev.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd
http://clancy.whoi.edu/thredds/dodsC/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml
http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml
http://oos.soest.hawaii.edu/erddap/griddap/ROMS_HIIG_Assim_Best.graph
http://oos.soest.hawaii.edu/thredds/dodsC/hioos/roms_assim/hiog/ROMS_Oahu_Regional_Ocean_Model_Assimilation_best.ncd
http://pacioos.org/currents/model-hawaii/

In [9]:
choice=np.random.choice(list(csw.records.keys()))
print(csw.records[choice].title)
csw.records[choice].references


Regional Ocean Modeling System (ROMS): Main Hawaiian Islands
Out[9]:
[{'scheme': 'http',
  'url': 'http://oos.soest.hawaii.edu/thredds/dodsC/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd.html'},
 {'scheme': 'http',
  'url': 'http://pacioos.org/voyager/index.html?b=15.093339%2C-167.519531%2C25.720735%2C-148.787842&t=h&o=ofore:1:f:d2'},
 {'scheme': 'http', 'url': 'http://pacioos.org/currents/model-hawaii/'},
 {'scheme': 'http',
  'url': 'http://oos.soest.hawaii.edu/las/UI.vm?catid=hiroms_hiig&dsid=hiroms_hiig&varid=temp-hiroms_hiig'},
 {'scheme': 'http',
  'url': 'http://oos.soest.hawaii.edu/erddap/griddap/ROMS_HIIG_Best.graph'},
 {'scheme': 'http',
  'url': 'http://oos.soest.hawaii.edu/erddap/griddap/ROMS_HIIG_SSH_Best.graph'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://oos.soest.hawaii.edu/thredds/dodsC/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd'},
 {'scheme': 'OGC:WCS',
  'url': 'http://oos.soest.hawaii.edu/thredds/wcs/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd?service=WCS&version=1.0.0&request=GetCapabilities'},
 {'scheme': 'OGC:WMS',
  'url': 'http://oos.soest.hawaii.edu/thredds/wms/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://oos.soest.hawaii.edu/thredds/ncss/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd/dataset.html'}]

In [10]:
csw.request


Out[10]:
'<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" outputSchema="http://www.opengis.net/cat/csw/2.0.2" outputFormat="application/xml" version="2.0.2" service="CSW" resultType="results" maxRecords="15" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd"><csw:Query typeNames="csw:Record"><csw:ElementSetName>full</csw:ElementSetName><csw:Constraint version="1.1.0"><ogc:Filter><ogc:PropertyIsLike wildCard="*" singleChar="?" escapeChar="\\"><ogc:PropertyName>apiso:AnyText</ogc:PropertyName><ogc:Literal>*ROMS*</ogc:Literal></ogc:PropertyIsLike></ogc:Filter></csw:Constraint></csw:Query></csw:GetRecords>'

In [11]:
csw.records[choice].xml


Out[11]:
'<csw:Record xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:identifier>roms_hiig_forecast</dc:identifier><dc:title>Regional Ocean Modeling System (ROMS): Main Hawaiian Islands</dc:title><dc:type>dataset</dc:type><dc:subject>Earth Science Services &gt; Models &gt; Ocean General Circulation Models (OGCM)/Regional Ocean Models</dc:subject><dc:subject>Earth Science Services &gt; Models &gt; Weather Research/Forecast Models</dc:subject><dc:subject>Earth Science &gt; Oceans &gt; Ocean Temperature &gt; Potential Temperature</dc:subject><dc:subject>Earth Science &gt; Oceans &gt; Salinity/Density &gt; Salinity</dc:subject><dc:subject>Earth Science &gt; Oceans &gt; Sea Surface Topography &gt; Sea Surface Height</dc:subject><dc:subject>Earth Science &gt; Oceans &gt; Ocean Circulation &gt; Ocean Currents</dc:subject><dc:subject>Pacific Islands Ocean Observing System (PacIOOS)</dc:subject><dc:subject>Pacific Islands Ocean Observing System (PacIOOS)</dc:subject><dc:subject>sea_binary_mask</dc:subject><dc:subject>sea_surface_height</dc:subject><dc:subject>eastward_sea_water_velocity</dc:subject><dc:subject>northward_sea_water_velocity</dc:subject><dc:subject>sea_water_potential_temperature</dc:subject><dc:subject>sea_water_salinity</dc:subject><dc:subject>forecast_period</dc:subject><dc:subject>latitude</dc:subject><dc:subject>longitude</dc:subject><dc:subject>depth</dc:subject><dc:subject>time</dc:subject><dc:subject>forecast_reference_time</dc:subject><dc:subject scheme="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode">oceans</dc:subject><dct:references scheme="http">http://oos.soest.hawaii.edu/thredds/dodsC/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd.html</dct:references><dct:references scheme="http">http://pacioos.org/voyager/index.html?b=15.093339%2C-167.519531%2C25.720735%2C-148.787842&amp;t=h&amp;o=ofore:1:f:d2</dct:references><dct:references scheme="http">http://pacioos.org/currents/model-hawaii/</dct:references><dct:references scheme="http">http://oos.soest.hawaii.edu/las/UI.vm?catid=hiroms_hiig&amp;dsid=hiroms_hiig&amp;varid=temp-hiroms_hiig</dct:references><dct:references scheme="http">http://oos.soest.hawaii.edu/erddap/griddap/ROMS_HIIG_Best.graph</dct:references><dct:references scheme="http">http://oos.soest.hawaii.edu/erddap/griddap/ROMS_HIIG_SSH_Best.graph</dct:references><dct:references scheme="OPeNDAP:OPeNDAP">http://oos.soest.hawaii.edu/thredds/dodsC/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd</dct:references><dct:references scheme="OGC:WCS">http://oos.soest.hawaii.edu/thredds/wcs/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd?service=WCS&amp;version=1.0.0&amp;request=GetCapabilities</dct:references><dct:references scheme="OGC:WMS">http://oos.soest.hawaii.edu/thredds/wms/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd?service=WMS&amp;version=1.3.0&amp;request=GetCapabilities</dct:references><dct:references scheme="UNIDATA:NCSS">http://oos.soest.hawaii.edu/thredds/ncss/hioos/roms_forec/hiig/ROMS_Hawaii_Regional_Ocean_Model_best.ncd/dataset.html</dct:references><dc:relation/><dct:modified>2016-10-19</dct:modified><dct:abstract>Regional Ocean Modeling System (ROMS) 7-day, 3-hourly forecast for the region surrounding the main Hawaiian Islands at approximately 4-km resolution. Boundary conditions provided by the global, 1/12-degree (~9-km) HYbrid Coordinate Ocean Model (HYCOM). Atmospheric forcing generated by the Weather Research and Forecasting (WRF) model for the region surrounding the main Hawaiian Islands (WRF_HI) at approximately 6-km resolution. Tide forcing uses the Oregon State University (OSU) Tidal Prediction Software (OTPS) TOPEX/Poseidon global inverse solution (TPXO) to derive barotropic tidal elevation and velocity. Data are assimilated over the previous 3 days using all available observations to improve the model estimate of current ocean state (its nowcast) before forecasts are run. Assimilated observations may include satellite-based sea surface temperatures from MODIS, AVHRR, or OSTIA; satellite-based sea surface height from AVISO; surface currents from PacIOOS high-frequency radios (HFR); and in-situ water temperature and salinity profiles from ARGO floats and ocean glider autonomous underwater vehicles (AUV). While considerable effort has been made to implement all model components in a thorough, correct, and accurate manner, numerous sources of error are possible. As such, please use these data with the caution appropriate for any ocean related activity.</dct:abstract><dc:date>2016-10-19</dc:date><ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2"><ows:LowerCorner>17.02 -163.83</ows:LowerCorner><ows:UpperCorner>23.98 -152.52</ows:UpperCorner></ows:BoundingBox></csw:Record>'

Add bounding box constraint. To specify lon,lat order for bbox (which we want to do so that we can use the same bbox with either geoportal server or pycsw requests), we need to request the bounding box specifying the CRS84 coordinate reference system. The CRS84 option is available in pycsw 1.1.10+. The ability to specify the crs in the bounding box request is available in owslib 0.8.12+. For more info on the bounding box problem and how it was solved, see this pycsw issue, this geoportal server issue, and this owslib issue


In [12]:
bbox = [-87.40, 34.25, -63.70, 66.70]    # [lon_min, lat_min, lon_max, lat_max]
bbox_filter = fes.BBox(bbox,crs='urn:ogc:def:crs:OGC:1.3:CRS84')
filter_list = [fes.And([filter1, bbox_filter])]
csw.getrecords2(constraints=filter_list, maxrecords=1000)

In [13]:
print(len(csw.records.keys()))
for rec in list(csw.records.keys()):
    print('title:'+csw.records[rec].title) 
    print('identifier:'+csw.records[rec].identifier)
    print('modified:'+csw.records[rec].modified)
    print(' ')


10
title:USGS Barnegat Bay Model for Hurricane Sandy : run076
identifier:USGS_BBLEH_SANDY_076
modified:2016-10-19
 
title:COAWST Hindcast:Barnegat Bay:ADCIRC tides, real rivers, plume, lowpass Espresso bdry, NAM, new bathy
identifier:COAWST.Barnegat_Bay.Spring2012
modified:2016-10-19
 
title:USGS Chincoteague Bay Model for Hurricane Sandy
identifier:gov.usgs.cmg:USGS_CHINCO_SANDY
modified:2016-10-19
 
title:USGS Chincoteague Bay Model for EPR
identifier:gov.usgs.cmg:USGS_CHINCO_EPR
modified:2016-10-19
 
title:COAWST Forecast System : USGS : US East Coast and Gulf of Mexico (Experimental)
identifier:gov.usgs.cmgp:COAWST.USEAST.Forecast
modified:2016-10-19
 
title:Hudson River and Jamaica Bay Model for Hurricane Sandy
identifier:gov.usgs.cmg:HudJBay_Sandy
modified:2016-10-19
 
title:COAWST Hindcast:MVCO/CBlast 2007:ripples with SWAN-40m res
identifier:COAWST.MVCO.CBLAST.spatial_7_ar0fd
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, NYB05 700m Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_NYB05_sim6
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, SHF05 2km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_SHF05_sim6
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, USE27 6km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_USE27_sim6
modified:2016-10-19
 

In [14]:
from pprint import pprint
val = 'opendap'
filter2 = fes.PropertyIsLike(propertyname='apiso:ServiceType',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')
filter_list = [fes.And([filter1, filter2, bbox_filter])]
csw.getrecords2(constraints=filter_list, maxrecords=1000)

print(len(csw.records.keys()))
for rec in list(csw.records.keys()):
    print('title:'+csw.records[rec].title) 
    print('identifier:'+csw.records[rec].identifier)
    print('modified:'+csw.records[rec].modified)
    pprint(csw.records[rec].references)
    print(' ')


10
title:USGS Barnegat Bay Model for Hurricane Sandy : run076
identifier:USGS_BBLEH_SANDY_076
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/zdefne/run076/his/00_dir_roms_display.ncml'}]
 
title:COAWST Hindcast:Barnegat Bay:ADCIRC tides, real rivers, plume, lowpass Espresso bdry, NAM, new bathy
identifier:COAWST.Barnegat_Bay.Spring2012
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/bbleh/spring2012/00_dir_roms.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/bbleh/spring2012/00_dir_roms.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/bbleh/spring2012/00_dir_roms.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/usgs/data0/bbleh/spring2012/00_dir_roms.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/usgs/data0/bbleh/spring2012/00_dir_roms.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/usgs/data0/bbleh/spring2012/00_dir_roms.ncml'}]
 
title:USGS Chincoteague Bay Model for Hurricane Sandy
identifier:gov.usgs.cmg:USGS_CHINCO_SANDY
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/abeudin/chinco/Sandy/master/00_dir_roms.ncml'}]
 
title:USGS Chincoteague Bay Model for EPR
identifier:gov.usgs.cmg:USGS_CHINCO_EPR
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/nganju/chincoteague_bedelevation/00_dir_roms.ncml'}]
 
title:COAWST Forecast System : USGS : US East Coast and Gulf of Mexico (Experimental)
identifier:gov.usgs.cmgp:COAWST.USEAST.Forecast
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/coawst_4/use/fmrc/coawst_4_use_best.ncd?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/coawst_4/use/fmrc/coawst_4_use_best.ncd/dataset.html'}]
 
title:Hudson River and Jamaica Bay Model for Hurricane Sandy
identifier:gov.usgs.cmg:HudJBay_Sandy
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://clancy.whoi.edu/thredds/dodsC/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://clancy.whoi.edu/thredds/dodsC/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://clancy.whoi.edu/thredds/dodsC/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml'},
 {'scheme': 'OGC:WCS',
  'url': 'http://clancy.whoi.edu/thredds/wcs/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml?service=WCS&version=1.0.0&request=GetCapabilities'},
 {'scheme': 'OGC:WMS',
  'url': 'http://clancy.whoi.edu/thredds/wms/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://clancy.whoi.edu/thredds/ncss/grid/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://clancy.whoi.edu/thredds/fileServer/data1/dralston/hudson/sandy/sandy009/00_dir_roms.ncml'}]
 
title:COAWST Hindcast:MVCO/CBlast 2007:ripples with SWAN-40m res
identifier:COAWST.MVCO.CBLAST.spatial_7_ar0fd
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/usgs/data0/mvco_ce/mvco_output/spatial_7_ar0fd/00_dir_roms.ncml'}]
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, NYB05 700m Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_NYB05_sim6
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_NYV05.ncml'}]
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, SHF05 2km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_SHF05_sim6
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_SHF05.ncml'}]
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, USE27 6km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_USE27_sim6
modified:2016-10-19
[{'scheme': 'WWW:LINK',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml.html'},
 {'scheme': 'WWW:LINK',
  'url': 'http://www.ncdc.noaa.gov/oa/wct/wct-jnlp-beta.php?singlefile=http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml'},
 {'scheme': 'OPeNDAP:OPeNDAP',
  'url': 'http://geoport-dev.whoi.edu/thredds/dodsC/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml'},
 {'scheme': 'OGC:WMS',
  'url': 'http://geoport-dev.whoi.edu/thredds/wms/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml?service=WMS&version=1.3.0&request=GetCapabilities'},
 {'scheme': 'UNIDATA:NCSS',
  'url': 'http://geoport-dev.whoi.edu/thredds/ncss/grid/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml/dataset.html'},
 {'scheme': 'file',
  'url': 'http://geoport-dev.whoi.edu/thredds/fileServer/clay/usgs/users/jcwarner/Projects/Sandy/triple_nest/00_dir_USE27.ncml'}]
 

In [15]:
val = 'Warner'
#val = 'COADS'
filter1 = fes.PropertyIsLike(propertyname='apiso:AnyText',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')
filter_list = [ filter1 ]
csw.getrecords2(constraints=filter_list, maxrecords=1000)

In [16]:
print(len(csw.records.keys()))
for rec in list(csw.records.keys()):
    print('title:'+csw.records[rec].title) 
    print('identifier:'+csw.records[rec].identifier)
    print('modified:'+csw.records[rec].modified)
    print(' ')


4
title:COAWST Forecast System : USGS : US East Coast and Gulf of Mexico (Experimental)
identifier:gov.usgs.cmgp:COAWST.USEAST.Forecast
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, NYB05 700m Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_NYB05_sim6
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, SHF05 2km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_SHF05_sim6
modified:2016-10-19
 
title:USGS-CMG-COAWST Model: Hurricane Sandy, USE27 6km Nest
identifier:gov.usgs.cmg:USGS_COAWST_Sandy_USE27_sim6
modified:2016-10-19
 

In [17]:
val = 'necofs'
filter1 = fes.PropertyIsLike(propertyname='apiso:AnyText',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')

val = 'opendap'
filter2 = fes.PropertyIsLike(propertyname='apiso:ServiceType',literal=('*%s*' % val),
                        escapeChar='\\',wildCard='*',singleChar='?')
filter_list = [fes.And([filter1, filter2, bbox_filter])]
csw.getrecords2(constraints=filter_list, maxrecords=1000)

print(len(csw.records.keys()))
for rec in list(csw.records.keys()):
    print('title:'+csw.records[rec].title) 
    print('identifier:'+csw.records[rec].identifier)
    print('modified:'+csw.records[rec].modified)
    print(' ')


3
title:NECOFS GOM3 (FVCOM) - Northeast US - Latest Forecast
identifier:gom3_nocache
modified:2016-10-19
 
title:NECOFS Massachusetts (FVCOM) - Massachusetts Coastal - Latest Forecast
identifier:massbay_nocache
modified:2016-10-19
 
title:NECOFS GOM3 Wave - Northeast US - Latest Forecast
identifier:necofs_gom3_wave
modified:2016-10-19
 

In [ ]:


In [ ]: