Skip to content

Commit f56da37

Browse files
committed
add parameters for flux_warp
update warp->fits_warp
1 parent c820327 commit f56da37

File tree

2 files changed

+46
-20
lines changed

2 files changed

+46
-20
lines changed

nextflow.config

+15-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ params.help = false
66
// input images are listed in this file, one image per line
77
params.image_file = "images.txt"
88

9-
// psf matching via convolution
10-
params.convol = false
9+
//
10+
// pre-processing
11+
//
1112

12-
// Warping stage
13-
params.warp = false
13+
// psf matching via convolution
1414
params.convolve = false
15+
16+
// fits/flux warping
17+
params.fits_warp = false
1518
params.ref_catalogue = null
1619
params.refcat_ra = 'RAJ2000'
1720
params.refcat_dec = 'DEJ2000'
1821

22+
params.flux_warp = false
23+
1924
// monitoring of a pre-determined source
2025
params.use_monitoring_src_file = false
2126
params.monitoring_src_file = ""
@@ -53,12 +58,15 @@ profiles {
5358
local {
5459
executor {
5560
name = 'local'
56-
queueSize = 2
61+
queueSize = 1
5762
cpus = 6
5863
memory = 24G
5964
}
60-
process.container = 'paulhancock/robbie-next:latest'
61-
params.stilts = "stilts"
65+
process {
66+
container = 'paulhancock/robbie-next:latest'
67+
publishDir = [path:params.output_dir, mode:'copy', overwite:true]
68+
}
69+
// params.stilts = "java -jar /home/paulhancock/Software/topcat/topcat-full.jar -stilts"
6270
docker {
6371
enabled = true
6472
temp = 'auto'

robbie.nf

+31-13
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ if ( params.help ) {
1515
| [default: ${params.stilts}]
1616
| --convolve
1717
| Determine the smallest psf common to all input images and then convolve all images
18-
| to this psf prior to any other processing [default: ${params.convol}]
18+
| to this psf prior to any other processing [default: ${params.convolve}]
1919
|
2020
|Warping arguments:
21-
| --warp Include if you want to warp your image files (with fits_warp.py)
22-
| to correct for the ionosphere.
23-
| [default: ${params.warp}]
21+
| --fits_warp Use astrometric correction via fits_warp.py.
22+
| [default: ${params.fits_warp}]
23+
| --flux_warp Use flux density correction via flux_warp.
24+
| [default: ${params.flux_warp}]
2425
| --ref_catalogue
2526
| The reference catalogue to warp your images to match.
2627
| [default: will download and use GLEAM catalogue]
@@ -57,8 +58,10 @@ log.info """\
5758
ROBBIE the Space Detective
5859
==========================
5960
images from : ${params.image_file}
60-
convolve img : ${params.convol}
61-
warp ref cat : ${params.warp} / ${params.ref_catalogue}
61+
convolve img : ${params.convolve}
62+
fits warp : ${params.fits_warp}
63+
flux warp : ${params.flux_warp}
64+
warp ref cat : ${params.ref_catalogue}
6265
minotor src : ${params.use_monitoring_src_file} / ${params.monitoring_src_file}
6366
region file : ${params.use_region_file} / ${params.region_file}
6467
output to : ${params.output_dir}
@@ -149,7 +152,7 @@ process initial_sfind {
149152
script:
150153
"""
151154
echo ${task.process} on \${HOSTNAME}
152-
aegean --cores ${task.cpus} --background *_bkg.fits --noise *_rms.fits --table ${image} ${region_command} ${image}
155+
aegean --background *_bkg.fits --noise *_rms.fits --table ${image} ${region_command} ${image}
153156
ls *.fits
154157
"""
155158
}
@@ -197,7 +200,6 @@ process fits_warp {
197200
suff1=(params.refcat_ra=='ra' ? '_1':'')
198201
suff2=(params.refcat_ra=='ra' ? '_2':'')
199202

200-
if (params.warp == true)
201203
"""
202204
echo ${task.process} on \${HOSTNAME}
203205
fits_warp.py --cores ${task.cpus} --refcat ${ref_catalogue} --incat ${basename}_comp.fits \
@@ -208,15 +210,31 @@ process fits_warp {
208210
--plot
209211
ls *.fits
210212
"""
211-
else
213+
}
214+
215+
216+
process flux_warp {
217+
label 'warp'
218+
publishDir params.output_dir, mode: 'copy', pattern: "*_warped.fits", enabled: params.keep_epoch_images
219+
220+
input:
221+
tuple val(basename), path(initial_catalogue)
222+
each ref_catalogue
223+
224+
output:
225+
tuple val(basename), path("*_warped.fits")
226+
227+
script:
228+
suff1=(params.refcat_ra=='ra' ? '_1':'')
229+
suff2=(params.refcat_ra=='ra' ? '_2':'')
230+
212231
"""
213232
echo ${task.process} on \${HOSTNAME}
214-
ln -s ${basename}.fits ${basename}_warped.fits
215-
ls *.fits
233+
match_catalogues ${initial_catalogue} ${ref_catalogue} -o matched.fits --ra2 RAJ2000 --dec2 DEJ2000
234+
flux_warp matched.fits ${initial_catalogue} -o ${basename}_flux.fits
216235
"""
217236
}
218237

219-
220238
process make_mean_image {
221239
publishDir params.output_dir, mode: 'copy'
222240

@@ -569,7 +587,7 @@ workflow {
569587
bane_raw( image_ch )
570588
// image_bkg_rms = epoch_label, image_fits, [bkg_fits, rms_fits]
571589
image_bkg_rms = bane_raw.out
572-
if ( params.warp ) {
590+
if ( params.fits_warp ) {
573591
if ( params.ref_catalogue == null ) {
574592
// No ref catalogue supplied so download default one
575593
download_gleam_catalogue()

0 commit comments

Comments
 (0)