[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master e5c4e986: MakeProfiles: now using input catalo
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master e5c4e986: MakeProfiles: now using input catalog's magnitude column by default |
Date: |
Sat, 7 May 2022 20:22:32 -0400 (EDT) |
branch: master
commit e5c4e98606b7b2759f9251de6b413f34d5996d86
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
MakeProfiles: now using input catalog's magnitude column by default
Until now, when a custom profile was given to MakeProfiles, the profile's
raw values were directly inserted into the 2D image (effectively ignoring
the requested magnitude in the main input catalog!). This was un-expected
behavior (because the magnitude should be set in that high-level catalog;
and this works for all other profile types).
With this commit, by default once the 2D image is created, it will be
scaled to the requested magnitude in that particular row of the input
catalog (like all other profiles!). However, if a user wants to use the raw
values in the profile (and ignore the total magnitude), they can use the
newly added '--mcolnocustprof' option to get the old behavior.
This was suggested by Elham Saremi.
---
NEWS | 11 +++++++++++
bin/mkprof/args.h | 15 ++++++++++++++-
bin/mkprof/main.h | 3 ++-
bin/mkprof/oneprofile.c | 2 +-
bin/mkprof/ui.h | 1 +
doc/announce-acknowledge.txt | 3 ++-
doc/gnuastro.texi | 12 +++++++++++-
7 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/NEWS b/NEWS
index 839cf38e..a79434c9 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,9 @@ See the end of the file for license conditions.
command). The magnitude of the inserted image can be set in the
magnitude column of the input catalog. This can be disabled (to use
the original image pixel values) using the '--mcolnocustimg' option.
+ --mcolnocustprof: new option to disable scaling of custom radial profiles
+ to required magnitude when building a 2D image from them.
+
astscript-radial-profile:
--zeroisnotblank: new option to account for zero-valued pixels in the
@@ -58,6 +61,14 @@ See the end of the file for license conditions.
'custom-prof' (until now, it was called 'custom'). This was necessary
because of the new custom image feature that has been added. The code
for this custom radial profile function (8) hasn't changed.
+ - After constructing a custom radial profile (the 'custom-prof'
+ profile), MakeProfiles will scale it to have the desired total
+ magnitude in the input catalog of all profiles. Until now, the 2D
+ images created from a custom radial profile wouldn't be touched and
+ the pixel values would exactly come from the custom radial profile
+ (ignoring the magnitude column of the input catalog). To have the old
+ behavior, use the new '--mcolnocustprof' option. This new
+ functionality was proposed by Elham Saremi.
** Bugs fixed
bug #62216: MakeProfiles crash when a 3D cube is requested and input
diff --git a/bin/mkprof/args.h b/bin/mkprof/args.h
index 743e0f20..ce31b802 100644
--- a/bin/mkprof/args.h
+++ b/bin/mkprof/args.h
@@ -313,7 +313,7 @@ struct argp_option program_options[] =
UI_KEY_MCOLNOCUSTIMG,
0,
0,
- "Ignore the value of mcol in 'custom-img'.",
+ "Ignore value of mcol in 'custom-img'.",
UI_GROUP_PROFILES,
&p->mcolnocustimg,
GAL_OPTIONS_NO_ARG_TYPE,
@@ -321,6 +321,19 @@ struct argp_option program_options[] =
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
+ {
+ "mcolnocustprof",
+ UI_KEY_MCOLNOCUSTPROF,
+ 0,
+ 0,
+ "Ignore value of mcol in 'custom-prof'.",
+ UI_GROUP_PROFILES,
+ &p->mcolnocustprof,
+ GAL_OPTIONS_NO_ARG_TYPE,
+ GAL_OPTIONS_RANGE_0_OR_1,
+ GAL_OPTIONS_NOT_MANDATORY,
+ GAL_OPTIONS_NOT_SET
+ },
{
"shift",
UI_KEY_SHIFT,
diff --git a/bin/mkprof/main.h b/bin/mkprof/main.h
index 46215336..c9eb945f 100644
--- a/bin/mkprof/main.h
+++ b/bin/mkprof/main.h
@@ -155,7 +155,8 @@ struct mkprofparams
char *tcol; /* Truncation of the profiles. */
uint8_t mforflatpix; /* mcol is flat pixel value (f is 4 or 5). */
uint8_t mcolisbrightness; /* mcol is total brightness, not magnitude. */
- uint8_t mcolnocustimg; /* mcol should be ignored in 'custom-img'. */
+ uint8_t mcolnocustimg; /* mcol is ignored in 'custom-img'. */
+ uint8_t mcolnocustprof; /* mcol is ignored in 'custom-profile'. */
gal_data_t *crpix; /* CRPIX FITS header keywords. */
gal_data_t *crval; /* CRVAL FITS header keywords. */
gal_data_t *cdelt; /* For CDELTi FITS header keywords. */
diff --git a/bin/mkprof/oneprofile.c b/bin/mkprof/oneprofile.c
index 45a80271..a5340807 100644
--- a/bin/mkprof/oneprofile.c
+++ b/bin/mkprof/oneprofile.c
@@ -757,7 +757,7 @@ oneprofile_set_prof_params(struct mkonthread *mkp)
case PROFILE_CUSTOM_PROF:
mkp->profile = profiles_custom_table;
mkp->truncr = tp ? p->t[id] : p->t[id]*p->r[id];
- mkp->correction = 0;
+ mkp->correction = p->mcolnocustprof ? 0 : 1;
break;
diff --git a/bin/mkprof/ui.h b/bin/mkprof/ui.h
index 2f91b0d2..2424ea56 100644
--- a/bin/mkprof/ui.h
+++ b/bin/mkprof/ui.h
@@ -75,6 +75,7 @@ enum option_keys_enum
UI_KEY_PSFINIMG = 1000,
UI_KEY_MAGATPEAK,
UI_KEY_MCOLISBRIGHTNESS,
+ UI_KEY_MCOLNOCUSTPROF,
UI_KEY_MCOLNOCUSTIMG,
UI_KEY_MODE,
UI_KEY_CCOL,
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 6fcad7bb..279b1c97 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -3,8 +3,9 @@ Alphabetically ordered list to acknowledge in the next release.
Sepideh Eskandarlou
SÃlvia Farras
Juan Miro
-Ignacio Ruiz Cejudo
Irene Pintos Castro
+Ignacio Ruiz Cejudo
+Elham Saremi
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index da8c0b44..cd37c0d0 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -22951,7 +22951,10 @@ In the latter case, just note that the central values
are going to be incorrect
@item
Custom radial profile with `@code{custom-prof}' or `@code{8}'.
-The values to use for each radial interval should be in the table given to
@option{--customtable}. For more, see @ref{MakeProfiles profile settings}.
+The values to use for each radial interval should be in the table given to
@option{--customtable}.
+By default, once the profile is built with the given values, it will be scaled
to have a total magnitude that you have requested in the magnitude column of
the profile (in @option{--mcol}).
+If you want the raw values in the 2D profile (to ignore the magnitude column),
use @option{--mcolnocustprof}.
+For more, see the description of @option{--customtable} in @ref{MakeProfiles
profile settings}.
@item
Azimuthal angle profile with `@code{azimuth}' or `@code{9}'.
@@ -23073,6 +23076,10 @@ The zero point magnitude (value to the
@option{--zeropoint} option) is ignored a
Recall that the total profile magnitude or brightness that is specified with
in the @option{--mcol} column of the input catalog is not an integration to
infinity, but the actual sum of pixels in the profile (until the desired
truncation radius).
See @ref{Profile magnitude} for more on this point.
+@item --mcolnocustprof
+Don't touch (re-scale) the custom profile that should be inserted in
@code{custom-prof} profile (see the description of @option{--fcol} in
@ref{MakeProfiles catalog} or the description of @option{--customtable} below).
+By default, MakeProfiles will scale (multiply) the custom image's pixels to
have the desired magnitude (or brightness if @option{--mcolisbrightness} is
called) in that row.
+
@item --mcolnocustimg
Don't touch (re-scale) the custom image that should be inserted in
@code{custom-img} profile (see the description of @option{--fcol} in
@ref{MakeProfiles catalog}).
By default, MakeProfiles will scale (multiply) the custom image's pixels to
have the desired magnitude (or brightness if @option{--mcolisbrightness} is
called) in that row.
@@ -23141,6 +23148,9 @@ asttable radial.fits -c'arith $1 1 -' -c1,2
-ocustom.fits
In case the intervals are different from 1 (for example 0.5), change the
@code{$1 1 -} to @code{$1 0.5 -}.
On a side-note, Gnuastro has features to extract the radial profile of an
object from the image, see @ref{Generate radial profile}.
+By default, once a 2D image is constructed for the radial profile, it will be
scaled such that its total magnitude corresponds to the value in the magnitude
column (@option{--mcol}) of the main input catalog.
+If you want to disable the scaling and use the raw values in your custom
profile (in other words: you want to ignore the magnitude column) you need to
call @option{--mcolnocustprof} (see above).
+
@item --customtablehdu INT/STR
The HDU/extension in the FITS file given to @option{--customtable}.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master e5c4e986: MakeProfiles: now using input catalog's magnitude column by default,
Mohammad Akhlaghi <=