Skip to content

Commit

Permalink
Symptom-treatment for #1578
Browse files Browse the repository at this point in the history
BUT: Issue needs real work, e.g. cross-checking uservars against inputs...
  • Loading branch information
willend committed Mar 1, 2024
1 parent c6df456 commit 9be44fd
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 67 deletions.
30 changes: 16 additions & 14 deletions mcxtrace-comps/examples/AstroX_ESA/ATHENA_1mm/ATHENA_1mm.instr
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
* Example: ATHENA_1mm.instr porenumber=3
*
* %Parameters
* FL [m] The focal length of the optical system
* optics_dist [m] The distance between souce and optic. In space this would be quite large :-).
* SRC_POS_X [m] Displacement of source along X
* SRC_POS_Y [m] Displacement of source along Y
* offaxis_angle [arcmin] Angle of collimated light from source
* reflectivity [ ] Data file containing reflectivities (such as from IMD)
* E0 [keV] Central energy of X-rays
* dE [keV] Half spread of energy spectrum to be emitted from source
* porenumber [ ] Actually the mirror module number.
* positionfile [ ] File containing the pore/mirror module positions.
* geomfile [ ] File which contains the geometry of the pores (i.e. radii,lengths)
* FL: [m] The focal length of the optical system
* optics_dist: [m] The distance between souce and optic. In space this would be quite large :-).
* SRC_POS_X: [m] Displacement of source along X
* SRC_POS_Y: [m] Displacement of source along Y
* offaxis_angle: [arcmin] Angle of collimated light from source
* reflectivity: [ ] Data file containing reflectivities (such as from IMD)
* E0: [keV] Central energy of X-rays
* dE: [keV] Half spread of energy spectrum to be emitted from source
* porenumber: [ ] Actually the mirror module number.
* positionfile: [ ] File containing the pore/mirror module positions.
* geomfile: [ ] File which contains the geometry of the pores (i.e. radii,lengths)
* dPx: [m] Offset/displacement of parabolic pore along x from its theoretical position.
* dPy: [m] Offset/displacement of parabolic pore along y from its theoretical position.
* dPz: [m] Offset/displacement of parabolic pore along z from its theoretical position.
Expand All @@ -67,6 +67,8 @@
* dHrx: [arcsec] Rotational misalignment of hyperbolic pore around x.
* dHry: [arcsec] Rotational misalignment of hyperbolic pore around y.
* dHrz: [arcsec] Rotational misalignment of hyperbolic pore around z.
* Hyper: [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* Para: [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
*
* %Link
* <a href="http://www.cosmos.esa.int/web/athena">The ATHENA web pages @ ESA</a>
Expand All @@ -81,7 +83,7 @@ DEFINE INSTRUMENT ATHENA_1mm(FL=12, optics_dist=10,
dHx=0,dHy=0,dHz=0, dHrx=0, dHry=0, dHrz=0,
string reflectivity="mirror_coating_unity.txt",
E0=5, dE=0.001, int porenumber=1,string ringfile="ref_design_breaks.txt",
string positionfile="ATHENA_mm_1petal.dat", string geomfile="ATHENA_rings_1_20.dat", int hyper=1, int para=1)
string positionfile="ATHENA_mm_1petal.dat", string geomfile="ATHENA_rings_1_20.dat", int Hyper=1, int Para=1)
DEPENDENCY "-DDATPATH=GETPATH(data/)"

/* The DECLARE section allows us to declare variables or small */
Expand Down Expand Up @@ -231,7 +233,7 @@ AT( 0,-PRM[ROW[porenumber-1]-1],0) RELATIVE misalign_rot_p

COMPONENT mm_p_1 = MM_p(
pore_th=0, ring_nr=ROW[porenumber-1], Z0=FL, pore_width=pore_width , pore_height=pore_height, mirror_reflec=reflectivity, R_d=0, size_file=ringfile)
WHEN(para) AT(0,0,0) RELATIVE ref_p
WHEN(Para) AT(0,0,0) RELATIVE ref_p
ROTATED (0.0,0.0,0.0) RELATIVE ref_p
EXTEND
%{
Expand All @@ -250,7 +252,7 @@ AT( 0,-PRM[ROW[porenumber-1]-1],0) RELATIVE misalign_rot_h

COMPONENT mm_h_1 = MM_h(
pore_th=0, ring_nr=ROW[porenumber-1], Z0=FL, pore_width=pore_width, pore_height=pore_height, mirror_reflec=reflectivity, R_d=0, size_file=ringfile)
WHEN (hyper) AT(0,0,0) RELATIVE ref_h
WHEN (Hyper) AT(0,0,0) RELATIVE ref_h
ROTATED (0.0,0.0,0.0) RELATIVE ref_h
EXTEND
%{
Expand Down
30 changes: 16 additions & 14 deletions mcxtrace-comps/examples/AstroX_ESA/ATHENA_1pore/ATHENA_1pore.instr
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@
* Example: ATHENA_1pore.instr porenumber=3
*
* %Parameters
* FL [m] The focal length of the optical system
* optics_dist [m] The distance between souce and optic. In space this would be quite large :-).
* SRC_POS_X [m] Displacement of source along X
* SRC_POS_Y [m] Displacement of source along Y
* offaxis_angle [arcmin] Angle of collimated light from source
* reflectivity [ ] Data file containing reflectivities (such as from IMD)
* E0 [keV] Central energy of X-rays
* dE [keV] Half spread of energy spectrum to be emitted from source
* porenumber [ ] Actually the mirror module number.
* positionfile [ ] File containing the pore/mirror module positions.
* geomfile [ ] File which contains the geometry of the pores (i.e. radii,lengths)
* FL: [m] The focal length of the optical system
* optics_dist: [m] The distance between souce and optic. In space this would be quite large :-).
* SRC_POS_X: [m] Displacement of source along X
* SRC_POS_Y: [m] Displacement of source along Y
* offaxis_angle: [arcmin] Angle of collimated light from source
* reflectivity: [ ] Data file containing reflectivities (such as from IMD)
* E0: [keV] Central energy of X-rays
* dE: [keV] Half spread of energy spectrum to be emitted from source
* porenumber: [ ] Actually the mirror module number.
* positionfile: [ ] File containing the pore/mirror module positions.
* geomfile: [ ] File which contains the geometry of the pores (i.e. radii,lengths)
* dPx: [m] Offset/displacement of parabolic pore along x from its theoretical position.
* dPy: [m] Offset/displacement of parabolic pore along y from its theoretical position.
* dPz: [m] Offset/displacement of parabolic pore along z from its theoretical position.
Expand All @@ -68,6 +68,8 @@
* dHrx: [arcsec] Rotational misalignment of hyperbolic pore around x.
* dHry: [arcsec] Rotational misalignment of hyperbolic pore around y.
* dHrz: [arcsec] Rotational misalignment of hyperbolic pore around z.
* Hyper: [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* Para: [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
*
* %Link
* <a href="http://www.cosmos.esa.int/web/athena">The ATHENA web pages @ ESA</a>
Expand All @@ -82,7 +84,7 @@ DEFINE INSTRUMENT ATHENA_1pore(FL=12, optics_dist=10,
dHx=0,dHy=0,dHz=0, dHrx=0, dHry=0, dHrz=0,
string reflectivity="mirror_coating_unity.txt",
E0=5, dE=0.001, int porenumber=1,
string positionfile="ATHENA_mm_1petal.dat", string geomfile="ATHENA_rings_1_20.dat", int hyper=1, int para=1)
string positionfile="ATHENA_mm_1petal.dat", string geomfile="ATHENA_rings_1_20.dat", int Hyper=1, int Para=1)
DEPENDENCY "-DDATPATH=GETPATH(data/)"

/* The DECLARE section allows us to declare variables or small */
Expand Down Expand Up @@ -226,7 +228,7 @@ ROTATED (0,0,-90+PA[porenumber-1]) RELATIVE optics_centre

COMPONENT Pore_p_1 = Pore_p(
radius_p=PRP[ROW[porenumber-1]-1], radius_m=PRM[ROW[porenumber-1]-1], zdepth=PRL[ROW[porenumber-1]-1], Z0=FL, xwidth=pore_width, yheight=pore_height, mirror_reflec=reflectivity, R_d=0)
WHEN(para) AT(dPx,dPy+PRM[ROW[porenumber-1]-1],dPz) RELATIVE a_1
WHEN(Para) AT(dPx,dPy+PRM[ROW[porenumber-1]-1],dPz) RELATIVE a_1
ROTATED (dPrx/3600.0,dPry/3600.0,dPrz/3600.0) RELATIVE a_1
EXTEND
%{
Expand All @@ -243,7 +245,7 @@ AT(0,0,0) RELATIVE optics_centre

COMPONENT Pore_h_1 = Pore_h(
radius_m=PRM[ROW[porenumber-1]-1], radius_h=PRH[ROW[porenumber-1]-1], zdepth=PRL[ROW[porenumber-1]-1], Z0=FL, xwidth=pore_width, yheight=pore_height, mirror_reflec=reflectivity, R_d=0)
WHEN (hyper) AT(dHx,dHy+PRM[ROW[porenumber-1]-1],dHz) RELATIVE a_1
WHEN (Hyper) AT(dHx,dHy+PRM[ROW[porenumber-1]-1],dHz) RELATIVE a_1
ROTATED (dHrx/3600.0,dHry/3600.0,dHrz/3600.0) RELATIVE a_1
EXTEND
%{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
* Example: ATHENA_cfgA_1mm.instr porenumber=3
*
* %Parameters
* FL [m] The focal length of the optical system
* optics_dist [m] The distance between souce and optic. In space this would be quite large :-).
* offaxis_angle [arcmin] Angle of collimated light from source
* reflectivity [ ] Data file containing reflectivities (such as from IMD)
* E0 [keV] Central energy of X-rays
* dE [keV] Half spread of energy spectrum to be emitted from source
* mmdef_file [ ] File containing the positions and overall geometry of Mirror Modules.
* ringfile [ ] File which contains deatiled plate descriptions.
* porenumber [ ] Actually the mirror module number.
* FL: [m] The focal length of the optical system
* optics_dist: [m] The distance between souce and optic. In space this would be quite large :-).
* offaxis_angle: [arcmin] Angle of collimated light from source
* reflectivity: [ ] Data file containing reflectivities (such as from IMD)
* E0: [keV] Central energy of X-rays
* dE: [keV] Half spread of energy spectrum to be emitted from source
* mmdef_file: [ ] File containing the positions and overall geometry of Mirror Modules.
* ringfile: [ ] File which contains deatiled plate descriptions.
* porenumber: [ ] Actually the mirror module number.
* dPx: [m] Offset/displacement of parabolic pore along x from its theoretical position.
* dPy: [m] Offset/displacement of parabolic pore along y from its theoretical position.
* dPz: [m] Offset/displacement of parabolic pore along z from its theoretical position.
Expand All @@ -54,13 +54,13 @@
* dHrx: [arcsec] Rotational misalignment of hyperbolic pore around x.
* dHry: [arcsec] Rotational misalignment of hyperbolic pore around y.
* dHrz: [arcsec] Rotational misalignment of hyperbolic pore around z.
* XWidth [m] The width of the user detector default is that of the ATHENA WFI large area detector
* YHeight [m] The height of the user detector default is that of the ATHENA WFI large area detector
* NX [ ] Number of pixels along X in the user detector
* NY [ ] Number of pixels along Y in the user detector.
* hyper [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* para [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
* lists [ ] If non-zero drop event mode monitr are active. Turn-off to save disk-space.
* XWidth: [m] The width of the user detector default is that of the ATHENA WFI large area detector
* YHeight: [m] The height of the user detector default is that of the ATHENA WFI large area detector
* NX: [ ] Number of pixels along X in the user detector
* NY: [ ] Number of pixels along Y in the user detector.
* Hyper: [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* Para: [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
* lists: [ ] If non-zero drop event mode monitr are active. Turn-off to save disk-space.
*
* %Link
* <a href="http://www.cosmos.esa.int/web/athena">The ATHENA web pages @ ESA</a>
Expand All @@ -77,7 +77,7 @@ DEFINE INSTRUMENT ATHENA_1mm(FL=12, optics_dist=10,
string reflectivity="mirror_coating_unity.txt",default_reflec=0,
E0=5, dE=0.001, int porenumber=1,
string mmdef_file="MM_Definitions-cfgA.csv", string ringfile="ref_design_breaks.txt",
int hyper=1, int para=1, int lists=0)
int Hyper=1, int Para=1, int lists=0)

/* The DECLARE section allows us to declare variables or small */
/* functions in C syntax. These may be used in the whole instrument. */
Expand Down Expand Up @@ -199,7 +199,7 @@ AT( 0,-PR,0) RELATIVE misalign_rot_p

COMPONENT mm_p_1 = MM_p(
pore_th=0, ring_nr=row, Z0=FL, pore_width=pore_width , pore_height=pore_height, chamfer_width=pore_wall, mirror_reflec=reflectivity, R_d=default_reflec, size_file=ringfile)
WHEN(para) AT(0,0,0) RELATIVE ref_p
WHEN(Para) AT(0,0,0) RELATIVE ref_p
ROTATED (0.0,0.0,0.0) RELATIVE ref_p
EXTEND
%{
Expand All @@ -224,7 +224,7 @@ AT( 0,-PR,0) RELATIVE misalign_rot_h

COMPONENT mm_h_1 = MM_h(
pore_th=0, ring_nr=row, Z0=FL, pore_width=pore_width, pore_height=pore_height, chamfer_width=pore_wall, mirror_reflec=reflectivity, R_d=default_reflec, size_file=ringfile)
WHEN (hyper) AT(0,0,0) RELATIVE ref_h
WHEN (Hyper) AT(0,0,0) RELATIVE ref_h
ROTATED (0.0,0.0,0.0) RELATIVE ref_h
EXTEND
%{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
* Example: ATHENA_cfgA_1mm_FEMd.instr porenumber=3
*
* %Parameters
* FL [m] The focal length of the optical system
* optics_dist [m] The distance between souce and optic. In space this would be quite large :-).
* offaxis_angle [arcmin] Angle of collimated light from source
* reflectivity [ ] Data file containing reflectivities (such as from IMD)
* E0 [keV] Central energy of X-rays
* dE [keV] Half spread of energy spectrum to be emitted from source
* mmdef_file [ ] File containing the positions and overall geometry of Mirror Modules.
* ringfile [ ] File which contains deatiled plate descriptions.
* disp_file [ ] Fiel that conatins mirror module displacements
* porenumber [ ] Actually the mirror module number.
* FL: [m] The focal length of the optical system
* optics_dist: [m] The distance between souce and optic. In space this would be quite large :-).
* offaxis_angle: [arcmin] Angle of collimated light from source
* reflectivity: [ ] Data file containing reflectivities (such as from IMD)
* E0: [keV] Central energy of X-rays
* dE: [keV] Half spread of energy spectrum to be emitted from source
* mmdef_file: [ ] File containing the positions and overall geometry of Mirror Modules.
* ringfile: [ ] File which contains deatiled plate descriptions.
* disp_file: [ ] Fiel that conatins mirror module displacements
* porenumber: [ ] Actually the mirror module number.
* dPx: [m] Offset/displacement of parabolic pore along x from its theoretical position.
* dPy: [m] Offset/displacement of parabolic pore along y from its theoretical position.
* dPz: [m] Offset/displacement of parabolic pore along z from its theoretical position.
Expand All @@ -56,13 +56,13 @@
* dHrx: [arcsec] Rotational misalignment of hyperbolic pore around x.
* dHry: [arcsec] Rotational misalignment of hyperbolic pore around y.
* dHrz: [arcsec] Rotational misalignment of hyperbolic pore around z.
* XWidth [m] The width of the user detector default is that of the ATHENA WFI large area detector
* YHeight [m] The height of the user detector default is that of the ATHENA WFI large area detector
* NX [ ] Number of pixels along X in the user detector
* NY [ ] Number of pixels along Y in the user detector.
* hyper [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* para [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
* lists [ ] If non-zero drop event mode monitr are active. Turn-off to save disk-space.
* XWidth: [m] The width of the user detector default is that of the ATHENA WFI large area detector
* YHeight: [m] The height of the user detector default is that of the ATHENA WFI large area detector
* NX: [ ] Number of pixels along X in the user detector
* NY: [ ] Number of pixels along Y in the user detector.
* Hyper: [ ] If non-zero the secondary mirror (hyperbolic) is active. Useful for debugging.
* Para: [ ] If non-zero the primary mirror is acive (parabolic) is active. Useful for debugging.
* lists: [ ] If non-zero drop event mode monitr are active. Turn-off to save disk-space.
*
* %Link
* <a href="http://www.cosmos.esa.int/web/athena">The ATHENA web pages @ ESA</a>
Expand All @@ -80,7 +80,7 @@ DEFINE INSTRUMENT ATHENA_cfgA_1mm_FEMd(FL=12, optics_dist=10,
E0=5, dE=0.001, int porenumber=1,
string mmdef_file="MM_Definitions-cfgA.csv", string ringfile="ref_design_breaks.txt",
string disp_file="none",int disp_type=0,
int hyper=1, int para=1, int lists=0)
int Hyper=1, int Para=1, int lists=0)

/* The DECLARE section allows us to declare variables or small */
/* functions in C syntax. These may be used in the whole instrument. */
Expand Down Expand Up @@ -224,7 +224,7 @@ AT( 0,-PR,0) RELATIVE misalign_rot_p

COMPONENT mm_p_1 = MM_p(
pore_th=0, ring_nr=row, Z0=FL, pore_width=pore_width , pore_height=pore_height, chamfer_width=pore_wall, mirror_reflec=reflectivity, R_d=default_reflec, size_file=ringfile)
WHEN(para) AT(0,0,0) RELATIVE ref_p
WHEN(Para) AT(0,0,0) RELATIVE ref_p
ROTATED (0.0,0.0,0.0) RELATIVE ref_p
EXTEND
%{
Expand All @@ -249,7 +249,7 @@ AT( 0,-PR,0) RELATIVE misalign_rot_h

COMPONENT mm_h_1 = MM_h(
pore_th=0, ring_nr=row, Z0=FL, pore_width=pore_width, pore_height=pore_height, chamfer_width=pore_wall, mirror_reflec=reflectivity, R_d=default_reflec, size_file=ringfile)
WHEN (hyper) AT(0,0,0) RELATIVE ref_h
WHEN (Hyper) AT(0,0,0) RELATIVE ref_h
ROTATED (0.0,0.0,0.0) RELATIVE ref_h
EXTEND
%{
Expand Down

0 comments on commit 9be44fd

Please sign in to comment.