<div dir="ltr"><div><div>This thread is very confusing [to me]. I have not looked at the script or data. It seems some &#39;custom processing&#39; task is being described. <br><br>You use the word &quot;conform&quot; rather loosely from my perspective. <br><br>&quot;conform a vector X of length, say 10, with another vector B of length 20&quot;<br><br></div><div>X(10), B(20)<br></div><div><br></div>NCL&#39;s  &#39;conform&#39; and &#39;conform_dims&#39; **require** that some dimension size &#39;match&#39;. Sizes 10 and 20 do not conform.<br><br></div><div>Do you mean &#39;merge&#39;?<br><br>X = ispan(1,10,1)<br></div><div>B = ispan(1,20,1)<br>XB = array_append_record(X, B, 0)      ; XB(30)<br>XB_unique = get_unique_values(XB)   <br></div><div>print(XB_unique)<br></div><div><br>Variable: XB_unique<br>Type: integer<br>Total Size: 80 bytes<br>            20 values<br>Number of Dimensions: 1<br>Dimensions and sizes:   [20]<br>Coordinates: <br><br>(0)     1<br>(1)     2<br>(2)     3<br></div><div>        [snip]<br></div><div>(17)    18<br>(18)    19<br>(19)    20<br><br></div><div><br>------------<br><br><br><br><br></div> <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 1:41 PM, Marston Johnston <span dir="ltr">&lt;<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Hi Mary,
<div><br>
</div>
<div>I understood what you meant. Apologies for the ambiguity.</div>
<div>My script is a long one and it is not yet a running smoothly and bug-free.</div>
<div>I’ve sent an attachment along with a subset of the data: </div>
<div><br>
</div>
<div><a href="https://www.dropbox.com/sh/gac3w26dzdtpd8y/AACrzZSVc3Fj5Dinh137E9Ywa?dl=0" target="_blank">https://www.dropbox.com/sh/<wbr>gac3w26dzdtpd8y/<wbr>AACrzZSVc3Fj5Dinh137E9Ywa?dl=0</a></div>
<div><br>
</div>
<div>I’m rethinking how to best bin and average the data. There is still problem, which I sent in as a issue today and that is how to I conform a vector X of length, say 10, with another vector B of length 20, for example ( see line 154).</div>
<div><br>
</div>
<div>As you can see from the script I use the model&#39;s lat lon to for the grid on which the MHS data is binned. In this case I’m using a square grid where the lat and lon spacing are equal. The lats and lons are from the model are not changed, which is why I
 suspect the binning. </div>
<div><br>
</div>
<div>Of course this is not the plot script as there is another averaging script in between. This is why I was hesitant to send any data as I’m trying to eliminate much of the secondary averaging and ensure this initial binning of the data is done correctly.</div>
<div><br>
</div>
<div>I would appreciate any tips you can give on making the attached script more efficient.</div>
<div><br>
</div>
<div>One idea I have is to use the bin_sum function and just do a running mean instead of saving the daily means. </div>
</div><span class="">
<div name="messageSignatureSection"><br>
<div class="m_-3194902180532696216matchFont">/M<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Marston S. Johnston, PhD<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Department of Earth Sciences<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
University of Gothenburg, Sweden<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Email: <a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
SkypeID: marston.johnston<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">+46-31-7864901</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Only the fruitful thing is true!</div>
</div>
</span><div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><span class="">
<br>
<br>
On 26 Jan 2017, 18:20 +0100, Mary Haley , wrote:<br>
</span><blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #1abc9c">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Marston,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">To be clear, I don&#39;t think you should set tfDoNHiDCOverlay at all!  I was asking if you were doing this, because that&#39;s what could make your plot wrong.</div><div><div class="h5">
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I don&#39;t think you should need to regrid the data to plot it, either.  You really should be able to plot the observational values as they are.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">It&#39;s hard for us to debug a problem if we can&#39;t see your script. If you can send this, then I might have a better idea of what&#39;s going on. It also helps if you can provide the data.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">--Mary</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div></div></div><div><div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jan 26, 2017 at 9:48 AM, GMAIL <span dir="ltr">&lt;<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:5px 5px;padding-left:10px;border-left:thin solid #e67e22">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Hi Mary,
<div><br>
</div>
<div>I’m still working on this. I’ve not set the <font size="2">tfDoNDCOverlay and what I realised is that my model doesn’t have a square grid, i.e., the </font></div>
<div><font size="2">spacing in the lat and lon directions are slightly different. I’m regridding instead to a square grid and then binning the MHS data to the square grid. If this fails I’ll plot the lat and lon values as you suggested and contact you again
 with more information for some help.</font></div>
<div><font size="2">Appreciate the tip :-)</font></div>
<div><font size="2"><br>
</font></div>
<div><font size="2">/M</font></div>
</div>
<div>
<div class="m_-3194902180532696216h5">
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br>
On 26 Jan 2017, 06:18 +0100, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;, wrote:<br>
<blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #3498db">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Marston,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">There could be a few things going on here.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">One is simply that your lat/lon values are not quite correct.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Are you setting tfDoNDCOverlay to True by any chance? If you are trying to use a native projection and you don&#39;t have the native projection parameters set exactly right, then the plot can be slightly misaligned.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">One thing I would suggest is plotting the observational lat/lon values as markers on your second plot to see if they are also misaligned with the coastlines. You should be able to use gsn_add_polymarker to
 plot the markers.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Finally, as usual, if you can provide the data for the observational plot, and a script, then I can take a look.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">--Mary</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 25, 2017 at 3:17 AM, Marston Johnston <span dir="ltr">
&lt;<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:5px 5px;padding-left:10px;border-left:thin solid #d35400">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<div>Hi,</div>
<div><br>
</div>
<div>I’ve binned (bin_sum) some MHS data to a model grid using rational lats and lons values (see linked <a href="https://www.dropbox.com/s/fi6s577iio47u4w/mhs_t511_si_contour.pdf?dl=0" target="_blank">fig</a>).</div>
<div>The upper panel in the figure is the model data but the bottom figure is from the observations. As you can see the</div>
<div>coastlines are slightly off and I cannot figure out why. Does anyone have any idea why this is happening to the bin_sum figure?</div>
<div>I’ve used the same set of lats and lons consistently throughout the process.</div>
<div><br>
</div>
<div>Any hint/help is appreciated.</div>
</div>
<div name="messageSignatureSection"><br>
<div class="m_-3194902180532696216m_-5902792530341305872m_8682350863920045591matchFont">/M<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Marston S. Johnston, PhD<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Department of Earth Sciences<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
University of Gothenburg, Sweden<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Email: <a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
SkypeID: marston.johnston<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">
+46-31-7864901</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Only the fruitful thing is true!</div>
</div>
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br>
<br>
<blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #34495e">
<div name="messageSignatureSection"></div>
</blockquote>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></blockquote><div><div class="h5">
<br>
<br>
On 26 Jan 2017, 06:18 +0100, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;, wrote:<br>
<blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #1abc9c">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Marston,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">There could be a few things going on here.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">One is simply that your lat/lon values are not quite correct.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Are you setting tfDoNDCOverlay to True by any chance? If you are trying to use a native projection and you don&#39;t have the native projection parameters set exactly right, then the plot can be slightly misaligned.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">One thing I would suggest is plotting the observational lat/lon values as markers on your second plot to see if they are also misaligned with the coastlines. You should be able to use gsn_add_polymarker to
 plot the markers.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Finally, as usual, if you can provide the data for the observational plot, and a script, then I can take a look.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">--Mary</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 25, 2017 at 3:17 AM, Marston Johnston <span dir="ltr">
&lt;<a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:5px 5px;padding-left:10px;border-left:thin solid #e67e22">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<div>Hi,</div>
<div><br>
</div>
<div>I’ve binned (bin_sum) some MHS data to a model grid using rational lats and lons values (see linked <a href="https://www.dropbox.com/s/fi6s577iio47u4w/mhs_t511_si_contour.pdf?dl=0" target="_blank">fig</a>).</div>
<div>The upper panel in the figure is the model data but the bottom figure is from the observations. As you can see the</div>
<div>coastlines are slightly off and I cannot figure out why. Does anyone have any idea why this is happening to the bin_sum figure?</div>
<div>I’ve used the same set of lats and lons consistently throughout the process.</div>
<div><br>
</div>
<div>Any hint/help is appreciated.</div>
</div>
<div name="messageSignatureSection"><br>
<div class="m_-3194902180532696216m_-5902792530341305872m_8682350863920045591matchFont">/M<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Marston S. Johnston, PhD<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Department of Earth Sciences<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
University of Gothenburg, Sweden<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Email: <a href="mailto:marston.johnston@gu.se" target="_blank">marston.johnston@gu.se</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
SkypeID: marston.johnston<br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">
+46-31-7864901</a><br style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
Only the fruitful thing is true!</div>
</div>
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<br>
<br>
<blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #3498db">
<div name="messageSignatureSection"></div>
</blockquote>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
</blockquote>
<br>
<br>
<br>
<blockquote type="cite" style="margin:5px 5px;padding-left:10px;border-left:thin solid #1abc9c">
<div name="messageSignatureSection"></div>
</blockquote>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>