[Thread Prev][Thread Next][Index]

Re: [ferret_users] regriding of variable by using lat lon as a variable



Dear Ansley,

It works BUT there is some problem: (below is ferret command lines)

In original raw data, latitude and longitude grid is J=1:1755, so XCH4 output should be XCH4/I=1:1755/J=1:1755, I guess I did some some mistake.

Here I am attaching raw data file as well as plots generated from this file (netcdf data file size= 272K, plots size = 26K, 11K, 9K total three plots)


**********************************************
 ! NOAA/PMEL TMAP
 ! FERRET v6.95
 ! Linux 2.6.32-573.7.1.el6.x86_64 64-bit - 10/27/15
 ! 29-Nov-16 16:44

use ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
sh d
     currently SET data sets:
    1> ./ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc  (default)
 name     title                             I         J         K         L         M         N
 LATITUDE latitude                         ...       1:1755    ...       ...       ...       ...
 LONGITUDE  longitude                        ...       1:1755    ...       ...       ...       ...
 XCH4     column-averaged dry air mole fr  ...       1:1755    ...       ...       ...       ...

let xdif=longitude[J=@DDF]
let xcross=xdif[J=@EVNT:0]
list longitude, xdif, xcross
             DATA SET: ./ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
             ESA CCI SCIAMACHY WFMD XCH4
             Y: 0.5 to 1755.5
 Column  1: LONGITUDE is longitude (degree_east)
 Column  2: XDIF is LONGITUDE[J=@DDF]
 Column  3: XCROSS is XDIF[J=@EVNT:0]
            LONGITUDE   XDIF  XCROSS
1      /    1:   144.1    0.5    0.0
2      /    2:   144.6   -0.5    1.0
3      /    3:   144.1    0.5    2.0
4      /    4:   144.5   -0.5    3.0


yes? let npts = `xcross[J=@LOC:1]`
 !-> DEFINE VARIABLE npts = 2
yes? define axis/x/units=degrees_east xaxis=longitude[J=1:`npts`]
 !-> define axis/x/units=degrees_east xaxis=longitude[J=1:2]
yes? let total = `latitude,return=isize`
 !-> DEFINE VARIABLE total = 1
yes? define axis/y/units=degrees_north yaxis=latitude[J=1:`total`:`npts`]
 !-> define axis/y/units=degrees_north yaxis=latitude[J=1:1:2]
yes? cancel data ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
yes? define grid/x=xaxis/y=yaxis xygrid
yes? file/var="xch4"/grid=xygrid ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
yes? sh d
     currently SET data sets:
    1> ./ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc  (default)
 name     title                             I         J         K         L         M         N
 XCH4     XCH4                      1:2       1:1       ...       ...       ...       ...
 ***************************************************


Great Thanks for your kind help,

 Best Regards,
Yogesh 


On Tue, Nov 29, 2016 at 10:42 PM, Ansley C. Manke <ansley.b.manke@xxxxxxxx> wrote:

Hi,

When you say longitude[J=@1:'npts'], you have an extra @ sign. I think you mean J=1:`npts`.  Also, make sure you are using the grave-accent surrounding the `npts`, not single-quotes.

-Ansley


On 11/29/2016 4:00 AM, Yogesh Tiwari wrote:
Hi Ansley,

Thanks,

I tried to grid data variable using ferret link you forwarded, but there is an error in LOC transformation: 

 ! NOAA/PMEL TMAP
 ! FERRET v6.95
 ! Linux 2.6.32-573.7.1.el6.x86_64 64-bit - 10/27/15
 ! 29-Nov-16 16:44

use ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
sh d
     currently SET data sets:
    1> ./ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc  (default)
 name     title                             I         J         K         L         M         N
 TIME     time                            ...       1:1755    ...       ...       ...       ...
 LATITUDE latitude                  ...       1:1755    ...       ...       ...       ...
 LONGITUDE   longitude         ...       1:1755    ...       ...       ...       ...
 XCH4     column-averaged dry air mole fr  ...       1:1755    ...       ...       ...       ...

let xdif=longitude[J=@DDF]
let xcross=xdif[J=@EVNT:0]
list longitude, xdif, xcross
             DATA SET: ./ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
             ESA CCI SCIAMACHY WFMD XCH4
             Y: 0.5 to 1755.5
 Column  1: LONGITUDE is longitude (degree_east)
 Column  2: XDIF is LONGITUDE[J=@DDF]
 Column  3: XCROSS is XDIF[J=@EVNT:0]
            LONGITUDE   XDIF  XCROSS
1      /    1:   144.1    0.5    0.0
2      /    2:   144.6   -0.5    1.0
3      /    3:   144.1    0.5    2.0
4      /    4:   144.5   -0.5    3.0


let npts = 'xcross[J=@LOC:1]'
define axis/x/units=degrees_east xaxis=longitude[J=@1:'npts']
 **ERROR: command syntax: Unknown transformation:J=@1:'npts'
          Use SHOW TRANSFORMS for a list of legal transformations




On Mon, Nov 28, 2016 at 11:23 PM, Ansley C. Manke <ansley.b.manke@xxxxxxxx> wrote:

Hi,

Do the "lat" and "lon" variables represent a grid?  If so, then you need to define X and Y axes which correspond to the lon/lat data.  This FAQ, http://ferret.pmel.noaa.gov/Ferret/faq/reading-ascii-data-representing-a-grid, though it discusses reading ASCII data, shows an example of defining axes using what is in lists of  lat/lon values.  Once you have defined the X-Y grid, then you'd use RESHAPE to put your data onto that grid.  Pay attention to whether your data lists longitude varying fastest.

If the "lat" and "lon" variables represent scattered data, then you would define use one of the SCAT2GRID functions.  To see a list of the options, type

yes? show function scat2grid*xy

-Ansley


On 11/25/2016 2:07 AM, 'Yogesh Tiwari' via _OAR PMEL Ferret Users wrote:
Dear Ferret Users,

I am using ferret v 6.95 on Linux OS

I have a netcdf file with three different variables as "v1". "lat", "lon" on J-axis
How to regrid "v1" on i-axis & j-axis using "lat" and "lon". Data looks like below:


NOAA/PMEL TMAP
  FERRET v6.95  
  Linux 2.6.32-573.7.1.el6.x86_64 64-bit - 10/27/15
  25-Nov-16 15:25     

yes? use data.nc
yes? sh d
     currently SET data sets:
    1> ./data.nc  (default)
 name     title                             I         J         K         L         M         N
 v1            var                        ...       1:1869    ...       ...       ...       ...
lat             latitude                  ...       1:1869    ...       ...       ...       ...
lon            longitude               ...       1:1869    ...       ...       ...       ...


Thanks,

Regards,





--
Yogesh K. Tiwari (Dr.rer.nat),
Scientist,
Centre for Climate Change Research,
Indian Institute of Tropical Meteorology,
Homi Bhabha Road,
Pashan,
Pune




--
Yogesh K. Tiwari (Dr.rer.nat),
Scientist,
Centre for Climate Change Research,
Indian Institute of Tropical Meteorology,
Homi Bhabha Road,
Pashan,
Pune

Attachment: ESACCI-GHG-L2-CH4-SCIAMACHY-WFMD-20111231-fv1.nc
Description: Cdf file

Attachment: xch4.gif
Description: GIF image

Attachment: latitude.gif
Description: GIF image

Attachment: longitude.gif
Description: GIF image


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

Privacy Policy | Disclaimer | Accessibility Statement