eposio.h
1
2/***************************************************************************
3 *
4 * Copyright (C) 2004 by Ramesh Karuppusamy
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8/*
9 *
10 * eposio.h - defines a C interface to read EPOS files
11 *
12 * The structs defined in this header file must be a binary match the EPOS data structure
13 * The EPOS files are always multiples of 17000 bytes.
14 *
15 * Ramesh Karuppusamy - June 2012
16 *
17 */
18
19#ifndef __EPOS_IO_H
20#define __EPOS_IO_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26typedef struct {
27 short int isn; /* scan number */
28 short int issn; /* sub-scan number*/
29 short int mbltp; /* block number in pulsar data file*/
30 short int mblsc; /* block number in the scan*/
31 short int iyr; /* year of observation */
32 short int imon; /* month */
33 short int iday; /* day */
34 short int ihr; /* hour*/
35 short int imin; /* minute */
36 short int isec; /* second */
37 short int modtel; /* telescope mode (idle, observing, stop) */
38 int ialpha; /* RA in milliarcs */
39 int idelta; /* DEC in milliarcs */
40 short int dummy0; /* unused*/
41 short int J11status; /* J11 status*/
42 short int dummy1; /* unused*/
43 short int J11istatus; /* J11 internal status*/
44 int J11ictr; /* J11 idle counter*/
45 short int dummy2[10]; /* unused*/
46 int masterref; /* Maser reference clock (Hz)*/
47 int ireqper1; /* requested barycentric period*/
48 int ireqper2; /* period=ireqper1*ireqper2/maserref*/
49 int ireqvel; /* requested doppler velocity correction*/
50 int ireqdel; /* last used delay*/
51 short int npul; /* number of pulses integrated by PUB (internal)*/
52 short int isamp0; /* requested sampling time in microseconds*/
53 short int dummy3[4]; /* unused */
54 short int J11clkday; /* J11 internal clock - day */
55 short int J11clkhr; /* J11 internal clock - hour */
56 short int J11clkmin; /* J11 internal clock - minute */
57 short int J11clksec; /* J11 internal clock - second */
58 short int intclkday; /* internal clock - day */
59 short int intclkhr; /* internal clock - hour */
60 short int intclkmin; /* internal clock - minute */
61 short int intclksec; /* internal clock - second */
62 short int dummy4[4]; /* unused */
63 int ical; /* cal duration in microseconds */
64 short int dummy5[2]; /* unused */
65 unsigned char ver[8];/* program version */
66 unsigned char syncstat[8];/* synchroisation status */
67 int iactper1; /* actual period*/
68 int iactper2; /* current period=iactper1*iactper2/maserref*/
69 int iactvel; /* current doppler velocity*/
70 int itotdel; /* total accumulated delay*/
71 short int isyncday; /*day of last sync - pulse phase is referred to this time */
72 short int isynchr; /*hour of last sync (MET)*/
73 short int isyncmin; /*minute of last sync */
74 short int isyncsec; /*second of last sync (multiple of 10!)*/
75 short int intday; /*day of intergration start*/
76 short int inthr; /*hour*/
77 short int intmin; /*min */
78 short int intsec; /*second */
79 unsigned char source[24]; /* source name*/
80 int baryper_us; /* timapr - barycentric period in microseconds */
81 int baryper_ps; /* timapr- barycentric period in picoseconds */
82 int nc1; /* counter correction stage 1 */
83 int nc2; /* counter correction stage 2 */
84 int nc3; /* periods until 0.5 microsecond drift */
85 short int dummy6; /*unused */
86 int freq_hz; /* this plus next two items - valid for observations made after 01 Nov 2002*/
87 int freq_ghz;
88 int feedpos; /* feed rotation in telescope units. rot(deg) = (feedpos - 555)* 0.036*/
89 short int dummy7[10];
90 int isyncusec; /* microseconds since last sync*/
91 short int numsamm; /* content counter*/
92 short int nint; /* number of integrations */
93 short int isamp; /* sampling time - divide this by 5, as this runs off a 150MHz clock*/
94 short int sampsrc; /* sampling source - 0:internal, 1:external */
95 short int timeref; /* time reference 0:pulsar 1:sampling period*/
96 short int inp[4]; /* no description */
97
98} eposhdr_t;
99
100typedef struct{
101 int data0[1024];
102 int data1[1024];
103 int data2[1024];
104 int data3[1024];
105 short int checksum;
106 short int dummy0[6]; /* no description */
107 unsigned char jhspuls[32]; /* used by JHSPULS*/
108 unsigned char dummy1[288]; /*empty */
109}eposdata_t;
110
111 int check_file(const char *filename, eposhdr_t *eposhdr, int verbose);
112 int get_nsubints(const char *filename);
113 int get_hdr(const char *filename, eposhdr_t *eposhdr, unsigned subint, int verbose);
114 int get_data(const char *filename, eposdata_t *eposdata, unsigned subint, int verbose);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif

Generated using doxygen 1.14.0