Q Evaluation routines

From magneticfields
Jump to: navigation, search

We have evaluated Q using two independent routines, one by Tashiro, second by Ferrer, and performed a triple check using Vachaspati's Mathematica notebook.


Ferrer's Python routines

The following Python script takes the files in Media:nosourceoutput.tar.gz as input and calculates Q for each E1 and E2 combination Media:qcalc.py. A small modification of the script that calculates Q separately for the northern and southern hemispheres is given here Media:qcalcnorthsouth.py. Both scripts generate a figure of the output and write the value of Q and the standard error to file. For example, the first script produces the figure Media:jan14z100bgt80.pdf and the file arrays Media:qarrays.tar.gz.

Tashiro's Fortran90 routines

Here are Tashiro's F90 routines.File:Gamma codes.tar

The "data_set" directory contains photon positions for all energy bins after source and latitude cuts.

The "cross_product" directory contains the code to calculate Q values from the files in "data_set". In "cross.f90", the parameter "gl=70" or "gl=80" sets the absolute minimum galactic latitude for the 50-60 energy bin. The parameter "in_rootname" is set to "../data_set/jan_LAT_" for the January data and to "../data_set/sep_LAT_" for the September data.

After running the code, the mathematica notebook "QandError.nb" is used to generate the data suitable for plotting. The parameter "CalDir" is set to the directory containing the mathematica notebook. After running the mathematica notebook, the data is located in the "data_for_plot" directory. For example, the file "result_jan_LAT_80_125.dat" is the data for January data with $|b|>80$, E_1=10, E_2=20, and E_3=50 GeV. The first column is for R degree, the second is for Q and the third is for the standard error.

Vachaspati's Mathematica routine

Intended as a check of some Q values generated by other routines: File:Cpgamma-northsouth.nb