From d365caaf83486f03d048ebd9f748427d0c450218 Mon Sep 17 00:00:00 2001 From: damonge Date: Sun, 22 Sep 2024 22:02:28 +0100 Subject: [PATCH 1/4] norm_type now saved properly --- src/nmt_io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nmt_io.c b/src/nmt_io.c index 5b49a50b..7957df3a 100644 --- a/src/nmt_io.c +++ b/src/nmt_io.c @@ -17,6 +17,7 @@ static void nmt_workspace_info_tohdus(fitsfile *fptr, fits_write_key(fptr,TINT,"LMAX_MASK",&(w->lmax_mask),NULL,status); fits_write_key(fptr,TINT,"IS_TEB",&(w->is_teb),NULL,status); fits_write_key(fptr,TINT,"NCLS",&(w->ncls),NULL,status); + fits_write_key(fptr,TINT,"NORM_TYPE",&(w->norm_type),NULL,status); for(ii=0;iicoupling_matrix_unbinned[ii],status); @@ -34,6 +35,9 @@ static void nmt_workspace_info_fromhdus(fitsfile *fptr, fits_read_key(fptr,TINT,"LMAX_MASK",&(w->lmax_mask),NULL,status); fits_read_key(fptr,TINT,"IS_TEB",&(w->is_teb),NULL,status); fits_read_key(fptr,TINT,"NCLS",&(w->ncls),NULL,status); + fits_read_key(fptr,TINT,"NORM_TYPE",&(w->norm_type),NULL,status); + if(status) // maybe used old format + w->norm_type=0; long ii; long n_el=w->ncls*(w->lmax+1); long fpixel[2]={1,1}; From 15844448bd7a0fb672faf4f9d2a49e386190f954 Mon Sep 17 00:00:00 2001 From: damonge Date: Sun, 22 Sep 2024 22:07:57 +0100 Subject: [PATCH 2/4] missing status reset --- src/nmt_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nmt_io.c b/src/nmt_io.c index 7957df3a..a95147aa 100644 --- a/src/nmt_io.c +++ b/src/nmt_io.c @@ -36,8 +36,10 @@ static void nmt_workspace_info_fromhdus(fitsfile *fptr, fits_read_key(fptr,TINT,"IS_TEB",&(w->is_teb),NULL,status); fits_read_key(fptr,TINT,"NCLS",&(w->ncls),NULL,status); fits_read_key(fptr,TINT,"NORM_TYPE",&(w->norm_type),NULL,status); - if(status) // maybe used old format + if(status) {// maybe used old format w->norm_type=0; + status=0; + } long ii; long n_el=w->ncls*(w->lmax+1); long fpixel[2]={1,1}; From b831f2deaff73778eca8446e3668240a5dd4b6ac Mon Sep 17 00:00:00 2001 From: damonge Date: Sun, 22 Sep 2024 22:16:46 +0100 Subject: [PATCH 3/4] missing status reset --- src/nmt_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nmt_io.c b/src/nmt_io.c index a95147aa..917bb700 100644 --- a/src/nmt_io.c +++ b/src/nmt_io.c @@ -36,9 +36,9 @@ static void nmt_workspace_info_fromhdus(fitsfile *fptr, fits_read_key(fptr,TINT,"IS_TEB",&(w->is_teb),NULL,status); fits_read_key(fptr,TINT,"NCLS",&(w->ncls),NULL,status); fits_read_key(fptr,TINT,"NORM_TYPE",&(w->norm_type),NULL,status); - if(status) {// maybe used old format + if(*status) {// maybe used old format w->norm_type=0; - status=0; + *status=0; } long ii; long n_el=w->ncls*(w->lmax+1); From 0bf988ed1038d8e1a2323d587c33dfac63374a5f Mon Sep 17 00:00:00 2001 From: damonge Date: Sun, 22 Sep 2024 22:19:57 +0100 Subject: [PATCH 4/4] missing status reset --- src/nmt_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nmt_io.c b/src/nmt_io.c index 917bb700..bb533728 100644 --- a/src/nmt_io.c +++ b/src/nmt_io.c @@ -29,16 +29,18 @@ static void nmt_workspace_info_fromhdus(fitsfile *fptr, int w_unbinned, int *status) { + int status_pre; fits_movnam_hdu(fptr,IMAGE_HDU,"WSP_PRIMARY",0,status); fits_read_key(fptr,TINT,"LMAX",&(w->lmax),NULL,status); fits_read_key(fptr,TINT,"LMAX_FIELDS",&(w->lmax_fields),NULL,status); fits_read_key(fptr,TINT,"LMAX_MASK",&(w->lmax_mask),NULL,status); fits_read_key(fptr,TINT,"IS_TEB",&(w->is_teb),NULL,status); fits_read_key(fptr,TINT,"NCLS",&(w->ncls),NULL,status); + status_pre = *status; fits_read_key(fptr,TINT,"NORM_TYPE",&(w->norm_type),NULL,status); if(*status) {// maybe used old format w->norm_type=0; - *status=0; + *status=status_pre; } long ii; long n_el=w->ncls*(w->lmax+1);