[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master a3074242: radial-profile: new options for prec
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master a3074242: radial-profile: new options for precision and radial interval |
Date: |
Wed, 7 Dec 2022 22:49:40 -0500 (EST) |
branch: master
commit a30742427e03e870b3a13954166eea92ad788582
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
radial-profile: new options for precision and radial interval
Until now, the radial profile script could only measure radii on an integer
basis. For example all the 8-connected neighbors of central pixel would be
considered at radius 2! Also, when oversampling was called, it wouldn't put
the central over-sampled pixel in the center of the original-resolution
pixel! Furthermore, when you wanted to build a 2D profile, it wasn't easy
to prepare the output for giving as a '--customtable' in MakeProfiles!
With this commit, all these issues are addressed: the new '--precision'
option allows for having a higher precision in sampling the profile, the
bug with oversampling has been fixed by accounting for this fact and a new
option called '--radinterval' has been added which will cause the output to
report intervals instead of a single value (ready to be fed to
MakeProfiles). This was particularly necessary after adding the precision
feature.
This bug was reported by Nafiseh Sedighi.
This fixes bug #63485.
---
NEWS | 16 +++++
bin/mkprof/ui.c | 2 +-
bin/script/radial-profile.in | 160 +++++++++++++++++++++++++++++++++----------
doc/announce-acknowledge.txt | 1 +
doc/gnuastro.texi | 124 +++++++++++++++++++++++++++++----
5 files changed, 250 insertions(+), 53 deletions(-)
diff --git a/NEWS b/NEWS
index e885649e..a43f3990 100644
--- a/NEWS
+++ b/NEWS
@@ -77,6 +77,20 @@ See the end of the file for license conditions.
Statistics:
--outliernumngb: see description of same option in NoiseChisel.
+ astscript-radial-profile:
+ --precision: sample the radial profile at precisions less than one
+ pixel. This is useful when you need to sample the profile within the
+ central few pixels more accurately than integer pixels. See the
+ documentation of this option in the book for a complete explanation
+ with examples.
+ --radinterval: output will contain two radius columns (showing the
+ radial interval of each measurement). Without this option, the output
+ only contains a single radius column (showing the central radius of
+ the measurement in each row). This greatly simplifies scenarios where
+ you want to build a 2D image of the profile, see the description of
+ this option in the book for a more complete description and an example
+ usage.
+
Library:
- GAL_ARITHMETIC_OP_SWAP: swap the top two operands.
- GAL_ARITHMETIC_OP_INDEX: An index (counting from 0) for every element.
@@ -159,6 +173,8 @@ See the end of the file for license conditions.
Serrano Borlaff.
bug #63399: Table's '--noblank' or '--noblankend' crashing when input
has no rows. Reported by Elham Saremi.
+ bug #63485: Oversampling in radial profile has incorrect center. Reported
+ by Nafiseh Sedighi.
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 3fbec67c..081175c8 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -1850,7 +1850,7 @@ ui_read_custom_table(struct mkprofparams *p)
/* Make sure the table only has three columns. */
if(gal_list_data_number(cols) != 3 )
error(EXIT_FAILURE, 0, "%s: has %zu columns, but it should only "
- "have three columns. Column1: the radial interval's lower "
+ "have three columns. Column 1: the radial interval's lower "
"value. Column 2: the radial interval's higher value. "
"Column 3: the value to use for pixels within that radius "
"interval",
diff --git a/bin/script/radial-profile.in b/bin/script/radial-profile.in
index 75faf66a..d3e0ce8b 100644
--- a/bin/script/radial-profile.in
+++ b/bin/script/radial-profile.in
@@ -50,11 +50,13 @@ keeptmp=0
mode="img"
azimuth=""
measure=""
+precision=0
axisratio=1
zeropoint=""
sigmaclip=""
measuretmp=""
oversample=""
+radinterval=0
undersample=""
positionangle=0
zeroisnotblank=""
@@ -78,6 +80,9 @@ $scriptname: run with '--help' for list of options
EOF
}
+# Short options available for use:
+# b e f g j l n r w x y
+# A B C D E F G H J K L M N S T U W X Y
print_help() {
cat <<EOF
Usage: $scriptname [OPTION] FITS-files
@@ -111,24 +116,27 @@ $scriptname options:
-p, --positionangle=FLT Position angle for ellipse profiles.
-s, --sigmaclip=FLT,FLT Sigma-clip multiple and tolerance.
-z, --zeropoint=FLT Zeropoint magnitude of input dataset.
+ -Z, --zeroisnotblank 0.0 in float or double images are not blank.
Output:
-o, --output Output table with the radial profile.
-t, --tmpdir Directory to keep temporary files.
-k, --keeptmp Keep temporal/auxiliar files.
-m, --measure=STR Measurement operator (mean, sigclip-mean, etc.).
+ -P, --precision=INT Number of digits after the decimal point for radius.
-v, --oversample=INT Oversample for higher resolution radial profile.
-u, --undersample=INT Undersample for lower resolution radial profile.
- -i, --instd=FLT/STR Sky standard deviation per pixel, as a single number
- or as the filename.
+ -i, --instd=FLT/STR Sky standard deviation per pixel, as a single
+ number or as the filename.
-d, --stdhdu=STR HDU/extension of the sky standard deviation image.
+ -I, --radinterval Format output for the '--customtable' feature
+ of MakeProfile.
Operating mode:
-?, --help Print this help list.
--cite BibTeX citation for this program.
-q, --quiet Don't print any extra information in stdout.
-V, --version Print program version.
- -Z, --zeroisnotblank 0.0 in float or double images are not blank.
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
@@ -246,24 +254,29 @@ do
-t|--tmpdir) tmpdir="$2"; check_v "$1"
"$tmpdir"; shift;shift;;
-t=*|--tmpdir=*) tmpdir="${1#*=}"; check_v "$1"
"$tmpdir"; shift;;
-t*) tmpdir=$(echo "$1" | sed -e's/-t//'); check_v "$1"
"$tmpdir"; shift;;
- -m|--measure) measuretmp="$2"; check_v
"$1" "$measuretmp"; shift;shift;;
- -m=*|--measure=*) measuretmp="${1#*=}"; check_v
"$1" "$measuretmp"; shift;;
+ -m|--measure) measuretmp="$2"; check_v "$1"
"$measuretmp"; shift;shift;;
+ -m=*|--measure=*) measuretmp="${1#*=}"; check_v "$1"
"$measuretmp"; shift;;
-m*) measuretmp=$(echo "$1" | sed -e's/-m//'); check_v
"$1" "$measuretmp"; shift;;
+ -P|--precision) precision="$2"; check_v "$1"
"$precision"; shift;shift;;
+ -P=*|--precision=*) precision="${1#*=}"; check_v "$1"
"$precision"; shift;;
+ -P*) precision=$(echo "$1" | sed -e's/-P//'); check_v
"$1" "$precision"; shift;;
-o|--output) output="$2"; check_v "$1"
"$output"; shift;shift;;
-o=*|--output=*) output="${1#*=}"; check_v "$1"
"$output"; shift;;
-o*) output=$(echo "$1" | sed -e's/-o//'); check_v "$1"
"$output"; shift;;
- -v|--oversample) oversample="$2"; check_v
"$1" "$oversample"; shift;shift;;
- -v=*|--oversample=*) oversample="${1#*=}"; check_v
"$1" "$oversample"; shift;;
+ -v|--oversample) oversample="$2"; check_v "$1"
"$oversample"; shift;shift;;
+ -v=*|--oversample=*) oversample="${1#*=}"; check_v "$1"
"$oversample"; shift;;
-v*) oversample=$(echo "$1" | sed -e's/-v//'); check_v
"$1" "$oversample"; shift;;
- -u|--undersample) undersample="$2"; check_v
"$1" "$undersample"; shift;shift;;
- -u=*|--undersample=*) undersample="${1#*=}"; check_v
"$1" "$undersample"; shift;;
+ -u|--undersample) undersample="$2"; check_v "$1"
"$undersample"; shift;shift;;
+ -u=*|--undersample=*) undersample="${1#*=}"; check_v "$1"
"$undersample"; shift;;
-u*) undersample=$(echo "$1" | sed -e's/-u//'); check_v
"$1" "$undersample"; shift;;
-i|--instd) instd="$2"; check_v "$1"
"$instd"; shift;shift;;
-i=*|--instd=*) instd="${1#*=}"; check_v "$1"
"$instd"; shift;;
-i*) instd=$(echo "$1" | sed -e's/-i//'); check_v "$1"
"$instd"; shift;;
- -d|--stdhdu) stdhdu="$2"; check_v "$1"
"$stdhdu"; shift;shift;;
- -d=*|--stdhdu=*) stdhdu="${1#*=}"; check_v "$1"
"$stdhdu"; shift;;
- -d*) stdhdu=$(echo "$1" | sed -e's/-d//'); check_v "$1"
"$stdhdu"; shift;;
+ -d|--stdhdu) stdhdu="$2"; check_v "$1"
"$stdhdu"; shift;shift;;
+ -d=*|--stdhdu=*) stdhdu="${1#*=}"; check_v "$1"
"$stdhdu"; shift;;
+ -d*) stdhdu=$(echo "$1" | sed -e's/-d//'); check_v "$1"
"$stdhdu"; shift;;
+ -F|--radinterval) radinterval=1; shift;;
+ -F*|--radinterval=*) on_off_option_error --radinterval -I;;
# Non-operating options.
-q|--quiet) quiet="--quiet"; shift;;
@@ -340,6 +353,14 @@ if [ x"$azimuth" != x ]; then
fi
fi
+# The precision should be an integer, smaller than 6.
+pcheck=$(echo $precision \
+ | awk 'int($1)==$1 && $1>=0 && $1<=6 {print 1}')
+if [ x$pcheck = x ]; then
+ echo "$scriptname: value of '--precision' ($precision) must be an integer
between 0 to 6 (inclusive)"
+ exit 1
+fi
+
# If no specific measurement has been requested, use the mean.
if [ x"$measure" = x ]; then measure=mean; fi
@@ -512,8 +533,14 @@ if [ x"$oversample" = x ]; then
cd $tmpdir; ln -fs $cropstdbase $valuesstdbase; cd $curdir
fi
else
- xcenter=$(echo $xcenter | awk '{print '$oversample'*$1}')
- ycenter=$(echo $ycenter | awk '{print '$oversample'*$1}')
+ # For the central coordinate, we can't simply multiply the X,Y by the
+ # oversample factor otherwise the over-sampled pixel with distance of 0
+ # will be on the edge of the original pixel. To make sure that the
+ # central oversampled pixel is in the center of the original pixel, we
+ # need to shift by half the oversampling factor (as an integer).
+ os=$oversample # To shorten the next two commands!.
+ xcenter=$(echo $xcenter | awk '{print '$os'*$1-int('$os'/2)}')
+ ycenter=$(echo $ycenter | awk '{print '$os'*$1-int('$os'/2)}')
rmax=$(echo $rmax | awk '{print '$oversample'*$1}')
astwarp $crop --scale=$oversample,$oversample -o$values
if [ x"$instd" != x -a -f "$instd" ]; then
@@ -574,14 +601,15 @@ fi
# the radius 1 (to avoid missing the central pixel in later phases.
radialaperturesbase=radial-raw.fits
radialapertures=$tmpdir/$radialaperturesbase
+precfactor=$(astarithmetic 10 $precision pow --quiet)
radialaperturesholed=$tmpdir/radial-raw-with-hole.fits
echo "1 $xcenter $ycenter 7 $rmax 1 $positionangle $axisratio 1 1" \
| astmkprof --background=$values --backhdu=1 --mforflatpix \
- --mode=img --clearcanvas --type=int16 $quiet \
+ --mode=img --clearcanvas --type=float32 $quiet \
--circumwidth=1 --replace --output=$radialaperturesholed
astarithmetic $radialaperturesholed set-i \
i 0 ne 1 fill-holes set-good \
- i good i 1 + where \
+ i good i 1 + where $precfactor x uint32\
$quiet --output $radialapertures
rm $radialaperturesholed
@@ -668,7 +696,17 @@ fi
aperturesbase=apertures.fits
apertures=$tmpdir/$aperturesbase
if [ x"$undersample" != x ]; then
- astarithmetic $aperturesraw $undersample / \
+
+ # Divide by the undersampling factor (multiplied by the precision
+ # factor: multiple of 10).
+ astarithmetic $aperturesraw $undersample $precfactor int16 x / \
+ $quiet --output $apertures.fits
+
+ # The integer division above will re-create the 0-valued hole in the
+ # center! So we need to fill it like above.
+ astarithmetic $apertures.fits set-i \
+ i 0 ne 1 fill-holes set-good \
+ i good i 1 + where \
$quiet --output $apertures
else
cd $tmpdir; ln -fs $aperturesrawbase $aperturesbase; cd $curdir
@@ -740,40 +778,88 @@ astmkcatalog $apertures --hdu=1 --valuesfile=$values
--valueshdu=1 --ids \
-# Prepare the final output
-# ------------------------
-#
-# The raw MakeCatalog output isn't clear for the users of this script (for
-# example the radius column is called 'OBJ_ID'!). Also, when oversampling
-# is requested, we need to divide the radii by the over-sampling factor.
-# In the same way, when undersampling (re-binning) is requested, we need to
-# multiple the radii by the undersample factor.
+# Final radii of each row
+# -----------------------
#
-# But before anything, we need to set the options to print the other
-# columns untouched (we only want to change the first column).
-outraw=$tmpdir/out-raw.fits
-restcols=$(astfits $cat -h1 \
- | awk '/^TFIELDS/{for(i=2;i<=$3;++i) printf "-c%d ", i}')
+# In the steps above many operations were done on the labels. It is now
+# necessary to revert them all and obtain the final radius column that will
+# go into the output.
+radraw=$tmpdir/radii.fits
if [ x"$oversample" != x ]; then
- asttable $cat -c'arith OBJ_ID float32 '$oversample' / 1 -' $restcols \
- -o$outraw --colmetadata=ARITH_3,RADIUS,pix,"Radial distance"
+
+ asttable $cat -c'arith OBJ_ID float32 '$precfactor' / 1 - '$oversample' /'
\
+ -o$radraw --colmetadata=1,RADIUS,pix,"Radial distance"
+
elif [ x"$undersample" != x ]; then
- asttable $cat -c'arith OBJ_ID float32 '$undersample' x 1 -' $restcols \
- -o$outraw --colmetadata=ARITH_3,RADIUS,pix,"Radial distance"
+
+ # Under sampling corrects for the 100 multiplication factor before
+ # MakeCatalog.
+ asttable $cat -c'arith OBJ_ID float32 1 - '$undersample' x' \
+ -o$radraw
+
else
- asttable $cat -c'arith OBJ_ID float32 1 -' $restcols -o$outraw \
+
+ asttable $cat -c'arith OBJ_ID float32 '$precfactor' / 1 -' \
+ -o$radraw --colmetadata=1,RADIUS,pix,"Radial distance"
+
+fi
+
+
+
+
+
+# Prepare the final output columns
+# --------------------------------
+#
+# Add the radius column calculated above to the measured columns. If the
+# user has asked for it, build the output in the format of '--customtable'
+# in MakeProfiles. But before anything, we need to set the options to print
+# the other columns untouched (we only want to change the first column).
+outraw=$tmpdir/out-raw.fits
+restcols=$(astfits $cat -h1 \
+ | awk '/^TFIELDS/{for(i=2;i<=$3;++i) \
+ printf "--catcolumns=%d ", i}')
+if [ x"$radinterval" = x0 ]; then
+ checkcol=RADIUS
+ asttable $radraw --catcolumnfile=$cat $restcols --output=$outraw \
--colmetadata=1,RADIUS,pix,"Radial distance"
+else
+ # Since the larger interval value will be outside of the '--rmax' by
+ # default, we'll use the smaller interval value for the final check in
+ # the next step.
+ checkcol=RADIUS_MIN
+
+ # Build the radial intervals from the radii. Note that order important
+ # in the AWK commands below.
+ radintervalraw=$tmpdir/radii-interval.fits
+ asttable $radraw -c1 \
+ | awk 'NR==2 {print 0, ($1-prev)/2} \
+ NR>2 {print prev-(prev-pprev)/2, prev+($1-prev)/2} \
+ {pprev=prev; prev=$1} \
+ END{print prev-(prev-pprev)/2, prev+(prev-pprev)/2}' \
+ | asttable -c'arith $1 float32','arith $2 float32' \
+ --colmetadata=1,RADIUS_MIN,pix,"Minimum radius of this
interval" \
+ --colmetadata=2,RADIUS_MAX,pix,"Maximum radius of this
interval" \
+ -o$radintervalraw
+
+ # Add the rest of the catalog columns to the interval.
+ asttable $radintervalraw --catcolumnfile=$cat $restcols --output=$outraw
+ rm $radintervalraw
fi
-# Due to a possible position angle and axis ratio, it is possible to get at
+
+# Correct possibly extra rows
+# ---------------------------
+#
+# Due to a possible position angle and axis ratio, it may happen that at
# least one extra radial aperture (that is given to
# MakeCatalog). Therefore, once the final radii are set (accounting for
# over/under sampling), we should make sure that the final output doesn't
# contain radii larger than what the user asked for.
-asttable $outraw --range=RADIUS,0,$rmax --output=$output
+asttable $outraw --range=$checkcol,0,$rmax --output=$output
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index c7f4bdbe..3f7f8437 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -6,6 +6,7 @@ Zohreh Ghaffari
Giulia Golini
Samane Raji
Elham Saremi
+Nafiseh Sedighi
Zahra Sharbaf
Michael Stein
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 8d41907b..a5233ec4 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -26559,7 +26559,7 @@ Also note that in such cases, besides de-convolution,
you will have to set @opti
@item --customtable FITS/TXT
The filename of the table to use in the custom radial profiles (see
description of @option{--fcol} in @ref{MakeProfiles catalog}.
-This can be a plain-text table, or FITS table, see @ref{Tables}, if it is a
FITS table, you can use @option{--customtablehdu} to specify which HDU should
be used (described below).
+This can be a plain-text table, or FITS table, see @ref{Recognized table
formats}, if it is a FITS table, you can use @option{--customtablehdu} to
specify which HDU should be used (described below).
A custom radial profile can have any value you want for a given radial profile
(including NaN/blank values).
Each interval is defined by its minimum (inclusive) and maximum (exclusive)
radius, when a pixel center falls within a radius interval, the value specified
for that interval will be used.
@@ -26567,7 +26567,7 @@ If a pixel is not in the given intervals, a value of
0.0 will be used for that p
The table should have 3 columns as shown below.
If the intervals are contiguous (the maximum value of the previous interval is
equal to the minimum value of an interval) and the intervals all have the same
size (difference between minimum and maximum values) the creation of these
profiles will be fast.
-However, if the intervals are not sorted and contiguous, Makeprofiles will
parse the intervals from the top of the table and use the first interval that
contains the pixel center.
+However, if the intervals are not sorted and contiguous, Makeprofiles will
parse the intervals from the top of the table and use the first interval that
contains the pixel center (this may slow it down).
@table @asis
@item Column 1:
@@ -28325,6 +28325,80 @@ By default, it is @option{--mode=img}.
Maximum radius for the radial profile (in pixels).
By default, the radial profile will be computed up to a radial distance equal
to the maximum radius that fits into the image (assuming circular shape).
+@item -P INT
+@itemx --precision=INT
+The precision (number of digits after the decimal point) in resolving the
radius.
+The default value is @option{--precision=0} (or @option{-P0}), and the value
cannot be larger than @option{6}.
+A higher precision is primarily useful when the very central few pixels are
important for you.
+A larger precision will over-resolve larger radial regions, causing scatter to
significantly affect the measurements.
+
+For example, in the command below, we will generate the radial profile of an
imaginary source (at RA,DEC of 1.23,4.567) and check the output without setting
a precision:
+
+@example
+$ astscript-radial-profile image.fits --center=1.23,4.567 \
+ --mode=wcs --measure=mean,area --rmax=10 \
+ --output=radial.fits --quiet
+$ asttable radial.fits --head=10 -ffixed -p4
+0.0000 0.0139 1
+1.0000 0.0048 8
+2.0000 0.0023 16
+3.0000 0.0015 20
+4.0000 0.0011 24
+5.0000 0.0008 40
+6.0000 0.0006 36
+7.0000 0.0005 48
+8.0000 0.0004 56
+9.0000 0.0003 56
+@end example
+
+Let's repeat the command above, but use a precision of 3 to resolve more finer
details of the radial profile, while only printing the top 10 rows of the
profile:
+
+@example
+$ astscript-radial-profile image.fits --center=1.23,4.567 \
+ --mode=wcs --measure=mean,area --rmax=10 \
+ --output=radial.fits --quiet
+$ asttable radial.fits --head=10 -ffixed -p4
+0.0000 0.0139 1
+1.0000 0.0056 4
+1.4140 0.0040 4
+2.0000 0.0027 4
+2.2360 0.0024 8
+2.8280 0.0018 4
+3.0000 0.0017 4
+3.1620 0.0016 8
+3.6050 0.0013 8
+4.0000 0.0011 4
+@end example
+
+Do you see how how many more radii have been added?
+Between 1.0 and 2.0, we now have one extra radius, between 2.0 to 3.0, we have
two new radii and so on.
+If you go to larger and larger radii, you will notice that they get resolved
into many sub-components and the number of pixels used in each measurement will
not be significant (you can already see that in the comparison above).
+This has two problems:
+1. statistically, the scatter in larger radii (where the signal-to-noise ratio
is usually low will make it hard to interpret the profile.
+2. technically, the output table will have many more rows!
+
+@cartouche
+@noindent
+@strong{Use higher precision only for small radii:} If you want to look at the
whole profile (or the outer parts!), don't set the precision, the default mode
is usually more than enough!
+But when you are targetting the very central few pixels (usually less than a
pixel radius of 5), use a higher precision.
+@end cartouche
+
+@item -v INT
+@itemx --oversample=INT
+Oversample the input dataset to the fraction given to this option.
+Therefore if you set @option{--rmax=20} for example, and
@option{--oversample=5}, your output will have 100 rows (without
@option{--oversample} it will only have 20 rows).
+Unless the object is heavily undersampled (the pixels are larger than the
actual object), this method provides a much more accurate result and there are
sufficient number of pixels to get the profile accurately.
+
+Due to the descrete nature of pixels, if you use this option to oversample
your profile, set @option{--precision=0}.
+Otherwise, your profile will become step-like (with several radii having a
single value).
+
+@item -u INT
+@itemx --undersample=INT
+Undersample the input dataset by the number given to this option.
+This option is for considering larger apertures than the original pixel size
(aperture size is equal to 1 pixel).
+For example, if a radial profile computed by default has 100 different radii
(apertures of 1 pixel width), by considering @option{--undersample=2} the
radial profile will be computed over apertures of 2 pixels, so the final radial
profile will have 50 different radii.
+This option is good to measure over a larger number of pixels to improve the
measurement.
+
@item -Q FLT
@itemx --axisratio=FLT
The axis ratio of the apertures (minor axis divided by the major axis in a 2D
ellipse).
@@ -28413,19 +28487,6 @@ By default, such pixels are not considered (when this
script crops the necessary
The long format of this option is identical to a similarly named option in
Crop (see @ref{Invoking astcrop}).
When this option is called, it is passed directly to Crop, therefore the
zero-valued pixels are not considered as blank and used in the profile creation.
-@item -v INT
-@itemx --oversample=INT
-Oversample the input dataset to the fraction given to this option.
-Therefore if you set @option{--rmax=20} for example, and
@option{--oversample=5}, your output will have 100 rows (without
@option{--oversample} it will only have 20 rows).
-Unless the object is heavily undersampled (the pixels are larger than the
actual object), this method provides a much more accurate result and there are
sufficient number of pixels to get the profile accurately.
-
-@item -u INT
-@itemx --undersample=INT
-Undersample the input dataset by the number given to this option.
-This option is for considering larger apertures than the original pixel size
(aperture size is equal to 1 pixel).
-For example, if a radial profile computed by default has 100 different radii
(apertures of 1 pixel width), by considering @option{--undersample=2} the
radial profile will be computed over apertures of 2 pixels, so the final radial
profile will have 50 different radii.
-This option is good to measure over a larger number of pixels to improve the
measurement.
-
@item -i FLT/STR
@itemx --instd=FLT/STR
Sky standard deviation as a single number (FLT) or as the filename (STR)
containing the image with the std value for each pixel (the HDU within the file
should be given to the @option{--stdhdu} option mentioned below).
@@ -28451,6 +28512,39 @@ You can disable the deletion of the temporary
directory with the @option{--keept
Do Not delete the temporary directory (see description of @option{--tmpdir}
above).
This option is useful for debugging.
For example, to check that the profiles generated for obtaining the radial
profile have the desired center, shape and orientation.
+
+@item -I
+@itemx --radinterval
+Output will contain the radial interval of each measurement (in two radius
columns: minimum and maximum radii of each measurement/row).
+Without this option, only the central radius value is used (so the default
output only has a single radius column).
+
+With this option, the output can be directly fed to the @option{--customtable}
option of MakeProfiles (see @ref{MakeProfiles profile settings}).
+In this format, the radial interval of each row is needed, not just the
central value.
+Therefore when this option is called, the radial profile script output will
have two radius columns showing the minimum (inclusive) and maximum (exclusive)
radii that the measurement was done on.
+
+In the example below, we are first measuring the radial profile of a
hypothetical object (at RA,Dec of 1.234,6.789), while activating the
@option{--radinterval} feature.
+The resulting radial profile is then given to MakeProfiles.
+Note that this is a minimal call to MakeProfiles just to show this feature,
you can heavily customize MakeProfiles (for example build the profile over a
background image, or have many rows with many different types of other profiles
and etc.).
+For more on MakeProfiles see @ref{MakeProfiles}.
+
+@example
+$ astscript-radial-profile image.fits --center=1.234,6.789 \
+ --mode=wcs --rmax=10 --precision=1 --radinterval \
+ --measure=mean --output=rad.fits
+
+$ echo "1 50 50 8 20 0 0 1 1 1" \
+ | astmkprof --oversample=1 --mergedsize=99,99 \
+ --customtable=rad.fits --mcolnocustprof \
+ --output=prof2d.fits
+
+$ astscript-fits-view prof2d.fits
+@end example
+
+@cartouche
+@noindent
+@strong{Use a single measurement to feed to MakeProfiles:} The table that is
given to the @option{--customtable} option must have three columns.
+Therefore if you plan to feed the output to MakeProfiles, only use a single
measurement for the radial profile script.
+@end cartouche
@end table
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master a3074242: radial-profile: new options for precision and radial interval,
Mohammad Akhlaghi <=