-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeasurement_set.h
85 lines (72 loc) · 3.19 KB
/
measurement_set.h
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright (c) 2020 Marzia Rivi
*
* This file is part of RadioLensfit.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MEASUREMENT_SET_H_
#define MEASUREMENT_SET_H_
#include <ms/MeasurementSets.h>
#include <stddef.h>
#include "datatype.h"
enum MS_ERROR_CODES
{
ERR_MS_COLUMN_NOT_FOUND = -1,
ERR_MS_OUT_OF_RANGE = -2,
ERR_MS_NO_DATA = -3
};
struct RL_MeasurementSet
{
casacore::MeasurementSet* ms; // Pointer to the Measurement Set.
casacore::MSColumns* msc; // Pointer to the sub-tables.
casacore::MSMainColumns* msmc; // Pointer to the main columns.
unsigned int *a1, *a2;
unsigned int num_pols, num_channels, num_stations;
double freq_start_hz, freq_inc_hz;
double phase_centre_ra, phase_centre_dec;
double start_time, end_time, time_inc_sec;
};
typedef struct RL_MeasurementSet RL_MeasurementSet;
RL_MeasurementSet* ms_open(const char* filename);
void ms_close(RL_MeasurementSet* p);
void ms_ensure_num_rows(RL_MeasurementSet* p, unsigned long int num);
double ms_freq_inc_hz(const RL_MeasurementSet* p);
double ms_freq_start_hz(const RL_MeasurementSet* p);
unsigned int ms_num_channels(const RL_MeasurementSet* p);
unsigned int ms_num_pols(const RL_MeasurementSet* p);
unsigned int ms_num_rows(const RL_MeasurementSet* p);
unsigned int ms_num_stations(const RL_MeasurementSet* p);
double ms_phase_centre_ra_rad(const RL_MeasurementSet* p);
double ms_phase_centre_dec_rad(const RL_MeasurementSet* p);
double ms_time_inc_sec(const RL_MeasurementSet* p);
double ms_read_coords(RL_MeasurementSet* p,
unsigned int start_row, unsigned int num_coords,
double* uu, double* vv, double* ww, int* status);
void ms_read_sigma(RL_MeasurementSet* p,
unsigned int start_row, unsigned int num_coords,
float* sigma2, int* status);
unsigned long int ms_read_Flag(RL_MeasurementSet* p,
unsigned int start_row, unsigned int start_channel,
unsigned int num_channels, unsigned int num_coords,
const char* column, bool* flag, int* status);
void ms_read_vis(RL_MeasurementSet* p,
unsigned int start_row, unsigned int start_channel,
unsigned int num_channels, unsigned int num_coords,
const char* column, complexd* vis, int* status);
void ms_write_vis(RL_MeasurementSet* p,
unsigned int start_row, unsigned int start_channel,
unsigned int num_channels, unsigned int num_coords,
const complexd* vis);
#endif /* MEASUREMENT_SET_H_ */