Anuga-user Digest, Vol 67, Issue 4

3 views
Skip to first unread message

anuga-use...@lists.sourceforge.net

unread,
Apr 28, 2014, 8:02:32 AM4/28/14
to anuga...@lists.sourceforge.net
Send Anuga-user mailing list submissions to
anuga...@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/anuga-user
or, via email, send a message with subject or body 'help' to
anuga-use...@lists.sourceforge.net

You can reach the person managing the list at
anuga-us...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Anuga-user digest..."


Today's Topics:

1. Re: anuga-viewer to movie [SEC=UNCLASSIFIED]
(Gareth...@ga.gov.au)


----------------------------------------------------------------------

Message: 1
Date: Mon, 28 Apr 2014 09:30:12 +1000
From: Gareth...@ga.gov.au
Subject: Re: [Anuga-user] anuga-viewer to movie [SEC=UNCLASSIFIED]
To: anuga...@lists.sourceforge.net
Cc: jdg...@uc.cl
Message-ID:
<60D02F9C526B7F48B2194...@EXCCR01.agso.gov.au>
Content-Type: text/plain; charset=us-ascii

Hi,

I am pasting a script below which I've used to make movies with ANUGA viewer [under linux]. It relies on imageMajik's "convert" program to work.

At the top are comments which explain how to make the directory of images with anuga-viewer -- in the original question, I think this was not being done correctly.

Apologies for any automated reformatting of the script which my email editor might do.

The key steps are:
1) Use anuga-viewer to make a directory of images.
2) The script below will stitch them together, get rid of repeated images, etc.

Beware that you still might need to manually delete the first image that anuga-viewer produces if it doesn't look right.

Cheers,
Gareth.

###########################

"""

Script to automate steps in making an anuga-viewer based movie

This assumes you have made a directory of jpg images with anuga-viewer

It also assumes you are running ANUGA from linux, and the 'convert' program is
installed [part of ImageMajik]

To produce the images:
1) Start anuga-viewer, and get the view oriented how you would like for the movie
2) Press 1 to start recording, space to start the animation, then press 1 to
finish recording, and 3 to save the movie to 'movie.swm'
3) Close anuga-viewer
4) Make a directory with images of the movie, with:
> anuga-viewer -movie MYMOVIEDIR movie.swm
Let it run until finished.
5) Look at the images. You might want to delete the first one (seems to have a
blue background irrespective of the actual value of trace set in anuga-viewer).
Don't worry about repeats -- this script will remove them.

Finally you can run the current script, setting the input parameters as appropriate
> python makeAnugaViewerMovie.py

"""
import os
import sys
import glob
import numpy
import shutil

## INPUT parameters
movieDir='MYMOVIEDIR' # Directory where jpg images to make movie are stored
animationName='animation.gif' # Must end in .gif
delay=20 # Delay between movie frames, in (1/100)ths of a second
## END INPUT parameters

#################################################################

# File names
alljpg=glob.glob(movieDir+'/*.jpg')

# File name integer
m=len(alljpg[0].split('_'))
alljpgInt=[ i.split('_')[m-1] for i in alljpg]
alljpgInt=[ int(i.split('.')[0]) for i in alljpgInt]

# File sizes
alljpgSize=[ os.stat(i)[6] for i in alljpg]

# Sort file names and sizes
newInds=numpy.array(alljpgInt).argsort()
alljpg=[ alljpg[newInds[i]] for i in range(len(newInds))]
alljpgSize=[ alljpgSize[newInds[i]] for i in range(len(newInds))]

# Make a temporary directory
tmpDir=movieDir+'/'+'TMP'+'/'
os.mkdir(tmpDir)

# Copy all files with unique size to the temporary directory
for i in range(len(alljpg)):
if(i==0):
shutil.copy2(alljpg[i],tmpDir+os.path.basename(alljpg[i]))
else:
if(alljpgSize[i]!=alljpgSize[i-1]):
shutil.copy2(alljpg[i],tmpDir+os.path.basename(alljpg[i]))

# Run movie command
movieCommand="convert -delay " +str(delay)+ " $(ls -rlt "+ tmpDir+ "*.jpg | awk '{print $9}') " + animationName
print movieCommand
os.system(movieCommand)

# Clean up directory
shutil.rmtree(tmpDir)


-----Original Message-----
From: anuga-use...@lists.sourceforge.net [mailto:anuga-use...@lists.sourceforge.net]
Sent: Saturday, 26 April 2014 10:06 PM
To: anuga...@lists.sourceforge.net
Subject: [DKIM] Anuga-user Digest, Vol 67, Issue 3

Send Anuga-user mailing list submissions to
anuga...@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/anuga-user
or, via email, send a message with subject or body 'help' to
anuga-use...@lists.sourceforge.net

You can reach the person managing the list at
anuga-us...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific than "Re: Contents of Anuga-user digest..."


Today's Topics:

1. Re: anuga-viewer to movie (Joaquim Luis)


----------------------------------------------------------------------

Message: 1
Date: Fri, 25 Apr 2014 14:24:13 +0100
From: Joaquim Luis <jl...@ualg.pt>
Subject: Re: [Anuga-user] anuga-viewer to movie
To: anuga...@lists.sourceforge.net
Message-ID: <535A61FD...@ualg.pt>
Content-Type: text/plain; charset="iso-8859-1"

You may want to try the Aquamoto tool in Mirone. It can make movies out of .sww files

Joaquim


> Dear list,
> I'm interested on creating a movie from anuga-viewer, currently I'm
> using the command
>
> anuga_viewer -movie <moviedir> domain.sww
>
> but it is giving me a Segmentation fault error, which I think is due
> to lack of memory in my computer. Is there a lighter way to create a
> video?, for example, by not showing results on screen but directly
> saving them as screenshots?
>
> Thank you all,
>
> Jos?
>
>
> ----------------------------------------------------------------------
> -------- Start Your Social Network Today - Download eXo Platform Build
> your Enterprise Intranet with eXo Platform Software Java Based Open
> Source Intranet - Social, Extensible, Cloud Ready Get Started Now And
> Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
>
>
> _______________________________________________
> Anuga-user mailing list
> Anuga...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/anuga-user

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform

------------------------------

_______________________________________________
Anuga-user mailing list
Anuga...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/anuga-user


End of Anuga-user Digest, Vol 67, Issue 3
*****************************************

Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is intended only for the person or entity to which it is addressed. If you are not the intended recipient, then you have received this e-mail by mistake and any use, dissemination, forwarding, printing or copying of this e-mail and its file attachments is prohibited. The security of emails transmitted cannot be guaranteed; by forwarding or replying to this email, you acknowledge and accept these risks.
-------------------------------------------------------------------------------------------------------------------------




------------------------------

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

------------------------------

_______________________________________________
Anuga-user mailing list
Anuga...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/anuga-user


End of Anuga-user Digest, Vol 67, Issue 4
*****************************************
Reply all
Reply to author
Forward
0 new messages