gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #66867] Query retrieves Gaia sources outside of the image


From: Raul Infante-Sainz
Subject: [bug #66867] Query retrieves Gaia sources outside of the image
Date: Tue, 4 Mar 2025 03:45:47 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?66867>

                 Summary: Query retrieves Gaia sources outside of the image
                   Group: GNU Astronomy Utilities
               Submitter: infantesainz
               Submitted: Tue 04 Mar 2025 08:45:40 AM UTC
                Category: Query
                Severity: 3 - Normal
              Item Group: Output not reasonable
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 04 Mar 2025 08:45:40 AM UTC By: Raul Infante-Sainz <infantesainz>
The program Query (Gnuastro 0.23.56-d8279) does not retrieve Gaia (and maybe
other data?) properly. It considers sources beyond the limit of the image. I
reduced the problem to a few lines so you can reproduce the problem easily:

# Parameters. WCS values from an image that I got the problem
imgx=5095
imgy=4993

cdelt1=0.0002
cdelt2=0.0002

crpix1=2547.0
crpix2=2498.0

crval1=182.637
crval2=58.3039

tmpdir=$(pwd)/build


# If the temporary directory doesn't exist, make it.
if ! [ -d $tmpdir ]; then mkdir $tmpdir; fi

# File names.
image=$tmpdir/image.fits
stars=$tmpdir/stars-gaia.fits
apertures=$tmpdir/apertures.reg

# Image. Create an empty image. The important point here is the WCS
information.
echo "1  1  1" \
     | awk '{print NR, $1, $2, 3, 1, 1, 1, 1, $3, 1}' \
     | astmkprof --mode=wcs --output=$image \
                 --cdelt=$cdelt1,$cdelt2 \
                 --crpix=$crpix1,$crpix2 \
                 --crval=$crval1,$crval2 \
                 --mergedsize=$imgx,$imgy

# Catalog. Download the Gaia catalog that overlaps with the image
astquery gaia \
         --dataset=dr3 \
         --output=$stars \
         --overlapwith=$image \
         -cra,dec,phot_g_mean_mag \
         --range=phot_g_mean_mag,0,22

# Plot the sources on top of the image with DS9
astscript-ds9-region $stars \
                     -cra,dec \
                     --radius=5 --width=5 \
                     --command="ds9 $image -zoom to fit -zscale"


If everything went well, you can see that the downloaded catalog contains
sources outside of the image. Do you? In the Book, there is a note:

Note that if the image has WCS distortions and the reference point for the WCS
is not within the image, the WCS will not be well-defined. Therefore the
resulting catalog may not overlap, or correspond to a larger/small area in the
sky.

However, this is not the case as there are not distortion terms nor the
reference point is outside of the image.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66867>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]