<div dir="ltr"><div>Hi Tabish,</div><div><br></div><div>I ran your script untouched on my Mac, and I got a plot with filled contours. But oddly enough, it had no labelling or contour lines!? I ran the script on my linux machine, and it came out perfect. Both plots are attached.</div><div><br></div><div>I don't have a good explanation. I thought there might be a difference in the default resources specified in the .hluresfile, but that is not the case. We used to see an issue where plots didn't get fully flushed in laptops with Intel graphics hardware, but that's not the case here either. Both my Mac and linux machine have ncl installations via miniconda. <br></div><div><br></div><div>I'm not sure what to advise here. Perhaps someone else may have some insights?</div><div><br></div><div>I wish I had a better answer...</div><div>Rick</div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2024 at 10:02 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Tabish,</div><div><br></div><div>I'm not seeing the problem -- it is indeed a straightforward script. If you can send me that dataset, I'll take a closer look into it.</div><div><br></div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2024 at 9:49 AM Tabish Ansari via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I have a cropped dataset over northern China from the CAMS Reanalyses product which contains 3-hourly PM2.5 concentrations for the year 2019. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Here's the variable metadata:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"> short pm2p5(time, latitude, longitude) ;<br> pm2p5:scale_factor = 7.76424835780384e-11 ;<br> pm2p5:add_offset = 2.54403361691801e-06 ;<br> pm2p5:_FillValue = -32767s ;<br> pm2p5:missing_value = -32767s ;<br> pm2p5:units = "kg m**-3" ;<br> pm2p5:long_name = "Particulate matter d < 2.5 um" ;<br> pm2p5:standard_name = "mass_concentration_of_pm2p5_ambient_aerosol_particles_in_air" ;<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I've written a fairly straightforward NCL script just to plot the annual average PM2.5 concentration. It shows the map with contour lines and an appropriately ranged labelbar but with no colors within the map.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Here's my script:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">==============================================================================</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><font color="#0000ff">begin<br><br>;SOURCING FILES<br>DIR = "/worknb/users/tans/Capstone-Maya/"<br>a = addfile(DIR+"CAMSconc_3hourly_NCP2019.nc","r")<br><br><br>;READING DATA<br>pm25NCP = short2flt(a->pm2p5)<br>pm25NCP = pm25NCP * 10^9<br>pm25NCP = pm25NCP(:,::-1,:) ; flipping latitudes to correct the inverted data<br><br><br>;PREPARING TIME-AVERAGED DATA<br>pm25NCPavg = dim_avg_n_Wrap(pm25NCP,0)<br>printVarSummary(pm25NCPavg)<br>printMinMax(pm25NCPavg,True)<br><br><br>;START THE GRAPHICS<br>wks = gsn_open_wks("x11","NCPavgconc")<br>res = True<br>res@gsnMaximize = True ; Maximize plot in frame<br>res@cnFillOn = True ; turn on color<br>;res@cnFillPalette = "MPL_Reds" ; set color map<br>res@cnLinesOn = True ; turn contour lines on/off<br>res@gsnAddCyclic = False<br>res@mpFillOn = True<br><br>;SELECT NCP REGION FROM THE GLOBE<br>res@mpProjection = "Mercator"<br>res@mpLambertParallel1F = 30.<br>res@mpLambertParallel2F = 40.<br>res@mpLambertMeridianF = 115.<br><br>res@mpLimitMode = "Corners" ; choose region of map<br>res@mpLeftCornerLatF = 20.<br>res@mpLeftCornerLonF = 100.<br>res@mpRightCornerLatF = 50.<br>res@mpRightCornerLonF = 130.<br><br>plot = gsn_csm_contour_map(wks, pm25NCPavg, res)<br><br>end</font><br>===================================================================</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">The output of the script is as follows:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><font color="#0000ff"> Copyright (C) 1995-2019 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.6.2<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br><br>Variable: pm25NCPavg<br>Type: float<br>Total Size: 6724 bytes<br> 1681 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [latitude | 41] x [longitude | 41]<br>Coordinates:<br> latitude: [20..50]<br> longitude: [100..130]<br>Number Of Attributes: 8<br> _FillValue : -32767<br> units : kg m**-3<br> long_name : Particulate matter d < 2.5 um<br> standard_name : mass_concentration_of_pm2p5_ambient_aerosol_particles_in_air<br> _FillValue_original : -32767<br> missing_value_original : -32767<br> missing_value : -32767<br> average_op_ncl : dim_avg_n over dimension(s): time<br>(0)<br>(0) Particulate matter d < 2.5 um (kg m**-3) : min=3.35468 max=205.552</font><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">And I have attached the resulting map as a png file.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I'd really appreciate it if someone can point out what is needed for the plot to show the contour colors. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks a lot.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">best regards,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Tabish</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"> </div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><font face="trebuchet ms, sans-serif" color="#666666">--------------------------------------------------------------------------------------<br><span style="background-color:rgb(255,255,255)">Dr Tabish Ansari</span></font></div><div><font face="trebuchet ms, sans-serif" color="#666666">Research Associate </font></div><div><font face="trebuchet ms, sans-serif" color="#666666">Air Quality Modelling Group</font></div><div><span style="background-color:rgb(255,255,255)"><span style="font-weight:normal"><font face="trebuchet ms, sans-serif" color="#666666">Research Institute for Sustainability (RIFS) - Helmholtz Centre Potsdam </font></span></span></div><div><font face="trebuchet ms, sans-serif" color="#666666">Potsdam, Germany</font></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
</blockquote></div>