[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 0b1a4792: MakeProfiles: first pixel of profile
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 0b1a4792: MakeProfiles: first pixel of profile not checked for truncation |
Date: |
Fri, 13 Sep 2024 13:19:44 -0400 (EDT) |
branch: master
commit 0b1a479242a365ed5eef4896c7e03b495bc188e3
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
MakeProfiles: first pixel of profile not checked for truncation
Until now, all the pixels of a profile where checked for being within the
truncation radius. As a result, when the given profile was extremely small
(such that its floating-point center would be more distant from the pixel's
center than the truncation radius) MakeProfiles would not produce any
pixels at all, returning NaN for all the profiles pixels!
With this commit, the distance of the pixel center from the profile center
(to check for trunction) is only applied after the first pixel. This solves
the problem described above.
In the debugging process, I noticed that one of the parts of the same
function (comment and description of the call to 'print_tossll') is no
longer applicable/useful, so I removed it.
This bug was reported by Alejandro Camazón Pinilla.
This fixes bug #66216.
---
NEWS | 8 ++++++++
THANKS | 1 +
bin/mkprof/oneprofile.c | 15 +++++++--------
doc/announce-acknowledge.txt | 1 +
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/NEWS b/NEWS
index 3553709d..2853aa2e 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,14 @@ See the end of the file for license conditions.
** Changed features
** Bugs fixed
+ - bug #66216: NaN values in MakeProfile outputs for very small profiles
+ (smaller than a pixel even after accounting for the truncation
+ factor). Reported by Alejandro Camazón Pinilla.
+
+
+
+
+
* Noteworthy changes in release 0.23 (library 21.0.0) (2024-07-13)
** New publications
diff --git a/THANKS b/THANKS
index 2a11da83..bfcce45c 100644
--- a/THANKS
+++ b/THANKS
@@ -24,6 +24,7 @@ support in Gnuastro. The list is ordered alphabetically (by
first name).
Alan Lefor alefor@astr.tohoku.ac.jp
Alberto Madrigal brt.madrigal@gmail.com
Alberto Moreno Signes amoreno@cefca.es
+ Alejandro Camazón Pinilla acamazon@ufl.edu
Alejandro Lumbreras Calle alumbreras@cefca.es
Alejandro Serrano Borlaff asborlaff@ucm.es
Alessandro Ederoclite aederocl@gmail.com
diff --git a/bin/mkprof/oneprofile.c b/bin/mkprof/oneprofile.c
index 22bc9588..e2faf1f7 100644
--- a/bin/mkprof/oneprofile.c
+++ b/bin/mkprof/oneprofile.c
@@ -397,19 +397,18 @@ oneprofile_pix_by_pix(struct mkonthread *mkp)
case PROFILE_GAUSSIAN:
while(sQ)
{
- /* In case you want to see the status of the twosided ordered
- queue, increasing and decreasing side by side, uncomment this
- line. Note that there will be a lot of lines printed! */
- /*print_tossll(lQ, sQ);*/
-
/* Pop a pixel from the queue, convert its index into coordinates
and use them to estimate the elliptical radius of the
- pixel. If the pixel is outside the truncation radius, ignore
- it. */
+ pixel. */
p=gal_list_dosizet_pop_smallest(&lQ, &sQ, &circ_r);
oneprofile_set_coord(mkp, p);
oneprofile_r_el(mkp);
- if(mkp->r > truncr) continue;
+
+ /* If the pixel is outside the truncation radius, ignore it. But
+ not if this is the first pixel that is being placed: when
+ truncation radius can be smaller than one pixel, see
+ https://savannah.gnu.org/bugs/index.php?66216*/
+ if(lQ && mkp->r > truncr) continue;
/* Set the range for this pixel. */
for(i=0;i<ndim;++i)
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index cfa168cc..613182ca 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,5 +1,6 @@
Alphabetically ordered list to acknowledge in the next release.
+Alejandro Camazón Pinilla
Alejandro Lumbreras-Calle
Antonio Diaz Diaz
Hok Kan (Ronald) Tsang
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 0b1a4792: MakeProfiles: first pixel of profile not checked for truncation,
Mohammad Akhlaghi <=