[Thread Prev][Thread Next][Index]

Re: [ferret_users] Changing variable's grid





On 4/19/2011 9:18 AM, Ansley Manke wrote:
Hi Szymon -
Olivier's solution sounds just fine, but do check in your original dataset.  Are there 2D variables that represent longitude and latitude? If so, the data is on a curvilinear grid, and you can look in the Ferret Users Guide for more details about handling data on such grids.

Hi Szymon et. al.,

I second Ansley's point:  check whether this is a curvilinear grid.

If not, then here is another approach to fixing the problem.   Using "g=final_grid@ASN" is satisfactory, too.  The following method, though, is particularly well suited to mending a flaw in a netCDF dataset, without actually altering the dataset.  The essence of the solution is to replace the erroneous axis coordinates with the correct axis definition.  In the example just below, I use the technique to replace a (valid) monthly axis with a (contrived) hourly time axis.  My example -- in which I appear to corrupt a valid file -- illustrates why the technique should be applied carefully.

    - Steve
yes? use coads_climatology
yes? show grid sst
    GRID GSQ1
 name       axis              # pts   start                end
 COADSX    LONGITUDE          180mr   21E                  19E(379)
 COADSY    LATITUDE            90 r   89S                  89N
 normal    Z
 TIME      TIME                12mr   16-JAN 06:00         16-DEC 01:20
yes? set view upper
yes? plot/x=180/y=0 sst
yes? define axis/t=0:12:1/unit=hours TIME
Replacing definition of axis TIME
 *** NOTE: grid  used by data set coads_climatology
 *** NOTE: Redefinition may alter apparent contents of data set
yes? set view lower
yes? plot/x=180/y=0 sst





Ansley


On 4/19/2011 7:55 AM, Szymon Roziewski wrote:
Thank you very much for your solution.

It works well know.

I appreciate your quick responses.

Martin:
Thank you for your wider explanation of the problem.

Best wishes,
Szymon Roziewski

2011/4/19 Olivier Marti <olivier.marti@xxxxxxxxxxxx>

Le 19 avr. 2011 à 15:55, Szymon Roziewski a écrit :

> Hello there,
>
> I am wondering if it's possible to change the grid for a defined variable?
> I mean that e.g. I have tmp variable on grid (132,145) -- elements of this grid are integers
> and eventually I want it to be on grid 132,145 but with elements defining longitudes and latitudes (real numbers).
> It's simple but I can't do it in ferret.
>
> Sth like that
> tmp = tmp[g=final_grid] doesn't work and I know why but how to do..?


If I undersand well your needs, you should use @ASN transform, and not use recursive definition of variables :

tmp2 = tmp[g=final_grid@ASN]

Olivier

--
Dr. Olivier Marti  - mailto:olivier.marti@xxxxxxxxxxxx
Laboratoire des Sciences du Climat et de l'Environnement
Institut Pierre Simon Laplace
Laboratoire CEA-CNRS-UVSQ  -  UMR 8212
Tel : +33 1 69 08 77 27 - Mob : +33 6 45 36 43 74
Fax: +33 1 69 08 30 73
<http://www.lsce.ipsl.fr/Pisp/56/olivier.marti.html>











--
Z wyrazami szacunku,
Szymon Roziewski

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

Privacy Policy | Disclaimer | Accessibility Statement