Re: png output filename issue

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 19 2010 - 15:06:13 MDT

TJ,

I should have mentioned this in my last reply. You can use "system" to rename the file after it is created. You will need to call "delete(wks)" before you rename the file, however. The "delete" command closes the file for you.

Try this, after you are completely finished drawing your graphics to "wks":

delete(wks)
system("mv " + wind_gram + ".000001.png " + wind_gram + ".png")

--Mary

>> wks = gsn_open_wks(type, windgram)
>> which produced a file as expected,
>> ./test/2010-07-19_BlackLZ_windgram.ncgm
>>
>> When I change it to
>> type = "png"
>> wks = gsn_open_wks(type, windgram)
>>
>> The file output I get is:
>> ./test/2010-07-19_BlackLZ_windgram.000001.png

On Jul 19, 2010, at 2:07 PM, wxtofly wrote:

>
> Thanks for the replies. In the post referred to below, the ticket refers to "a single image from a script", I create within a loop multiple images with different names based on inputs to the script, will that work under the envisioned scheme? Under the current scheme it creates separate files each with a .000001 in it.
>
> Where within a script would the image file that has been created with the .000001 be closed, so that I could immediately rename it.
>
> Now that I understand how it works, however, the fix is straightforward from my end, thanks to the utility mmv.
>
> TJ Olney
>
> On 07/19/2010 12:39 PM, Mary Haley wrote:
>>
>> Hi TJ,
>>
>> This is not a bug or a bad installation. Please see:
>>
>> http://www.ncl.ucar.edu/Support/talk_archives/2010/1411.html
>>
>> --Mary
>>
>>
>> On Jul 19, 2010, at 1:06 PM, wxtofly wrote:
>>
>>> I am trying to get the new NCL v 5.2 png driver to work for, previously, I had the lines:
>>> outdir="./test"
>>> type = "ncgm"
>>> windgram=outdir+day+"_"+sites(ns)+"_windgram"
>>> wks = gsn_open_wks(type, windgram)
>>> which produced a file as expected,
>>> ./test/2010-07-19_BlackLZ_windgram.ncgm
>>>
>>> When I change it to
>>> type = "png"
>>> wks = gsn_open_wks(type, windgram)
>>>
>>> The file output I get is:
>>> ./test/2010-07-19_BlackLZ_windgram.000001.png
>>>
>>> Is there some other resource or something I have to change to suppress the .000001 part of the file name?
>>>
>>> Might I have a bad installation of some new ncl file? ( I had been getting different results, but reinstalled $NCARG_ROOT/lib/ncarg/nclscripts/* and now get the above.)
>>>
>>> The png output file is very nice, better resolution and without the aliasing that the ncgm to png conversion process I had been using has, but it would be nice not to have to rename it each time.
>>>
>>> I do see that in gsn_code.ncl ncgm has a slightly different treatment than png, but I don't understand the significance of it.
>>>
>>> TJ Olney
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> TJ's Blanchard Page <ene3.ico> My Wx Widget <ebeywings.ico> Ft Ebey (Whidbey) <nwsicon.ico>NWS Seattle <raspicon16.png>ASP
> <skewt.ico>: MAPS/RUC2 <skewt.ico> | <llapse1.png> Lo Alt | MM5 <skewt.ico> <nwsicon.ico>Bham Obs <fireSky.gif>Fire Winds Rasp <skewt.ico>Soundings
> Winds Aloft R♥sp Visible Satellite <discuss.jpg> Fcst Discussion <ca_icon.ico>Fraser Valley <windgramico.png> Windgrams text
> <nwsicon.ico> Blanchard Digital | ♥Meteogram ♦UW Satellite | Loop ♥ <discuss.jpg>Discussion With Images <nwsicon.ico>Windcast <blipspot1.ico>Blipspots
> ♦ Quick Radar ♥ <nwsicon.ico> NWS Radar 9 Meso-stations Pressure gradients WA Meso Stations map <wbarb3.png>Time/hght/wind
> MesoW GoogleMaps <findu.ico>aprs current <wunder.ico>Personal Wx Stations ♣ <nwsicon.ico>Wind Map now, sfc winds | bl winds
> RASP Regional Atmospheric Soaring Predictions for PNW || Average BL wind loop Blanchard
> Surface wind forecast Loops: | Animated Radar | | loop Blanchard | loop PNW | loop FtEbey | loop Tiger | loop FraserValley
>
> Layered by altitude Sea Level to 850mb (approx 5000 ft) looped by time wind forecasts:
> Blanchard Pressure Level Loop | Tiger Pressure Level Loop | Fraser Valley Pressure Level Loop
> All day hour-by-hour text RUC2/MAPS soundings
> These have no graphics and are designed to be printed to take with you to the site.
> After sunclipse there will be one run for the next day but it only has MAPS soundings.
> Woodside/Sumas/Bridal Black Mt Big Johnson Stewart same as Blanchard Ft Ebey Skagit Valley Tiger Blipsp⊕ts: | Baldy | BJ | Black | BlackLZ | Blanchard | Chelan | Iron | Saddle | Stewart | Tiger | FtEbey | Woodside | Bridal Falls
> | Current Rapid Update Soundings for flying sites | Winds aloft Seatac & Vancouver | Visible Satellite zoomed | NWS forecasts |
> Abbreviated pages for mobile devices. | Blanchard | Tiger | Ft Ebey | East Side
> The Seattle Forecast Discussion "translated" or with maps or original form without maps (available sooner) Learn to read the maps. Soundings Tutorial
> Cloud Forecast -- RUC based Meteogram for KBLI Bellingham | RUC based Meteogram for CYXX Abbotsford -- Cloud Forecast
> TJ Olney Weather: Site Map
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 19 15:06:20 2010

This archive was generated by hypermail 2.1.8 : Wed Jul 28 2010 - 10:42:06 MDT