File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,13 @@ def _get_pol_conventions(
6161 f"different values: { uvd_pol_convention } and { uvdata .pol_convention } ."
6262 )
6363 else :
64- if uvdata .pol_convention is not None :
65- raise ValueError ("You are trying to calibrate already-calibrated data." )
64+ if uvdata .pol_convention is not None and (
65+ uvc_pol_convention != uvdata .pol_convention
66+ ):
67+ raise ValueError (
68+ "UVData already has a pol_convention applied that does not match UVCal "
69+ f"convention: { uvdata .pol_convention } and { uvc_pol_convention } ."
70+ )
6671 if uvd_pol_convention is None :
6772 uvd_pol_convention = uvc_pol_convention
6873
Original file line number Diff line number Diff line change @@ -714,7 +714,7 @@ def _init_from_mir_parser(
714714 self .uvw_array = (- 1.0 ) * uvw_array
715715
716716 self .vis_units = "Jy"
717- # self.pol_convention = "avg"
717+ self .pol_convention = "avg"
718718
719719 isource = np .unique (mir_data .in_data ["isource" ])
720720 for sou_id in isource :
Original file line number Diff line number Diff line change @@ -97,14 +97,14 @@ def test_uvd_uvdata_different(self):
9797
9898 def test_calibrate_already_calibrated (self ):
9999 with pytest .raises (
100- ValueError , match = "You are trying to calibrate already-calibrated data "
100+ ValueError , match = "UVData already has a pol_convention applied "
101101 ):
102102 _get_pol_conventions (
103- uvdata = SimpleNamespace (pol_convention = "avg " ),
103+ uvdata = SimpleNamespace (pol_convention = "sum " ),
104104 uvcal = SimpleNamespace (pol_convention = "avg" ),
105105 undo = False ,
106106 uvc_pol_convention = "avg" ,
107- uvd_pol_convention = "avg " ,
107+ uvd_pol_convention = "sum " ,
108108 )
109109
110110 @pytest .mark .parametrize ("which" , ["uvc" , "uvd" ])
You can’t perform that action at this time.
0 commit comments