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

import iris
iris.FUTURE.netcdf_promote = True

from iris.cube import CubeList

import time

In [1]:
# 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 [9]:
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 time.time()-t0
print(cube)


24.7964229584
sea_surface_height_above_geoid / (m) (time: 7230; -- : 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  4:26:49  00:00
          description: 2015012100
          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 01:21:01 2015: ncks -O -F -d time,1,6 estofs.atl.t00z.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  4:39:44  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.5
          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

Hangs and I have to hit the kernel interrupt key


In [8]:
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


173.827374935
sea_surface_height_above_geoid / (m) (time: 7230; -- : 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  4:26:49  00:00
          description: 2015012100
          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 01:21:01 2015: ncks -O -F -d time,1,6 estofs.atl.t00z.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  4:39:44  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.5
          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 [ ]: