Bug #33

Invalid FITS input file name leads to creation of file

Added by Knödlseder Jürgen over 12 years ago. Updated about 10 years ago.

Status:ClosedStart date:02/20/2012
Priority:UrgentDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:00-08-00
Duration:

Description

If an invalid event file name is specified, the ctools do not throw an exception, but they create a file with the specified name on the disk.

This is due to the logic implemented in the GFits::open() method, which creates a file if it does not exist. This does not make much sense for ctools that expect an input event file, hence we need to add some logic to test the existence of files before trying to open the file. Note that this logic can be implemented on GPar level, as the 'f’ specifiers should be used for files for which existence checking should be performed. However, I don’t know yet how to handle this for result files, as they don’t exist by definition (unless an existing file should be overwritten). Some more reading is needed here to better understand the logic of the IRAF parameter interface.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 10 years ago

  • Priority changed from Normal to Urgent
  • Target version set to 00-08-00

This needs to be fixed as soon as possible.

#2 Updated by Knödlseder Jürgen about 10 years ago

  • Status changed from New to Closed
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 100

I’m not sure that this is actually still a problem. Here what happens of I specify the name of a non-existing file on input to some of the ctools:

$ ctlike
Event list, counts cube or observation definition file [selected_events.fits] my.fits
*** ERROR encounterted in the execution of ctlike. Run aborted ...
*** ERROR in GUrlFile::open(std::string&, std::string&): Unable to open file "my.fits" 
$ ctselect
Input event list or observation definition file [events.fits] my.fits
*** ERROR in GUrlFile::open(std::string&, std::string&): Unable to open file "my.fits" 
*** ERROR encounterted in the execution of ctselect. Run aborted ...
$ ctbin
Input event list or observation definition file [events.fits] my.fits
*** ERROR encounterted in the execution of ctbin. Run aborted ...
*** ERROR in GUrlFile::open(std::string&, std::string&): Unable to open file "my.fits" 
$ ctskymap
Event data file name [events.fits] my.fits
*** ERROR encounterted in the execution of ctskymap. Run aborted ...
*** ERROR in GFits::open(std::string&): Unable to open FITS file "my.fits" (status=104)
$ ctpsfcube
Event list or observation definition file [NONE] my.fits
*** ERROR encounterted in the execution of ctpsfcube. Run aborted ...
*** ERROR in GUrlFile::open(std::string&, std::string&): Unable to open file "my.fits" 

Also available in: Atom PDF