The shell script you use to generate the frames of the movie doesn’t need a figure name or output format after “gmt begin” . The frame differences can be set using the MOVIE_ variables.
The output name is specified in the call to gmt movie using the -N option and gif output using -Agif (I see you have GraphicsMagick installed so that should work).
The man page makes this quite clear: have a look at the examples.
NB The documentation may be a concise description of many options, but it’s worth reading.
I also modified based on your comments. Now, I’m using GMT 6.3 and as I read in movie documents (movie — GMT 6.5.0 documentation). There is no -A, instead of that we use -F.
I wanna generate the series of figures in gif, thus I use the call function to do that. Is it the right way to do generate figures and make gif?. %1 and %2 in Subtropical High.bat is corresponded to STPs_1977 and WSPH_1977 in call function.
Here is the call function.
call Subtropical_High STPs_1977
WSPH_1977
call Subtropical_High STPs_1978
WSPH_1978
call Subtropical_High STPs_1979
WSPH_1979
call Subtropical_High STPs_1980
WSPH_1980
call Subtropical_High STPs_1981
WSPH_1981
After that, I combine it with the above subtropical high batch to generate the gif. But the output generates more folders. There is still no gif output!!!
It is the first time I use GMT 6, and it is a huge difference from GMT 5. I read examples, but most of them are related to Linux. There is some strange to me like CAT < function. I use call function to replace it and it seems to be not working well.
I very much appreciate any kind of help.
"This is the response from the command window! It is quite strange to me. "
D:\Subtropical_High\Data\Animation>gmt movie Subtropical_High.bat -Chd -Nanime02 -Fgif -T5 -H8 -Vi -Z
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Execute movie frame scripts in parallel
gmt [ERROR]: Unrecognized keyword =.
gmt [ERROR]: 1 GMT Defaults conversion errors in file C:/Users/user/.gmt/sessions/gmt_session.1/gmt.conf.1!
plot [ERROR]: Cannot find file 1.monthly
plot [ERROR]: Cannot find file 3.monthly
plot [ERROR]: Cannot find file 0.monthly
plot [ERROR]: Cannot find file 2.monthly
contour [ERROR]: Cannot find file .monthly
plot [ERROR]: Cannot find file 4.monthly
contour [ERROR]: Cannot find file .monthly
contour [ERROR]: Cannot find file .monthly
contour [ERROR]: Cannot find file .monthly
contour [ERROR]: Cannot find file .monthly
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Execute movie frame scripts in parallel
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Execute movie frame scripts in parallel
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Execute movie frame scripts in parallel
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for the main animation: 5
movie [INFORMATION]: GraphicsMagick 1.3.36 found.
movie [INFORMATION]: Paper dimensions: Width = 24c Height = 13.5c
movie [INFORMATION]: Pixel dimensions: 1920 x 1080
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Building opaque PNG images.
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Create parameter initiation script movie_init.bat
movie [INFORMATION]: Execute movie frame scripts in parallel
movie [INFORMATION]: Number of main animation frames: 5
movie [INFORMATION]: Parameter files for main animation: 5
movie [INFORMATION]: Create main movie frame script movie_frame.bat
movie [INFORMATION]: Total frames to process: 5
movie [INFORMATION]: Build frames using 15 cores
movie [INFORMATION]: Execute movie frame scripts in parallel
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
begin [ERROR]: Failed to remove gmt.conf! [remove error: Permission denied]
begin [WARNING]: Unable to remove gmt.conf [permissions?]
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
figure [ERROR]: gmt figure: Cannot select an existing figure and change its format.
Yes it is very linux oriented which can be confusing for those dealing with the inadequacies of DOS
My suggestion:
create a timeline file (eg TimeLine.dat) containing parameters that change in each frame:
TimeLine.dat:
STPs_1977 WSPH_1977
STPs_1978 WSPH_1978
STPs_1979 WSPH_1979
STPs_1980 WSPH_1980
STPs_1981 WSPH_1981
the SubtropicalHigh.bat should probably be:
SubtropicalHigh.bat:
gmt begin
gmt basemap -R100/180/0/45 -JQ180/%MOVIE_WIDTH% -Bxa10Wf5W -Bya10Nf5N -BWeSn -X1 -Y2
gmt coast -W1 -G200 -Di
gmt plot %MOVIE_COL1%.monthly -Sc0.1i -W0.01i,0/0/0 -G153/0/153
gmt contour %MOVIE_COL2%.monthly -A5880+f18+d+r1 -W5p,red
gmt end
–
the MOVIE_COLn variables pick up the data from your timeline file
In modern mode you don’t need to repeat the -R option in the plot command
Don’t include the movie instruction in the SubtropicalHigh.bat – this will just create recursion (giving you all those subdirectories)
call from the command line (or a separate batch file)
gmt movie Subtropical_High.bat -Chd -Nanime02 -Fgif -TTimeLine.dat
As all that seems to be changing is the plot and contour commands you could probably put the basemap and coast commands in a background script file which can be specified in the -Sb option to movie.
This should generate a file anime02.gif in the working directory and the individual frames as .png in the ./anime02 subdirectory.
If I wanted each of these frames as gif files I would use ImageMagick: cd into the subdirectory and run:
mogrify -format gif *.png
Your suggestion is useful and actually similar to what I tried to do last night.
There is a bug that I cannot understand the reason behind that cannot recognize my file name “STPs_1977 WSPH_1977” as stored up in TimeLine.dat. So the results in empty.
Again, thank you so much for this kind of help.
Here is new coding:
Blockquote
gmt begin
gmt set GMT_THEME cookbook
gmt set FONT_ANNOT_PRIMARY +20p FONT_LABEL +20p
gmt set MAP_TICK_LENGTH 4p MAP_TICK_PEN 2p MAP_FRAME_PEN 1p
gmt set PROJ_LENGTH_UNIT INCH FORMAT_GEO_MAP ddd:mm:ssF gmt basemap -R100/180/0/45 -JQ180/%MOVIE_WIDTH% -Bxa10Wf5W -Bya10Nf5N -BWeSn -X1 -Y2
gmt coast -W1 -G200 -Di
gmt plot %MOVIE_COL1%.monthly -R100/180/0/45 -Sc0.1i -W0.01i,0/0/0 -G153/0/153
gmt contour %MOVIE_COL2%.monthly -A5880+f18+d+r1 -W5p,red
gmt end
Blockquote
movie [INFORMATION]: Frame 00 of 44 completed [ 2.3 %]
movie [INFORMATION]: Frame 03 of 44 completed [ 4.5 %]
movie [INFORMATION]: Frame 01 of 44 completed [ 6.8 %]
movie [INFORMATION]: Frame 02 of 44 completed [ 9.1 %]
movie [INFORMATION]: Frame 04 of 44 completed [ 11.4 %]
movie [INFORMATION]: Frame 05 of 44 completed [ 13.6 %]
movie [INFORMATION]: Frame 06 of 44 completed [ 15.9 %]
movie [INFORMATION]: Frame 07 of 44 completed [ 18.2 %]
movie [INFORMATION]: Frame 08 of 44 completed [ 20.5 %]
movie [INFORMATION]: Frame 09 of 44 completed [ 22.7 %]
movie [INFORMATION]: Frame 10 of 44 completed [ 25.0 %]
movie [INFORMATION]: Frame 11 of 44 completed [ 27.3 %]
movie [INFORMATION]: Frame 12 of 44 completed [ 29.5 %]
movie [INFORMATION]: Frame 13 of 44 completed [ 31.8 %]
movie [INFORMATION]: Frame 14 of 44 completed [ 34.1 %]
plot [ERROR]: Cannot find file 15.monthly
contour [ERROR]: Cannot find file 15.monthly
plot [ERROR]: Cannot find file 16.monthly
plot [ERROR]: Cannot find file 17.monthly
plot [ERROR]: Cannot find file 22.monthly
contour [ERROR]: Cannot find file 17.monthly
plot [ERROR]: Cannot find file 19.monthly
contour [ERROR]: Cannot find file 16.monthly
plot [ERROR]: Cannot find file 18.monthly
plot [ERROR]: Cannot find file 20.monthly
plot [ERROR]: Cannot find file 21.monthly
contour [ERROR]: Cannot find file 22.monthly
contour [ERROR]: Cannot find file 18.monthly
contour [ERROR]: Cannot find file 19.monthly
contour [ERROR]: Cannot find file 20.monthly
plot [ERROR]: Cannot find file 23.monthly
plot [ERROR]: Cannot find file 24.monthly
contour [ERROR]: Cannot find file 21.monthly
plot [ERROR]: Cannot find file 26.monthly
plot [ERROR]: Cannot find file 25.monthly
contour [ERROR]: Cannot find file 24.monthly
contour [ERROR]: Cannot find file 23.monthly
plot [ERROR]: Cannot find file 28.monthly
contour [ERROR]: Cannot find file 26.monthly
contour [ERROR]: Cannot find file 25.monthly
contour [ERROR]: Cannot find file 28.monthly
plot [ERROR]: Cannot find file 29.monthly
plot [ERROR]: Cannot find file 27.monthly
contour [ERROR]: Cannot find file 29.monthly
contour [ERROR]: Cannot find file 27.monthly
movie [INFORMATION]: Frame 15 of 44 completed [ 36.4 %]
movie [INFORMATION]: Frame 17 of 44 completed [ 38.6 %]
movie [INFORMATION]: Frame 16 of 44 completed [ 40.9 %]
movie [INFORMATION]: Frame 18 of 44 completed [ 43.2 %]
movie [INFORMATION]: Frame 19 of 44 completed [ 45.5 %]
movie [INFORMATION]: Frame 20 of 44 completed [ 47.7 %]
movie [INFORMATION]: Frame 22 of 44 completed [ 50.0 %]
movie [INFORMATION]: Frame 24 of 44 completed [ 52.3 %]
movie [INFORMATION]: Frame 21 of 44 completed [ 54.5 %]
movie [INFORMATION]: Frame 23 of 44 completed [ 56.8 %]
movie [INFORMATION]: Frame 25 of 44 completed [ 59.1 %]
movie [INFORMATION]: Frame 26 of 44 completed [ 61.4 %]
movie [INFORMATION]: Frame 27 of 44 completed [ 63.6 %]
movie [INFORMATION]: Frame 28 of 44 completed [ 65.9 %]
movie [INFORMATION]: Frame 29 of 44 completed [ 68.2 %]
plot [ERROR]: Cannot find file 30.monthly
contour [ERROR]: Cannot find file 30.monthly
plot [ERROR]: Cannot find file 31.monthly
contour [ERROR]: Cannot find file 31.monthly
plot [ERROR]: Cannot find file 33.monthly
plot [ERROR]: Cannot find file 32.monthly
plot [ERROR]: Cannot find file 37.monthly
Note that if your TImeLine.dat file just has text (like file names) then there are no MOVIE_COL entries, just MOVIE_WORD1, MOVIE_WORD2 (see how to tell the -T option to break your text into words. MOVIE_COLs are for data columns of which you have none.
Hello, Mr. Pwessel,
I have changed based on your suggestions. But it is still not working. Do you have any suggestions? Anything is fine regarding individual plotting, but I faced very difficulty applying the GMT movie function.
The minor problem is the movement of the framework. It is ok for individual plotting (I mean without GMT movie).
Paul’s right about the text in the timeline file (and spaces in filenames). But you might find the words 0-based. Ie the first word accessed using MOVIE_WORD0
But actually, there is no spacing in my file name, I can really sure about it. The name is STPs_1977.monthly and WSPH_1977.monthly. There are two different files.
And inside TimeLine.dat, I stored as two columns of “STPs_1977" and "WSPH_1977”.
So, my plotting is
“gmt plot %MOVIE_COL1%.monthly -Sc0.1i -W0.01i,0/0/0 -G153/0/153
gmt contour %MOVIE_COL2%.monthly -A5880+f18+d+r1 -W5p,red”
As I mentioned above, I work perfectly for plotting individual images. But coming to the movie function, such as errors appear.
Hi,
That’s not working at all even I replace my name’s file like this STPs1977. No spacing, no underscore, or nothing else. But the command and function cannot understand.