[ncl-talk] New York Map issue(s)
Barry Lynn
barry.h.lynn at gmail.com
Tue Feb 21 08:13:22 MST 2017
Hi Nick:
Thank you.
Barry
On Tue, Feb 21, 2017 at 4:54 PM, Bassill, Nicholas <nbassill at albany.edu>
wrote:
> Hi Barry,
> It's sort of a cheating method. I have point data, that I want to
> interpolate to a grid so I can map it (say, temperature). Since I can
> choose the grid I map it to, I merely pick a grid that happens to have a
> western border of exactly where the NY western border *should* be.
>
>
> Here's the relevant section of my script:
>
>
> sitefile = "currenttemp.dat"
>
> sitedata = asciiread(sitefile,-1,"string")
>
> delim = ","
>
> sitelats = tofloat(str_get_field(sitedata,1,delim))
>
> sitelons = tofloat(str_get_field(sitedata,2,delim))
>
> sitetemp = tofloat(str_get_field(sitedata,3,delim))
>
>
> lonmin = -79.76332855224604
>
> lonmax = -71.85635375976562
>
> latmin = 40.4
>
> latmax = 45.1
>
>
> newlons = fspan(lonmin,lonmax,200)
>
> newlats = fspan(latmin,latmax,200)
>
>
> latsize=(dimsizes(newlats))
>
> lonsize=(dimsizes(newlons))
>
>
> newlons at units="degrees_east"
>
> newlats at units="degrees_north"
>
>
> newdata2 = dsgrid2(sitelats,sitelons,sitetemp,newlats,newlons)
>
> newdata3 = natgrid(sitelats,sitelons,sitetemp,newlats,newlons)
>
>
> newdata = (newdata3+newdata2)/2 ; take average
>
> newdata!0="lat"
>
> newdata!1="lon"
>
> newdata&lon = newlons
>
> newdata&lat = newlats
>
> newdata at _FillValue = -999
>
>
>
> Nick Bassill, PhD
>
> Modeler & Meteorologist, New York State Mesonet
>
> LC SB-28, 1400 Washington Ave.,
>
> SUNY, University at Albany, NY 12222
> (518) 442-6375
>
> http://nysmesonet.org/
>
>
> ------------------------------
> *From:* Barry Lynn <barry.h.lynn at gmail.com>
> *Sent:* Tuesday, February 21, 2017 2:15 AM
>
> *To:* Bassill, Nicholas
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: [ncl-talk] New York Map issue(s)
>
> Hi Bassill:
>
> How do you mask the incorrect western boundary?
>
> Barry
>
> On Mon, Feb 20, 2017 at 4:57 PM, Bassill, Nicholas <nbassill at albany.edu>
> wrote:
>
>> Hi Rick,
>> Thanks for the reply. I guess I must have missed that masking doesn't
>> work with the high-res datasets, so sorry about that.
>>
>> I've played around with shapefiles a little, but in our case we're
>> interested in making some production-quality images pretty much in
>> real-time, so the issue of "missing" data near the state boundaries is kind
>> of a deal-breaker. Since all we care about is plotting the data, I think
>> the best bet for the moment is to mask with medium-res, and interpolate our
>> data to the correct western NY boundary so that the incorrect portion does
>> not plot. Something like this: http://www.atmos.albany.
>> edu/facstaff/nbassill/live/regularmercator.png
>>
>>
>> Nick Bassill, PhD
>>
>> Modeler & Meteorologist, New York State Mesonet
>>
>> LC SB-28, 1400 Washington Ave.,
>>
>> SUNY, University at Albany, NY 12222
>> (518) 442-6375
>>
>> http://nysmesonet.org/
>>
>>
>> ------------------------------
>> *From:* Rick Brownrigg <brownrig at ucar.edu>
>> *Sent:* Friday, February 17, 2017 5:24 PM
>> *To:* Bassill, Nicholas
>> *Cc:* ncl-talk at ucar.edu
>> *Subject:* Re: [ncl-talk] New York Map issue(s)
>>
>> Hi Nicholas,
>>
>> Yes, you are right about the western border issue: attached is a plot
>> showing NCL's border (in white), and the Shapefile's border (in red).
>> (this map was very quickly put together, please ignore the lack of
>> esthetics). I'm not sure we can do anything about that in the short term.
>> I'll file a bug report.
>>
>> As for the second issu, the docs do explicitly state that NCL's builtin
>> masking functions do not work with the HighRes/RANGS map databases.
>>
>> However, for both purposes, state boundaries and masking, you might want
>> to consider using a shapefile as a source. Check out the examples page for
>> both a link to a good source of shapefiles, GADM, and for examples of how
>> to use them to perform masking.
>>
>> http://ncl.ucar.edu/Applications/shapefiles.shtml
>> NCL and Shapefiles <http://ncl.ucar.edu/Applications/shapefiles.shtml>
>> ncl.ucar.edu
>> Shapefiles. Shapefiles are a supported data format. in NCL, and hence can
>> be read with addfile. Unlike other supported formats, however, a
>> "shapefile" refers to a ...
>>
>>
>>
>> Hope this helps...
>> Rick
>>
>> On Fri, Feb 17, 2017 at 8:59 AM, Bassill, Nicholas <nbassill at albany.edu>
>> wrote:
>>
>>> Hi All,
>>> New subscriber, so bear with me here. Two things - (1) a likely bug,
>>> and (2) a question. I'm using NCL 6.3.
>>>
>>>
>>> (1) It appears that the state boundaries for New York are slightly off
>>> in the far western boundary. I'm attaching an image (NY.png) that plots the
>>> state of NY, but with data that is specifically limited by the *actual*
>>> western border to demonstrate this.
>>>
>>>
>>> The relevant map settings are:
>>>
>>>
>>> res at mpDataBaseVersion = "Ncarg4_1"
>>> res at mpDataSetName = "Earth..4"
>>> res at mpFillAreaSpecifiers = (/"Land", "Land:North America:United
>>> States:Conterminous US:New York","Water"/)
>>> res at mpSpecifiedFillColors = (/"white","transparent",
>>> "white"/)
>>> res at mpInlandWaterFillColor = 238
>>> res at mpLandFillColor = -1 ; transparent
>>> res at mpOutlineOn = True
>>> res at mpMaskOutlineSpecifiers = (/"Land"/)
>>> res at mpOutlineSpecifiers = (/ "Land:North America:United
>>> States:Conterminous US:New York"/)
>>> res at mpDataBaseVersion = "MediumRes"
>>>
>>>
>>> (2) Partially based off of that, and in an effort to have a more
>>> detailed coastline, I decided to try the "HighRes" dataset. However, I am
>>> not able to successfully do any masking. In this case I want *only* a fill
>>> in the shape of NY. For this I'm attaching the dataset I'm using
>>> (currenttemp.dat), the script I'm using (temp.ncl, based largely on
>>> http://www.ncl.ucar.edu/Applications/Scripts/mask_8.ncl for the mask),
>>> and a sample image (current.png).
>>>
>>> Any help with (2) would be greatly appreciated!
>>>
>>>
>>> Nick Bassill, PhD
>>>
>>> Modeler & Meteorologist, New York State Mesonet
>>>
>>> LC SB-28, 1400 Washington Ave.,
>>>
>>> SUNY, University at Albany, NY 12222
>>> (518) 442-6375
>>>
>>> http://nysmesonet.org/
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108 <(914)%20432-3108>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581
C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170221/e83f19b7/attachment.html
More information about the ncl-talk
mailing list