[ncl-talk] extract_data_from_selected_box

Mary Haley haley at ucar.edu
Wed Jun 1 08:34:29 MDT 2016


I didn't see this message before I responded to the previous question.

I've provided you with at least two examples, and would hope that the
example showing how to extract data from a simple box could be expanded to
work for several boxes.

I don't know how you generated the thick red lat / lon outline in this
plot, but if you have it as a single polygon represented by lat/lon values,
then you can use the gc_inout function to traverse your data and see if a
lat/lo point in your original data is inside or outside of a point in you
polygon.  If it's inside, then keep it, and if it's outside, then set that
point to missing.

See example "mask_9.ncl" at:

http://www.ncl.ucar.edu/Applications/mask.shtml#ex9

This uses a shapefile outline as the polygon, but the same idea applies.

--Mary


On Fri, May 27, 2016 at 11:59 PM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Dear Mary,
>
> I need to visualize and extract the data,  which are covered by red line
> only in masked data figure. see the attached figure
>
> Kunal Bali
> Research Scholar
> Radio & Atmospheric Science Division
> CSIR - National Physical Laboratory
> New Delhi - 110012
> India
>
>
>
>
>
> On Sat, May 28, 2016 at 10:09 AM, Kunal Bali <kunal.bali9 at gmail.com>
> wrote:
>
>> Thanks Mary for giving your extra time.
>>
>> But, I am not looking that kind of result. In the output which you
>> provided, it covers the extra data as well and i don't want to include all
>> these data. I strictly need to visualize and extract the only polygon box
>> data which i shown in previous mail.
>>
>> And same in the shape file script, it covers extra data as well. If i
>> give the any state name it cover the whole data of that state.
>>
>>
>>
>> Regards
>> Kunal Bali
>>
>>
>>
>>
>> On Sat, May 28, 2016 at 12:34 AM, Mary Haley <haley at ucar.edu> wrote:
>>
>>> Kunal,
>>>
>>> Hopefully the previous script using shapefiles was helpful.
>>>
>>> However, it's relatively easy to mask your data based on a lat/lon box,
>>> especially if you have rectilinear or curvilinear lat/lon data. I took the
>>> last script, removed the shapefile stuff, and masked your data based on the
>>> lat/lon box you provided.
>>>
>>> --Mary
>>>
>>>
>>> On Fri, May 27, 2016 at 5:57 AM, Kunal Bali <kunal.bali9 at gmail.com>
>>> wrote:
>>>
>>>> Dear NCL
>>>>
>>>> I need to extract the data from the selected box. Could anyone please
>>>> let me know how it is done ?
>>>>
>>>> please find the attached files.
>>>>
>>>> Regards
>>>> Kunal Bali
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160601/a7a7f507/attachment.html 


More information about the ncl-talk mailing list