-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRAW_tool.cpp
More file actions
68 lines (52 loc) · 1.6 KB
/
RAW_tool.cpp
File metadata and controls
68 lines (52 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include"src/pointer_management.hpp"
#include"src/TCP_API.hpp"
#include"src/sig_proc_float.hpp"
#include"src/scan_conversion_float.hpp"
#include"src/methods.hpp"
typedef int SOCKET;
typedef float _Complex cplxf;
#define Port 7538
float r0=0.0, rf=0.0;
int Nline=0, decimation=0, Npoint=0;
double sector=0.0;
int mode_RP;
int main(void)
{
//socket variable
SOCKET sock;
//const char *IP="192.168.43.223";
const char *IP="0.0.0.0";
init_TCP_client(&sock, IP, Port);
get_RP_settings(&sock);
float fech=0.0;
fech=125.0/((float)decimation);
int Npoint=0, loop=0;
Npoint=(int)(2.0*(rf-r0)*125.0/1.48/((double)decimation));
if (Npoint>16384){Npoint=16384;}
printf("Npoint = %i\n",Npoint);
//init struc fft
sig_proc_float * spf1;
init_struct_spf(&spf1,Npoint);
int16_t **image0=NULL;
float **imagee=NULL;
create_matrix_int16_t(&image0, Nline, Npoint);
create_matrix_float(&imagee, Nline, Npoint);
//wait for line 1 to start image at beggining
init_line(&sock, Npoint);
//get image
get_image(&sock, image0, Nline, Npoint);
image_envelop(spf1, image0, imagee, fech, Nline, Npoint);
unsigned int nx=256, ny=256;
scan_conv scan_conv_struct={0};
create_scan_conv_struct (&scan_conv_struct, Npoint, Nline, (float)sector, r0, rf, nx, ny, 0);
image_scan_conversion (&scan_conv_struct, imagee);
std::string toto2="./image/image_sc.txt";
writeim(toto2, scan_conv_struct.image, nx, ny);
delete_matrix_int16_t(&image0, Nline);
delete_matrix_float(&imagee, Nline);
delete_scan_conv_struct(&scan_conv_struct);
return 0;
}