Diego Casadei's Web Site: Software

Last update for this page: Sun Apr 15 08:45:20 2012

About this web site

Contact (edit!)

WebCounter: counter.digits.com/wc/diego-casadei since Dec 1999.
contacts since 26 Nov. 2001.

<

Here you can find a selected collection of useful scripts, FORTRAN and C/C++ program sources, written to solve frequent problems. I don't think they are the best you can get ... and if you know better ones, please let me know!

C/C++ source

SVN repositoryROOT macros to plot the discrepancy between the observed counts and the expectation. [prompt]$ root -q -b plotSign.C+ will produce the last plot of Plotting the Differences Between Data and Expectation by Georgios Choudalakis and myself, published by EPJ Plus, arXiv: 1111.2062.
SkyCoverageSkyCoverage is a program which produces sky maps with the exposure of an orbiting detector, as described in my paper Sky coverage of orbital detectors. Analytical approach, arXiv: astro-ph/0511674.
dos2unix.ccA simple (not oject oriented) C++ program that converts the DOS like end-of-line (LF+CR) to Unix like end-of-line (LF).    It is a C++ program that does the same kind of operations as the ita2tex shell script, but can be compiled.   You can modify either the first or the second to get what you need, using a compiled or interpreted program.
mac2unix.ccSimilar to the previous one, but works with MacIntosh files.

LaTeX

thesisbo-3.14i.tgzThe class that I wrote to format my thesis (and all the folowing AMS-Bologna theses) (+ explanations and 1 example).    To use it simply start your document with the command \documentclass{thesisbo}.    Requires LaTeX2e.
phdthesisbo v.1.16The class I wrote to format my PhD thesis, with an example.
amsbo.clsThe class I wrote to format the AMS Bologna Group Internal Notes, derived from aastex.cls.
sourcecode.tgzThis simple package allows the user to include source files into LaTeX docs.

FORTRAN sources

fitline.fA function that performs a linear fit of N (x,y) points. Given two N-dimensional arrays X(N) and Y(N) of coordinates, and a vector of uncertainties EY(N) about the Y's, fitline(X,Y,EY,N,A) computes the best y(x) = A(1) + A(2)*x function and returns the chi-square/n.d.f. of the fit.
bin.fGiven an ordered vector VECT of N elements and the value VALUE,the function bin(N,VECT,VALUE) returns the minimum index I (0<I<N+1) that satisfy the following condition: VALUE >= VECT(I). It can be used to fill a histogram of a quantity that needs a non-constant binning. A binary tree search algorithm is used [the worst case scales as log(2,N)].
bb.fBethe-Bloch energy loss distribution, as function of beta, for polyvinyltoluene scintillators (common organic scintillator counters) of 0.87 cm effective width (used by the time of flight system of the AMS detector). The Z2 term is not included: by dividing the energy measurement by bb.f(...) and taking the square root, you get the charge distribution.
diffuse.fThis subroutine simulates the diffusion of the reflected photon direction, due to microstructures in the mirror surface.   Actually, I used a simple model in which the user has to put as input the spreading in angle, in the form of the standard deviation of the used gaussian distribution.    The original vector (given as input) is changed to the final direction by this subroutine.    The actual value for the standard deviation is expected to come from measurements.

Unix scripts

a5toa4A very simple shell script to manage PostScript documents in A5 page format: it puts two A5 pages onto a single A4 page, calling the pstops program (one among the psutils collection). It can be used in combination with psbook (in psutils) to print A5 booklets.
ita2texA shell script that converts accented characters (like 'è') into the equivalent TeX strings (i.e. "\'e"). It works with uppercase and lowercase letters, and includes the ñ and Ñ characters.
tex2tgz.shA shell script that should be invoked with your LaTeX source. It will create a tar.gz archive with all needed files, whose name contains the current date.