[Thread Prev][Thread Next][Index]

Re: [ferret_users] extracting state grid from netcdf file



Dear Ansley Manke,

Thanks for your steps. I forgot in earlier email to mention point 2

1. I have one query (find attached script) that when I am doing list in my script it is saving all the grid points in the txt file, but I want to save only the grid points which comes under the shaded area (xgp, ygp). Any mistake I am doing in list statement?

2. let gp_data = if gp eq 1 then gp*rf[d=1,l=18050:18171]
    How to average the xgp and ygp (in script), to list single value l= on daily basis (122 days in my case)?




--
Regards,
Nitin Patil

Webpage: https://sites.google.com/site/nitinpatil85/

On Wed, Dec 3, 2014 at 11:49 AM, Nitin Patil <nitinpatil85@xxxxxxxxx> wrote:
Dear Ansley Manke,

Thanks for your steps.

I have one query (find attached script) that when I am doing list in my script it is saving all the grid points in the txt file, but I want to save only the grid points which comes under the shaded area (xgp, ygp). Any mistake I am doing in list statement?

--
Regards,
Nitin Patil


On Tue, Nov 25, 2014 at 10:46 PM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi,
There's a function,
yes? show func pt*
PT_IN_POLY(A,XVERT,YVERT)
    Return -1 outside, 0 if on edge, 1 if inside polygon
    A: Variable on the XY grid and region to be tested
    XVERT: X-coordinates of vertices of polygon
    YVERT: Y-coordinates of vertices of polygon
If you have the boundaries as lists of longitude and latitude values, this function will return a mask as shown in the description.  So, check how it looks:
yes? let state_mask = pt_in_poly( var, xvert, yvert)
yes? let var_in_state = if state_mask eq 1 then state_mask * var
yes? shade var_in_state

yes? plot/vs/over/line xvert, yvert  ! just to see the outline
It's up to you whether you make the mask include any grid points that happen to match the boundary.

  if state_mask GE 0 then...

And you can list out var_in_state, in whatever format you want.



On 11/25/2014 7:40 AM, Nitin Patil wrote:
Dear ferret users,

I have a netcdf file from which I have to extract grid values of one state.
I know the state boundaries grid lat lon but it is not a perfect square, How to write in jnl script the know grid values for state to extract the values in txt?



--
Regards,
Nitin Patil






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

Privacy Policy | Disclaimer | Accessibility Statement