Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96643616
f_source.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 29, 10:12
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Dec 31, 10:12 (2 d)
Engine
blob
Format
Raw Data
Handle
23219135
Attached To
R1448 Lenstool-HPC
f_source.c
View Options
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
#include<lt.h>
/****************************************************************/
/* nom: f_source */
/* auteur: Jean-Paul Kneib */
/* date: 10/02/92 */
/* place: Toulouse */
/* lecture de la premiere galaxy dans un fichier */
/****************************************************************/
void
f_source
(
char
*
name
,
struct
galaxie
*
galaxy
,
int
*
n
)
{
const
extern
struct
g_mode
M
;
FILE
*
IN
;
int
i
,
j
,
ncom
;
char
word
[
10
],
line
[
1280
];
i
=
j
=
0
;
NPRINTF
(
stderr
,
"READ: %s "
,
name
);
IN
=
fopen
(
name
,
"r"
);
if
(
IN
!=
NULL
)
{
rewind
(
IN
);
for
(
j
=
0
,
fscanf
(
IN
,
"%s"
,
word
);
(
strncmp
(
word
,
"#"
,
1
)
==
0
);
j
++
)
{
flire
(
IN
,
line
);
fscanf
(
IN
,
"%s"
,
word
);
};
ncom
=
j
;
rewind
(
IN
);
for
(
j
=
0
;
j
<
ncom
;
j
++
,
flire
(
IN
,
line
));
while
((
fscanf
(
IN
,
"%s%lf%lf%lf%lf%lf%lf%lf"
,
galaxy
[
i
].
n
,
&
galaxy
[
i
].
C
.
x
,
&
galaxy
[
i
].
C
.
y
,
&
galaxy
[
i
].
E
.
a
,
&
galaxy
[
i
].
E
.
b
,
&
galaxy
[
i
].
E
.
theta
,
&
galaxy
[
i
].
z
,
&
galaxy
[
i
].
I0
))
!=
-
1
)
{
galaxy
[
i
].
E
.
theta
*=
DTR
;
flire
(
IN
,
line
);
i
++
;
}
NPRINTF
(
stderr
,
": %d galaxy
\n
"
,
i
);
}
*
n
=
i
;
}
Event Timeline
Log In to Comment