[Thread Prev][Thread Next][Index]

Re: [ferret_users] problem with merging time series data files



Hi,
Check that the datafiles aaa.dat contain data, just to make sure you are reading the data correctly.  Then I would try @NRST instead of @XACT for the T axis. I know that the documentation suggests XACT, but I think NRST will work as well.

As an aside, this kind of data is something we are seeing more and more of, and we are now developing Ferret functions and scripts to work with such data.  In the NetCDF documentation there are standards for representing different kinds of "Discrete Geometry" data,
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#appendix-examples-discrete-geometries

and this data might be represented as a "contiguous ragged array of time series", http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#idp8327296

For your data you there would be a variable row_size, containing the number of data in each time series; the variables representing the station: wmoid, station, lon, lat, elev, row_size, would all have length representing number of stations. Then the length of the wind-variable would be the sum of the timeseries lengths.  Watch for announcements of functions for using data in these new file formats.

Ansley



On 7/4/2013 9:45 AM, Malgorzata Liszewska wrote:

Hi Everybody,

 

I need to prepare a file with time series of wind data at stations for use with the SCAT2GRIDGAUSS_XY, it worked for me with other data very nicely.

 

The problem is that the files containing time series (daily data) are not of the same length because of missing data.

I followed the strategy described in "Working with special datasets-collection of profiles or time series".

I created a time axis with all time steps and tried to fill the "merged" file as in the script below. Unfortunately always I obtain an empty file with correct structure.

 

I would be very grateful for any advices, I do not know how to manage with this??

 

Thanks in advance for any ideas,

Malgorzata

 

 

1> /home/staff/mali/DATA/wiatr/wind_all_sta.cdf (default)

name title I J K L M N

WINDSTA wiatr 1:3 ... ... 1:2101 ... ...

LAT Latitude 1:3 ... ... ... ... ...

LON Longitude 1:3 ... ... ... ... ...

yes? list windsta[l=1:5]

VARIABLE : wiatr (m/s)

FILENAME : wind_all_sta.cdf

FILEPATH : /home/staff/mali/DATA/wiatr/

SUBSET : 3 by 5 points (X (sequence)-TIME)

0 1 2

1 2 3

01-APR-2005 00 / 1:............

02-APR-2005 00 / 2:............

03-APR-2005 00 / 3:............

04-APR-2005 00 / 4:............

05-APR-2005 00 / 5:............

 

 

and the script:

-------------------------------

\CANCEL MODE VERIFY

 

CANCEL DATA/ALL

CANCEL REGION

CANCEL VIEWPORTS

set memory/size=400

 

let path =...

let pin=...

let pin1=...

let pout=...

 

let staparam=pin+"/"+"stacje"

file/skip=1/var="wmoid,stname,lats,lons,elevs"/form=delimited/delimiter=";,;,;,;" "`staparam`"

 

let nsta=60

let nsta=3

 

let fout=pout+"wind_all_sta.cdf"

 

DEFINE AXIS/T="1-APR-2005":"31-DEC-2010":1/units=days taxx

DEFINE AXIS/X=0:`nsta-1`:1/UNIT="sequence" xallsta

define grid/x=xallsta/t=taxx gallsta

 

let windsta=1/0 * x[g=gallsta] * t[g=gallsta]

SET VARIABLE/TITLE="wiatr"/units="m/s" windsta

SAVE/CLOBBER/FILE="`fout`" windsta

LET LAT = 1/0*X[gx=gallsta]

SET VARIABLE/TITLE="Latitude"/UNITS="degrees" lat

SAVE/CLOBBER/APPEND/FILE="`fout`"/ILIMITS=1:`nsta` lat

LET LON = 1/0*X[gx=gallsta]

SET VARIABLE/TITLE="Longitude"/UNITS="degrees" lon

SAVE/CLOBBER/APPEND/FILE="`fout`"/ILIMITS=1:`nsta` lon

 

let delimin=" ,;,;"

 

repeat/range=1:`nsta`/name=n \

(let xsta=lons[i=`n`];\

let ysta=lats[i=`n`];\

let nrsta=wmoid[i=`n`];\

let fin=pin1+"/"+"dy_wind_"+"`nrsta`"+".cdf";\

use "`fin`";\

DEFINE AXIS/X=`n`:`n`:1/UNIT="sequence" x1sta;\

DEFINE GRID/X=x1sta/t=tax g1sta;\

list/clobber/file=aaa.dat/form=(f10.4)/noheader wind;\

FILE/VAR="invar"/GRID=g1sta aaa.dat;\

LET windsta = invar[g=gallsta,GT=@XACT];\

SAVE/CLOBBER/APPEND/FILE="`fout`" windsta[I=`n`];\

canc data 2;\

CANC DATA 3)

 

let lat = lats

let lon = lons

 

SET MODE/LAST VERIFY

---------------------------------

 

--

Dr. Malgorzata Liszewska

 

Interdisciplinary Centre for Mathematical and Computational Modelling

University of Warsaw

Pawinskiego 5a, 02-106 Warszawa, Poland

 

 

 



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

Privacy Policy | Disclaimer | Accessibility Statement