[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master b5385f7 093/113: Projected spectra given NaN w
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master b5385f7 093/113: Projected spectra given NaN when no measurement on slice |
Date: |
Fri, 16 Apr 2021 10:33:57 -0400 (EDT) |
branch: master
commit b5385f7412a85d47b97ff9a380167313984fb083
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Projected spectra given NaN when no measurement on slice
In the spectra extensions of MakeCatalog's output we report the area of
measurements on each slice for all spectra except the projected
spectra. But this caused complications in interpretting the value of zero
in a projected spectra: is the sum of values zero, or is the whole slice
blank (for example because of Sky lines)?
So with this commit, when no measurement could be made in the projected
spectra, at the end of parsing the slice, we set it (and its error) to NaN.
---
bin/mkcatalog/parse.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/mkcatalog/parse.c b/bin/mkcatalog/parse.c
index 4c4cc55..d9adaff 100644
--- a/bin/mkcatalog/parse.c
+++ b/bin/mkcatalog/parse.c
@@ -303,7 +303,7 @@ parse_spectrum(struct mkcatalog_passparams *pp, gal_data_t
*xybin)
gal_data_t *area;
float *st_v, *st_std;
uint32_t *narr, *oarr;
- size_t *tsize, start_end_inc[2];
+ size_t nproj=0, *tsize, start_end_inc[2];
uint8_t *xybinarr = xybin ? xybin->array : NULL;
int32_t *O, *OO, *st_o, *objarr=p->objects->array;
size_t tid, *dsize=p->objects->dsize, num_increment=1;
@@ -366,6 +366,7 @@ parse_spectrum(struct mkcatalog_passparams *pp, gal_data_t
*xybin)
/* Projected spectra: see if we have a value of `2' in the
`xybin' array (showing that there is atleast one non-blank
element there over the whole spectrum. */
+ ++nproj;
parr [ sind ] += *V;
pearr[ sind ] += var;
@@ -403,7 +404,9 @@ parse_spectrum(struct mkcatalog_passparams *pp, gal_data_t
*xybin)
index `pind' if we have just finished parsing a slice. */
if( (num_increment-1)%pp->tile->dsize[1]==0 )
{
- pind=0;
+ if(nproj==0) parr[sind]=pearr[sind]=NAN;
+
+ nproj=pind=0;
++sind;
}
}
- [gnuastro-commits] master 737a0cd 046/113: Merged recent corrections in master branch, (continued)
- [gnuastro-commits] master 737a0cd 046/113: Merged recent corrections in master branch, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 486f915 067/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master d6051a1 074/113: Upperlimit magnitude in 3D, corrected creation of check table, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 5dac3c3 075/113: Recent work in master imported, small conflict in book fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 3882956 077/113: Narrow-band areas from MakeCatalog in 3D datasets, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master abe82cb 086/113: Imported recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 924787b 098/113: Updated copyright year in files specific to this branch, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master fbbc2fc 100/113: Imported recent work in master, minor conflict fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 22d0fba 089/113: Imported recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 8edc804 092/113: Imported recent work in master, minor conflic fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master b5385f7 093/113: Projected spectra given NaN when no measurement on slice,
Mohammad Akhlaghi <=
- [gnuastro-commits] master ac2a821 103/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 3f51e31 108/113: Imported work in master, conflicts fixed, corrections made, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 45bd003 049/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 6f85919 060/113: Connectivity of 2, for filling pseudo-detection holes in 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 442d052 061/113: Imported work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 9285abe 057/113: Imported recent work from master with corrections, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master c91d988 063/113: Recent work in master merged, conflicts corrected, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 05cc693 080/113: Added 3rd dimension to MakeCatalog's minimum-maximum columns, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 0eaf0dc 091/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 9e2397a 094/113: Imported recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16