In [3]:
import pytz
from datetime import datetime, timedelta

import iris
iris.FUTURE.netcdf_promote = True

from iris.cube import CubeList

import time

In [4]:
# SECOORA region (NC, SC GA, FL).
bbox = [-87.40, 24.25, -74.70, 36.70]

url = "http://geoport-dev.whoi.edu/thredds/dodsC/estofs/atlantic"

Works fine


In [5]:
t0 = time.time()
cube = iris.load_cube(url, 'sea_surface_height_above_geoid')

lon = iris.Constraint(longitude=lambda l: bbox[0] <= l <= bbox[2])
lat = iris.Constraint(latitude=lambda l: bbox[1] <= l < bbox[3])

cube = cube.extract(lon & lat)
print 'elapsed time = %f seconds' % (time.time()-t0)
print(cube)


elapsed time = 24.818419 seconds
sea_surface_height_above_geoid / (m) (time: 7236; -- : 54731)
     Dimension coordinates:
          time                            x          -
     Auxiliary coordinates:
          latitude                        -          x
          longitude                       -          x
     Attributes:
          Conventions: UGRID-0.9
          NCO: 20150121
          a00: 0.35
          b00: 0.3
          c00: 0.35
          cdm_data_type: ugrid
          cf: 0.0025
          comments: ESTOFS ATLANTIC V1.0.0
          contact: yuji.funakoshi@noaa.gov
          cori: 0.0
          coverage_content_type: modelResult
          creation_date: 2015-01-21 10:25:03  00:00
          description: 2015012106
          dramp: 0.0
          dt: 5.0
          eslm: 5.0
          fort.15: ==== Input File Parameters (below) ====
          grid: ec2001_v2e.grd
          grid_type: Triangular
          h0: 0.25
          history: Wed Jan 21 07:21:00 2015: ncks -O -F -d time,1,6 estofs.atl.t06z.fields.cwl.nc...
          host: CSDL/MMAP - NCEP/EMC
          ics: 2
          id: estofs/atlantic/1.1.0
          ihot: 368
          institution: CSDL/MMAP - NCEP/EMC
          location: node
          mesh: adcirc_mesh
          model: ADCIRC
          modification_date: 2015-01-21 10:36:37  00:00
          nbfr: 10
          ncor: 1
          nolibf: 2
          nolica: 0
          nolicat: 0
          nolifa: 2
          nramp: 1
          ntif: 8
          ntip: 1
          nwp: 0
          nws: -5
          references: http://www.adcirc.org
          reftim: 0.0
          rnday: 770.75
          sfea0: 35.0
          slam0: -79.0
          source: IBM POWER 6 CIRRUS/STRATUS
          statim: 0.0
          summary: NOAA Extratropical Surge and Tide Operational Forecast System (ESTOFS),...
          tau0: -5.0
          title: ESTOFS Storm Surge Model - Atlantic - v1.0.0 - NOAA - NCEP - ADCIRC
          version: 49.82.10
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'nbdv' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'neta' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'ibtypee' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'nvell' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'ibtype' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'nbvv' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'nvel' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))
/home/usgs/anaconda/lib/python2.7/site-packages/iris/fileformats/_pyke_rules/compiled_krb/fc_rules_cf_fc.py:1196: UserWarning: Ignoring netCDF variable 'nvdll' invalid units 'nondimensional'
  warnings.warn(msg.format(msg_name, msg_units))

Hangs and I have to hit the kernel interrupt key


In [6]:
t0 = time.time()
cube = iris.load_cube(url, 'sea_surface_height_above_geoid')

cube = cube.intersection(longitude=(bbox[0], bbox[2]),
                         latitude=(bbox[1], bbox[3]))
print time.time()-t0
print cube


170.486581087
sea_surface_height_above_geoid / (m) (time: 7236; -- : 54731)
     Dimension coordinates:
          time                            x          -
     Auxiliary coordinates:
          latitude                        -          x
          longitude                       -          x
     Attributes:
          Conventions: UGRID-0.9
          NCO: 20150121
          a00: 0.35
          b00: 0.3
          c00: 0.35
          cdm_data_type: ugrid
          cf: 0.0025
          comments: ESTOFS ATLANTIC V1.0.0
          contact: yuji.funakoshi@noaa.gov
          cori: 0.0
          coverage_content_type: modelResult
          creation_date: 2015-01-21 10:25:03  00:00
          description: 2015012106
          dramp: 0.0
          dt: 5.0
          eslm: 5.0
          fort.15: ==== Input File Parameters (below) ====
          grid: ec2001_v2e.grd
          grid_type: Triangular
          h0: 0.25
          history: Wed Jan 21 07:21:00 2015: ncks -O -F -d time,1,6 estofs.atl.t06z.fields.cwl.nc...
          host: CSDL/MMAP - NCEP/EMC
          ics: 2
          id: estofs/atlantic/1.1.0
          ihot: 368
          institution: CSDL/MMAP - NCEP/EMC
          location: node
          mesh: adcirc_mesh
          model: ADCIRC
          modification_date: 2015-01-21 10:36:37  00:00
          nbfr: 10
          ncor: 1
          nolibf: 2
          nolica: 0
          nolicat: 0
          nolifa: 2
          nramp: 1
          ntif: 8
          ntip: 1
          nwp: 0
          nws: -5
          references: http://www.adcirc.org
          reftim: 0.0
          rnday: 770.75
          sfea0: 35.0
          slam0: -79.0
          source: IBM POWER 6 CIRRUS/STRATUS
          statim: 0.0
          summary: NOAA Extratropical Surge and Tide Operational Forecast System (ESTOFS),...
          tau0: -5.0
          title: ESTOFS Storm Surge Model - Atlantic - v1.0.0 - NOAA - NCEP - ADCIRC
          version: 49.82.10

In [6]: