Skip to content

Postprocessing#47

Open
emmyescott wants to merge 2 commits intomasterfrom
postprocessing
Open

Postprocessing#47
emmyescott wants to merge 2 commits intomasterfrom
postprocessing

Conversation

@emmyescott
Copy link

I have added the post-processing workflow which includes astrometry and flux scaling corrections. Many thanks

@tikk3r tikk3r self-requested a review February 10, 2026 12:03
Copy link
Member

@tikk3r tikk3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a first set of comments. Functionality wise I think the current main blocking factor is that there are a bunch of hard coded paths that are assumed to exist. For a general pipeline run those super specific paths will not exists, so a more general approach is needed.

There is a bunch of commented out code that looks like it can be removed to clean things up a bit as well.

import glob
from astropy import units as u

path='/cosma8/data/do011/dc-esco1/postprocessing/restored_post/correct_compact/'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work for the general pipeline, so it will need a more general solution. Could it be made an input argument or can the script assume everything is in directory where it runs?




'''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's commented out, this whole block can be removed I presume?

"""
#prefix_old = source_fits.split('/')[-1].split('_')[2]
prefix = os.path.basename('{}'.format(source_fits)).replace('.fits','')
cmd1 = 'java -jar /cosma8/data/do011/dc-esco1/postprocessing/stilts.jar tskymatch2 in1="{}" in2="{}" out=source_matches_{}.fits ra1={} dec1={} ra2={} dec2={} error={} join=1and2'.format(crossmatch_fits, source_fits, prefix, ra1, dec1, ra2, dec2, error)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another hard coded path that will need a more general solution.

ax.set_xlabel('RA offset')
ax.set_ylabel('Dec offset')
plt.savefig('astrometry_offset_{}.png'.format(prefix))
'''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented block can be removed.

parser.add_argument('--ra2', type=str, help='column name of ra from pyBDSF catalogue')
parser.add_argument('--dec1', type=str, help='column name of dec from crossmatch catalogue')
parser.add_argument('--dec2', type=str, help='column name of dec from pyBDSF catalogue')
parser.add_argument('--error', type=str, help='Error for source location for crossmatching', default=5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help message could be clarified a little. What kind of error does this refer to?

import glob
import csv

path='/cosma8/data/do011/dc-esco1/postprocessing/restored_post/correct_compact/'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another hard coded path that needs generalising.

"""
Created on Mon Feb 3 15:12:32 2025

@author: pwcc62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the other comment about author in Python scripts.


plt.rcParams['axes.labelsize'] = 19
plt.rc('font',family='Serif')
plt.rc('figure',figsize=(8,7)) ##8,6 previously
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded comment at the end of the line.

ax.set_xlabel('Log Flux at 1.2" [Jy]')
ax.set_ylabel('Log Flux at 6" [Jy]')
plt.savefig('flux_scaling_{}.png'.format(prefix))
'''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?


def main():
"""
Main function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment about the main function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants