[ncl-talk] About projection in NCL
Mary Haley
haley at ucar.edu
Mon Oct 31 09:59:10 MDT 2016
Dear Tao,
It's a bit difficult to debug a long script like this without the data.
There are several potential issues with your script.
[1] You are setting some lambert conformal resources, but then plotting
over a cylindrical equidistant map. I think you need to add this:
mpres at mpProjection = "LambertConformal"
[2] You are setting these five resources:
mpres at mpLimitMode = "LatLon"
mpres at mpMinLatF = 33.5
mpres at mpMaxLatF = 38.5
mpres at mpMinLonF = 137
mpres at mpMaxLonF = 142
but generally, when you use a Lambert Conformal projection, you want to
define the two corners of the area, and not the min/max lat/lon values.
Please see this page for some examples:
http://www.ncl.ucar.edu/Applications/lcnative.shtml
[3] You are setting:
res at tfDoNDCOverlay = True
and also:
pre_res at sfXArray = lon ; Associates lat/lon
locations
pre_res at sfYArray = lat ; with data values.
which is contradictory. The first one tells NCL you want to plot the data
in its native projection, which assumes that you have done all the work of
setting the correct map resources (like you did with mpLambert
Parallel1/2F, mpMeridianF, etc). However, if you are even slightly off in
defining the native map projection, then your data will not be correctly
plotted. You only want to set sfXArray/sfYArray if you are NOT plotting
data in a native projection.
My guess is that you don't have the native map projection set up correctly,
and hence the data is skewed slightly.
To debug this problem, I suggest using your lat/lon arrays to plot the data
over a simple cylindrical equidistant map instead of plotting in a native
map projection.
I modified your script and attached it here. Since I can't run it, there
may be some errors, but hopefully you understand what it's doing.
If this plot looks correct, then what this tells you that NCL is reading
and plotting your data correctly, and that likely in your original script
you didn't have the native map projection resources set correctly. These
are the resources I would then take a closer look at to make sure they are
correct:
; zoom in map
mpres at mpLambertParallel1F = 30.0 ; two parallels
mpres at mpLambertParallel2F = 60.0
mpres at mpLambertMeridianF = 136.0 ; central meridian
mpres at mpLimitMode = "LatLon"
mpres at mpMinLatF = 33.5
mpres at mpMaxLatF = 38.5
mpres at mpMinLonF = 137
mpres at mpMaxLonF = 142
--Mary
On Fri, Oct 28, 2016 at 1:44 AM, Tao Lu <hakufu.asano at gmail.com> wrote:
> Hello Mary
>
> Thank you for your helps.
>
> About the image:
> First is [image: Inline image 1]
> This image is the graph other people put graph to google earth.
>
> Then I get the grids data, here is my image.
> [image: Inline image 2]
>
> It is obvious that the rain band in my graph drifts from the above one.
>
> Also I will attach my ncl script. The data is from composite radar rain
> data.
>
> Thank you for taking time to check it for me.
>
> On Tue, Oct 25, 2016 at 12:59 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> Tao,
>>
>> There's not enough information to go on here. Could you include the NCL
>> image, and what you expect the correct image to be?
>>
>> Also, where is the data coming from and how are you plotting it? It would
>> help if we could see an NCL script.
>>
>> --Mary
>>
>>
>> On Sun, Oct 23, 2016 at 8:06 AM, Tao Lu <hakufu.asano at gmail.com> wrote:
>>
>>> Dear ncl-talk
>>>
>>> I am plotting rain density data using ncl.
>>> The location of heavy rain is different from the graph created by others.
>>>
>>> I did not include projection in visualization and want to know whether
>>> projection affects location of plotted data?
>>>
>>> Thank you very much.
>>>
>>> Tao
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> ******************************************************
> 盧 涛 (ル タオ) 修士課程2年
>
> 〒112-8551 東京都文京区春日1-13-27
>
> 中央大学理工学研究科都市環境学専攻
>
> 河川・水文研究室(山田正教授)
>
>
> TEL: 03-3817-3406; Phone: 070-2188-7509
> Email1: hakufu.asano at gmail.com <mail%3Amet.yamos at gmail.com>
> Email2: lutao at civil.chuo-u.ac.jp <mail%3Ayamoto at civil.chuo-u.ac.jp>
> *******************************************************
> ******************************************************
> Tao Lu (M. Eng)
> Laboratory of River Engineering and Hydrology,
> Dept. of Civil and Environmental Engineering,
> Graduate School of Science and Engineering,
> Chuo University
>
> 1-13-27,Kasuga,Bunkyo-ku,Tokyo
> 112-8551, Japan
> TEL: 03-3817-1805; Phone: 070-2188-7509
> Email1: hakufu.asano at gmail.com <mail%3Amet.yamos at gmail.com>
> Email2: lutao at civil.chuo-u.ac.jp <mail%3Ayamoto at civil.chuo-u.ac.jp>
> *****************************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161031/d7b736de/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 131739 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161031/d7b736de/attachment-0002.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 756304 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161031/d7b736de/attachment-0003.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cband_ascii_to_graph_projection_fineline_mod.ncl
Type: application/octet-stream
Size: 2221 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161031/d7b736de/attachment-0001.obj
More information about the ncl-talk
mailing list