taskGNU Astronomy Utilities - Tasks: task #15704, Assuming a default size for...

 
 

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

task #15704: Assuming a default size for --wcsdistortion when no data included

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Tue 23 Jun 2020 02:07:46 AM UTC
   
 
Should Start On:  Mon 22 Jun 2020 11:00:00 PM UTC Should be Finished on:  Mon 22 Jun 2020 11:00:00 PM UTC
Category:  Fits Priority:  5 - Normal
Item Group:  Enhancement Status:  Done
Privacy:  Public Assigned to:  sks_15
Percent Complete:  100% Open/Closed:  Closed
Effort:  0.00

Wed 24 Jun 2020 01:00:10 AM UTC, comment #4: 

Great! Thanks Sachin, all the work was rebased into Commit 808c95dc56.

I also tested and it was reasonable: the reverse values weren't as accurate, but that is natural, its a fit after all ;-).

I am closing this task now.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Wed 24 Jun 2020 12:08:21 AM UTC, comment #3: 

The problem is fixed now and it read and write data from simply wcs files only. The commit is pushed here.

The problem, arose because the function `wcsdistortion_get_tpvparams` was not reading the pv parameters somehow. So, I read directly from the disseq parameter of wcs which fixed the problem. It also made its reading style similar to `wcsdistortion_get_siparams`, providing uniformity in code.

I also tried to test the results using the sip_tpv module but it constantly broke complaining `numpy.linalg.LinAlgError: Singular matrix` during inversion of array(it may be due to fact it was unable to read CD matrix as it is not directly present in the header from which python simply uses something like `cd[i]=header['cdn'] %n)` i.e a dictionary to read data).

Sachin Kumar Singh <sks_15>
Tue 23 Jun 2020 05:47:15 PM UTC, comment #2: 

Thanks for the check Sachin, so the Python script can't account for header-only TPV to SIP conversion.

I just started adding some steps to assume a default size (and print a warning) for the operation to be completed.

But there was a problem as mentioned below:

First I used this command to convert the attached file of this task to TPV and it worked nicely:


astfits sip-header.fits -h0 --wcsdistortion=TPV


Then in 'tests/during-dev.sh', I called set the output of the command above as input to 'astfits' with these options: '-h1 --wcsdistortion=SIP'.

The output didn't have any SIP keywords! So I printed out 'fullheaders' in 'wcsdistortion_add_sipkeywords' and noticed that they are all NAN!

Can you please look into this? and commit the change over my test branch?

We have made good progress on this task, so I am marking it as 50% done, and as soon as this problem is fixed we can close it ;-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Tue 23 Jun 2020 04:34:03 PM UTC, comment #1: 

When I try to run the fits file you gave using sip_pv python module, it crashes complaining absence of NAXIS keywords.

Sachin Kumar Singh <sks_15>
Tue 23 Jun 2020 02:07:46 AM UTC, original submission:  

Currently, the Fits program's '--wcsdistortion' function can work on FITS HDUs that don't have any data. But this is only the case for SIP --> TPV conversion. The TPV --> SIP conversion needs an initial size for the dataset and will crash without it.

Sachin, can you please look into the sip_tpv Python module and see what size they assume when the input dataset is header-only (its NAXIS is 0)?

As a test file, I am sending an output of astrometry.net called 'sip-header.fits'. Its a FITS file with no data, but a single extension that has an NAXIS=0. It is a standard FITS file and can be read into any library.

The function that calls 'gal_wcs_distortion_convert' is 'keywords_distortion_wcs' function in bin/fits/keywords.c (which is activated with the '--wcsdistortion' option is given to 'astfits'). You can simply give this image to 'astfits' in 'tests/developer-build.sh' and set a default 'size_t *' array when there is no input dataset.

It is very important that we finish this very soon, so please do this before continuing work on task #15700.

Mohammad Akhlaghi <makhlaghi>
Group administrator

 

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

Attached Files
file #49353:  sip-header.fits added by makhlaghi (11KiB - image/fits)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sks_15 (Posted a comment)
  • -email is unavailable- added by makhlaghi (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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-24 makhlaghi StatusIn Progress Done
        Percent Complete50% 100%
        Open/ClosedOpen Closed
    2020-06-23 makhlaghi Percent Complete0% 50%
    2020-06-23 makhlaghi Attached File- Added sip-header.fits, #49353

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code