File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 39
39
"--config" ,
40
40
type = click .Choice (CONFIGS ),
41
41
default = "6km" ,
42
- help = "Array configuration, used to calculate image and pixel sizes if unspecified. ASKAP is equivalent to 6km." ,
42
+ help = (
43
+ "Array configuration, used to calculate image and pixel sizes if unspecified. "
44
+ "ASKAP is equivalent to 6km."
45
+ ),
43
46
)
44
47
@click .option (
45
48
"-N" ,
163
166
type = str ,
164
167
nargs = 2 ,
165
168
default = None ,
166
- help = "Coordinates of imaging phasecentre (provide as separate values, e.g. -p <RA> <DEC>)." ,
169
+ help = (
170
+ "Coordinates of imaging phasecentre. "
171
+ "Provide as separate values (e.g. -p <RA> <DEC>) in decimal degrees or sexagesimal."
172
+ ),
167
173
)
168
174
@click .option (
169
175
"--name" ,
Original file line number Diff line number Diff line change 33
33
type = str ,
34
34
nargs = 2 ,
35
35
default = None ,
36
- help = "Coordinates of phasecentre at which to extract DS (provide as separate values, e.g. -p <RA> <DEC>)." ,
36
+ help = (
37
+ "Coordinates of phasecentre at which to extract DS "
38
+ "(provide as separate values, e.g. -p <RA> <DEC>)."
39
+ ),
37
40
)
38
41
@click .option (
39
42
"-P" ,
40
43
"--primary-beam" ,
41
44
type = Path ,
42
45
default = None ,
43
- help = "Path to primary beam image with which to correct flux scale. Must also provide phasecentre." ,
46
+ help = (
47
+ "Path to primary beam image with which to correct flux scale. "
48
+ " Must also provide phasecentre. Provide non-existent path to compute PB separately."
49
+ ),
44
50
)
45
51
@click .option (
46
52
"-F" ,
Original file line number Diff line number Diff line change 17
17
from dstools .logger import parse_stdout_stderr
18
18
from dstools .mask import beam_shape_erode , minimum_absolute_clip
19
19
from dstools .ms import MeasurementSet
20
+ from dstools .utils import parse_coordinates
20
21
21
22
logger = logging .getLogger (__name__ )
22
23
@@ -253,7 +254,8 @@ def _phasecentre_args(self):
253
254
if self .phasecentre is None :
254
255
return ""
255
256
256
- ra , dec = self .phasecentre
257
+ ra , dec = parse_coordinates (self .phasecentre ).to_string ("hmsdms" ).split ()
258
+
257
259
return f"-shift { ra } { dec } "
258
260
259
261
@property
Original file line number Diff line number Diff line change @@ -118,18 +118,30 @@ def test_wsclean_run_command_args(mocker, ms_path):
118
118
assert "-parallel-deconvolution 100" in cmd
119
119
120
120
121
+ @pytest .mark .parametrize (
122
+ "phasecentre" ,
123
+ [
124
+ (281.2719 , - 63.9632 ),
125
+ ("281.2719" , "-63.9632" ),
126
+ ("18:45:05.256" , "-63:57:47.520" ),
127
+ ("18h45m05.256s" , "-63d57m47.520s" ),
128
+ ],
129
+ )
130
+ def test_wsclean_coordinate_parsing (phasecentre , mocker , ms_path ):
121
131
mocker .patch ("subprocess.Popen" )
122
132
mocker .patch ("dstools.imaging.parse_stdout_stderr" )
123
133
124
134
wsclean = WSClean (
125
135
imsize = 500 ,
126
136
cellsize = "0.66asec" ,
137
+ phasecentre = phasecentre ,
127
138
)
128
139
129
140
# Abstract version of MS object, only needs access to path attribute
130
141
mock_ms = mocker .Mock (path = ms_path )
131
142
cmd = wsclean .run (mock_ms , name = "test" )
132
143
144
+ assert "-shift 18h45m05.256s -63d57m47.52s" in cmd
133
145
134
146
135
147
def test_wsclean_run_command_multiscale (mocker , ms_path ):
You can’t perform that action at this time.
0 commit comments