[gradsusr] Crop country boundary or masking an area - still not working

Huddleston, John Huddleston at cira.colostate.edu
Mon Sep 12 08:00:55 EDT 2011


Serge

See http://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml and convert your study area shapefile to a masking netCDF file.

Then write a small C/FORTRAN application to read your input netCDF file and the masking netCDF and write out a new netCDF file where the area outside your study area is the missing "undef" value.

John Huddleston

________________________________
From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] On Behalf Of Rafanoharana Serge Claudio [rafanoharana at gmail.com]
Sent: Monday, September 12, 2011 1:27 AM
To: GrADS Users Forum
Subject: Re: [gradsusr] Crop country boundary or masking an area - still not working

Dear Yaqiang,

Thank you for your email. I will work on it and let you know ASAP.

Best Regards,

Serge


On Sat, Sep 10, 2011 at 7:57 PM, Yaqiang Wang <yaqiang.wang at gmail.com<mailto:yaqiang.wang at gmail.com>> wrote:
You can use maskout function to crop your grid data. Or use basemap
script to 'crop' your figure.

On Sat, Sep 10, 2011 at 11:57 PM, Rafanoharana Serge Claudio
<rafanoharana at gmail.com<mailto:rafanoharana at gmail.com>> wrote:
> Dear John,
>
> Thank you for your answer. I do have ogr2ogr and a shapefile of the study
> area. Thank you anyway for the file.
> In your command, you only deal with .shp files, and ogr2ogr cannot be used
> within GrADS.
> The problem is that I have a .nc file which contains a variable. I want to
> clip this .nc file (but not a .shp file). I am not sure that ogr2ogr can
> deal with .nc format (I also tried but not working).
>
> Thanks,
>
> Serge
>
>
> On Fri, Sep 9, 2011 at 1:09 PM, Huddleston, John
> <Huddleston at cira.colostate.edu<mailto:Huddleston at cira.colostate.edu>> wrote:
>>
>> Serge
>>
>>
>>
>> Attached is your study area shapefile (Study_Area.shp). Use ogr2ogr to
>> clip your data.
>>
>>
>>
>> You can get ogr2ogr from http://www.gdal.org/ogr2ogr.html or if on Linux
>> use ‘apt-get install gdal-bin’.
>>
>>
>>
>> Use the following command:
>>
>>
>>
>> ogr2ogr -clipsrc Study_Area.shp output.shp Your_input_data.shp
>>
>>
>>
>> where Study_Area.shp is a shapefile in the attached zip file and
>> Your_input_data.shp is the shapefile you want to clip.
>>
>>
>>
>> John Huddleston, PhD
>>
>> Cooperative Institute for Research in the Atmosphere
>>
>>
>>
>>
>>
>>
>>
>> From: gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org> [mailto:gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org>]
>> On Behalf Of Rafanoharana Serge Claudio
>> Sent: Friday, September 09, 2011 12:59 PM
>> To: GrADS Users Forum
>> Subject: [gradsusr] Crop country boundary or masking an area - still not
>> working
>>
>>
>>
>> Dear all,
>>
>> I've already posted this message before but I can't get it worked.
>> If any of you have any idea to crop the study area, please let me know.
>> One said that it is possible to grab a shapefile of the top part  and fill
>> it with black (I guess he meant re-setting the value of the variable covered
>> by this shapefile to 0). If you have any experience or any tips on how to do
>> that, thanks in advance for your help.
>>
>> Kind regards,
>>
>> Serge
>>
>> ---------- Forwarded message ----------
>> From: Rafanoharana Serge Claudio <rafanoharana at gmail.com<mailto:rafanoharana at gmail.com>>
>> Date: Fri, Aug 26, 2011 at 7:53 AM
>> Subject: Crop country boundary
>> To: GrADS Users Forum <gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>>
>>
>>
>> Dear all,
>>
>> I would like to ask if there is a way to crop the data to a specific area.
>> In GrADS, if we use 'set mpdset hires', we have the country boundary.
>> However for my case I only need the study area (please refer to the attached
>> file).
>>
>> I found that http://www.diva-gis.org/datadown provides Grid data. Can we
>> use the data from this Website to crop it or...?
>>
>> Thank you,
>>
>> --
>> Serge
>>
>>
>> --
>> Serge
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
>
> --
> Serge
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>



--
*************************************************
Dr. Yaqiang Wang
Chinese Academy of Meteorological Sciences (CAMS)
46, Zhong-Guan-Cun South Avenue
Beijing, 100081
China

yaqiang.wang at gmail.com<mailto:yaqiang.wang at gmail.com>
**************************************************

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr



--
Serge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110912/52babf1b/attachment-0003.html 


More information about the gradsusr mailing list