Hi Chris and Jaison, I have just one thing to add to what looks like a great answer from Jaison. Chris mentioned in his original question that the SCAT2GRID function smears out the results onto land. You can try choosing the SCAT2GRID parameters to get a closer fit, or use a mask on the final result. If var_2 is the data on the X-Y-T grid, then you could do something like this: ... compute var_2 use etopo20 ! choose a data set with a resolution similar to your output grid ! Regrid the elevations to your grid and use them to define a mask which is ! 1 over the ocean and missing everywhere else let land_mask = if rose[d=2] LT 0 then 1 let masked_var = land_mask * var_2[d=1] shade masked_var Ansley Manke Jaison Kurian wrote: Hi Chris, You reached there almost...but missed few points. I modified your script (see the attachment:scat2grid.jnl, using the data sample_data.txt) to get proper time dimension for the variable based on following details... 1. Your data is repeating for the common X-Y locations for 5 time points ( 1990- 3/31, 4/30, 5/21, 6/14 & 6/21). But the lat-lon point "80.50 -67.75" exists only for "1990 03 31". If this point is skipped we are left with 107 spacial points and 5 time points ==> 107*5 = 535 values (or lines in the data file). Now read the variable in Ferret like... define axis/x=1:107:1 xscat ! spatial points define axis/t=1:5:1 tscat ! time points define grid/x=xscat/t=tscat gscat file/grid=gscat/var=.............. 2. to define a time axis choose only the five values from year, month & day (skip all the repeated values). Get the time values using days1900 function, define a time axis..assign to the variable using @ASN regridding. 3. Use this new variable in scat2grid function. Now the variable is 2D but one of the dimention is time. So you have to give only the common lat and lon points as the arguments to the scat2grid. Define the final destination grid such that it is within the limits of the original data. Dont forget to use the /UNITS attribute while defining latitude or longitude axis 4. Define a climatological monthly time axis then regrid to this usin @MODULO regridding to get the climatology. Please go through the modified script..if anything need to be explained..let me know. As a "bonus" you can see how to use "POLYGON" command to look at the original data in a spatial plot without any interpolation/extrapolation. Hope this helps With Regards Jaison On Thu, 18 Nov 2004, Chis Konig wrote:Hi there, I have data that came in 2D-fields at irregular times, i.e. it is unevenly spaced in time (weekly - monthly) and space (i.e. 2D but was not on a lon-lat-grid). I'd like to make a climatology with monthly means etc. from it. Unless there is an elegant way of doing that all at once (3D regridding?) I think I have to achieve this in two steps (but correct me if I'm wrong): - First regrid it in space onto a lon-lat-grid for each time step. - Secondly regrid it over time, i.e. make monthly averages etc. I might prefer a two-stepped approach anyway as it gives me more control, e.g. different types of interpolation for space and time. The data is in ASCII and in the form: yr mo dy lat lon var An example file can be found here: http://math.nyu.edu/~konigc/sample_data/sample_data.txt The first three variables (time) are non-decreasing but identical for several hundreds to thousands data points (all the data from one field). That's how far I got: !!!!!!!!!!!!!!!!!!!!!!!! define axis/x=1:1000:1 x_temp define grid/x=x_temp g_temp file/var="yr,mo,dy,lat,lon,var"/grid=g_temp sample_data.txt let gregday = days1900(yr,mo,dy) define axis/x=-75:-55:0.25 xax define axis/y=79:83:0.25 yax !Those axes would be different for the total data. let var_2=scat2gridgauss_XY(lon,lat,var,x[gx=xax],y[gy=yax],0.5,0.5,2,2) !OR let var_2=scat2gridlaplace_XY(lon,lat,var,x[gx=xax],y[gy=yax],5,2) shade var_2 go land !!!!!!!!!!!!!!!!!!!!!!!! My problems with that approach: - I lose the time dimension in the regridding process. - The data is confined to the ocean. But with scat2gridXXX the information 'spills' onto the land. Is there a possibility to use a simpler interpolation (nearest neighbour, linear...)? Thanks for any help! Chris |