{
 "metadata": {
  "name": "find_attributes"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import netCDF4"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "nc = netCDF4.Dataset('http://testbedapps-dev.sura.org/thredds/dodsC/alldata/Inundation/und/adcirc_tropical/runs/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for varname,ncvar in nc.variables.items():\n",
      "    attdict = ncvar.__dict__\n",
      "    if 'dimension' in attdict: print 'found dimension in %s ' % varname\n",
      "    if 'standard_name' in attdict: \n",
      "        if attdict['standard_name']=='mesh_topology':\n",
      "            print 'found mesh_topology in %s' % varname\n",
      "        if attdict['standard_name']=='face_node_connectivity':\n",
      "            print 'found face_node_connectivity in %s' % varname    \n",
      "        \n",
      "        "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "found face_node_connectivity in element\n",
        "found dimension in adcirc_mesh \n",
        "found mesh_topology in adcirc_mesh\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "attdict"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "OrderedDict([(u'long_name', u'radiation stress gradient y component'), (u'standard_name', u'radiation_stress_gradient_y'), (u'units', u'metric'), (u'_FillValue', -99999.0), (u'location', u'node'), (u'coordinates', u'time y x'), (u'mesh', u'adcirc_mesh')])"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}