Star object

The fields of Star, its brightness and mutagen predicates, and tracing back to its palace.

A Star is one star sitting in a palace, carrying its type, brightness and mutagen mark, and able to trace back to the palace it sits in.

ziwei, palace := chart.Star(iztro.StarZiweiMaj)

The examples on this page chart with "en-US", so the display values in the output are English.

Fields

FieldTypeDescription
KeystringStar key, independent of language; use it in predicates
NamestringStar name, translated into the charting language
TypestringStar type, see below
ScopestringWhich layer it acts on: "origin" for natal stars, the matching scope for scope stars
BrightnessstringTranslated brightness; an empty string for stars with no brightness table
BrightnessKeystringBrightness key
MutagenstringTranslated natal mutagen; an empty string for stars the birth-year stem did not transform
MutagenKeystringMutagen key

The eight star types

ValueMeaningTypical members
majorThe fourteen major starsZiwei, Tianfu, Qisha, Pojun
softAuspicious starsZuofu, Youbi, Wenchang, Wenqu, Tiankui, Tianyue
toughMalefic starsQingyang, Tuoluo, Huoxing, Lingxing, Dikong, Dijie
adjectiveAdjective starsSantai, Bazuo, Tianxing, Tianyao
flowerPeach-blossom starsHongluan, Tianxi, Xianchi
helperJieshenJieshen
lucunLucunLucun
tianmaTianmaTianma

Lucun and Tianma each get a category of their own, because in the traditional division they are neither purely auspicious nor purely malefic and predicates routinely single them out.

Empty strings rather than nil

The Go side uses an empty string for "absent" — an empty Brightness means the star has no brightness table, an empty Mutagen means the birth-year stem did not transform it. Test with if star.MutagenKey != "".


WithBrightness

Purpose Test whether this star is at one of the given brightness levels.

Zi Wei meaning Brightness (miao, wang, de, li, ping, bu, xian) describes how strong a star is in its palace. Each star has a fixed value in each of the twelve palaces; at miao or wang its power comes out in full, at xian it is constrained.

Signature

func (s *Star) WithBrightness(brightnessKeys ...string) bool

Parameters

ParameterTypeRequiredDefaultDescription
brightnessKeys...stringYesBrightness keys; any match is true

Return value bool. Always false for a star with no brightness.

Example

ziwei, _ := chart.Star(iztro.StarZiweiMaj)

fmt.Println(ziwei.WithBrightness(iztro.BrightnessMiao))
fmt.Println(ziwei.WithBrightness(iztro.BrightnessWang, iztro.BrightnessDe))

Output

true
false

Edge cases and pitfalls

The semantics are "any match", not "all match" — a star has exactly one brightness, so passing several just means "any one of these will do".


WithMutagen

Purpose Test whether this star carries a given natal mutagen.

Zi Wei meaning Natal mutagens are fixed by the birth-year stem: a given year always sends lu, quan, ke and ji to four particular stars. The mark travels with the star, whichever palace it lands in.

Signature

func (s *Star) WithMutagen(mutagenKeys ...string) bool

Parameters

ParameterTypeRequiredDefaultDescription
mutagenKeys...stringYesMutagen keys; any match is true

Return value bool. Always false for a star the birth-year stem did not transform.

Example

ziwei, _ := chart.Star(iztro.StarZiweiMaj)
taiyang, _ := chart.Star(iztro.StarTaiyangMaj)

fmt.Println("Ziwei takes lu:", ziwei.WithMutagen(iztro.MutagenLu))
fmt.Println("Taiyang takes lu:", taiyang.WithMutagen(iztro.MutagenLu))

Output

Ziwei takes lu: false
Taiyang takes lu: true

This chart's birth-year stem is geng, and geng sends lu to Taiyang, so the mark lands on Taiyang rather than Ziwei.

Edge cases and pitfalls

Natal mutagens and flying mutagens are not the same thing

WithMutagen looks at the mark the birth-year stem placed on this star; only four stars on a chart carry one. Mutagens flown by palace stems do not show up here — for those use the palace's FliesTo family.


Palace / OppositePalace / SurroundedPalaces

Purpose Trace from a star back to its palace, that palace's opposite, and its surrounded set.

Signature

func (s *Star) Palace() *Palace
func (s *Star) OppositePalace() *Palace
func (s *Star) SurroundedPalaces() *SurroundedPalaces

Return value A star constructed on its own, detached from a chart, returns nil; a star obtained from a chart query never does.

Example

ziwei, _ := chart.Star(iztro.StarZiweiMaj)

fmt.Println(ziwei.Palace().Name)
fmt.Println(ziwei.OppositePalace().Name)
fmt.Println("Tianxiang in the same palace or the trine:",
    ziwei.SurroundedPalaces().Have(iztro.StarTianxiangMaj))

Output

soul
surface
Tianxiang in the same palace or the trine: true

Edge cases and pitfalls

chart.Star() already hands back the palace as its second return value, so calling ziwei.Palace() again is usually unnecessary.

On this page