Some Tools/Tips to get work accomplished
- PdftoDjvu convertor
- AvitoGif convertor
- Package for animation in Beamer/LaTeX presentation
- Analytical DamBreak Solver
- Volume Calculation Pipeline for Planetary Geomorphology
- Pre-compiled Pedr2Tab
- BlenderFlows:: Use Blender as pre-modeling package for geophysical flows simulations
- Howto Get HiRISE EDR products automatically
- Get IDL source codes highlighting with Gedit
- Conversion of ISIS cube into ENVI file
PDF to Djvu
Les documents pdf générés par pdflatex peuvent être un peu lourd pour
les transférer par e-mail. La solution est ce petit convertisseur de
pdf vers des fichiers Djvu, disponible ici.
AVItoGIF Convertor
Description :
Il est parfois (souvent) utile de convertir des films avi (par exemple
générés sous MatLab) dans un format GIF que des logiciels de
présentation comme PowerPoint (ou OpenOffice) acceptent. Ici se trouve
un petit script shell (utilisant Mplayer) permettant de convertir
facilement un fichier avi vers un fichier gif.
Utilisation :
avitogif monfilm.avi monanimation.gif
Howto get animation in Beamer/LaTeX presentation
Synopsis:
Want to have some animation in your Beamer/LaTeX presentation ? This tutorial will explain how to do thatRequierments:
You must have Latex with beamer packages installed on you computer. You will need the animate.sty file. You have to read you compiled pdf file with Adobe reader (it's free and available on most OSs...)Let's make it
First, from a GIF animated file you will need to convert it into n-frames PNG files using the command :
convert my_gifanimatedfile.gif my_pngfiles_%d0.png
You will get n-frames PNG files names my_pngfile_n.png where n is the number of the frame. Let's use these files into our Beamer/LaTeX source file :
In the header part, do not forget to add :
\usepackage{animate} %need the animate.sty file
Then, where you need to display your animation :
\animategraphics[autoplay,loop,height=5cm]{1}{my_ongfile_}{0}{n-1}
The n-1 corresponds to the number of frames n but we start at step 0 and not 1.
Analytical DamBreak Solver

Objectives: We propose here an Analytical Dambreak Solver (named ADS) derived from Mangeney et al., [2000] solution.
Description of the solver This scenario involves movement of mass in a wide inclined channel, triggered by sudden removal of dam. From the analytical solution derived by Mangeney et al., (2000), profiles of the debris flow at any given time t are:

where H is the initial height of debris mass, g the gravity, θ is the slope angle and δ is the angle of friction.
Using the previously analytical solution, we propose here a solver for several plateforms written in Fortran90. The program is quiet simple to use; the user just has to input a few parameters and then get from the solver an ascii sheet readable under Octave, Gnuplot or commercial MatLab, Excel programs.
- Examples
The program involves a parameters file (named params.txt) whith the following set :
H, theta, phi
g, xmax, xmin
dx, time, dt, nt
Where H is the initial height, theta the slope angle, phi the bed friction angle, g the gravity, xmax and xmin are boundaries of the model, dx is the space increment for the output, time is the initial time recorded, dt is the time increment and nt is the number of step recorded. Note that everything uses I.S. !

Fig 1 - Results get from Dambreak Solver at time = 0, 10, 20 and 30 secs.
Howto use it:
You just have to run the program (using your favorite term) from the smame directory where your params.txt is.
>> Here an output exemple using these parameters
>> Gnuplot script for visualization [ps output]
Linux x86 32bits [*]
Mac x86 32bits (Tested under 10.4.x) [*]
Win32 (NT/XP) [***]
Linux x86 64bits [*]
Mac x86 64bits (Tested under 10.5.x) [*]
Sun sparc 32bits [**]
Linux IA64 [*]
- Apple PPC 32bits will be available soon
- SGI MIPS 64bits will be available
Other Boxes:
** Sun Studio Pro (11)
*** compiled under WinXP with g95 compiler
This program is free software; you can redistribute it. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Patches and suggestions are always welcome.
Volume Calculation Pipeline for Planetary Geomorphology
Purpose:
Planetary geomorphology often requires some morphometrics parameters such as areas, distance and volume. The purpose of this paper is to introduce a simple volume calculation pipeline using GMT (Generic Mapping Tools) under UNIX. An example is here presented on ILD (Interior Layered Deposits) within Ganges Chasma, Mars.Requierements:
- Workstation under any POSIX OS's (Unix, Linux, Mac OS X, BSD). With some modifications, MS windows would be supported.- GMT ( > 3.0.x) installed
- DTM data in binary or ASCII format (e.g. MOLA, HRSC-DTM, HiRISE-DTM)
Contributions:
Suggestions, remarks or any improvement are always welcome.1. Introduction
ILD have been obsverved in many place in Valles Marineris structure [1]. Many processes have been proposed for the formation of such object on Mars. In order to understand the formation, volume calculation could be very usefull.
Fig.1 - Perspective view of ILD within Ganges Chasma (IR
THEMIS Mosaic draped on MOLA DTM) [2]
2. Data ingestion
In our purpose, we need a topographic data. For this example we will use MOLA MEGRD Grid provided by NASA and USGS and available online (fig.2).
Fig.2 - MOLA DTMs croped on ILD area.
A_AXIS_RADIUS = 3396.0 Km
B_AXIS_RADIUS = 3396.0 Km
C_AXIS_RADIUS = 3396.0 Km
GMT thus need to know the Martian ellipsoid params by editing a new file named "MARS-MOLA" and containing the ellipsoid (here is a sphere) data. This operation is done at the beginning of the GMT script (see below). Afterwards, we determine boudaries contour of our feature (here ILD mount) so as to perform the volume calcultation. In our exemple we use grdvolume program provided by GMT. This contour is viewable by uncomment "#' in the code below (in the display part). We finally choose a baseline level needed by grdvolume program.
# GMT Script Shell
# Author: A. Lucas (lucas@ipgp.fr)
# -----------------------------------------------------------------------------
#
# Need GMT > 3.x.x.
# Runs under Unix,Linux, BSD, Mac OS X
# -----------------------------------------------------------------------------
# Data parameters:
# - Ellipsoid
echo "MARS-MOLA 2001 3396000 3396000 0" >! MARS-MOLA
gmtset ELLIPSOID=MARS-MOLA # Set Martian ellipsoid uses by MOLA
# - I/O files
set file_in=ild_mola # Input filename
set oline=outline.txt # Outline file
set file_out=ild_out # output map filename
# - Geographical params set inc=0.0078125 # Space increment of the DTM grid
set range=309/313/-8.5/-6 # Range for data injection
# - Display params
set niv=100 # Level increment for contour lines
set t=500 # Level increment for bolding
set proj=I311/7i # Projection type (see gmt manpage)
set base=-3200 # Baseline level for volume calculation
set coord=f1a2 # Displaying boudaries
set az=120 # Azimuth for 3D view
set elev=45 # Elevation for 3D view
set color=220/220/220 # Color box setting
set xt=312.1
set yt=-8.22
set yt2=-8.32
set ulx=312
set uly=-8.15
set urx=313
set ury=-8.15
set dlx=312
set dly=-8.4
set drx=313
set dry=-8.4
set level=4000
# -----------------------------------------------------------------------------
echo "GMT script Shell"
echo "__________________"
echo " "
echo "[1/5]. Resempling data..."
xyz2grd $file_in.img -G$file_out.grd -I$inc -R$range -F -Zh -V
grd2cpt $file_out.grd -R$range -Cjet -Z > $file_out.cpt
grdgradient $file_out.grd -G$file_out.int -A0/270 -Ne0.6
echo " "
echo "[2/5]. Masking data..."
grdmask $oline -I$inc -R$range -Gmask.grd -F -N0/1/1
grdmask $oline -I$inc -R$range -Gmask2.grd -F -N0/3/3
grdsample mask.grd -I$inc -R$range -Gout.grd
grdsample mask2.grd -I$inc -R$range -Gout2.grd
mv out.grd mask.grd
mv out2.grd mask2.grd
grdmath mask.grd mask2.grd NAN = mask_tmp.grd
grdmath $file_out.grd mask_tmp.grd MUL = sub.grd
#grd2cpt sub.grd -R$range -Cjet -Z > sub.cpt
echo " "
echo "[3/5]. Volume calculation..."
set info=`grdvolume sub.grd -C$base -S`
echo " "
echo "[4/5]. Postscript output..."
grdimage $file_out.grd -I$file_out.int -C$file_out.cpt -J$proj \
-B$coord -R$range -K -Y5 >! $file_out.ps
psscale -D3.5i/-0.5i/3i/0.2ih -C$file_out.cpt -B1500/:"Elevation (m)": -O \
-K >> $file_out.ps
grdcontour $file_out.grd -C$niv -R$range -J$proj -A$t -B$coord \
-K -O -U >> $file_out.ps
psxy -R -J$proj -O -K -G$color -L -Wthicker << END >> $file_out.ps
$ulx $uly
$urx $ury
$drx $dry
$dlx $dly
END
echo $xt $yt 8 0 1 5 Area: $info[2] m@+2@+| pstext -R$range -J$proj \
-O -K >> $file_out.ps
echo $xt $yt2 8 0 1 5 Volume: $info[3] m@+3@+ | pstext -R -J$proj \
-O -K >> $file_out.ps
#grdimage sub.grd -Csub.cpt -J$proj \
#-B$coord -R$range -K -Y3 >! mask.ps
#psscale -D3.5i/-0.5i/3i/0.2ih -Csub.cpt -B1500/:"Elevation (m)": -O \
# -K >> mask.ps
#grdcontour sub.grd -C$niv -R$range -J$proj -A$t -B$coord \
#-K -O -U >> mask.ps
rm *.grd
rm *.cpt
rm *.int
echo " "
echo "[5/5]. Convert PostScript to PDF using ghostscript"
ps2pdf $file_out.ps
ps2pdf mask.ps
echo " "
echo " "
echo "Done !"
echo ""
echo " Thanks Antwan :)"
echo ""
# -----------------------------------------------------------------------------
You can download the MOLA grid and the Outline file.
This GMT script gives you this result:
Fig.3 -Topographic map from GMT.
See also
Ross Beyer provides a very efficient PERL program named mola2gmt.References
[1] S.S. Nedell, S.W. Squyres, and D.W. Andersen. Origin and evolution of layered deposits in the Valles Marineris, Mars. Icarus,70, 409-441, 1987.[2] A. Lucas, Géologie de Ganges Chasma, Mars, Université Paris-Sud, Mémoire de Master, Juin 2005
[3] Some Free GIS software : GRASS - gvGIS - QuantumGIS - SAGA GIS
Pedr2tab
This is a program that reads MOLA PEDR files and produces an ASCII table of selected fields, one line for each altimetry shot detected. The user may choose to see all ranges, or only those that are/are not ground hits, in a selected region. The user may output any of eight groups of MOLA instrument values. By default, topography, range, planetary radius, and flags are output. The program is written in Fortran 77 with MIL-STD-1753 and other extensions.
PEDR2TAB was written by Gregory Neumann, MOLA Science Team, NASA/Goddard Space Flight Center.Mac OSX i386 [1]
Sun Sparc 32bits [2]
Linux i386 32bits [3]
1 Compiled under OS X 10.5.x with Gnu Fortran Compiler
2 Compiled under Solaris 10 with Sun Studio Pro 11
3 Compiled under linux RHEL 5 with Gnu Fortran compiler
BlenderFlows
HowTo use the 3D modeling package Blender for Geophysical flows simulations? Answer here.
HowTo get HiRISE EDR products automatically
For DTM derivative from Stereo Pais of HiRISE images, it is necessary to get all the RED ccd's EDR products, so twenty PDS files per image. Here is an example of a little shell script to get these EDR products automatically.
# wgetdata script - v.0.1 - 04/15/2008
# author: A.Lucas (lucas@ipgp.fr)
# Donwload data from the web script using wget unix command
# allows to get serveral data from a directory
#
#
# Requierments: wget, writing rights where the script is run
#
#------------------------------------------------------------
# Host parameters
prot=http://
host=hirise-pds.lpl.arizona.edu
dir=/PDS/EDR/PSP/ORB_001700_001799/PSP_001714_1415/
#------------------------------------------------------------
# Data parameters (e.g. PSP_001714_1415_RED0_0.IMG)
data=PSP_001714_1415_RED
ext=IMG
dvar1i=0
dvar1f=9
inc1=1
dvar2i=0
dvar2f=1
inc2=1
#------------------------------------------------------------
# local parameters
n=0
out=.
#------------------------------------------------------------
echo "Web Get Data Script"
while test $dvar1i -le $dvar1f
do
while test $dvar2i -le $dvar2f
do
datai=$data$dvar1i\_$dvar2i.$ext
d=$prot$host$dir$datai
echo "get file:" $datai
let "n+=1"
wget $d
echo " "
let "dvar2i+=$inc2"
done
dvar2i=0
let "dvar1i+=$inc1"
done
size=`du -h *.$ext`
echo $size
echo " "
echo "-----------------------------------"
echo $n "files downloaded -"
echo "host:" $prot$host$dir
echo "Thanks Antwan ;)"
echo " "
_______________________
How to Work Free: Some usefull softwares (for geosciences and planetology):
- GMT: Mapping your stuffs
- VisIt : Visualization from modeling
- MayaVi
- Paraview
- Isis3 : USGS (astrogeology branch) distribution for planetary data processing
- Octave : Matrix and Maths visualization
- Building Unix Software from Source Without Fink or Macports on Mac OSX
- The Power to Serve