<div dir="ltr">That was exactly the problem!, now I'm able to cut all images previous to do the animation.<br><br><br>Thank you everybody,<br>I do really appreciate your help,<br>All the best,<br>Sebastián.<br><br><br><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 20, 2015 at 8:40 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The 'cmd' variable should contain exactly what you would type at the<br>
[u/li]nix prompt. **That includes spaces**<br>
<br>
You should try some manual debugging.<br>
<br>
%>ncl<br>
<br>
it = 0<br>
<span class=""> cmd="convert -trim "+ "animate"+sprinti("%03i",it)+".png"<br>
</span> print(cmd)<br>
<span class=""><br>
cmd="convert -trim "+ "animate"+sprinti("%03i",it)+".png" "animate"<br>
<br>
</span> ^<br>
<br>
no space<br>
error ... you have no space between png and animate!!!<br>
=========================================================<br>
The following has an explicit space ... +" "+ ...<br>
<br>
cmd="convert -trim "animate"+sprinti("%03i",it)+".png"+" "+<br>
<span class="">"animate"+sprinti("%03i",it)+".png"<br>
<br>
</span>better, less busy<br>
<br>
it=123<br>
<span class="">cmd="convert -trim animate"+sprinti("%03i",it)+".png<br>
animate"+sprinti("%03i",it)+".png"<br>
</span>print(cmd)<br>
================<br>
<span class=""><br>
Variable: cmd<br>
Type: string<br>
Total Size: 8 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
<br>
</span>(0) convert -trim animate123.png animate123.png<br>
<br>
<br>
<br>
On Thu, Aug 20, 2015 at 4:38 PM, Sebastian Otarola-Bustos<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br>
> Hi,<br>
><br>
> I attached you the error, I'm not able to read this line, should be<br>
> something wrong on it:<br>
><br>
> cmd="convert -trim "animate"+sprinti("%03i",it)+".png"<br>
> "animate"+sprinti("%03i",it)+".png"<br>
><br>
> The print command didn't work, cause the error is in the line before.<br>
><br>
><br>
> Someone see something wrong? I'll continue searching for something.<br>
><br>
> Thank you very much.<br>
> All the best,<br>
> Sebastián.<br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Thu, Aug 20, 2015 at 5:01 PM, Adam Phillips <<a href="mailto:asphilli@ucar.edu">asphilli@ucar.edu</a>> wrote:<br>
>><br>
>> Hi Sebastián,<br>
>> What is the error message that you are getting? Also, right before the<br>
>> system(cmd) line, can you add the following line:<br>
>> print(cmd)<br>
>> and report back to ncl-talk with the resulting output..<br>
>> Thanks..<br>
>> Adam<br>
>><br>
>><br>
>><br>
>> On Wed, Aug 19, 2015 at 9:57 PM, Sebastian Otarola-Bustos<br>
>> <<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br>
>>><br>
>>> Hi, The other day I tried the improvement, but it didn't work. Here is<br>
>>> what I did:<br>
>>><br>
>>> do it=0,N_times-1<br>
>>><br>
>>> u300w = fall[it]->UGRD_P0_L100_GLL0({levs},::-1,:)<br>
>>> v300w = fall[it]->VGRD_P0_L100_GLL0({levs},::-1,:)<br>
>>> hgt300= fall[it]->HGT_P0_L100_GLL0({levs(k)},:,:)<br>
>>> hgt300@units = "m"<br>
>>> tmp300 = fall[it]->TMP_P0_L100_GLL0({levs},::-1,:)<br>
>>> lat = fall[it]->lat_0(::-1)<br>
>>> T300=tmp300({levs(k)},:,:)<br>
>>> T300=T300-273.15<br>
>>> U300=u300w({levs(k)},:,:)<br>
>>> V300=v300w({levs(k)},:,:)<br>
>>> wks_type = "png"<br>
>>> wks_type@wkWidth = 1700<br>
>>> wks_type@wkHeight = 1700<br>
>>><br>
>>> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br>
>>><br>
>>> mpid = gsn_csm_map(wks,mpres)<br>
>>> hnid = gsn_csm_contour(wks,hgt300(:,:),hres)<br>
>>> T_300 = gsn_csm_contour(wks,T300,Tres)<br>
>>> V_300 =gsn_csm_vector(wks,U300,V300,Vres)<br>
>>><br>
>>> ;Overlaps maps in order<br>
>>> overlay(mpid,hnid)<br>
>>> overlay(mpid,T_300)<br>
>>> overlay(mpid,V_300)<br>
>>><br>
>>> maximize_output(wks,True)<br>
>>> ;el comando maximize_output hace lo que hacia frame<br>
>>> delete(wks)<br>
>>> cmd="convert -trim "+ "animate"+sprinti("%03i",it)+".png"<br>
>>> "animate"+sprinti("%03i",it)+".png"<br>
>>> system(cmd)<br>
>>> end do<br>
>>><br>
>>><br>
>>> It's throwing me error when I tried to use the convert command. I was<br>
>>> able to use it without problems for one file, but not yet inside a loop.<br>
>>><br>
>>><br>
>>> Any help would be really helpful,<br>
>>><br>
>>> All the best,<br>
>>> Sebastián.<br>
>>><br>
>>><br>
>>> On Sat, Aug 8, 2015 at 11:43 AM, Adam Phillips <<a href="mailto:asphilli@ucar.edu">asphilli@ucar.edu</a>> wrote:<br>
>>>><br>
>>>> Hi Sebastián,<br>
>>>> You need to delete the workstation before you call convert otherwise you<br>
>>>> will get an error message:<br>
>>>><br>
>>>> do it=0,1<br>
>>>> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br>
>>>> ..........<br>
>>>> plot = ..........<br>
>>>> delete(wks)<br>
>>>> system("convert -trim"animate"+sprinti("%03i",it)+".png"<br>
>>>> "animate"+sprinti("%03i",it)+".png")<br>
>>>> end do<br>
>>>><br>
>>>> Hope that helps.. If not let ncl-talk know.<br>
>>>> Adam<br>
>>>><br>
>>>> On Aug 8, 2015, at 6:58 AM, Sebastian Otarola-Bustos<br>
>>>> <<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br>
>>>><br>
>>>> Thank you very much, that was really helpful! I think that my trouble is<br>
>>>> solved. By the way, and only for curiosity, you know if you can use the trim<br>
>>>> option inside a loop, to get a gif with all images without those blank<br>
>>>> spaces. Cause I tried something like this inside a loop, but it didn't<br>
>>>> work:<br>
>>>><br>
>>>> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br>
>>>><br>
>>>> system("convert -trim"animate"+sprinti("%03i",it)+".png"<br>
>>>> "animate"+sprinti("%03i",it)+".png")<br>
>>>><br>
>>>><br>
>>>> All the best,<br>
>>>><br>
>>>> Thank you a lot.<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Thu, Aug 6, 2015 at 2:42 PM, Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>> wrote:<br>
>>>>><br>
>>>>> I didn't notice this before, but you can't use the wkWidth and wkHeight<br>
>>>>> resources with PS or PDF. These width and height are for pixel sizes, which<br>
>>>>> apply to the X11 and PNG workstations only.<br>
>>>>><br>
>>>>> If you want an image to be a specific pixel size, then you need to use<br>
>>>>> "PNG" as the output. With PNG as the output, the image will not be rotated<br>
>>>>> automatically, so you don't need to set gsnPaperOrientation.<br>
>>>>><br>
>>>>> However, NCL always draws its images to a square, so your image is<br>
>>>>> going to be the smaller of the two sizes you specified: 1536 x 1536.<br>
>>>>><br>
>>>>> My suggestion is to set the size to 1700 x 1700, and then use<br>
>>>>> ImageMagick's "convert" to trim the image.<br>
>>>>><br>
>>>>> I've attached a sample script.<br>
>>>>><br>
>>>>> --Mary<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On Wed, Aug 5, 2015 at 1:46 PM, Sebastian Otarola-Bustos<br>
>>>>> <<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br>
>>>>>><br>
>>>>>> Hi,<br>
>>>>>><br>
>>>>>> Thank you very much, but it seems that doesn't works. The plot it's<br>
>>>>>> too big I think.<br>
>>>>>><br>
>>>>>><br>
>>>>>> All the best,<br>
>>>>>> Sebastián.<br>
>>>>>><br>
>>>>>> On Wed, Aug 5, 2015 at 11:19 AM, Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>> wrote:<br>
>>>>>>><br>
>>>>>>> Try setting gsnPaperOrientation with the "mpres" resources and not<br>
>>>>>>> the workstation resources.<br>
>>>>>>><br>
>>>>>>> I know this doesn't make a lot of sense, but it's when the plot is<br>
>>>>>>> being created that it needs to know that the paper is oriented one way or<br>
>>>>>>> another.<br>
>>>>>>><br>
>>>>>>> --Mary<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Tue, Aug 4, 2015 at 12:34 AM, Sebastian Otarola-Bustos<br>
>>>>>>> <<a href="mailto:Sebastian.F.Otarola-Bustos.1@nd.edu">Sebastian.F.Otarola-Bustos.1@nd.edu</a>> wrote:<br>
>>>>>>>><br>
>>>>>>>> Hi All, I was doing a gif animation in .png format, and I was able<br>
>>>>>>>> to set the width and the height, so my plots were ok. But now I'm trying to<br>
>>>>>>>> do the same with .ps format or .pdf, and I'm having some troubles. It's<br>
>>>>>>>> rotated, and the command, wks_type@gsnPaperOrientation = "portrait" is not<br>
>>>>>>>> recognized. Any suggestion?<br>
>>>>>>>> Any help would be really appreciated, below you can see what I<br>
>>>>>>>> mentioned to you from my code.<br>
>>>>>>>><br>
>>>>>>>> wks_type = "ps"<br>
>>>>>>>> ;wks_type@wkWidth = 1700<br>
>>>>>>>> ;wks_type@wkHeight = 1536<br>
>>>>>>>> wks_type@gsnPaperOrientation = "portrait"<br>
>>>>>>>><br>
>>>>>>>> wks = gsn_open_wks(wks_type,"animate"+sprinti("%03i",it))<br>
>>>>>>>><br>
>>>>>>>> mpid = gsn_csm_map(wks,mpres)<br>
>>>>>>>> hnid = gsn_csm_contour(wks,hgt300(:,:),hres)<br>
>>>>>>>> T_300 = gsn_csm_contour(wks,T300,Tres)<br>
>>>>>>>> V_300 =gsn_csm_vector(wks,U300,V300,Vres)<br>
>>>>>>>><br>
>>>>>>>> ;Overlaps maps in order<br>
>>>>>>>> overlay(mpid,hnid)<br>
>>>>>>>> overlay(mpid,T_300)<br>
>>>>>>>><br>
>>>>>>>> All the best,<br>
>>>>>>>> Sebastián.<br>
>>>>>>>><br>
>>>>>>>> _______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
>>>>>>>><br>
>>>>>>><br>
>>>>>><br>
>>>>><br>
>>>><br>
>>>> _______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Adam Phillips<br>
>> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR<br>
>> <a href="http://www.cgd.ucar.edu/staff/asphilli/" rel="noreferrer" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> <a href="tel:303-497-1726" value="+13034971726">303-497-1726</a><br>
>><br>
><br>
><br>
> _______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
><br>
</div></div></blockquote></div><br></div>