Re: read shapefile in ncl

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 09 2011 - 10:57:00 MST

Hi Lei,

There was something strange about the shapefile you were using. I tried to plot it and got a bunch of straight lines instead of a nice polyline defining the outline of China.

I went to gadm.org/countryres to download a different shapefile for China. This gives you several shapefiles, and the one I used was "CHN_adm/CHN_adm0.shp". This contains the single outline for China, while the other *.shp files in that same directory contain other smaller regions.

Please see the attached script and images. This script is a modifcation of the one you sent me.

--Mary

On Dec 8, 2011, at 5:05 PM, Lei Meng wrote:

> Hi Mary,
> I never try to make a graph. The script creates a new .nc file and the thumbnail images were taken from the new generated nc file.
> Thanks,
> Lei
>
> On Thu, Dec 8, 2011 at 4:26 PM, Mary Haley <haley@ucar.edu> wrote:
> Lei,
>
> In your NCL script, all the graphics code is commented out. Do you have a script where the graphics code is actually working?
>
> --Mary
>
> On Dec 8, 2011, at 2:13 PM, Lei Meng wrote:
>
>> Hi Mary,
>> It has been uploaded. Thanks,
>> Lei
>>
>> On Thu, Dec 8, 2011 at 3:43 PM, Mary Haley <haley@ucar.edu> wrote:
>> Sorry, you need to "cd incoming" before you put the file.
>>
>> --Mary
>>
>> On Dec 8, 2011, at 11:54 AM, Lei Meng wrote:
>>
>>> Hi Mary,
>>> I got the error message when uploading the file:
>>> ftp> put ERA-40-V1-4-allyears-monthly.nc
>>> local: ERA-40-V1-4-allyears-monthly.nc remote: ERA-40-V1-4-allyears-monthly.nc
>>> 229 Entering Extended Passive Mode (|||49152|)
>>> 553 Could not create file.
>>> Thanks,
>>> Lei
>>>
>>> On Thu, Dec 8, 2011 at 1:21 PM, Mary Haley <haley@ucar.edu> wrote:
>>> Can you provide all the data file too?
>>>
>>> ftp ftp.cgd.ucar.edu
>>> < login as anonymous, with your email as the password>
>>> put ERA-40-V1-4-allyears-monthly.nc
>>> quit
>>>
>>> I have to see where the missing values are getting set, and I can't do that without being able to run your script.
>>>
>>> Thanks,
>>>
>>> --Mary
>>>
>>> On Dec 8, 2011, at 11:12 AM, Lei Meng wrote:
>>>
>>>> Hi Mary,
>>>> Attached is the script I used. Do I have several regions in my shapefile? I thought it is just boundary of China. Thanks,
>>>> Lei
>>>>
>>>> On Thu, Dec 8, 2011 at 12:26 PM, Mary Haley <haley@ucar.edu> wrote:
>>>>
>>>> Lei,
>>>>
>>>> Thanks for providing the data files. Can you provide the script as well? It's hard to debug this based on a small thumbnail image.
>>>>
>>>> One thing that comes to mind is if you have several regions in your shapefile, you need to be careful that you don't set your data values to missing because they only fall in one of the regions.
>>>>
>>>> That is, once you find that a data point is inside one of your regions, make sure that this particular data value stays set, and that it doesn't get reset to missing just because it doesn't fall inside some other region.
>>>>
>>>> --Mary
>>>>
>>>>
>>>> On Dec 8, 2011, at 9:38 AM, Lei Meng wrote:
>>>>
>>>> > Hi,
>>>> > I was able to use a China shapefile to extract ERA40 soil moisture data for the whole country. But I found that extracted data within China contain missing data which should be valid data instead of missing value in ERA40. I attached screen shots of the extracted data and the original ERA40 data. I also attached the shapefiles I used to extract the data. Any suggestions? Thanks,
>>>> > Lei
>>>>
>>>>
>>>> <era40_china.ncl>
>>>
>>>
>>
>>
>
>
Received on Fri Dec 9 10:57:00 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 09 2011 - 13:09:09 MST