Commit 94960be9 authored by Ruben Farinelli's avatar Ruben Farinelli
Browse files

Changed the routines for fitting the C and Q spectra

Replaced the MC files with new ones after fixing some bugs
parent 729ccc12
Loading
Loading
Loading
Loading
+8 −0
Changes for .gitignore: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
bl_pol
build_model/*.pdf
build_model/spectra/*pdf
build_model/spectra/*fits
build_model/spectra/bf*xcm
build_model/spectra/*dat
build_model/spectra/*qdp
build_model/spectra/*pco
build_model/spectra/*log
build_model/*dat
build_model/*qdp
build_model/bf*xcm
random_image.fits

.project

0 → 100644
+49 −0
Changes for .project: 49 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>bl_polarization</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
	</buildSpec>
	<natures>
	</natures>
	<filteredResources>
		<filter>
			<id>1785195882923</id>
			<name></name>
			<type>5</type>
			<matcher>
				<id>org.eclipse.ui.ide.multiFilter</id>
				<arguments>1.0-name-matches-false-false-*.c</arguments>
			</matcher>
		</filter>
		<filter>
			<id>1785195882924</id>
			<name></name>
			<type>5</type>
			<matcher>
				<id>org.eclipse.ui.ide.multiFilter</id>
				<arguments>1.0-name-matches-false-false-*.h</arguments>
			</matcher>
		</filter>
		<filter>
			<id>1785195882924</id>
			<name></name>
			<type>10</type>
			<matcher>
				<id>org.eclipse.ui.ide.multiFilter</id>
				<arguments>1.0-name-matches-false-false-*polarized_seed*</arguments>
			</matcher>
		</filter>
		<filter>
			<id>1785195882925</id>
			<name></name>
			<type>10</type>
			<matcher>
				<id>org.eclipse.ui.ide.multiFilter</id>
				<arguments>1.0-name-matches-false-false-tmp_res</arguments>
			</matcher>
		</filter>
	</filteredResources>
</projectDescription>
+41 −38
Changes for README.txt: 41 added lines, 38 removed lines.
Original line number Diff line number Diff line
INSTRUCTION FOR  COMPILING AND EXECUTING THE CODE
NSTRUCTIONS FOR COMPILING AND EXECUTING THE CODE

==============================================================
COMPILING THE CODE
==============================================================

The command line for creating the executable is defined in file compile.txt
From shell of the user just type
To create the executable, from the user shell simply type

$chmod 755 compile.txt
$./compile.txt
make

If everything works well you find the binary executable bp_pol
If the compilation is successful, the binary executable bl_pol will be created.

========================================================
EXECUTING THE CODE
==============================================================

The code is run by calling the executable and then the parameter list in format par1=value par2=value etc
The code is run by executing the binary and passing a list of parameters in the form

==============================================================
par1=value par2=value ...

========================================================
GEOMETRY OF THE EMISSION
==============================================================
========================================================

1) BOUNDARY LAYER

This geometry is defined by the parameters

geom=bl latmax=value
geom=bl
latmax=value

where latmax is latitude of the boundary layer with angle computed from the equator
where latmax is the latitude of the boundary layer, measured from the equator (in degrees).

2) POLAR CAP

The second case is emission from two polar caps and is defined by
In this case, the emission originates from two polar caps and is defined by

geom=xrp

The size of the two caps is set by the parameter (units of km)
The size of the two caps is set by the parameter (in km)

capsize=value

@@ -42,54 +45,56 @@ while the cap latitude is given by

thetacap=value

The are two possibility then: either make computations across the whole phase (XRP) or at a given
phase only (e.g., FRB). In the first case the following parameters must be defined
There are two possibilities: either computing the emission over the full rotational phase (XRP case), or at a single phase only (e.g. FRB-like case).

For phase-averaged computations, use

timefunct=all

while for emission only at given azimuthal angle
For emission at a single azimuthal angle, use

timefunct=single phicap=value
timefunct=single
phicap=value

==============================================================
Rest frame polarization degree and intensity
as a function of the normal to the surface
==============================================================
REST-FRAME POLARIZATION DEGREE AND INTENSITY
AS A FUNCTION OF THE SURFACE NORMAL

By default if no input file is provided, the local P(u) and I(u) laws are computed assuming Chandrasekhar’s profile. If one wants to use pre-defined P(u) and I(u) values, they must be defined in a ASCII file with three columns having the format
By default, if no input file is provided, the local polarization degree P(μ) and intensity I(μ) are computed assuming Chandrasekhar’s scattering profile.

u  P(u)  I(u)  
If pre-defined P(μ) and I(μ) laws are to be used, they must be provided in an ASCII file with three columns in the format

Then, the file is passed from shell as
μ P(μ) I(μ)

The file is then passed from the shell as

simulfile=/path_to_file/user_file

Note that P(u) must not be in percentage (i.e. x 100) but just as a fraction of 1, while
the intensity I(u) must be defined as normalizaed to the value I(u=1)
Note that P(μ) must be given as a fraction (i.e. not multiplied by 100), while the intensity I(μ) must be normalized to I(μ=1).

==============================================================
MANDATORY PARAMETERS
==============================================================

iobs=observer’s viewing angle (degrees)
iobs = observer viewing angle (degrees)

==============================================================
OPTIONAL PARAMETERS
==============================================================

NS radius in Km (default 10)
Neutron star radius in km (default: 10)

nsrad=value

Compactness, defined as Rg/Rns (default 1/2.5)

compactness=value
Compactness, defined as Rg/Rns (default: 1/2.5)

NS rotation frequency (default 500 Hz)
==============================================================
Neutron star spin frequency in Hz (default: 500)
==============================================================

spin=value

ASCII file with results, valid for cap geometry and phase-dependent case (default name polarimetry.dat)
Output ASCII file name (valid for polar cap geometry and phase-dependent case; default: polarimetry.dat)

output=filename

@@ -97,13 +102,11 @@ output=filename
WORKING EXAMPLES
==============================================================

1) Calculate PD and PA for a BL with latitude 45 degrees and observer’s viewing angle 70 degrees
with PD and angular distribution read from a file

$ ./bl_pol latmax=45 iobs=70 geom=bl simulfile=/Users/Shared/astro/slab_polarization/results/intensity_ode_tau5_seed3.dat
Compute polarization degree and polarization angle for a boundary layer with latitude 45 degrees and observer viewing angle 70 degrees, using P(μ) and I(μ) read from a file

./bl_pol geom=bl latmax=45 iobs=70 simulfile=/Users/Shared/astro/slab_polarization/results/intensity_ode_tau5_seed3.dat

2) Polar cap(s) with size 100 m located at latitude 45 degrees with angular distribution of intensity and polarization defined in a file

bl_pol geom=xrp timefunct=all iobs=60 capsize=0.1  thetacap=45 spin=500  timefunct=all simulfile=/astro/slab_polarization/results/intensity_ode_tau1_seed3.qdp output=newfile.dat
Polar caps with size 100 m (0.1 km) located at latitude 45 degrees, with angular distributions of intensity and polarization read from a file

./bl_pol geom=xrp timefunct=all iobs=60 capsize=0.1 thetacap=45 spin=500 simulfile=/astro/slab_polarization/results/intensity_ode_tau1_seed3.qdp output=newfile.dat
+1 −1
Changes for build_model/REAME.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ type factor=M where the latter must be a power of 2.

1) To create the FITS table model with lower boundary, use the following command

make_model.py runtable=y tabname=blcomp_new.fits emin_model=0.1
make_model.py runtable=y tabname=slcomp.fits emin_model=0.1


2) To show single plot with fit
Loading