From: Ansley Manke <ansley.b.manke@xxxxxxxx>
To: jagadish karmacharya <j_karmacharya@xxxxxxxxx>
Sent: Wednesday, February 8, 2012 5:28 PM
Subject: Re: [ferret_users] india boundary
Hi,
You can get the Ferret executables tar file from the downloads pages,
http://ferret.pmel.noaa.gov/static/Downloads/ferret_downloads.html
and install it in a local directory of your own. If you don't know which one to try, we can tell which you have now using the header information from your current Ferret, that is, when you start Ferret, you get some lines like this:
> ferret
NOAA/PMEL TMAP
FERRET v6.65
Linux rh5 (gfortran) 2.6.18-164.11.1.el5 - 11/17/10
8-Feb-12 08:40
This is the RedHat 5, 32-bit one. Or
> ferret
NOAA/PMEL TMAP
FERRET v6.65
Linux(gfortran) 2.6.9-89.0.20.ELsmp - 11/17/10
8-Feb-12 08:40
This is the RedHat 5, 64-bit one. If it's not one of these, send me what does come up when you start Ferret and we can go from there.
Get the executables tar file, fer_executables.tar.gz, and put it in your directory. I might make one that says,
/home/users/ansley/ferret/
and then go into that directory,
> tar xzf fer_executables.tar.gz
In the bin/ directory, you will find the Ferret executable, ferret (synbolic-linked to ferret_v6.72)
So I could just run
/home/users/ansley/ferret/bin/ferret_v6.72
The environment that you have set up for v6.65 should work fine with this executable.
Ansley
On 2/8/2012 8:35 AM, jagadish karmacharya wrote:Hi Ansley,
Mine is version 6.5.
I have to ask system administrator for the update but that could take ages. Is it possible to install/load it in the version I am currently using?
ThanksJagadish
From: Ansley Manke <ansley.b.manke@xxxxxxxx>
To: jagadish karmacharya <j_karmacharya@xxxxxxxxx>
Cc: "ferret_users@xxxxxxxx" <ferret_users@xxxxxxxx>
Sent: Wednesday, February 8, 2012 4:15 PM
Subject: Re: [ferret_users] india boundary
Hi Jagadish,
The function pt_in_poly is included with Ferret versions 6.67 and higher. Perhaps you have an older Ferret version? Can you update your Ferret executable?
Ansley
On 2/8/2012 4:59 AM, jagadish karmacharya wrote:Hi Patrick and Ansley,
Thanks a lot but I am a bit confused. My guess is direct application of Patrick's methode would be mask (white out) unwanted regions surrounding Area Of Interest (AOI) that a mask of AOI itself. However, method mentioned by Ansley should make suppliment it and make it possible to creat a mask for AOI upon which averages etc. could also be computed.
Well, I followed the steps mentioned by Patrick ( took a while to figure out, plot.jnl is the script he has written in this mail) for NPL_adm0. Firstly, margins_set.jnl script is missing in my case, so at first I just disabled that line. This produced the filled map for Nepal with seemed OK. Next I replaced the margins_set.jnl script with margins.jnl; but this time filled map and the boarder outline does not overlay. Does is makes any difference? the resulting nc file seems to overlay correctly (with both plot/vs and polygen) when I tried it over another dataset (as well as match with go land overlay.Furhter, Patrick, what do you mean by: " .... just do not blindly use polygon command but rather plot/vs. There may be a problem anyway."
My prime interest is to creat a mask for AOI, but I can't find pt_in_poly function (It is not listed when I issue show function command). Can someone send me a copy?
Thanks in advance.
Jagadish
From: Ansley Manke <ansley.b.manke@xxxxxxxx>
To: Brockmann Patrick <Patrick.Brockmann@xxxxxx>
Cc: nitin patil <nitinpatil85@xxxxxxxxx>; ferret_users@xxxxxxxx
Sent: Tuesday, February 7, 2012 10:43 PM
Subject: Re: [ferret_users] india boundary
Hi
Thank you for that resource, Patrick.
Once you have the outline and have verified it using PLOT/VS, Patrick's message shows how to use the POLYGON command to plot the shape. Another option is the function pt_in_poly,
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/pt_in_poly/
which would let you make a mask which is 1 at every grid location inside the polygon and missing outside it; so you could do calculations or graphics over only the region inside the border.
Ansley
On 2/7/2012 11:29 AM, Brockmann Patrick wrote:
> nitin patil a écrit :
>> Dear ferret users,
>> Did any one knows how to give a border to India country if we have to plot only India.
>> if possible can we border states also?
>
> Hi,
>
> I have done this recently using kml files distributed
> by the "Global Administrative Areas" website.
>
> Please follow the different steps:
>
> 1) From http://www.gadm.org
> Go in the Download section, select the country
> and choose "Google Earth .kmz"
>
> After the download, you can have a look to the kmz file
> with googleearth of course.
> Unzip the kmz file. You should obtain a kml file.
>
> 2) Convert the kml file to a text with
> 3 columns lon,lat,number (number is the
> index representing the area) with the python
> script attached.
>
> 3) Use the ferret plot.jnl script to validate and
> save the polygons as a netcdf file.
>
> Here is an example with India with the first
> 2 administratives levels.
>
> $ unzip IND_adm1.kmz
> $ ./convert_kml.py IND_adm1.kml > IND_adm1.dat
> $ ferret
> yes? go plot.jnl IND_adm1.dat IND_adm1.nc
>
> Note: that when I try to do the same with IND_adm0.dat,
> ferret restarts my X11 server !
> The problem occurs at line
> repeat/name=n/range=1:`numb[i=@max]` ( def sym n=`n` ; let lon1=if numb eq `n` then lon ; let lat1=if numb eq `n` then lat ; polygon/line/fill/o/nolab/lev=(1,200,1)/pal=thirty_by_levels.spk lon1,lat1,`n` ; PPL SHASET RESET )
>
> But the method is still ok, just do not not blindly
> use polygon command but rather plot/vs.
> There may be a problem anyway.
>
> Happy ferreting
>
> Patrick
>