PixInsight Forum (historical)

PixInsight => Bug Reports => Topic started by: georg.viehoever on 2009 June 18 14:00:51

Title: Image registration/Star alignment cannot handl filenames like
Post by: georg.viehoever on 2009 June 18 14:00:51
Hi,

image registration fails if the filenames look like "m27 (2).cal.fts". It cannot safe the registered fits files. Changing names to something like "m27_2.cal.fts" helps. Unfortunately, the form with " (2)" is what windows automatically generates with my usual processing procedure.

Attached is the error message. Medium priority issue as far as I am concerned.



Georg

Code: [Select]
StarAlignment: Global context

Reference view: m27_stacked_int16
Extracting CIE L* component: 100%
Structure map: 100%
Detecting stars: 100%
2490 stars found.

Registering target image 1 of 1
Loading target file:
D:/Benutzer/Oeffentlich/Pictures/2009_06_17_m57/calibrated_images/m27 (2).cal .fts
Reading FITS: 16-bit integers, 1 channel(s), 3908x2602 pixels: 100%
Structure map: 100%
Detecting stars: 100%
3089 stars found.
Matching stars...
* Reference image: Limiting to 2000 brightest stars.
* Target image: Limiting to 2000 brightest stars.
576 putative star pair matches.
Performing RANSAC...
*** RANSAC: Failed to find a valid set of star pair matches.
* Previous attempt failed - this is try #2
useScaleDifferences=false
* Reference image: Limiting to 2000 brightest stars.
* Target image: Limiting to 2000 brightest stars.
506 putative star pair matches.
Performing RANSAC...
*** RANSAC: Failed to find a valid set of star pair matches.
* Previous attempt failed - this is try #3
useScaleDifferences=true
* Reference image: Limiting to 1000 brightest stars.
* Target image: Limiting to 1000 brightest stars.
292 putative star pair matches.
Performing RANSAC...
95 star pair matches in 264 RANSAC iterations.
Root mean square error:
drms  :  0.243 px
Peak errors:
dXmax :  0.571 px
dYmax :  0.655 px
Transformation matrix:
     +0.9998     -0.0002    +19.2084
     +0.0000     +0.9998     -4.0815
     -0.0000     -0.0000     +1.0000
Generating registered image
Homographic Projection / Bicubic Spline Interpolation: 100%
Registration successful.
Writing output file: D:/Benutzer/Oeffentlich/Pictures/2009_06_17_m57/calibrated_images/aligned/m27 (2).cal_r.fit
*** PCL Exception: PCL FITS Format Support: Unable to create FITS file:
D:/Benutzer/Oeffentlich/Pictures/2009_06_17_m57/calibrated_images/aligned/m27 (2).cal_r.fit

*** Applying error policy: Continue on error.

===== StarAlignment: 0 succeeded, 1 failed, 0 aborted, 0 skipped =====
30.686 s
Title: Re: Image registration/Star alignment cannot handl filenames like
Post by: Nocturnal on 2009 June 18 14:03:35
It's possible that cfitsio can't deal with spaces in filenames (I avoid them for all kinds of reasons). Would your workflow break if PI replaced spaces with '_'?
Title: Re: Image registration/Star alignment cannot handl filenames like
Post by: georg.viehoever on 2009 June 18 23:31:37
Sander,

what I do is this: The Canon software produces filenames like "IMG_2009_05_30_3430.CR2". I use the Vista rename function to change those names into something more meaningful, such as "m27.....CR2" or "dark....CR2". The Vista renaming function adds those " (number)" parts if filenames would otherwise be identical.

I know it is not too difficult to write a small script implementing a different renaming scheme. But I feel that PI should be able to handle all types of filenames that are normal on an OS, instead of creating cryptic error messages (which are one reason why PI is seen as tool that is difficult to use).

On top of that: software developers like myself tend to be lazy, they prefer the computer to do the work. That's why they became software developers  :-[

Georg
Title: Re: Image registration/Star alignment cannot handl filenames like
Post by: Nocturnal on 2009 June 19 05:30:32

Hi Georg,

I agree about the application needing to support OS native paths. As you know modern unix supports spaces in paths so this isn't even a windows issue either. We'll have to see what Juan says. Of course the FITS file process is included in the PCL distro so you can poke around and see what's up :)
Title: Re: Image registration/Star alignment cannot handl filenames like
Post by: Juan Conejero on 2009 June 30 05:38:51
Hi Sander and Georg,

Of course PI fully supports file names with spaces, parentheses and the like (there were some problems with certain characters, but they were fixed in the newest versions).

The problem here is with CFITSIO's "extended file name syntax", which interprets parentheses and brackets in some very special ways. For more information:

http://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node80.html

Of course, PI doesn't use these features at all --and, IMHO, it is a very unfortunate error to implement them through special syntactical constructs embedded in file names. I don't know of any way to disable this extended file name syntax (other than hacking CFITSIO, which I won't do), but my ears are wide open.

So, please don't use [] and () within FITS file names... sorry for the inconvenience!
Title: Re: Image registration/Star alignment cannot handl filenames like
Post by: georg.viehoever on 2009 June 30 09:19:57
Maybe you can make sure that the user gets a helpful error message. Figuring out the root cause is what really cost me a bit of time.

Georg