Author Topic: Image registration/Star alignment cannot handl filenames like  (Read 5446 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
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
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
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 '_'?
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
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
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com

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 :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
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!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
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
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)