1 /*
2  * Copyright (c) 2014-2021, The OSKAR Developers.
3  * See the LICENSE file at the top-level directory of this distribution.
4  */
5 
6 #include "telescope/station/private_station.h"
7 #include "telescope/station/oskar_station.h"
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
oskar_station_save_apodisation(const oskar_Station * station,int feed,const char * filename,int * status)16 void oskar_station_save_apodisation(const oskar_Station* station, int feed,
17         const char* filename, int* status)
18 {
19     FILE* file = 0;
20     if (*status || !station) return;
21     file = fopen(filename, "w");
22     if (!file)
23     {
24         *status = OSKAR_ERR_FILE_IO;
25         return;
26     }
27     oskar_mem_save_ascii(file, 1, 0, oskar_station_num_elements(station),
28             status, oskar_station_element_weight_const(station, feed));
29     fclose(file);
30 }
31 
32 #ifdef __cplusplus
33 }
34 #endif
35