You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Smooth a field of 3D cubes to a common resolution. - Default names of output files are /path/to/beamlog{infile//.fits/.{SUFFIX}.fits} - By default, the
99
+
smallest common beam will be automatically computed. - Optionally, you can specify a target beam to use. - It is currently assumed that cubes will be
100
+
4D with a dummy Stokes axis. - Iterating over Stokes axis is not yet supported.
114
101
115
102
positional arguments:
116
-
infile Input FITS image(s) to smooth (can be a wildcard)
117
-
- CASA beamtable will be used if present i.e. if CASAMBM = T
118
-
- Otherwise beam info must be in co-located beamlog files.
119
-
- beamlog must have the name /path/to/beamlog{infile//.fits/.txt}
120
-
103
+
infile Input FITS image(s) to smooth (can be a wildcard) - CASA beamtable will be used if present i.e. if CASAMBM = T - Otherwise beam
104
+
info must be in co-located beamlog files. - beamlog must have the name /path/to/beamlog{infile//.fits/.txt}
121
105
122
-
optional arguments:
106
+
options:
123
107
-h, --help show this help message and exit
124
-
--uselogs Get convolving information from previous run [False].
125
-
--mode MODE Common resolution mode [natural].
126
-
natural -- allow frequency variation.
127
-
total -- smooth all plans to a common resolution.
128
-
108
+
--uselogs Get convolving information from previous run [False]. (default: False)
109
+
--mode MODE Common resolution mode [natural]. natural -- allow frequency variation. total -- smooth all plans to a common resolution.
110
+
(default: natural)
129
111
--conv_mode {robust,scipy,astropy,astropy_fft}
130
-
Which method to use for convolution [robust].
131
-
'robust' computes the analytic FT of the convolving Gaussian.
132
-
Note this mode can now handle NaNs in the data.
133
-
Can also be 'scipy', 'astropy', or 'astropy_fft'.
134
-
Note these other methods cannot cope well with small convolving beams.
135
-
136
-
-v, --verbosity Increase output verbosity
137
-
--logfile LOGFILE Save logging output to file
138
-
-d, --dryrun Compute common beam and stop [False].
112
+
Which method to use for convolution [robust]. 'robust' computes the analytic FT of the convolving Gaussian. Note this mode can
113
+
now handle NaNs in the data. Can also be 'scipy', 'astropy', or 'astropy_fft'. Note these other methods cannot cope well with
--logfile LOGFILE Save logging output to file (default: None)
117
+
-d, --dryrun Compute common beam and stop. (default: False)
139
118
-p PREFIX, --prefix PREFIX
140
-
Add prefix to output filenames.
119
+
Add prefix to output filenames. (default: None)
141
120
-s SUFFIX, --suffix SUFFIX
142
-
Add suffix to output filenames [{MODE}].
121
+
Add suffix to output filenames [{MODE}]. (default: None)
143
122
-o OUTDIR, --outdir OUTDIR
144
-
Output directory of smoothed FITS image(s) [None - same as input].
145
-
--bmaj BMAJ BMAJ to convolve to [max BMAJ from given image(s)].
146
-
--bmin BMIN BMIN to convolve to [max BMAJ from given image(s)].
147
-
--bpa BPA BPA to convolve to [0].
123
+
Output directory of smoothed FITS image(s) [None - same as input]. (default: None)
124
+
--bmaj BMAJ BMAJ to convolve to [max BMAJ from given image(s)]. (default: None)
125
+
--bmin BMIN BMIN to convolve to [max BMAJ from given image(s)]. (default: None)
126
+
--bpa BPA BPA to convolve to [0]. (default: None)
148
127
-c CUTOFF, --cutoff CUTOFF
149
-
Cutoff BMAJ value (arcsec) -- Blank channels with BMAJ larger than this [None -- no limit]
150
-
--circularise Circularise the final PSF -- Sets the BMIN = BMAJ, and BPA=0.
128
+
Cutoff BMAJ value (arcsec) -- Blank channels with BMAJ larger than this [None -- no limit] (default: None)
129
+
--circularise Circularise the final PSF -- Sets the BMIN = BMAJ, and BPA=0. (default: False)
151
130
--ref_chan {first,last,mid}
152
-
Reference psf for header [None].
153
-
first -- use psf for first frequency channel.
154
-
last -- use psf for the last frequency channel.
155
-
mid -- use psf for the centre frequency channel.
156
-
Will use the CRPIX channel if not set.
157
-
131
+
Reference psf for header [None]. first -- use psf for first frequency channel. last -- use psf for the last frequency channel.
132
+
mid -- use psf for the centre frequency channel. Will use the CRPIX channel if not set. (default: None)
158
133
-t TOLERANCE, --tolerance TOLERANCE
159
-
tolerance for radio_beam.commonbeam.
134
+
tolerance for radio_beam.commonbeam. (default: 0.0001)
160
135
-e EPSILON, --epsilon EPSILON
161
-
epsilon for radio_beam.commonbeam.
136
+
epsilon for radio_beam.commonbeam. (default: 0.0005)
162
137
-n NSAMPS, --nsamps NSAMPS
163
-
nsamps for radio_beam.commonbeam.
138
+
nsamps for radio_beam.commonbeam. (default: 200)
139
+
--ncores NCORES Number of cores to use for parallelisation. If None, use all available cores. (default: None)
140
+
--executor_type {thread,process,mpi}
141
+
Executor type for parallelisation. (default: thread)
164
142
```
165
143
166
144
```
@@ -186,6 +164,19 @@ options:
186
164
187
165
If finding a common beam fails, try tweaking the `tolerance`, `epsilon`, and `nsamps` parameters. See [radio-beam](https://radio-beam.readthedocs.io/en/latest/) for more details.
188
166
167
+
## Performance
168
+
169
+
Profiling for `beamcon_3D` suggests this program requires a minimum of ~15X the memory of a data cube slice per process to perform convolution to a common beam. So for a 800 MB slice (e.g. typical POSSUM cube) you would want to allow 15 GB memory per worker (I use 20 GB). Choose `ncores` appropriately given your machine memory availability and this limit to ensure optimal performance with multiprocessing.
170
+
171
+
An example slurm header for `beamcon_3D`:
172
+
173
+
```
174
+
#SBATCH --nodes=1
175
+
#SBATCH --ntasks-per-node=1
176
+
#SBATCH --cpus-per-task=<ncores>
177
+
#SBATCH --mem-per-cpu=20G
178
+
```
179
+
189
180
## Contributing
190
181
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
0 commit comments