Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lenstool
Lenstool
Commits
f3220812
Commit
f3220812
authored
Dec 09, 2020
by
Johan Richard
Browse files
Check parameters for potential 17
parent
6e1eadb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/checkpar.c
View file @
f3220812
...
...
@@ -101,6 +101,42 @@ void checkpar()
}
}
//Double check potentials
for
(
i
=
0
;
i
<
G
.
nlens
;
i
++
)
{
if
(
lens
[
i
].
type
==
17
)
{
if
((
lens
[
i
].
gamma1file
[
0
]
==
0
)
||
(
lens
[
i
].
gamma2file
[
0
]
==
0
)
||
(
lens
[
i
].
kappafile
[
0
]
==
0
))
{
if
((
lens
[
i
].
gamma1file
[
0
]
==
0
)
&&
(
lens
[
i
].
gamma2file
[
0
]
==
0
)
&&
(
lens
[
i
].
kappafile
[
0
]
==
0
))
fprintf
(
stderr
,
"WARNING: No convergence / shear file provided for potential %d. Magnifications / Shapes will not be correctly computed.
\n
"
,
i
+
1
);
else
{
fprintf
(
stderr
,
"ERROR: Missing convergence or shear file for potential %d.
\n
"
,
i
+
1
);
exit
(
-
1
);
}
}
if
((
lens
[
i
].
dplxfile
[
0
]
==
0
)
||
(
lens
[
i
].
dplyfile
[
0
]
==
0
))
{
if
((
lens
[
i
].
dplxfile
[
0
]
==
0
)
&&
(
lens
[
i
].
dplyfile
[
0
]
==
0
))
fprintf
(
stderr
,
"WARNING: No displacement file provided for potential %d. Predicted positions / displacements will not be correctly computed.
\n
"
,
i
+
1
);
else
{
fprintf
(
stderr
,
"ERROR: Missing displacement file for potential %d.
\n
"
,
i
+
1
);
exit
(
-
1
);
}
}
if
(
lens
[
i
].
potenfile
[
0
]
==
0
)
{
fprintf
(
stderr
,
"WARNING: No potential map provided for potential %d. Time delays will not be correctly computed.
\n
"
,
i
+
1
);
}
}
return
;
printf
(
"#REFERENCE 0 %.7f %.7f
\n
"
,
M
.
ref_ra
,
M
.
ref_dec
);
...
...
@@ -170,4 +206,8 @@ void checkpar()
};
};
}
printf
(
"COUCOU %d
\n
"
,
lens
[
i
].
type
);
}
src/set_default.c
View file @
f3220812
...
...
@@ -29,6 +29,7 @@ void set_default()
extern
struct
g_cline
CL
;
extern
struct
g_observ
O
;
/* default flux dispersion^2 */
extern
struct
g_pot
P
[
NPOTFILE
];
extern
struct
pot
lens
[
NLMAX
];
extern
struct
ipot
ip
;
extern
struct
sigposStr
sigposAs
;
extern
struct
g_pixel
ps
,
imFrame
;
...
...
@@ -183,6 +184,17 @@ void set_default()
ps
.
ny
=
40
;
ps
.
pixfile
[
0
]
=
0
;
for
(
i
=
0
;
i
<
NLMAX
;
i
++
)
{
lens
[
i
].
gamma1file
[
0
]
=
0
;
lens
[
i
].
gamma2file
[
0
]
=
0
;
lens
[
i
].
kappafile
[
0
]
=
0
;
lens
[
i
].
dplxfile
[
0
]
=
0
;
lens
[
i
].
dplyfile
[
0
]
=
0
;
lens
[
i
].
potenfile
[
0
]
=
0
;
}
/* potfile */
for
(
i
=
0
;
i
<
NPOTFILE
;
i
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment