From 67d6bbf47a7dde5ef0de7e1b88be12aada0c4d99 Mon Sep 17 00:00:00 2001 From: Maciej Serylak Date: Tue, 1 Nov 2016 23:51:01 +0200 Subject: [PATCH 1/2] Update readpsrfits_hd.c Will help with conversion PSRFITS -> filerbank (SIGPROC). --- src/readpsrfits_hd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/readpsrfits_hd.c b/src/readpsrfits_hd.c index 5c2fc46..6706050 100644 --- a/src/readpsrfits_hd.c +++ b/src/readpsrfits_hd.c @@ -79,7 +79,11 @@ void readpsrfits_hd(char *filename,int *machine_id,int *telescope_id,int *data_t *telescope_id=8; else if (strcasecmp(telescope,"SRT")==0) *telescope_id=10; - else + else if (strcasecmp(telescope,"MEERKAT")==0) + *telescope_id=64; + else if (strcasecmp(telescope,"KAT-7")==0) + *telescope_id=65; + else *telescope_id = -1; // Start time From fcb3f44c179a84b2efc5d07aabdd6c2bb33cbcf6 Mon Sep 17 00:00:00 2001 From: Maciej Serylak Date: Wed, 2 Nov 2016 11:59:26 +0200 Subject: [PATCH 2/2] Update readpsrfits_hd.c --- src/readpsrfits_hd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/readpsrfits_hd.c b/src/readpsrfits_hd.c index 6706050..025da74 100644 --- a/src/readpsrfits_hd.c +++ b/src/readpsrfits_hd.c @@ -19,7 +19,7 @@ void readpsrfits_hd(char *filename,int *machine_id,int *telescope_id,int *data_t int status; float obsbw,fc; char sobsbw[100],sfc[100],ras[100],decs[100]; - char name[100],telescope[100]; + char name[100],telescope[100],machine[100]; double h,m,sec,chanbw,smjd,offs; int imjd; @@ -86,6 +86,18 @@ void readpsrfits_hd(char *filename,int *machine_id,int *telescope_id,int *data_t else *telescope_id = -1; + // Parse machine_id + fits_read_key(fp, TSTRING, "BACKEND", machine, NULL, &status); + fits_report_error(stderr,status); + if (strcasecmp(machine,"PSPM")==0) + *machine_id=1; + else if (strcasecmp(machine,"KAT")==0) + *machine_id=64; + else if (strcasecmp(machine,"KAT-DC2")==0) + *machine_id=65; + else + *machine_id = -1; + // Start time *tstart = imjd+(smjd+offs)/86400.0;