[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to assign/fill a time series value to a spatial grid?



Dear Karnan,

On Tue, Apr 25, 2023 at 8:34 PM Karnan C <karnanc6@xxxxxxxxx> wrote:
Dear Ferreters,
I have a time series measurements for one point in a text file. I want to fill the same TS value to an area containing multiple points (lat/lon) and convert to a spatial-time series data in .nc format. See the attachment.

or I have a grid file (.nc) with multiple time steps and I want to replace all values by a single value in each time step.


What the image you attach depicts can be written, in Ferret, as

!! your_grid_file.nc contains "xytdata",
!! a variable defined on (x,y,t) grid
set data your_grid_file

let varXYT =  0 * x[gx=xytdata] + 0 * y[gy=xytdata] + timeseries

In this case, the time axis of xytdata is ignored and the time axis of the timeseries is taken.

If your timeseries is in a text file, then it would be easier to utilize the time axis of xytdata when you read the text file, assuming that the two time axes are identical:

set data your_grid_file
! There may be a better way. We just want to copy the time axis.
define axis/t/from_data/like=xytdata tax = t[gt=xytdata]
define grid/t=tax grid_timeseries
file/grid=grid_timeseries/var=tdummy,timeseries  timeseries.txt

let varXYT =  0 * x[gx=xytdata[d=1]] + 0 * y[gy=xytdata[d=1]] + timeseries[d=2]

I haven't tested the code. I must have made some mistakes.

Ryo




How can I do it?

--
Dr. Karnan Chinnadurai, Scientist
Biological Oceanography Division
CSIR- National Institute of Oceanography
Dona Paula, Goa, India.
Contact: 0832 2450 515.
Mobile No. +91 9633032345; +91 9941811608

Attachment: example.png
Description: PNG image


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement