import os
import netCDF4
import gspread
import pyugrid
c = gspread.Client(auth=('rsignell@yahoo.com', 'sura_ftp'))
c.login()
# testing
w = c.open_by_key(key='0AjAHlPEEP_ujdGRPMU9ZSkF5b2xJU0E5X3lSU2ZTdXc')
# corbitt's
w = c.open_by_key(key='0AmAEVaW9GoHedFZHU3Z4c1pyMkozWmJxSUlGSDk3eVE')
wks = w.worksheet('Testbed2')
rows = wks.get_all_records(empty2zero=False)
# DAP URLs look like:
a = 'http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/MDL_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml'
# Data URLs look like
b = '/data/testbed/inundation_tropical/MDL_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml'
print a.split('/',6)[-1]
print b.split('/',3)[-1]
inundation_tropical/MDL_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml inundation_tropical/MDL_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml
dap_path='http://testbed2.sura.org/thredds/dodsC/alldata'
wrow = 1
for row in rows:
wrow += 1
path = os.path.join(row['Data path'],row['NCML Link'])
dataset = path.split('/',3)[-1]
print path
dap_url = os.path.join(dap_path,dataset)
print dap_url
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-6-a04705f3358e> in <module>() 1 wrow = 1 ----> 2 for row in rows: 3 wrow += 1 4 path = os.path.join(row['Data path'],row['NCML Link']) 5 dataset = path.split('/',3)[-1] NameError: name 'rows' is not defined
wcol = wks.find('NCML working').col
wrow = 1
for row in rows:
wrow += 1
path = os.path.join(row['Data path'],row['NCML Link'])
dataset = path.split('/',3)[-1]
dap_url = os.path.join(dap_path,dataset)
try:
nc = netCDF4.Dataset(dap_url)
try:
pyugrid.UGrid.from_ncfile(dap_url)
wks.update_cell(wrow,wcol,'ugrid')
except:
wks.update_cell(wrow,wcol,'grid')
except:
wks.update_cell(wrow,wcol,'fail')
http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/MDL_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/MDL_SLOSH/Hurricane_Rita_final_run_egm3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_1_spinup/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_2_spinup_without_advection_implicit_1s/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_3_spinup_with_levees/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_4_spinup_with_levees_and_river_flow/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_5_tides_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_6_without_waves_and_advection_implicit_1s/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_7_with_waves_without_advection_implicit_1s/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_8_with_waves_and_levees/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_preliminary_run_9_with_waves_and_levees_and_river_flow/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_3D_preliminary_run_1_spinup/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_Timing_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_Timing_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_preliminary_run_1_spinup/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_preliminary_run_2_spinup_without_advection_implicit_1s/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_preliminary_run_3_tides_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_preliminary_run_4_with_waves_without_advection_implicit_1s/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_2D_preliminary_run_5_without_waves_and_advection_implicit_1s/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Rita_3D_preliminary_run_1_spinup/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Tides_only_2D_final_run/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Tides_only_2D_preliminary_run_1_without_advection_implicit_1s/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Tides_only_3D_final_run/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_final_run_egl3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_final_run_egm3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_1_egl3_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_2_egl3_with_SLOSH_winds/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_3_egl3_with_SLOSH_winds_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_4_egm3_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_5_egm3_with_SLOSH_winds/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Ike_preliminary_run_6_egm3_with_SLOSH_winds_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_final_run_ebp3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_final_run_egm3/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_1_ebp3_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_2_ebp3_with_SLOSH_winds/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_3_ebp3_with_SLOSH_winds_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_4_egm3_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_5_egm3_with_SLOSH_winds/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_SLOSH/Hurricane_Rita_preliminary_run_6_egm3_with_SLOSH_winds_without_tides/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Ike_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Ike_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Ike_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Rita_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Rita_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Rita_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Hurricane_Rita_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/SWAN_Ike_final_run_with_2DSurge/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/SWAN_Ike_final_run_without_Surge/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/SWAN_Rita_final_run_with_2DSurge/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/SWAN_Rita_final_run_without_Surge/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Tides_only_2D_final_run/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Tides_only_2D_preliminary_run_fixed_manning/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Tides_only_2D_preliminary_run_varied_manning_minimum_manning_0.025/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Tides_only_3D_final_run/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/Tides_only_3D_preliminary_run_fixed_roughness/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Ike_2D_final_run_wave_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Ike_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Ike_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Ike_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Rita_2D_final_run_waves_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Rita_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Rita_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Rita_3D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/VIMS_SELFE/Hurricane_Rita_3D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/BIO_WW3/ww3_swan_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/BIO_WW3/ww3_swan_2007/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/BIO_WW3/ww3_swan_wlev_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/BIO_WW3/ww3_swan_wlev_curr_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/BIO_WW3/ww3_swan_wlev_curr_2007_f7/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1/current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1/wave/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1/wave_current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1_1.09wind_old/current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1_1.09wind_old/wave/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1_1.09wind_old/wave_current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1/current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1/wave/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1/wave_current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1_pair_1.09wind_old/current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1_pair_1.09wind_old/wave/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2007_fine_grid1_pair_1.09wind_old/wave_current/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2010_12_storm/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/gom3_wave/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/gom3_wave_spectra/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/sci_v11_tide20100501_fine_grid1/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/sci_v9_tide20100710/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2005_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2005_2D_final_run_wave_model_only_without_circulation/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2005_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2007_2D_final_run_without_waves/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2007_2D_final_run_wave_model_only_without_circulation/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2007_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2010_final_run_tide_only/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_final_run_waves_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_final_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_preliminary_run_waves_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_preliminary_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2005_2D_preliminary_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_final_run_waves_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_final_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_final_run_without_waves/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_preliminary_run_waves_only/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_preliminary_run_with_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2007_2D_preliminary_run_without_waves/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2010_2D_final_run_tide_only/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/VIMS_SELFE/2010_2D_preliminary_run_without_waves/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Long_Hood_ChesROMS_BGC/ChesROMS_BGC_1991-?2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/NOAA_CBOFS/CBOFS/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/NOAA_CBOFS/CBOFS_1termDO_2004/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Scully_ChesROMS_1termDO/ChesROMS_1termDO_1991-2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Scully_ChesROMS_1termDO/ChesROMS_1termDO_2004-2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Li_UMCES_ROMS/Case01_Y2004_lres/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Li_UMCES_ROMS/Case02_Y2004_hres/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Li_UMCES_ROMS/Case03_Y2005_lres/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Li_UMCES_ROMS/Case04_Y2005_hres/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Shen_VIMS_EFDC/EFDC_DO3d_2004/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/CBOFS2_2004_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/CH3D_ICM_2004/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/CH3D_ICM_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/ChesROMS_constantR_2004/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/ChesROMS_constantR_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/ChesROMS_DepthDep_2004/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/estuarine_hypoxia/Bever_et_al_manuscript_runs_VIMS/ChesROMS_DepthDep_2005/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_clim_053_B20clim/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_clim_058_A20clim/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_hycom_081_A30HYC/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_hycom_082_B30HYC/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_iasnfs_080_B30IAS/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/dal/roms/b_iasnfs_083_A30IAS/00_dir.ncml http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/navocean/ncom_amseas/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/noaa/NGOM/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/nrl/gem3d/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/nrl/hycom_gom/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/nrl/ncom_gom/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/nrl/ncom_iasnfs/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/ssc/v1/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/ssc/v3/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/tamu/ssh/00_dir.ncml fail http://testbed2.sura.org/thredds/dodsC/alldata/shelf_hypoxia/tamu/roms/00_dir.ncml fail
url='http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/UND_ADCIRC/Hurricane_Ike_2D_final_run_with_waves/00_dir.ncml'
url='http://testbed2.sura.org/thredds/dodsC/alldata/inundation_tropical/USF_FVCOM/SWAN_Ike_final_run_with_2DSurge/01_dir.ncml'
ug = pyugrid.UGrid.from_ncfile(url)
nc = netCDF4.Dataset(url)
ncvars = nc.variables
meshname = 'adcirc_mesh'
meshatt_names = ncvars[meshname].ncattrs()
meshatt_names
[u'long_name', u'node_coordinates', u'face_node_connectivity', u'cf_role', u'topology_dimension']
meshatts = {}
for attname in meshatt_names:
meshatts[attname] = ncvars[meshname].getncattr(attname)
assert meshatts['cf_role'] == 'mesh_topology'
node_coordinates = meshatts.get('node_coordinates', None)
node_coordinates
u'x y'
type(node_coordinates)
unicode
node_coord_var=node_coordinates.split()[0].strip()
foo=ncvars[node_coord_var]
len(foo)
417642
dap_url='http://129.252.139.124/thredds/dodsC/testAll/sciwms.nc'
pyugrid.UGrid.from_ncfile(dap_url)
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) <ipython-input-3-515809097d44> in <module>() ----> 1 pyugrid.UGrid.from_ncfile(dap_url) /home/local/python27_epd/lib/python2.7/site-packages/pyugrid/ugrid.pyc in from_ncfile(klass, nc_url, mesh_name) 151 data = open_cf_todict(nc_url) 152 if mesh_name is None: --> 153 ug = data[data.keys()[0]] 154 else: 155 ug = data[mesh_name] IndexError: list index out of range
dap_url='http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UND_ADCIRC/2010_2D_final_run_tide_only/00_dir.ncml'
dap_url='http://testbed2.sura.org/thredds/dodsC/alldata/inundation_extratropical/UMASS_FVCOM/2005_fine_grid1/current/00_dir.ncml'
pyugrid.UGrid.from_ncfile(dap_url)
<pyugrid.ugrid.UGrid at 0x39119d0>
dap_url='http://testbedapps-dev.sura.org/thredds/dodsC/alldata/Inundation/umass/fvcom_extratropical/runs/2005_fine_grid1/wave/output/00_dir.ncml'
foo=pyugrid.UGrid.from_ncfile(dap_url)
foo.nodes.len()
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-4738ae91f08b> in <module>() ----> 1 foo.nodes.len() AttributeError: 'numpy.ndarray' object has no attribute 'len'
foo.num_vertices
3
a=foo.nodes
type(a)
numpy.ndarray
shape(a)
(5620, 2)