waynebhayes / SpArcFiRe

SPiral ARC FInder and REporter - find spiral arcs in galaxies.... and maybe hurricanes too?
9 stars 16 forks source link

Issue in scripts/AlignBandColors: Fits without 'CD1_2' in header will crash program #63

Closed cora-schallock closed 2 years ago

cora-schallock commented 2 years ago

Error Message:

  File "./shift_gal.py", line 435, in <module>
    process_galaxy(gal, args.outDir, args.borderSize, args.minStarsTemplate, args.minStarsAll, args.upscaleFactor, ar                                                                                                                        gs.cropImages, args.runInParallel, args.maxMemory * 1024**3, args.compressOutput)
  File "./shift_gal.py", line 316, in process_galaxy
    save_output(p, galaxy, shift_imgs, shift_vectors, compressOutput)
  File "./shift_gal.py", line 250, in save_output
    hdu[0].header['CRVAL1'] += (shift_vectors[color][1] - int(shift_vectors[color][1])) * hdu[0].header['CD1_2']
  File "/home/whayes/.local/lib/python2.7/site-packages/astropy/io/fits/header.py", line 150, in __getitem__
    card = self._cards[self._cardindex(key)]
  File "/home/whayes/.local/lib/python2.7/site-packages/astropy/io/fits/header.py", line 1677, in _cardindex
    raise KeyError("Keyword {!r} not found.".format(keyword))
KeyError: "Keyword 'CD1_2' not found."

Temporary Workaround: In shift_gal.py comment out lines that write to header of shifted_galaxy fits

Steps to Recreate Error: 1) Download ngc615 2) rename y band to u (for workaround of other issue) 3) ./runShiftGal.sh inDir/ outDir/

cora-schallock commented 2 years ago

Issue fixed with recent merge: https://github.com/waynebhayes/SpArcFiRe/pull/67