Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96640070
im_stat.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, 09:12
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Dec 31, 09:12 (2 d)
Engine
blob
Format
Raw Data
Handle
23220974
Attached To
R1448 Lenstool-HPC
im_stat.c
View Options
#include<stdio.h>
#include<math.h>
#include "fonction.h"
#include "constant.h"
#include"dimension.h"
#include "structure.h"
void
im_stat
(
double
**
im
,
int
nx
,
int
ny
,
double
*
mean
,
double
*
disp
)
{
register
int
i
,
j
,
k
;
double
s
,
s2
,
moy
,
sig
;
s
=
s2
=
0.
;
for
(
i
=
0
;
i
<
nx
;
i
++
)
for
(
j
=
0
;
j
<
ny
;
j
++
)
{
s
+=
im
[
i
][
j
];
s2
+=
im
[
i
][
j
]
*
im
[
i
][
j
];
};
moy
=
s
/
nx
/
ny
;
sig
=
sqrt
(
s2
/
nx
/
ny
-
moy
*
moy
);
k
=
0
;
s
=
s2
=
0.
;
for
(
i
=
0
;
i
<
nx
;
i
++
)
for
(
j
=
0
;
j
<
ny
;
j
++
)
if
(
fabs
(
im
[
i
][
j
]
-
moy
)
<
3.
*
sig
)
{
s
+=
im
[
i
][
j
];
s2
+=
im
[
i
][
j
]
*
im
[
i
][
j
];
k
++
;
};
moy
=
s
/
nx
/
ny
;
sig
=
sqrt
(
s2
/
nx
/
ny
-
moy
*
moy
);
k
=
0
;
s
=
s2
=
0.
;
for
(
i
=
0
;
i
<
nx
;
i
++
)
for
(
j
=
0
;
j
<
ny
;
j
++
)
if
(
fabs
(
im
[
i
][
j
]
-
moy
)
<
3.
*
sig
)
{
s
+=
im
[
i
][
j
];
s2
+=
im
[
i
][
j
]
*
im
[
i
][
j
];
k
++
;
};
*
mean
=
s
/
k
;
*
disp
=
sqrt
(
s2
/
k
-
(
*
mean
)
*
(
*
mean
));
}
Event Timeline
Log In to Comment