wiki:HowToFixFitsFiles

Version 1 (modified by tbretz, 5 years ago) ( diff )

--

How to fix files rejectes by Ingest

  • First, backup the source directories in case something goes wrong with the repair process
  • just use the scripts
    • ~fact_arc/ingestScripts/fixSlowDirectory.sh <directory>
    • ~fact_arc/ingestScripts/fixRawDirectory.sh <directory>

depending on the type of file being recovered

If some files were really corrupt, they will have some leftover .fitscorrupt0 in the source directory. In this case this file must be merged with the (hopefully) already recovered .fits file. If some .fits file remain in the failed directory, it is most likely dues to some warnings being exhibited by fverify. You decide whether to put them in the archive anyway or not. Usually it is simply duplicated column names (e.g. Time vs time).

HOW TO MERGE 2 SLOW CONTROL FITS: go to ~fact_arc/ingestScripts. All sources of programs used here are in this directory.

  1. list timestamps and look visually for defects near the end of the file:
    /swdev_nfs/FACT++/fitsdump -c Time <first, most likely corrupt file>
    
  2. merge the two files, minus the number of corrupt rows of the first file:
    mergeFits <first_file> <second_file> <target,merged file> <number of rows to ignore in the first file>
    
  3. make sure that only valid values remain:
    /swdev_nfs/FACT++/fitsdump -c Time --minmax —nozero <target, merged file>
    
  4. make sure that the produced file is valid:
    fverify <target, merged file>
    
  5. fix the keywords headers and checksum:
    fixHeaderKeywordsSlowControl.sh <target, merged file> <fully fixed file>
    

If it goes well, the message <fully fixed file> has been created is displayed. If this message isn't displayed something is wrong: you must investigate further....

  1. move the final product back into place
Note: See TracWiki for help on using the wiki.