Chandra-MARX / marx

Chandra X-ray Observatory ray-trace simulator
http://space.mit.edu/cxc/marx/
5 stars 4 forks source link

marx2fits crashes if file name of ASOLFILE is too long #12

Closed hamogu closed 9 years ago

hamogu commented 9 years ago

From a user report:

I have a script that worked with marx 5.0, but that now fails with 5.1. The script is (probably) dying at a stage where it is running marx2fits (the version 5.1.0-0 version on 64bit linux here), with the message:

ERROR: String is too long for keyword ASOLFILE WARNING: Either the header or the data portion of the file was not ended. I am assuming this is the data portion and filling it with 0.

It seems that I need to sanitize filenames that are longer than allowed for values in the fits header. In CIAO that does not happen, because the data reduction scripts produce filenames that are short enough automatically, but specifically for ASOLFILE users may input their own files.

I don't think there is an easy way to encode a value that is too long in the header, so I will probably do the following implementation: