<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thanks Alan,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Just reordering it while plotting worked.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Sourav<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Alan Brammer <abrammer@albany.edu><br>
<b>Sent:</b> Tuesday, December 19, 2017 2:57:56 PM<br>
<b>To:</b> Sourav Chatterjee<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Latitude units assignment</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">Possibly 2 things:</div>
<div class=""><br class="">
</div>
<div class="">1. </div>
<div class="">Would help to see the printVarSummary(sst) outputs, but I think you might be missing the actual coordinate values. You named the dimension and set the units, but that doesn’t set the values. </div>
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div class="">sst!1 = "longitude"<br class="">
sst!2 = “latitude”</div>
</div>
</blockquote>
sst&latitude = f->Latitude ;; assuming there is a variable in the file <br class="">
sst&longitude = f->Longitude<br class="">
<blockquote type="cite" class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div class="">sst&latitude@units = "degrees_north"<br class="">
sst&longitude@units =“degrees_east"</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">When you printVarSummary(sst) you want to see values in the “Coordinates:” section of the output (highlighted below).</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Variable: example</div>
<div class="">...</div>
<div class="">Number of Dimensions: 2</div>
<div class="">Dimensions and sizes:<span class="x_Apple-tab-span" style="white-space:pre">
</span>[lat | 10] x [lon | 10]</div>
<div class="">Coordinates:</div>
<div class=""><b class=""> lat: [ 0.. 9]</b></div>
<div class=""><b class=""> lon: [ 0.. 9]</b></div>
<div class="">Number Of Attributes: 1</div>
<div class=""> _FillValue :<span class="x_Apple-tab-span" style="white-space:pre">
</span>9.96921e+36</div>
</div>
<div class=""><br class="">
</div>
<div class="">If this doesn’t work, include the printVarSummary(sst) outputs you’re getting. </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">2. </div>
<div class="">Would also help to see the line that actually gives you the error. </div>
<div class="">From gsn_csm_contour_map() "<span class="" style="color:rgb(51,51,51); font-family:verdana,sans-serif; font-size:13.333333015441895px">If</span><span class="" style="color:rgb(51,51,51); font-family:verdana,sans-serif; font-size:13.333333015441895px"> </span><em class="" style="color:rgb(51,51,51); font-family:verdana,sans-serif; font-size:13.333333015441895px; margin:0px; padding:0px">data</em><span class="" style="color:rgb(51,51,51); font-family:verdana,sans-serif; font-size:13.333333015441895px"> </span><span class="" style="color:rgb(51,51,51); font-family:verdana,sans-serif; font-size:13.333333015441895px">is
two-dimensional, then the leftmost dimension is represented on the Y (latitude) axis, and the rightmost dimension on the X (longitude) axis."</span></div>
<div class=""><br class="">
</div>
<div class="">Currently your data is not ordered in this manner, so a simple way to plot it would be :</div>
<div class="">time_index = 0</div>
<div class=""> plot = gsn_csm_contour_map(wks, sst( Time | time_index, latitude | :, longitude | : ), res)</div>
<div class=""><br class="">
</div>
<div class="">See the reference manual here: <a href="http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#NamedSubscripting" class="">http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#NamedSubscripting</a></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Good luck, </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Alan</div>
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 19 Dec 2017, at 09:26, Sourav Chatterjee via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; font-size:12pt; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div class="" style="margin-top:0px; margin-bottom:0px">Hi,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">My original variable is as below:</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class=""> float SLA(Time, Longitude, Latitude) ;<br class="">
SLA:_FillValue = 9.96921e+36f ;<br class="">
SLA:scale_factor = 1.f ;<br class="">
SLA:coordinates = "Sea Level Anomaly Estimate" ;<br class="">
SLA:add_offset = 0.f ;<br class="">
SLA:long_name = "Sea Level Anomaly Estimate" ;<br class="">
SLA:standard_name = "Sea Level Anomaly Estimate" ;<br class="">
SLA:units = "m" ;<br class="">
<br class="">
</div>
As the lat lon dimensions has no units I was not getting the plot properly.<span class="x_Apple-converted-space"> </span><br class="">
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">I tried this:</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class=""></div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="">sst = f->SLA<br class="">
printVarSummary(sst)<br class="">
<br class="">
sst!1 = "longitude"<br class="">
sst!2 = "latitude"<br class="">
<br class="">
sst&latitude@units = "degrees_north"<br class="">
sst&longitude@units ="degrees_east"<br class="">
<br class="">
printVarSummary(sst)</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">But still getting the error,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class=""><br class="">
(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.<br class="">
(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:<span class="x_Apple-converted-space"> </span><br class="">
<br class="">
</div>
Why is the units attribute is not getting assigned?
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Thanks</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Sourav<br class="">
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; float:none; display:inline!important">ncl-talk
mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">
<a href="mailto:ncl-talk@ucar.edu" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">ncl-talk@ucar.edu</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; float:none; display:inline!important">List
instructions, subscriber options, unsubscribe:</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>