<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi Zoe,</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">If you just want to store the resultant variable (monthly averages of precipitation) to a new netcdf file, you can achieve that just by adding 2 lines of code before or after the plotting routine:</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">b = addfile("myNCfile.nc", "c") ; open in create mode<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">b->prcClm = prcClm</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">Cheers,</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"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">Tabish U Ansari<br></font></span></i></span></div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">Postdoctoral Researcher <br></font></span></i></span></div><div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">Centre for Climate and Air Pollution Studies (C-CAPS)<br></font></span></i></span></div><div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">School of Physics, NUI-Galway</font></span></i><font size="1"><span style="font-family:tahoma,sans-serif"><i><span style="font-family:verdana,sans-serif">, Ireland</span></i><br></span></font></span></div><div><span style="color:rgb(11,83,148)"><font size="1"><span style="font-family:tahoma,sans-serif"><i><span style="font-family:verdana,sans-serif">ResearchGate: <a href="https://www.researchgate.net/profile/Tabish_Ansari" target="_blank">https://www.researchgate.net/profile/Tabish_Ansari</a></span></i><br></span></font></span></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 29 Jul 2020 at 14:16, Rick Brownrigg via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">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>Hi,</div><div><br></div><div>I don't believe there's a way to do this directly with NCL. However, "gdal" is a set of utilities that are extremely useful for dealing with geospatial (raster) data. In particular, the "gdal_translate" command can convert a png to netCDF. See example 9 at the link below for an example command line invocation to convert a jpg to netCDF. Please be advised that gdal has dozens of optional libraries that can be used to build it, netCDF being one. The gdal_translate --format" command will list the formats supported by a given binary.<br></div><div><br></div><div><a href="http://ncl.ucar.edu/Applications/rgbacolor.shtml" target="_blank">http://ncl.ucar.edu/Applications/rgbacolor.shtml</a><br></div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 29, 2020 at 12:59 AM zoe jacobs 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">Dear all NCL users,<div>I have a script (attached) which gives me monthly averages of precipitation and plots the result as png files. I wonder if there is any command in NCL which could convert the png file to nc file after plot command?</div><div>Please kindly advise me in this regard,</div><div>Many thanks in advance,</div><div>Best wishes,</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></blockquote></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></blockquote></div>