Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Imports SIMBADObjectPackage, IVOALib --, AstroLib
Context SIMBADObjectObservations

Let observedStar: SIMBADObjectObservations = Self


-- is Type II Cepheid and what subclass?
-- Type II cepheids are pop II stars, metal poor, old, masses < 0.5 MSun, periods determine subclass
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
-- | TypeIICep subclass| Supergiant?| SpectralClass| Teff{K)     | period(d)| Lum  | Mass| Metallicity|
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
-- | RV Tauri          |     Y      | G - K        | 4100 - 6000 |  > 20    | high | low |    low     |
-- | W Vir             |     N      | F6 - K2      | 4900 - 6200 |  10 - 20 |      | low |    low     |
-- | BL Her            |     N      | varies       |             |  1 - 4   | low  | low |    low     |
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
Let observedVarPeriod: PQ = If observedStar.collectionsOfMeasurements.variableStar.first().period.oclIsDefined() then
                            observedStar.collectionsOfMeasurements.variableStar->sortedBy(r|r.reference.date).last().period
                           else null
                          endif
Let observedTeff: PQ = If observedStar.collectionsOfMeasurements.fe_H.first().tEff.oclIsDefined() then
                         observedStar.collectionsOfMeasurements.fe_H->sortedBy(r|r.reference.date).last().tEff
                        else null
                       endif
Let observedFe_H: Real = If observedStar.collectionsOfMeasurements.fe_H.first().fe_H.oclIsDefined() then
                           observedStar.collectionsOfMeasurements.fe_H->sortedBy(r|r.reference.date).last().fe_H
                          else null
                         endif
Let observedStarLumClass:CD = observedStar.spectralType.luminosityClass  -- use fluxes?
Let litCalculatedMass: PQ = If observedStar.literatureDerivedParameters.mass.first().m.oclIsDefined() then
                           observedStar.literatureDerivedParameters.mass->sortedBy(r|r.reference.date).last().m
                          else null
                         endif
Let lit_Luminosity: PQ = If observedStar.literatureDerivedParameters.luminosity.first().l.oclIsDefined() then
                           observedStar.literatureDerivedParameters.luminosity->sortedBy(r|r.reference.date).last().l
                          else null
                         endif
Let lit_Metallicity: Real = If observedStar.literatureDerivedParameters.metallicity.first().met.oclIsDefined() then
                              observedStar.literatureDerivedParameters.metallicity->sortedBy(r|r.reference.date).last().met
                             else null
                            endif
Let lit_TEff: PQ = If observedStar.literatureDerivedParameters.tEff.first().t.oclIsDefined() then
                              observedStar.literatureDerivedParameters.tEff->sortedBy(r|r.reference.date).last().t
                             else null
                            endif
Let lit_VarPeriod: PQ = If observedStar.literatureDerivedParameters.variabilityPeriod.first().p.oclIsDefined() then
                              observedStar.literatureDerivedParameters.variabilityPeriod->sortedBy(r|r.reference.date).last().p
                             else null
                            endif
--get best parameter values where needed
Let metallicityBest: Real = If observedFe_H.oclIsDefined() then observedFe_H else
                            If lit_Metallicity.oclIsDefined() then lit_Metallicity else
                            null endif endif
Let varPeriodBest: PQ = If observedVarPeriod.oclIsDefined() then observedVarPeriod else
                            If lit_VarPeriod.oclIsDefined() then lit_VarPeriod else
                            null endif endif
Let tEffBest: PQ = If observedTeff.oclIsDefined() then observedTeff else
                            If lit_TEff.oclIsDefined() then lit_TEff else
                            null endif endif
--Type II Cepheid query
Let isLowMass: Boolean = litCalculatedMass < PQ{value = 0.6, unit = "Msun"}
Let isMetalPoor: Boolean = metallicityBest < 0.05
Let isVariable: Boolean = varPeriodBest.oclIsDefined()
Let isTypeIICepheid: Boolean = isLowMass and isMetalPoor and isVariable
-- is Supergiant?
Let childIVOAConcept: CD = observedStar.objectType.code
Let parentIVOAConcept:CD = CD{code = '81261979', displayName = ST{value='SuperGiant'}, codeSystem = 'IVOA'}
Let isSuperGiant: Boolean = IVOAImplies(childIVOAConcept, parentIVOAConcept)

--Determine subclass If Type II cepheid variable
Let subclass: String =
  If isTypeIICepheid and varPeriodBest > PQ{value=20,unit='d'}
     and isSuperGiant and lit_Luminosity > PQ{value=1000,unit='Lsun'}
      and tEffBest > PQ{value=4100,unit='K'} and tEffBest < PQ{value=6000,unit='K'}
       then 'RV Tauri subclass' else
     if isTypeIICepheid and varPeriodBest > PQ{value=10,unit='d'} and varPeriodBest <= PQ{value=20,unit='d'}
        and tEffBest > PQ{value=4900,unit='K'} and tEffBest < PQ{value=6200,unit='K'}
         then 'W Vir subclass' else
        If isTypeIICepheid and varPeriodBest < PQ{value=4,unit='d'} and lit_Luminosity < PQ{value=1000,unit='Lsun'}
         then 'BL Her' else
      null endif endif endif
----
subclass

Here is the result:

Image Added