# Animation from grid data/files:

**URL:** <https://discourse.julialang.org/t/animation-from-grid-data-files/114277>\
**Category:** Visualization\
**Tags:** geospatial, geodesy\
**Created:** [May 15, 2024, 12:24am UTC](https://discourse.julialang.org/t/animation-from-grid-data-files/114277 "2024-05-15T00:24:11Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [May 17, 2024, 2:23pm UTC](https://discourse.julialang.org/t/animation-from-grid-data-files/114277/11 "2024-05-17T14:23:10Z")

</div>

> [@GeodeticR](#):
>
> Now, just to figure out how to animate it…

Hi, I have opened this GMT.jl [issue](https://github.com/GenericMappingTools/GMT.jl/issues/1443) that explains some of the details involved in the `movie` usage and to track future improvements.

But regarding your case, I think that if you rename the input .txt files to `*_Vgrdimg_N.txt`, where `N` = _0:n\_files-1_, the next piece of code should a working base that you can tune. Note, you must adapt the `frames = ???` to your number of files.

```julia-auto
function pre_sc()
	makecpt(cmap=:roma, range=(-6.8, 5.0, 0.1), H=true, name="lixo.cpt");
end
function main2_sc()
	surface("51915_Vgrdimg_" * "MOVIE_FRAME" * ".txt", incols="0,1,2", proj=(name=:lambertConic, center=[-90 35], parallels=[33 45]), region=(-124.4, -53.0, 24.8, 49.2), inc=0.1, mask=0.3, save="lixo.grd");
	grdimage("lixo.grd", shade=true, cmap="lixo.cpt", proj=(name=:lambertConic, center=[-90 35], parallels=[33 45]), frame=:auto, title = "Vertical Residual Values")
	coast!(ocean=:gray, shore=0.5)
end
movie(main2_sc, pre=pre_sc, C="hd", name=:deforms, frames=10, format=:mp4, frame_rate=10, V=true)

```

Put this in a script and `include(it.jl)`

EDIT: Sorry, forgot to say. Before a version \> 1.13.3 comes out, the master version is needed to run the above.

---

_[View the full topic](https://discourse.julialang.org/t/animation-from-grid-data-files/114277)._
