Home
Name Modified Size InfoDownloads / Week
README 2013-05-09 4.3 kB
LICENSE 2013-05-09 2.7 kB
KNOWN_BUGS 2013-05-09 1.5 kB
v1.0.zip 2013-05-09 1.4 MB
Totals: 4 Items   1.4 MB 0
v 1.0

The code is provided in a developmental form. The Driver_SingleNonGaussian.f90 file contains a sample driver demonstrating how one can employ the code. A driver routine must include the QuantileTransformation module, define the grid-size, and initialise a field of type FieldType with the initialiseField subroutine. It is also most convenient to pass the tag for the statistics at this point. The user can also allocate fieldname%pdf and fieldname%pdfgrid and populate with the desired output PDF. If this is not done and the named statistics not recognised by the code it will look for the file statisticsname.dat in the working directory and, if not present, prompt the user for the location of the file.

The code will look for the existence of a directory Lldim/nN/Statistics where ldim is the grid-size and N the spectral index. If this directory does not exist it asks the user to generate it. This directory will contain the target statistics and power spectrum and the result; most importantly it also contains the input spectrum for this combination. Initially, target spectra are provided only for grids with ldim=64 but this will be expanded as new input spectra are found.



Issuing make in the source directory will build bin.GenerateField and bin.AnalyseField -- GenerateField will construct a single field and analyse it (running through spectral distortion if necessary), while AnalyseField will loop over a number of fields (and will run through spectral distortion if necessary). Clearly the driver routines for these two (Driver_SingleNonGaussian.f90 and Driver_Analyse.f90) are very similar.
* make : constrct bin.GenerateField and bin.AnalyseField; on first run will also construct the dependent libraries
* make clean : delete bin.GenerateField, bin.AnalyseField and the object and module files in the source directory
* make cleanlib : delete the libraries and their module files in the source/lib directory



PDFs implemented explicitly in the code are:

* Gaussian (generate a Gaussian field with a standard routine)
* GaussianProcessed (pass a Gaussian through a quantile correction)
* Uniform
* Laplace
* LogLogistic (with scale parameter s and power parameter p)
* Chi2 (chi^2, with degree of freedom parameter d)
* Chi (with degree of freedom parameter d; if d=2 the field is called a Rayleigh and if d=3 the field is called a Maxwell-Boltzmann)
* Planck
* LogNormal (with shape parameter s)
* Generalised gamma distribution (with degree of freedom, scale and power d, s and p)
* Generalised error distribution (with scale and power s and p)

Where the PDF contains a scale parameter the form with s=1 is always employed with the exception of the log-logistic. (This will be corrected in a future release.) Fields are output with zero mean and a standard deviation normalised to that of the input Gaussian.


Intended additions in the future include
* Implement the test of the spectral distortion (at present it is run for 10 iterations)
* Restructured and refactored versions of the magnetic field codes developed by myself and Robert Crittenden (astro-ph/0506570, arXiv:0812.1781, arXiv:1005.2982)
* Routines to evaluate the colinear and a general bispectrum
* OpenMP parallelisation throughout code (currently only FFT is parallelised)
* MPI parallelisation throughout


To add an analytic PDF to the code you must edit the QuantileTransform.f90:
* In initialisePDF, add the PDF to the cases. If you only know the PDF analytically it is "Mixed"; if you know the PDF and CDF it is "Analytic" and if you know the PDF, CDF and QF "FullyAnalytic"
* If the PDF takes parameters then add a case after line 293, allocating the pdf_parameters array and defining the parameters
* Add the explicit form to targetPDF
* If present, add the analytic CDF to targetCDF (although it is usually easiest to set "Mixed" and simply integrate the CDF)
* If present, add the analytic QF to targetQF
It is very strongly recommended that you employ PDFs in standard form (ie with vanishing location and unit scale parameters -- note that this is not equivalent to unit variance and zero mean. Expressing the field in units of the standard deviation can be set separately, as with the generalised gamma, for instance.)

Iain Brown, May 9th, 2013
Source: README, updated 2013-05-09