[ncl-talk] contour not working with missing values in coordinate variables

xiaoming Hu yuanfangcan at hotmail.com
Mon Dec 21 21:51:00 MST 2020


Dennis
  Thanks a lot for confirming that "NCL can not plot or attempt to plot data if there are no valid coordinates. "

  Yes, I am able to plot the sub-region without missing coordinate on top of WRF domain.

  Sorry I did not clean up my script.  I will remember that in the future.

Happy holidays
Xiaoming
________________________________
From: Dennis Shea <shea at ucar.edu>
Sent: Monday, December 21, 2020 6:43 PM
To: Barry Lynn <barry.h.lynn at gmail.com>
Cc: xiaoming Hu <yuanfangcan at hotmail.com>; ncl-talk <ncl-talk at ucar.edu>; Xiaoming Hu <xhu at ou.edu>
Subject: Re: [ncl-talk] contour not working with missing values in coordinate variables

Having missing "coordinates"  [eg: latitude, longitude, level, time, etc] is not recommended by the netCDF user group.
A missing value associated with one or more missing coordinates makes no sense.

It is the users responsibility to explore the data.explore.

%> ncdhump -h   ...   | less
or
%> ncl_filedump ... | less

The attached script does that

[1] the full (800,1600) array for different variables
     NCL can not plot or attempt to plot data if there are no valid coordinates.

[2] then the subset you specified. If you extract just the sub region you specified the varble and, more importantly, the latitude/longitudes have no missing values. This can be plotted by associating the subset region latitude & longitudes to the variable.

Carefully look at the printed output to see what is happening

[3] Hopefully, you will be able to use the attached approach to work with the WRF data.

[4] Please submit clean scripts. Following heavily commented scripts is annoying and time consuming.

Stay Healthy

Merry Christmas


%> ncl ncl XiaomingHu_1.ncl




On Mon, Dec 21, 2020 at 12:35 PM Barry Lynn via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Hi:

If the nc data appears to be upside down, when you plot it, you probably need to subtract 90 degrees from your data.

Also, you should printMinMax(data, False) to see the bounds of the data you are trying to plot. If the longitude is not -180 to 180, this could also mess up your program.

Barry



On Mon, Dec 21, 2020 at 8:38 PM xiaoming Hu <yuanfangcan at hotmail.com<mailto:yuanfangcan at hotmail.com>> wrote:
Thanks!
Not quite.
What I currently plot is
[cid:17686cb0b5acb971f161]
But I would like to plot the full data (from ncveiw):
[cid:17686cb0b5acb971f162]
ncview figure appears to be up-side-down.
Thanks
Xiaoming
________________________________
From: Barry Lynn <barry.h.lynn at gmail.com<mailto:barry.h.lynn at gmail.com>>
Sent: Monday, December 21, 2020 12:27 PM
To: xiaoming Hu <yuanfangcan at hotmail.com<mailto:yuanfangcan at hotmail.com>>
Cc: ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>; Xiaoming Hu <xhu at ou.edu<mailto:xhu at ou.edu>>
Subject: Re: [ncl-talk] contour not working with missing values in coordinate variables

Hello:

You can always plot point data, interpolating it to a grid.

Perhaps this will help...?

https://www.ncl.ucar.edu/Document/Functions/Built-in/linint2_points.shtml

On Mon, Dec 21, 2020 at 7:44 PM xiaoming Hu via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Because there are missing values in the 2d latitude and longitude,  the contour plot did not work.
So I have to cut off the area with the missing coordinate variables by
  LST = f->visible_count(78:730,365:998)
  LST at lat2d = latitude(78:730,365:998)
  LST at lon2d = longitude(78:730,365:998)

But by doing so, I miss a lot of useful data.
Anyway to plot the full data?   My full script is attached
A sample data file: http://www.caps.ou.edu/micronet/SouthernOcean/Observation/satellite.SATCORPS_V2.2_HIMAWARI-8.2km.201802170000.NC
The domain I want to plot on: http://www.caps.ou.edu/micronet/SouthernOcean/Observation/wrfout_d01_2018-02-18_20:00:00
BTW: this script works very slow even when I cut off the area with missing coordinate.
Thanks a lot!
Xiaoming Hu
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk


--
Guest Editor of Special Issue “Extreme Hydroclimatic Events and Prediction”
LINK:
https://www.mdpi.com/journal/water/special_issues/Extreme_Hydroclimatic_Events

Barry H. Lynn, Ph.D
Senior Associate Scientist, 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



--
Guest Editor of Special Issue “Extreme Hydroclimatic Events and Prediction”
LINK:
https://www.mdpi.com/journal/water/special_issues/Extreme_Hydroclimatic_Events

Barry H. Lynn, Ph.D
Senior Associate Scientist, 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

_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201222/a3b96b27/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 163037 bytes
Desc: image.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201222/a3b96b27/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 129762 bytes
Desc: image.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201222/a3b96b27/attachment-0003.png>


More information about the ncl-talk mailing list