mainGNU Astronomy Utilities - Support: sr #110941, converting wcs-to-img asttable...

 
 

sr #110941: converting wcs-to-img asttable does not work

Submitter:  None
Submitted:  Sun 08 Oct 2023 11:44:19 AM UTC
   
 
Category:  Table Priority:  5 - Normal
Severity:  3 - Normal Item Group:  * Output not reasonable
Status:  Done Privacy:  Public
Assigned to:  makhlaghi Originator Email:  -email is unavailable-
Open/Closed:  Closed Operating System:  Mac OS
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 31 Oct 2023 11:28:23 AM UTC, comment #2: 

This issue is assumed fixed; so it is being closed.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 08 Oct 2023 02:32:19 PM UTC, comment #1: 

Thank you for the good question.

Summary: the solution is given in this section of the Gnuastro book (the '--gridfile' feature of 'astwarp'): https://www.gnu.org/software/gnuastro/manual//html_node/Color-channels-in-same-pixel-grid.html

Detailed: Using Crop was the old solution to have several images (filters in this case) in a pixel grid with the same size. But it would just select the NxM pixels around the central coordinate. The Crop command you quoted, didn't take into account sub-pixel difference, rotations or distortions that may be present from one image to another and can cause inaccurate results.

Because of these issues, with Gnuastro 0.19, we added the '--gridfile' option to the Warp program. It will solve all the issues above and ensure that the pixel grid between different images is identical. For an actual hands-on demonstration the power of the '--gridfile' option, see this introduction video by Pedram (author of this feature).

Please let me know if this fixes the problem.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 08 Oct 2023 11:44:19 AM UTC, original submission:  

The gnuastro0.15 manual gave the following code (here reproduced the significant snippet) to convert from CRVALs in RA, DEC to CRPIX in pixels:

for f in $r $g $b; do
       centerpix=$(echo $centerwcs \
                        | asttable -c’arith $1 $2 wcstoimg’ \
                                   --wcsfile=$f-aligned.fits \
                        | awk ’{printf "%g,%g", $1, $2}’)
       astcrop $f-aligned.fits --mode=img --width=$widthpix \
               --center=$centerpix -o$f-use.fits
       rm $f-aligned.fits
done

However, substituting wcstoimg with wcs-to-img does not give the pixel values, but rather the RA, DEC values in $centerwcs, such that $centerpix is the same as $centerwcs.

An analogous formulation is not given in the latest (to my knowledge) gnuastro.pdf for gnuastro-0.20, so it's not clear to me how to revise the script to obtain the CRPIX values associated with CRVALs for an arbitrary fits file.

Thanks very much for any enlightenment!

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-31 makhlaghi StatusIn Progress Done
        Open/ClosedOpen Closed
    2023-10-08 makhlaghi StatusNone In Progress
        Assigned toNone makhlaghi

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code