gnuastro-devel
[Top][All Lists]
Advanced

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

[task #15128] TPV and SIP keywords when WCS distortions are necessary


From: Mohammad Akhlaghi
Subject: [task #15128] TPV and SIP keywords when WCS distortions are necessary
Date: Wed, 13 May 2020 18:38:18 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Follow-up Comment #3, task #15128 (project gnuastro):

Thanks for the nice progress report Sachin. 

About your question on the need for TPV, the whole problem is SCAMP! It is
currently one of the only programs that does the distortion calculations
properly. But unfortunately it uses TPV (like the example FITS file I attached
in my previous comment). Through this task, we want to be able to internally
convert such TPV headers into SIP, so even when the input to any Gnuastro
program has TPV headers, it will be converted to SIP on the fly and programs
can always assume that distortions (when necessary) are in SIP. In the inverse
scenario, we want to let people choose to write the distortions in TPV if they
want, probably as an extra command-line option.

Here are some points:

* Instead of using 'gal_fits_key_read_from_ptr', I recommend to use WCSLIB's
wcsprm structure. Reading all the keywords with the various histories of the
WCS standard is not easy! Its best to leave the low-level WCS keyword reading
to WCSLIB ;-). Just set your function to accept 'struct wcsprm *wcs' as input,
similar to all the other functions in Gnuastro's WCS-related functions
<https://www.gnu.org/software/gnuastro/manual/html_node/World-Coordinate-System.html>.
If your test implementation isn't yet in Gnuastro, you can use
'gal_wcs_read_fitsptr' or 'gal_wcs_read' to read the 'wcsprm' structure from a
given FITS pointer of file. Fortunately WCSLIB's 'wcs.h' (for example in
'/usr/include/wcslib/wcs.h') has a very nice explanation on the contents of
this structure as comments. 

* In the end, you should also write your results into this 'wcsprm' structure.
This way, the writing of the keywords will also be left to WCSLIB and we don't
have to worry about it ;-).

* Essentially, your function should take a `wcsprm' structure and correct it
internally, so it's declaration looks something like this:


void
gal_wcs_tpv_to_sip(struct wcsprm *wcs);


* About the if-else case in 'calcsip' function, I guess its best to contact is
author, maybe you can post an issue on Github for them to answer ;-).

* About what to write in the output headers, as mentioned above, I think its
best to leave the final writing to WCSLIB (which is written by the author of
the WCS standard and is effectively the WCS standard!). We shouldn't make the
same mistake as the author of SCAMP and make our own custom
formats/conventions ;-).

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15128>

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




reply via email to

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