[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 40f0a56 013/113: Minor corrections to MakeProf
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 40f0a56 013/113: Minor corrections to MakeProfiles continued |
Date: |
Fri, 16 Apr 2021 10:33:32 -0400 (EDT) |
branch: master
commit 40f0a566a8ce5e55068cbc970e3bca5e749ff088
Author: Mohammad Akhlaghi <akhlaghi@gnu.org>
Commit: Mohammad Akhlaghi <akhlaghi@gnu.org>
Minor corrections to MakeProfiles continued
While looking into the MakeProfiles code and finalizing it, some further
minor corrections were found to be necessary and are implemented.
---
bin/mkprof/oneprofile.c | 9 ++++-----
bin/mkprof/profiles.c | 4 ++--
bin/mkprof/ui.c | 12 ++++++++++--
doc/gnuastro.texi | 12 ++++++++----
4 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/bin/mkprof/oneprofile.c b/bin/mkprof/oneprofile.c
index 8e20236..2d6fcef 100644
--- a/bin/mkprof/oneprofile.c
+++ b/bin/mkprof/oneprofile.c
@@ -103,13 +103,12 @@ oneprofile_set_coord(struct mkonthread *mkp, size_t index)
/* Convert cartesian coordinates to the rotated elliptical radius. See the
- "Defining an ellipse" section of the book for the full derivation. */
+ "Defining an ellipse and ellipsoid" section of the book for the full
+ derivation. */
static void
oneprofile_r_el(struct mkonthread *mkp)
{
- /* ct: cos(theta) st: sin(theta)
- cp: cos(phi) sp: sin(phi) */
- double Xr, Yr, Zr; /* Rotated x, y, z. */
+ double Xr, Yr, Zr; /* Rotated x, y, z. */
double q1=mkp->q[0], q2=mkp->q[1];
double c1=mkp->c[0], s1=mkp->s[0];
double c2=mkp->c[1], s2=mkp->s[1];
@@ -514,7 +513,7 @@ oneprofile_ispsf(uint8_t fcode)
-/* About the shifts on the X column and y column:*/
+/* Prepare all the parameters for any type of profile. */
void
oneprof_set_prof_params(struct mkonthread *mkp)
{
diff --git a/bin/mkprof/profiles.c b/bin/mkprof/profiles.c
index b869c1e..39e38f4 100644
--- a/bin/mkprof/profiles.c
+++ b/bin/mkprof/profiles.c
@@ -52,8 +52,8 @@ profiles_radial_distance(struct mkonthread *mkp)
-/* The integral of the Gaussian from -inf to +inf equals the square
- root of PI. So from zero to +inf it equals half of that.*/
+/* The integral of the Gaussian from -inf to +inf equals the square root of
+ PI. So from zero to +inf it equals half of that.*/
double
profiles_gaussian_total(double q)
{
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 43b3ef0..a9b47c5 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -164,6 +164,7 @@ ui_profile_name_write(int profile_code)
case PROFILE_POINT: return "point";
case PROFILE_FLAT: return "flat";
case PROFILE_CIRCUMFERENCE: return "circum";
+ case PROFILE_DISTANCE: return "distance";
default:
error(EXIT_FAILURE, 0, "%s: %d not recognized as a profile code",
__func__, profile_code);
@@ -426,7 +427,7 @@ ui_parse_kernel(struct argp_option *option, char *arg,
are needed. */
if( kernel->size != need )
error_at_line(EXIT_FAILURE, 0, filename, lineno, "as a %uD kernel, "
- "a `%s' profile needs %zu parameters, but only %zu "
+ "a `%s' profile needs %zu parameters, but %zu "
"parameter%s given to `--kernel'", kernel->flag,
ui_profile_name_write(kernel->status), need,
kernel->size, kernel->size>1?"s are":" is");
@@ -1344,7 +1345,7 @@ ui_prepare_canvas(struct mkprofparams *p)
{
float *f, *ff;
gal_data_t *keysll;
- long width[2]={1,1};
+ long width[3]={1,1,1};
int status=0, setshift=0;
double truncr, semiaxes[3], euler_deg[3];
size_t i, nshift=0, *dsize=NULL, ndim_counter;
@@ -1478,6 +1479,7 @@ ui_prepare_canvas(struct mkprofparams *p)
{
p->shift[0] = (width[0]/2)*p->oversample;
p->shift[1] = (width[1]/2)*p->oversample;
+ if(p->ndim==3) p->shift[2] = (width[2]/2)*p->oversample;
}
}
}
@@ -1557,6 +1559,12 @@ ui_finalize_coordinates(struct mkprofparams *p)
need to change them into actual image coordinates. */
if(p->mode==MKPROF_MODE_WCS)
{
+ /* `gal_wcs_world_to_img' API needs to be changed to allow any number
+ of dimensions. */
+ if(ndim!=2)
+ error(EXIT_FAILURE, 0, "%s: conversion from WCS coordinates is not "
+ "yet implemented for %zu dimensions", __func__, ndim);
+
/* Note that we read the RA and Dec columns into the `p->x' and `p->y'
arrays temporarily before. Here, we will convert them, free the old
ones and replace them with the proper X and Y values. */
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 194eb85..1b41a40 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -14911,14 +14911,18 @@ value will be used for all pixels between the
truncation radius
(@mymath{r_t}) and @mymath{r_t-w} (@mymath{w} is the value to the
@option{--circumwidth}).
@item
+@item
Radial distance profile with `@code{distance}' or `@code{7}'. At the lowest
level, each pixel only has an elliptical radial distance given the
profile's shape and orentiation (see @ref{Defining an ellipse and
ellipsoid}). When this profile is chosen, the pixel's elliptical radial
-distance from the profile center is written as its value. You can use this
-to define your own higher-level radial function. Note that for this
-profile, the value in the magnitude column (@option{--mcol}) will be
-ignored.
+distance from the profile center is written as its value. For this profile,
+the value in the magnitude column (@option{--mcol}) will be ignored.
+
+You can use this for checks or as a first approximation to define your own
+higher-level radial function. In the latter case, just note that the
+central values are going to be incorrect (see @ref{Sampling from a
+function}).
@end itemize
- [gnuastro-commits] master 42e04b6 002/113: Recent changes in master merged, (continued)
- [gnuastro-commits] master 42e04b6 002/113: Recent changes in master merged, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master f25b55e 005/113: Merged with recent changes in master, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master a11e71c 003/113: Merged with recent changes in master, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 3df6490 001/113: Crop works in 3D, except for --polygon, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master d14384a 007/113: Minor corrections in MakeProfiles manual, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 5abb468 008/113: Other minor corrections in the documentation, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 3e76e1f 010/113: MakeProfiles --kernel builds 3D kernels also, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 81f3f65 023/113: More --coordcol options acceptable in Crop, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master e47f8db 024/113: Merged recent work in master, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 8fa5ff1 026/113: Minor edit in book (part added in last commit), Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 40f0a56 013/113: Minor corrections to MakeProfiles continued,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 8372486 020/113: NoiseChisel's detection complete in 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 6cc3d25 027/113: No 3D projections in function to inspect NoiseChisel outputs, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master e990860 029/113: Merged recent updates in master, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 6bdc5d6 030/113: Oversegmentation connectivity one less for 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master be3bfd8 033/113: NoiseChisel configuration file in 3D updated, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 3b6c15d 036/113: Merged with recent work in master, no conflicts, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master fb3660f 037/113: MakeCatalog works in 3D, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 73fdf0c 006/113: MakeProfiles builds 3D ellipsoids, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 03d73fe 011/113: Some minor corrections in code and comments, Mohammad Akhlaghi, 2021/04/16
- [gnuastro-commits] master 87ab805 014/113: Identifiers for integer constants in BZERO comparisons, Mohammad Akhlaghi, 2021/04/16