[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master d6051a1 074/113: Upperlimit magnitude in 3D, c
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master d6051a1 074/113: Upperlimit magnitude in 3D, corrected creation of check table |
Date: |
Fri, 16 Apr 2021 10:33:50 -0400 (EDT) |
branch: master
commit d6051a1260d61e28df0b79ff63aaf7d0f4226fef
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Upperlimit magnitude in 3D, corrected creation of check table
When converting the Z axis position to UINT32, we were mistakenly making a
copy of the Y position. So when freeing, MakeCatalog would abort with a
segmentation fault. It now correctly copies from the Z axis.
Also, the conversion is now only done on non-32-bit systems.
---
bin/mkcatalog/upperlimit.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/bin/mkcatalog/upperlimit.c b/bin/mkcatalog/upperlimit.c
index 2b271be..d883a4e 100644
--- a/bin/mkcatalog/upperlimit.c
+++ b/bin/mkcatalog/upperlimit.c
@@ -405,11 +405,16 @@ upperlimit_write_check(struct mkcatalogparams *p,
gal_list_sizet_t *check_x,
"Sum of pixel values over random footprint.");
- /* Convert the unsigned 64-bit values to 32-bit because the FITS table
- format doesn't recognize 64-bit integers.*/
- x=gal_data_copy_to_new_type_free(x, GAL_TYPE_UINT32);
- y=gal_data_copy_to_new_type_free(y, GAL_TYPE_UINT32);
- if(check_z) z=gal_data_copy_to_new_type_free(y, GAL_TYPE_UINT32);
+ /* If `size_t' isn't 32-bit on this system, then convert the unsigned
+ 64-bit values to 32-bit because the FITS table format doesn't
+ recognize 64-bit integers.*/
+ if( GAL_TYPE_SIZE_T != GAL_TYPE_UINT32 )
+ {
+ x=gal_data_copy_to_new_type_free( x, GAL_TYPE_UINT32);
+ y=gal_data_copy_to_new_type_free( y, GAL_TYPE_UINT32);
+ if(check_z)
+ z=gal_data_copy_to_new_type_free( z, GAL_TYPE_UINT32);
+ }
/* Write exactly what object/clump this table is for. */
@@ -684,7 +689,8 @@ upperlimit_one_tile(struct mkcatalog_passparams *pp,
gal_data_t *tile,
parsed. */
if(continueparse) uparr[ counter++ ] = sum;
- /* If a check is necessary, write in the values. */
+ /* If a check is necessary, write in the values (in FITS
+ coordinates). */
if(writecheck)
{
switch(ndim)
- [gnuastro-commits] master 54b099d 043/113: Neighbors options doc generalized for different dimensions, (continued)
- [gnuastro-commits] master 54b099d 043/113: Neighbors options doc generalized for different dimensions, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 5cd3c1e 044/113: Recent work in master merged, small conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 1b0046b 051/113: Recent additions in master imported here, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master b1ea932 054/113: Separate Segment program now available in 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master f537368 066/113: Segment's default 3D configuration file in tarball, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 133e277 071/113: Imported recent work from master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master a42ac37 085/113: Fixed MakeProfiles loop in checking radius values, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 1f9d941 090/113: Imported recent work in master, conflicts fixed, Mohammad Akhlaghi, 2021/04/16
- [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 <=
- [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, 2021/04/16
- [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