Surrounded palaces
The four palaces of SurroundedPalaces and its five predicates.
The surrounded set is the most commonly used reading scope in Zi Wei Dou Shu. A matter cannot be read from its own palace alone: the stars of the opposite palace and the two trine palaces bear on it just as much, and only all four together give the full picture.
The examples on this page all chart in en-US, so the display values in the output are the English
translations.
The four palaces
| Field | Offset | Traditional name | Meaning |
|---|---|---|---|
target | +0 | The palace itself | The matter itself |
opposite | +6 | Opposite palace | The facing side; the most immediate influence |
career | +4 | Career position | One of the trine |
wealth | +8 | Wealth position | One of the trine |
All four fields are Palace objects, so every method of the palace object
is available on them.
Wealth and career positions are relative names
wealth and career mean "the trine positions relative to this palace", not the two fixed palace
names among the twelve. Anchored on the Soul palace they happen to land on the Wealth and Career
palaces (+8 and +4) — that is where the names come from; anchored elsewhere they are other palaces.
Three ways to get one
# from the chart
sp = chart.surrounded_palaces("soulPalace")
# from a palace
sp = chart.palace("soulPalace").surrounded_palaces()
# from a star (the surrounded set of the palace it sits in)
sp = chart.star("ziweiMaj").surrounded_palaces()All three give the same result; pick whichever matches what you already have.
have / not_have / have_one_of
Purpose Test whether the four palaces together hold the given stars.
Zi Wei meaning A phrase like "Ziwei is in the surrounded set" asks exactly whether a star appears anywhere among these four palaces, without asking which one.
Signature
def have(self, stars: list[str]) -> bool
def not_have(self, stars: list[str]) -> bool
def have_one_of(self, stars: list[str]) -> boolParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
stars | list[str] | Yes | — | A list of star keys; star names in the chart's charting language are accepted too |
Return value
| Method | Meaning |
|---|---|
have | Every star in the list appears among the four palaces (not necessarily the same one) |
not_have | No star in the list appears |
have_one_of | At least one star in the list appears |
Example
from x_iztro import MajorStar, MinorStar
sp = chart.surrounded_palaces("soulPalace")
print(sp.have([MajorStar.ZIWEI, MajorStar.TIANXIANG]))
print(sp.have_one_of([MajorStar.QISHA, MajorStar.POJUN]))
print(sp.not_have([MinorStar.HUOXING]))Output
True
False
TrueZiwei is in the Soul palace and Tianxiang in the Wealth palace — different palaces, but both within
the four, so have is true.
Edge cases and pitfalls
have_mutagen / not_have_mutagen
Purpose Test whether the four palaces carry a given natal mutagen.
Zi Wei meaning "Ji is in the surrounded set" means one of these palaces holds a star the birth-year stem sent ji to — a common condition when locating a source of pressure.
Signature
def have_mutagen(self, mutagen: Mutagen) -> bool
def not_have_mutagen(self, mutagen: Mutagen) -> boolParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mutagen | str | Yes | — | One of the mutagen keys |
Return value bool.
Example
from x_iztro import Mutagen
sp = chart.surrounded_palaces("soulPalace")
print("lu in the surrounded set:", sp.have_mutagen(Mutagen.LU))
print("ji in the surrounded set:", sp.have_mutagen(Mutagen.JI))
print("no ke in the surrounded set:", sp.not_have_mutagen(Mutagen.KE))Output
lu in the surrounded set: False
ji in the surrounded set: False
no ke in the surrounded set: TrueThis chart's natal mutagens land in four palaces: Taiyang with lu in Children, Wuqu with quan in
Wealth, Taiyin with ke in Friends, Tiantong with ji in Health. The Soul palace's surrounded set is
Soul, Surface, Wealth and Career — only the quan falls inside it, so both the lu and the ji test
False while a quan test would be True.
Edge cases and pitfalls
This looks at the natal mutagen marks on stars, unrelated to mutagens flown by palace stems. For those, use the palace's flying-star methods.
to_text
Purpose The surrounded palaces' semantic text: one section each for the target palace, its opposite, and the wealth and career positions.
Signature
def to_text(self) -> strExample
sp = chart.surrounded_palaces("soul")
print(sp.to_text().split("\n")[0])Output
Target Palace: soul (renwoo)When the target palace is detached from a chart there is no charting context and ValueError is
raised. The full format is on Semantic text.