<div dir="ltr"><div><div><div><div>Hi Mary,<br></div> Thanks for your suggestions. I have modified my script as per your suggestion, but the issue is LH4 level dimension is in Km unit whereas, wscale level unit is in hpa. If I am trying to select the levels same for both the variable (say 25 levels for LH4 and for wscale) then both the plot is not covering same height.<br>
</div>Is there any way to solve this isuue? Can I convert my data variable LH4 from Km to hpa or wscale hpa to Km in ncl?<br><br></div>Thanks,<br></div>Ipsita<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Aug 20, 2014 at 12:27 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default" style="font-size:small">Ipsita,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for providing your code and data.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm a bit confused by the code, because the "LH4" variable purposely has all the metadata stripped off by this command:</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"> LH4=(/L3*24/)</div><div style="font-size:small"><div><div><br>You want to preserve metadata, especially coordinate arrays, if you are going to be plotting and/or overlaying variables.</div>
<div><br></div><div><div> LH4=L3</div><div> LH4=L3*24 ; preserve metadata</div></div><div><br></div></div><div>You also want to do this for "wscale":</div><div><div><br>
wscale=W <span style="white-space:pre-wrap">        </span> ; Trick for copying metadata </div><div> wscale=W*scale</div></div><div><br></div><div>The above two lines could also be done like this:</div>
<div><br></div><div><div> wscale=W*scale</div><div> copy_VarMeta(W,wscale) ; Copy all metadata from W to wscale</div></div><div><br></div><div>Another issue is you are plotting LH4 using "gsn_contour" instead of "gsn_csm_contour". You want to use "gsn_csm_xxxx" scripts where possible, because they examine your variable to check for metadata, and will use that metadata, including coordinate arrays, to correctly plot it.<br>
</div></div><div style="font-size:small"><br></div><div style="font-size:small">Even with these corrections, the overlay is not going to work properly because your "lev" coordinate array is different in for your LH4 variable than it is for your wscale/U variables. In order for "overlay" to work, your X/Y coordinate arrays must be in the same data space.</div>
<div style="font-size:small"><br></div><div style="font-size:small">For LH4, note that the "lev" values go from 0 to 14:</div><div style="font-size:small"><br></div><div><div>Variable: LH4</div><div>
Type: float</div><div>Total Size: 164160 bytes</div><div> 41040 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[lev | 57] x [lon | 720]</div>
<div>Coordinates: </div><div> lev: [ 0.. 14]</div><div> lon: [-179.75..179.75]</div><div><br></div><div>For wscale "levels" looks like this:</div><div>
<br></div><div><div>Variable: wscale</div><div>Type: float</div><div>Total Size: 72000 bytes</div><div> 18000 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[levels | 25] x [lon | 720]</div>
<div>Coordinates: </div><div> levels: [1000.. 100]</div><div> lon: [-180..179.5]</div><div><br></div><div>Finally, you are calling "draw()", but you need to also call "frame(wks)" after the "draw" command so that the graphic is ended properly.</div>
<div><br></div><div>Please fix these issues and post to ncl-talk if you continue to have problems.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Mary</div><div><br></div></font></span></div><div><br>
</div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 11:12 PM, Ipsita Putatunda <span dir="ltr"><<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div>Hi Mary,<br></div> I have tried as per your suggestion to first overlay the plots and then to attach, but it is not doing as per my requirements. As my data is from -179 to 179 longitude wise and I want to plot from -30 to -30 that is why am attaching two plots from -30 to 179 and 179 to -30 longitude. I finally want to over lay one vector plot and one contour plot. My script with data files are attached herewith.<br>
</div>Any help will be appreciated.<br><br></div>Thanks,<br></div>Ipsita<br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1">
<a href="https://docs.google.com/file/d/0B438RTfd8A-Nc1NXeHNzMHZHekE/edit?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:medium none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">GLOBAL_SON.nc</span></a></div>
<br><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1">
<a href="https://docs.google.com/file/d/0B438RTfd8A-NSGR3XzJGbHo3OHc/edit?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:medium none;width:100%" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">MERRA_regrid.nc</span></a></div>
<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 14, 2014 at 9:03 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Ipsita,</div><div class="gmail_default" style="font-size:small">
<br></div><div class="gmail_default" style="font-size:small">I'm not exactly sure how you want your final plot to look, but the "overlay" procedure really is meant to be used to do simply overlays of say, contours on a map, or vectors on contours on a map, etc.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It looks like you are trying to attach some plots via X and/or Y axes, and then try to use these as overlays, which won't work. The gsn_attach_plots (which is perhaps poorly named) is simply meant to join several plots together along a given axis.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My suggestion is to overlay the plots *before* you call gsn_attach_plots.</div><div class="gmail_default" style="font-size:small">
<br></div><div class="gmail_default" style="font-size:small">If you continue to have problems, please describe your desired result in more detail, and what you are currently getting of your script that isn't correct. </div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As always, it helps if you can provide a full script and your data so we can run the script here.</div><div class="gmail_default" style="font-size:small">
<br></div><div class="gmail_default" style="font-size:small">Thanks,</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><br><div class="gmail_quote"><div><div>On Wed, Aug 13, 2014 at 1:18 PM, Ipsita Putatunda <span dir="ltr"><<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div> I want to get an overlay plot of two plots which are created by attached plot. I have tried with overlay function which is not giving my desired plot. I tried with setting vpXF, vpYF for each plot also, but still am not getting overlaid plot. Is attaching plots before overlaying is causing the problem? Plotting part of my script is attached herewith.</div>
<div>Please help me to solve this issue.</div><div><br></div><div>Thanks,</div><div>Ipsita</div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>