bugGNU Astronomy Utilities - Bugs: bug #56859, Bad result and crash of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56859: Bad result and crash of MakeCatalog and Table with PV parameters in header

Submitted by:  Raul Infante-Sainz <infantesainz>
Submitted on:  Wed 04 Sep 2019 12:16:14 PM UTC  
 
Category:  MakeCatalog Severity:  3 - Normal
Item Group:  Crash Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Thu 19 Sep 2019 08:49:53 PM UTC, comment #5: 

I will try to describe the context and the work around.

I have the same data image but with two different kind of distortion coefficients (SIP and PV). The goal is to estimate the sky background of the image with PV coefficients and correct for it. To do that, I need to mask all objects in the image. I do that by generating a mock image with ellipse shape like objects obtained from the catalogue.

The problem is that I am not able to obtain a catalog from the image with PV coefficients, which is the one I need.

The solution was to create the catalogue using the image with SIP coefficients and then apply the mock image to the image with PV coefficients. Of course, this is only possible because I have the image with SIP distortion coefficients.

I hope the explanation will help to other people with the same kind of problem.

Raul Infante-Sainz <infantesainz>
Project Member
Thu 19 Sep 2019 05:04:22 PM UTC, comment #4: 

Until we find the solution, can you post your temporary work-around solution here? It will be helpful to others (that might have come up with this problem).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Wed 18 Sep 2019 08:17:45 AM UTC, comment #3: 

Hi Mohammad,
Thanks for answering. Unfortunately I am also really busy right now, and trying to fix this problem would require an amount of time that I don't have :-( Let's keep this bug open until any of us have the chance to have a look and try to fix. Thanks again ;-)

Raul Infante-Sainz <infantesainz>
Project Member
Tue 17 Sep 2019 06:28:07 PM UTC, comment #2: 

Thanks for reporting this Raul, and so sorry I haven't been able to look into it yet. I am really busy these days.

As you mentioned the problem seems to be in the WCS and the error that `asttable' prints for the TPV dataset is directly written by WCSLIB, not by Gnuastro.

Unfortunately I don't have time to go into it deeper right now. But maybe this can be a good excuse to start getting your hands dirty in the code ;-).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Tue 17 Sep 2019 04:35:39 PM UTC, comment #1: 

Hello,

Is there any news related with this problem?

I can work around this issue but it implies extra code and since it is a bug that I think it is easy to solve maybe it would be better to wait until it is fixed. I have the feeling that it just does not like `TPV' in the keyword `CTYPE1', right now it is:

CTYPE1  = 'RA---TPV'           / TAN (gnomonic) projection + distortions

The same could happen to `CTYPE2'. Thanks a lot for the help.

Raul Infante-Sainz <infantesainz>
Project Member
Wed 04 Sep 2019 12:16:14 PM UTC, original submission:  

I found a no sense result and crash when trying to obtain a catalogue of objects using a combination of Noisechisel, Segment and MakeCatalog. Step by step:

I have two images: `sip.fits' and `pv.fits'. The names came from the different notation for the distortion coefficients (SIP and PV). Both images are the same, as it can be seen with `DS9' matching WCS.

Then I run the shell script `script' attached in this message. Basically, it runs NoiseChisel, Segment and finally MakeCatalog over both images.

At the end I get two catalogues with different results. The catalogue from `sip.fits' is good but the catalogue obtained from `pv.fits' is wrong.

Seems to me that it is reading the WCS information from the PV keywords in the header in a bad way, and the result are wrong RA-DEC coordinates for the detected objects.

In addition to this, if I try to use the feature `wcstoimg' with Table, I get an error in the case of PV but not in the case of SIP. That is, once the script has been executed I try to do:

asttable sip_cat.fits -cRA,DEC,"arith RA DEC wcstoimg" --wcsfile=sip.fits

It success. But if I do:

asttable pv_cat.fits -cRA,DEC,"arith RA DEC wcstoimg" --wcsfile=pv.fits

It fails with an error:

asttable: gal_wcs_world_to_img: wcss2p ERROR 9: One or more of the world coordinates were invalid

Here I paste the content of `script':


# Define the name of the input images
i_sip=sip.fits
i_pv=pv.fits



# Run Noisechisel
sip_det=sip_det.fits
pv_det=pv_det.fits

astnoisechisel $i_sip --output=$sip_det
astnoisechisel $i_pv --output=$pv_det



# Run Segment
sip_seg=sip_seg.fits
pv_seg=pv_seg.fits

astsegment $sip_det --output=$sip_seg
astsegment $pv_det --output=$pv_seg



# Run MakeCatalog
sip_cat=sip_cat.fits
pv_cat=pv_cat.fits

astmkcatalog $sip_seg --ra --dec --magnitude --output=$sip_cat
astmkcatalog $pv_seg --ra --dec --magnitude --output=$pv_cat

Raul Infante-Sainz <infantesainz>
Project Member

 

Attached Files
file #47450:  script added by infantesainz (531B - application/octet-stream)
file #47451:  pv.fits added by infantesainz (638KiB - application/octet-stream)
file #47452:  sip.fits added by infantesainz (638KiB - application/octet-stream)

 

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 infantesainz (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-04 infantesainz Attached File- => Added script, #47450
        Attached File- => Added pv.fits, #47451
        Attached File- => Added sip.fits, #47452

    Back to the top


    Powered by Savane 3.7