[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20041008: how to handle staggered U & V in IDV?



>From: Rich Signell <address@hidden>
>Organization: USGS
>Keywords: 200410081020.i98AK8UE000709 IDV staggered flow vectors

Hi Rich-

>I have U and V fields from a model that uses a
>Arakawa-C grid, with U values at the left and right of
>a grid cell, and V values at the top and bottom. In
>the NetCDF file, therefore, U and V have different
>dimensions (different by 1), and different coordinate
>variables (lat_u, lon_u, lon_v, lat_v).  

>It would be great to have a formula that averages the
>U & V values to the grid point centers so that we can
>create displays with co-located velocity.  Is this
>possible?

If you just use the default behavior in the IDV, it will
resample the V component to the U locations and
display the vectors on the points defined by the u component.

(from a separate message)
> I'm unclear on how I'm supposed to proceed, however, with my desire
> to display flow arrows from my staggered grid in IDV.   Am I to start
> writing some Jython or wait for a future release?

If you wanted to display them at different points, you would
need to resample each wind component to those points first
The big job would be to figure out the points you wanted to
sample to and create the new sampling domain.  This could
all be done in Jython, but would require a bit of understanding
of the VisAD data model.  There's nothing right out of the box
to do this.  Since the spatial domains of the variables change
with time, that's a complicating factor.   If you had some
dummy variable that was on the domain you wanted to resample
to for each timestep, then that would make things easier.
Do you have a sample file?  

>Here's what my file looks like:
>
>netcdf feb2003_short {
>dimensions:
>       ocean_time = UNLIMITED ; // (1 currently)
>       s_rho = 20 ;
>       eta_u = 60 ;
>       xi_u = 159 ;
>       eta_v = 59 ;
>       xi_v = 160 ;
>       eta_rho = 60 ;
>       xi_rho = 160 ;
>       tracer = 2 ;
>       s_w = 21 ;
>       eta_psi = 59 ;
>       xi_psi = 159 ;
>variables:
>       short u(ocean_time, s_rho, eta_u, xi_u) ;
>               u:scale_factor = -1.191449e-005f ;
>               u:add_offset = 0.0627047f ;
>               u:coordinates = "lat_u lon_u" ;
>       short v(ocean_time, s_rho, eta_v, xi_v) ;
>               v:scale_factor = -1.155427e-005f ;
>               v:add_offset = -0.1354672f ;
>               v:coordinates = "lat_v lon_v" ;
>       double h(eta_rho, xi_rho) ;
>               h:long_name = "bathymetry at RHO-points" ;
>               h:units = "meter" ;
>               h:field = "bath, scalar" ;
>               h:coordinates = "lat_rho lon_rho" ;
>       double hc ;
>               hc:long_name = "S-coordinate parameter, critical
>depth" ;
>               hc:units = "meter" ;
>       double lat_rho(eta_rho, xi_rho) ;
>               lat_rho:long_name = "latitude of RHO-points" ;
>               lat_rho:units = "degree_north" ;
>               lat_rho:field = "lat_rho, scalar" ;
>       double lat_u(eta_u, xi_u) ;
>               lat_u:long_name = "latitude of U-points" ;
>               lat_u:units = "degree_north" ;
>       double lat_v(eta_v, xi_v) ;
>               lat_v:long_name = "latitude of V-points" ;
>               lat_v:units = "degree_north" ;
>       double lon_rho(eta_rho, xi_rho) ;
>               lon_rho:long_name = "longitude of RHO-points" ;
>               lon_rho:units = "degree_east" ;
>               lon_rho:field = "lon_rho, scalar" ;
>       double lon_u(eta_u, xi_u) ;
>               lon_u:long_name = "longitude of U-points" ;
>               lon_u:units = "degree_east" ;
>       double lon_v(eta_v, xi_v) ;
>               lon_v:long_name = "longitude of V-points" ;
>               lon_v:units = "degree_east" ;
>}

Don
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.