Skip to content

Commit 5a10f08

Browse files
committed
Set default polarization to unpolarized
1 parent 216fba6 commit 5a10f08

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

astromodels/core/model_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def _parse_polarization(self, polarization_definititon):
723723

724724
# just make a default polarization
725725

726-
this_polarization = polarization.Polarization()
726+
this_polarization = polarization.Unpolarized()
727727
# raise ModelSyntaxError("Polarization specification for source %s has an
728728
# invalid parameters. You need to specify either 'angle' and 'degree', or
729729
# 'I' ,'Q', 'U' and 'V'." % self._source_name)
@@ -777,7 +777,7 @@ def _parse_spectral_component(self, component_name, component_definition):
777777

778778
else:
779779

780-
this_polarization = polarization.Polarization()
780+
this_polarization = polarization.Unpolarized()
781781

782782
this_spectral_component = spectral_component.SpectralComponent(
783783
component_name, shape, this_polarization

astromodels/core/polarization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88

99

1010
class Polarization(Node):
11-
def __init__(self, polarization_type="linear"):
11+
def __init__(self, polarization_type="unpolarized"):
1212

1313
assert polarization_type in [
14+
"unpolarized",
1415
"linear",
1516
"stokes",
16-
], "polarization must be linear or stokes"
17+
], "polarization must be unpolarized, linear or stokes"
1718

1819
self._polarization_type = polarization_type
1920

astromodels/core/spectral_component.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__author__ = "giacomov"
22

3-
from astromodels.core.polarization import Polarization
3+
from astromodels.core.polarization import Unpolarized
44
from astromodels.core.tree import Node
55

66

@@ -25,7 +25,7 @@ def __init__(self, name, shape, polarization=None):
2525

2626
if polarization is None:
2727

28-
self._polarization = Polarization()
28+
self._polarization = Unpolarized()
2929

3030
else:
3131

0 commit comments

Comments
 (0)