Conversation
tikk3r
left a comment
There was a problem hiding this comment.
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/' |
There was a problem hiding this comment.
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?
|
|
||
|
|
||
|
|
||
| ''' |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)) | ||
| ''' |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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/' |
There was a problem hiding this comment.
Another hard coded path that needs generalising.
| """ | ||
| Created on Mon Feb 3 15:12:32 2025 | ||
|
|
||
| @author: pwcc62 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)) | ||
| ''' |
|
|
||
| def main(): | ||
| """ | ||
| Main function |
There was a problem hiding this comment.
See other comment about the main function.
I have added the post-processing workflow which includes astrometry and flux scaling corrections. Many thanks