From f85136190b6e39393049e9be1cf14ac32b89b538 Mon Sep 17 00:00:00 2001 From: Dustin Lang Date: Tue, 9 May 2023 21:37:06 -0400 Subject: [PATCH] removelines/uniformize: propagate headers from input to output --- util/removelines.py | 2 +- util/uniformize.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/removelines.py b/util/removelines.py index b1c57bf66..3d4b4ede4 100755 --- a/util/removelines.py +++ b/util/removelines.py @@ -51,7 +51,7 @@ def removelines(infile, outfile, xcol='X', ycol='Y', ext=1, cut=None, **kwargs): #header.add_history('This xylist was filtered by the "removelines.py" program') #header.add_history('to remove horizontal and vertical lines of sources') #header['REMLINEN'] = (len(x) - len(xc), 'Number of sources removed by "removelines.py"') - T.writeto(outfile) + T.writeto(outfile, header=T.get_header()) return 0 def main(): diff --git a/util/uniformize.py b/util/uniformize.py index 6a06e46fd..7258f3f80 100755 --- a/util/uniformize.py +++ b/util/uniformize.py @@ -14,7 +14,7 @@ def uniformize(infile, outfile, n, xcol='X', ycol='Y', ext=1, **kwargs): T = fits_table(infile, lower=False) if len(T) == 0: print('No sources') - T.writeto(outfile) + T.writeto(outfile, header=T.get_header()) return x = T.get(xcol) y = T.get(ycol) @@ -63,7 +63,7 @@ def uniformize(infile, outfile, n, xcol='X', ycol='Y', ext=1, **kwargs): J = np.array(J) #header.add_history('This xylist was filtered by the "uniformize.py" program') T.cut(J) - T.writeto(outfile) + T.writeto(outfile, header=T.get_header()) return 0 def main():