@@ -32,17 +32,19 @@ def parse_custom_bkg_sas(region: Union[CircleSkyRegion, EllipseSkyRegion], withi
32
32
outer_radius = region .radius if not within_radii else region .radius * 1.5
33
33
central_coord = Quantity ([region .center .ra .deg , region .center .dec .deg ], 'deg' )
34
34
rot_angle = Quantity (0 , 'deg' ) # No rotation for circular regions
35
+ inner_radius = Quantity (0 , 'deg' )
35
36
36
37
elif isinstance (region , EllipseSkyRegion ):
37
38
outer_radius = Quantity ([region .height / 2 , region .width / 2 ]) if not within_radii \
38
39
else Quantity ((region .height / 2 )* 1.5 )
39
40
central_coord = Quantity ([region .center .ra .deg , region .center .dec .deg ], 'deg' )
40
41
rot_angle = Quantity (region .angle .to ('deg' ).value , 'deg' )
42
+ inner_radius = Quantity ([0 , 0 ], 'deg' )
41
43
42
44
else :
43
45
raise TypeError (f"Unsupported region type: { type (region )} " )
44
46
45
- return outer_radius , central_coord , rot_angle
47
+ return inner_radius , outer_radius , central_coord , rot_angle
46
48
47
49
48
50
@@ -79,8 +81,6 @@ def _spec_cmds(sources: Union[BaseSource, BaseSample], outer_radius: Union[str,
79
81
:param bool force_gen: This boolean flag will force the regeneration of spectra, even if they already exist.
80
82
:param Union[CircleSkyRegion, EllipseSkyRegion] custom_bkg: A region to extract the background spectrum from.
81
83
"""
82
- print ('custom_bkg' )
83
- print (custom_bkg )
84
84
# We check to see whether there is an XMM entry in the 'telescopes' property. If sources is a Source object, then
85
85
# that property contains the telescopes associated with that source, and if it is a Sample object then
86
86
# 'telescopes' contains the list of unique telescopes that are associated with at least one member source.
@@ -213,7 +213,7 @@ def _spec_cmds(sources: Union[BaseSource, BaseSample], outer_radius: Union[str,
213
213
outer_radii [s_ind ] * source .background_radius_factors [1 ],
214
214
'xmm' , source .default_coord )
215
215
else :
216
- bkg_outr , bkg_coord , _ = parse_custom_bkg_sas (custom_bkg , True )
216
+ _ , bkg_outr , bkg_coord , _ = parse_custom_bkg_sas (custom_bkg , True )
217
217
back_inter_reg = source .regions_within_radii (Quantity (0 , 'deg' ), bkg_outr , 'xmm' ,
218
218
bkg_coord )
219
219
src_inn_rad_str = inner_radii [s_ind ].value
@@ -268,12 +268,10 @@ def _spec_cmds(sources: Union[BaseSource, BaseSample], outer_radius: Union[str,
268
268
inst , interloper_regions = back_inter_reg ,
269
269
central_coord = source .default_coord )
270
270
else :
271
- print ('in here' )
272
- bkg_outr , bkg_coord , _ = parse_custom_bkg_sas (custom_bkg , True )
271
+ _ , bkg_outr , bkg_coord , _ = parse_custom_bkg_sas (custom_bkg , True )
273
272
back_inter_reg = source .regions_within_radii (Quantity (0 , 'deg' ), bkg_outr , 'xmm' ,
274
273
bkg_coord )
275
- bkg_outr , bkg_coord , bkg_rot_angle = parse_custom_bkg_sas (custom_bkg )
276
- bkg_innr = Quantity (0 , 'deg' )
274
+ bkg_innr , bkg_outr , bkg_coord , bkg_rot_angle = parse_custom_bkg_sas (custom_bkg )
277
275
b_reg = source .get_annular_sas_region (bkg_innr , bkg_outr , obs_id = obs_id , inst = inst ,
278
276
interloper_regions = back_inter_reg ,
279
277
central_coord = bkg_coord ,
0 commit comments