1D "GRID" issues #153
Replies: 3 comments 1 reply
-
This is not an answer, but rather that an answer is not really that the 1D common dimension does not seem possible with the present implentation of The closest to my use case seems to be compute_tidal_{elevations,currents}.py with --format=netCDF4 --type=grid.
Then the output data becomes
The issue here lies in that the data are read without checking dimensionality (spatial.py, line 345):
So, data are read as if they are 1D, and without checking if they share dimension. To solve my use case, it would be necessary to look at the actual dimensions of x and y, and only do a meshgrid if the dimensions do not match. Thus, I presently believe that I cannot use the pyTMD scripts to solve my use case. I might be able to write a different/specific wrapper script. But I would have to also re-code how netCDF files are read, because the dimension-info is not retained in By the way @tsutterley: Is there a particular reason for having the Best, |
Beta Was this translation helpful? Give feedback.
-
I'm adding functionality for the "time series" type in #162. This has also been an outstanding, undocumented issue that's been on the list. Hopefully this works for your use case. |
Beta Was this translation helpful? Give feedback.
-
I've recently started to use the following "trick" for passing var:attrs from src to tgt nc files. It is important to treat
|
Beta Was this translation helpful? Give feedback.
-
Dear Wizard(s) (@tsutterley),
I am trying to use pyTMD to create boundary conditions for a hydrodynamic model. Therefore, I need tidal elevations and depth-integrated currents in a number of points - and for a number of time steps. Typically a few hundred points times a few hundred time values.
I would prefer to use the "scripts"-approach, ie compute_tidal_elevations.py and compute_tidal_elevations.py.
Presently, it seems, however, that it is assumed that the target should be (ny,nx,nt)-shaped, ie that input data are always given as 1D coordinates. However, I am really interested in x,y (lon.lat) being defined in specific points (along a track/boundary), and thus they should not be "crossed" to a "grid". Does this make sense?
In essence, I give lon(bdy), lat(bdy), time(time), and I would like output to be shaped (bdy,time), ie 2D.
It would not be a problem for me to create a fake/degenerate dimension of length 1, but I cannot position my points to be on a proj4 grid.
Any ideas on how to approach this?
Would I have to write my own wrapper-script?
Thank you,
/Bjarne
Beta Was this translation helpful? Give feedback.
All reactions