ocean_time in pyroms_toolbox.nc_create_roms_bdry_file

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
JDTilley
Posts: 63
Joined: Tue May 31, 2011 3:31 pm
Location: University of Southern Mississippi

ocean_time in pyroms_toolbox.nc_create_roms_bdry_file

#1 Unread post by JDTilley »

I decided to use pyroms to create my input netCDFs. I have successfully created a grid file, and now I'm trying to create a boundary file. I see the function for this is:

Code: Select all

pyroms_toolbox.nc_create_roms_bdry_file

The function call is:

Code: Select all

nc_create_roms_bdry_file(filename, grd, ocean_time)

so I tried:

Code: Select all

pyroms_toolbox.nc_create_roms_bdry_file('test_bry.nc', grd, 0)
but I get the error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyroms_toolbox/nc_create_roms_bdry_file.py", line 86, in nc_create_roms_bdry_file
    nc.variables['ocean_time'].long_name = ocean_time.long_name
AttributeError: 'str' object has no attribute 'long_name'
What is the expected type for ocean_time? I thought it would be an integer, but this obviously fails. I seems there used to be an ocean_time class. Is this what it's expecting? Or is there something else wrong here? It seems nc.variables['ocean_time'].long_name would be expecting a string, but ocean_time.long_name doesn't exist as far as I know.

EDIT: I'd also like to know what ocean_time.field is supposed to be. Looking at the CDL file I only see long_name, units, and calendar as attributes.

Post Reply