private static CatEntry getPronValues(Node node) { CatEntry catEntry = new CatEntry("pron"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetPronEntry().GetVariants().Add(getValue(ch)); } else if (ch.Name.Equals("type")) { catEntry.GetPronEntry().GetType().Add(getValue(ch)); } else if (ch.Name.Equals("gender")) { catEntry.GetPronEntry().SetGender(getAttribute(ch, "type")); } else if (ch.Name.Equals("interrogative")) { catEntry.GetPronEntry().SetInterrogative(true); } } } return(catEntry); }
private static CatEntry getDetValues(Node node) { CatEntry catEntry = new CatEntry("det"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetDetEntry().SetVariants(getValue(ch)); } else if (ch.Name.Equals("interrogative")) { catEntry.GetDetEntry().SetInterrogative(true); } else if (ch.Name.Equals("demonstrative")) { catEntry.GetDetEntry().SetDemonstrative(true); } } } return(catEntry); }
private static CatEntry getAdvValues(Node node) { CatEntry catEntry = new CatEntry("adv"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetAdvEntry().GetVariants().Add(getValue(ch)); } else if (ch.Name.Equals("modification")) { catEntry.GetAdvEntry().GetModification().Add(getValue(ch)); } else if (ch.Name.Equals("negative")) { catEntry.GetAdvEntry().SetNegative(getAttribute(ch, "type")); } else if (ch.Name.Equals("interrogative")) { catEntry.GetAdvEntry().SetInterrogative(true); } } } return(catEntry); }
private static List <LexRecord> GetLexRecords(Node node) { List <LexRecord> lexRecords = new List <LexRecord>(); LexRecord lexRecord = null; CatEntry catEntry = null; for (Node records = node.FirstChild; records != null; records = records.NextSibling) { for (Node record = records.FirstChild; record != null; record = record.NextSibling) { if (record.NodeType == XmlNodeType.Element) { if (record.Name.Equals("lexRecord")) { lexRecord = new LexRecord(); GetLexRecord(record, lexRecord, catEntry); } lexRecords.Add(lexRecord); } } } return(lexRecords); }
public PositionVector GetApparentPosition(double tjd) { CatEntry star = new CatEntry(); PositionVector positionVector = new PositionVector(); double[] bary_earthp = new double[4]; double[] bary_earthv = new double[4]; double[] helio_earthp = new double[4]; double[] helio_earthv = new double[4]; double[] pos = new double[4]; double[] pos2_1 = new double[4]; double[] pos2_2 = new double[4]; double[] pos2_3 = new double[4]; double[] pos2_4 = new double[4]; double[] pos2_5 = new double[4]; double[] vel = new double[4]; double[] pos2_6 = new double[4]; if (!(this.m_rav & this.m_decv)) { throw new ASCOM.Astrometry.Exceptions.ValueNotSetException("Star.GetApparentPosition RA or DEC not available"); } double tdb = 0; this.hr = NOVAS2.GetEarth(tjd, ref this.m_earth, ref tdb, ref bary_earthp, ref bary_earthv, ref helio_earthp, ref helio_earthv); if ((int)this.hr > 0) { pos2_6[0] = 0.0; pos2_6[1] = 0.0; pos2_6[2] = 0.0; throw new NOVASFunctionException("Star.GetApparentPosition", "get_earth", this.hr); } star.RA = this.m_ra; star.Dec = this.m_dec; star.ProMoRA = this.m_pmra; star.ProMoDec = this.m_pmdec; star.Parallax = this.m_plx; star.RadialVelocity = this.m_rv; NOVAS2.StarVectors(star, ref pos, ref vel); NOVAS2.ProperMotion(2451545.0, pos, vel, tdb, ref pos2_1); double lighttime = 0; NOVAS2.BaryToGeo(pos2_1, bary_earthp, ref pos2_2, ref lighttime); int num1 = (int)NOVAS2.SunField(pos2_2, helio_earthp, ref pos2_3); int num2 = (int)NOVAS2.Aberration(pos2_3, bary_earthv, lighttime, ref pos2_4); NOVAS2.Precession(2451545.0, pos2_4, tdb, ref pos2_5); int num3 = (int)NOVAS2.Nutate(tdb, NutationDirection.MeanToTrue, pos2_5, ref pos2_6); positionVector.x = pos2_6[0]; positionVector.y = pos2_6[1]; positionVector.z = pos2_6[2]; return(positionVector); }
private static CatEntry getVerbValues(Node node) { CatEntry catEntry = new CatEntry("verb"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetVerbEntry().GetVariants().Add(getValue(ch)); } else if (ch.Name.Equals("intran")) { catEntry.GetVerbEntry().GetIntran().Add(getValue(ch)); } else if (ch.Name.Equals("tran")) { catEntry.GetVerbEntry().GetTran().Add(getValue(ch)); } else if (ch.Name.Equals("ditran")) { catEntry.GetVerbEntry().GetDitran().Add(getValue(ch)); } else if (ch.Name.Equals("link")) { catEntry.GetVerbEntry().GetLink().Add(getValue(ch)); } else if (ch.Name.Equals("cplxtran")) { catEntry.GetVerbEntry().GetCplxtran().Add(getValue(ch)); } else if (ch.Name.Equals("nominalization")) { catEntry.GetVerbEntry().GetNominalization().Add(getValue(ch)); } } } return(catEntry); }
private static CatEntry getNounValues(Node node) { CatEntry catEntry = new CatEntry("noun"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetNounEntry().GetVariants().Add(getValue(ch)); } else if (ch.Name.Equals("compl")) { catEntry.GetNounEntry().GetCompl().Add(getValue(ch)); } else if (ch.Name.Equals("nominalization")) { catEntry.GetNounEntry().GetNominalization().Add(getValue(ch)); } else if (ch.Name.Equals("tradeName")) { catEntry.GetNounEntry().GetTradeName().Add(getValue(ch)); } else if (ch.Name.Equals("trademark")) { catEntry.GetNounEntry().SetTradeMark(true); } else if (ch.Name.Equals("proper")) { catEntry.GetNounEntry().SetProper(true); } } } return(catEntry); }
private static CatEntry getModalValues(Node node) { CatEntry catEntry = new CatEntry("modal"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variant")) { catEntry.GetModalEntry().GetVariant().Add(getValue(ch)); } } } return(catEntry); }
private static CatEntry getAdjValues(Node node) { CatEntry catEntry = new CatEntry("adj"); for (Node ch = node.FirstChild; ch != null; ch = ch.NextSibling) { if (ch.NodeType == XmlNodeType.Element) { if (ch.Name.Equals("variants")) { catEntry.GetAdjEntry().GetVariants().Add(getValue(ch)); } else if (ch.Name.Equals("position")) { catEntry.GetAdjEntry().GetPosition().Add(getAttribute(ch, "type")); } else if (ch.Name.Equals("compl")) { catEntry.GetAdjEntry().GetCompl().Add(getValue(ch)); } else if (ch.Name.Equals("nominalization")) { catEntry.GetAdjEntry().GetNominalization().Add(getValue(ch)); } else if (ch.Name.Equals("stative")) { catEntry.GetAdjEntry().SetStative(true); } } } return(catEntry); }
public void SetHipparcos(double RA, double Dec, double ProMoRA, double ProMoDec, double Parallax, double RadVel) { CatEntry hipparcos = new CatEntry(); CatEntry fk5 = new CatEntry(); hipparcos.RA = RA; hipparcos.Dec = Dec; hipparcos.ProMoRA = ProMoRA; hipparcos.ProMoDec = ProMoDec; hipparcos.Parallax = Parallax; hipparcos.RadialVelocity = RadVel; NOVAS2.TransformHip(ref hipparcos, ref fk5); this.m_ra = fk5.RA; this.m_dec = fk5.Dec; this.m_pmra = fk5.ProMoRA; this.m_pmdec = fk5.ProMoDec; this.m_plx = fk5.Parallax; this.m_rv = fk5.RadialVelocity; this.m_rav = true; this.m_decv = true; this.m_num = 0; this.m_name = ""; this.m_cat = ""; }
protected override void OnAppearing() { CatEntry.Focus(); base.OnAppearing(); }
public void TransformCat(TransformationOption option, double date_incat, ref CatEntry incat, double date_newcat, ref byte[] newcat_id, ref CatEntry newcat) { NOVAS2.TransformCat(option, date_incat, ref incat, date_newcat, ref newcat_id, ref newcat); }
public void StarVectors(CatEntry star, ref double[] pos, ref double[] vel) { NOVAS2.StarVectors(star, ref pos, ref vel); }
public short AstroStar(double tjd, ref BodyDescription earth, ref CatEntry star, ref double ra, ref double dec) { return(NOVAS2.AstroStar(tjd, ref earth, ref star, ref ra, ref dec)); }
public void TransformHip(ref CatEntry hipparcos, ref CatEntry fk5) { NOVAS2.TransformHip(ref hipparcos, ref fk5); }
public short LocalStar(double tjd, ref BodyDescription earth, double deltat, ref CatEntry star, ref SiteInfo location, ref double ra, ref double dec) { return(NOVAS2.LocalStar(tjd, ref earth, deltat, ref star, ref location, ref ra, ref dec)); }
public PositionVector GetLocalPosition(double tjd, Site site) { CatEntry star = new CatEntry(); PositionVector positionVector = new PositionVector(); SiteInfo locale = new SiteInfo(); double[] pos2_1 = new double[4]; double[] pos2_2 = new double[4]; double[] earthvector1 = new double[4]; double[] vel1 = new double[4]; double[] earthvector2 = new double[4]; double[] numArray = new double[4]; double[] pos = new double[4]; double[] vel2 = new double[4]; double[] pos2_3 = new double[4]; double[] pos2_4 = new double[4]; double[] pos2_5 = new double[4]; double[] pos2_6 = new double[4]; double[] bary_earthp = new double[4]; double[] bary_earthv = new double[4]; double[] helio_earthp = new double[4]; double[] helio_earthv = new double[4]; double[] pos2_7 = new double[4]; if (!(this.m_rav & this.m_decv)) { throw new ASCOM.Astrometry.Exceptions.ValueNotSetException("Star.GetLocalPosition RA or DEC not available"); } double jd_high = !this.m_bDTValid ? tjd - DeltatCode.DeltaTCalc(tjd) / 86400.0 : tjd - this.m_deltat; star.RA = this.m_ra; star.Dec = this.m_dec; star.ProMoRA = this.m_pmra; star.ProMoDec = this.m_pmdec; star.Parallax = this.m_plx; star.RadialVelocity = this.m_rv; try { locale.Latitude = site.Latitude; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetLocalPosition Site.Latitude is not available"); } try { locale.Longitude = site.Longitude; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetLocalPosition Site.Longitude is not available"); } try { locale.Height = site.Height; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetLocalPosition Site.Height is not available"); } double tdb = 0; this.hr = NOVAS2.GetEarth(tjd, ref this.m_earth, ref tdb, ref bary_earthp, ref bary_earthv, ref helio_earthp, ref helio_earthv); if ((int)this.hr > 0) { pos2_7[0] = 0.0; pos2_7[1] = 0.0; pos2_7[2] = 0.0; throw new NOVASFunctionException("Star.GetApparentPosition", "get_earth", this.hr); } double mobl = 0; double tobl = 0; double eq = 0; double dpsi = 0; double deps = 0; NOVAS2.EarthTilt(tdb, ref mobl, ref tobl, ref eq, ref dpsi, ref deps); double gst = 0; NOVAS2.SiderealTime(jd_high, 0.0, eq, ref gst); NOVAS2.Terra(ref locale, gst, ref pos, ref vel2); int num1 = (int)NOVAS2.Nutate(tdb, NutationDirection.TrueToMean, pos, ref pos2_3); NOVAS2.Precession(tdb, pos2_3, 2451545.0, ref pos2_1); int num2 = (int)NOVAS2.Nutate(tdb, NutationDirection.TrueToMean, vel2, ref pos2_4); NOVAS2.Precession(tdb, pos2_4, 2451545.0, ref pos2_2); int index = 0; do { earthvector1[index] = bary_earthp[index] + pos2_1[index]; vel1[index] = bary_earthv[index] + pos2_2[index]; earthvector2[index] = helio_earthp[index] + pos2_1[index]; numArray[index] = helio_earthv[index] + pos2_2[index]; checked { ++index; } }while (index <= 2); NOVAS2.StarVectors(star, ref pos, ref vel2); NOVAS2.ProperMotion(2451545.0, pos, vel2, tdb, ref pos2_3); double lighttime = 0; NOVAS2.BaryToGeo(pos2_3, earthvector1, ref pos2_5, ref lighttime); int num3 = (int)NOVAS2.SunField(pos2_5, earthvector2, ref pos2_6); int num4 = (int)NOVAS2.Aberration(pos2_6, vel1, lighttime, ref pos2_7); positionVector.x = pos2_7[0]; positionVector.y = pos2_7[1]; positionVector.z = pos2_7[2]; return(positionVector); }
private static void GetLexRecord(Node node, LexRecord lexRecord, CatEntry catEntry) { if (node.NodeType == XmlNodeType.Element) { if (node.Name.Equals("base")) { lexRecord.SetBase(getValue(node)); } else if (node.Name.Equals("eui")) { lexRecord.SetEui(getValue(node)); } else if (node.Name.Equals("cat")) { lexRecord.SetCat(getValue(node)); } else if (node.Name.Equals("spellingVars")) { lexRecord.SetSpellingVar(getValue(node)); } else if (node.Name.Equals("acronyms")) { lexRecord.GetAcronyms().Add(getValue(node)); } else if (node.Name.Equals("abbreviations")) { lexRecord.GetAbbreviations().Add(getValue(node)); } else if (node.Name.Equals("annotations")) { lexRecord.GetAnnotations().Add(getValue(node)); } else if (node.Name.Equals("signature")) { lexRecord.SetSignature(getValue(node)); } else if (node.Name.Equals("verbEntry")) { catEntry = getVerbValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("auxEntry")) { catEntry = getAuxValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("modalEntry")) { catEntry = getModalValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("nounEntry")) { catEntry = getNounValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("pronEntry")) { catEntry = getPronValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("adjEntry")) { catEntry = getAdjValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("advEntry")) { catEntry = getAdvValues(node); lexRecord.SetCatEntry(catEntry); } else if (node.Name.Equals("detEntry")) { catEntry = getDetValues(node); lexRecord.SetCatEntry(catEntry); } } for (Node child = node.FirstChild; child != null; child = child.NextSibling) { GetLexRecord(child, lexRecord, catEntry); } }
public PositionVector GetTopocentricPosition(double tjd, Site site, bool Refract) { CatEntry star = new CatEntry(); SiteInfo siteInfo = new SiteInfo(); double[] earthvector1 = new double[4]; double[] pos2_1 = new double[4]; double[] vel1 = new double[4]; double[] pos2_2 = new double[4]; double[] earthvector2 = new double[4]; double[] pos1 = new double[4]; double[] pos2_3 = new double[4]; double[] pos2_4 = new double[4]; double[] pos2_5 = new double[4]; double[] pos2_6 = new double[4]; double[] pos2_7 = new double[4]; double[] vel2 = new double[4]; double[] pos2_8 = new double[4]; double[] bary_earthp = new double[4]; double[] bary_earthv = new double[4]; double[] helio_earthp = new double[4]; double[] helio_earthv = new double[4]; double[] pos2 = new double[4]; if (!(this.m_rav & this.m_decv)) { throw new ASCOM.Astrometry.Exceptions.ValueNotSetException("Star.GetTopocentricPosition RA or DEC not available"); } double jd_high = !this.m_bDTValid ? tjd - DeltatCode.DeltaTCalc(tjd) / 86400.0 : tjd - this.m_deltat; try { siteInfo.Latitude = site.Latitude; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetTopocentricPosition Site.Latitude is not available"); } try { siteInfo.Longitude = site.Longitude; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetTopocentricPosition Site.Longitude is not available"); } try { siteInfo.Height = site.Height; } catch (Exception ex) { //ProjectData.SetProjectError(ex); throw new ValueNotAvailableException("Star:GetTopocentricPosition Site.Height is not available"); } double tdb = 0; this.hr = NOVAS2.GetEarth(tjd, ref this.m_earth, ref tdb, ref bary_earthp, ref bary_earthv, ref helio_earthp, ref helio_earthv); if ((int)this.hr > 0) { pos2[0] = 0.0; pos2[1] = 0.0; pos2[2] = 0.0; throw new NOVASFunctionException("Star.GetApparentPosition", "get_earth", this.hr); } double mobl = 0; double tobl = 0; double eq = 0; double dpsi = 0; double deps = 0; NOVAS2.EarthTilt(tdb, ref mobl, ref tobl, ref eq, ref dpsi, ref deps); double gst = 0; NOVAS2.SiderealTime(jd_high, 0.0, eq, ref gst); NOVAS2.Terra(ref siteInfo, gst, ref pos1, ref vel2); int num1 = (int)NOVAS2.Nutate(tdb, NutationDirection.TrueToMean, pos1, ref pos2_3); NOVAS2.Precession(tdb, pos2_3, 2451545.0, ref pos2_1); int num2 = (int)NOVAS2.Nutate(tdb, NutationDirection.TrueToMean, vel2, ref pos2_8); NOVAS2.Precession(tdb, pos2_8, 2451545.0, ref pos2_2); int index = 0; do { earthvector1[index] = bary_earthp[index] + pos2_1[index]; vel1[index] = bary_earthv[index] + pos2_2[index]; earthvector2[index] = helio_earthp[index] + pos2_1[index]; checked { ++index; } }while (index <= 2); star.RA = this.m_ra; star.Dec = this.m_dec; star.ProMoRA = this.m_pmra; star.ProMoDec = this.m_pmdec; star.Parallax = this.m_plx; star.RadialVelocity = this.m_rv; NOVAS2.StarVectors(star, ref pos1, ref vel2); NOVAS2.ProperMotion(2451545.0, pos1, vel2, tdb, ref pos2_3); double lighttime = 0; NOVAS2.BaryToGeo(pos2_3, earthvector1, ref pos2_4, ref lighttime); int num3 = (int)NOVAS2.SunField(pos2_4, earthvector2, ref pos2_5); int num4 = (int)NOVAS2.Aberration(pos2_5, vel1, lighttime, ref pos2_6); NOVAS2.Precession(2451545.0, pos2_6, tdb, ref pos2_7); int num5 = (int)NOVAS2.Nutate(tdb, NutationDirection.MeanToTrue, pos2_7, ref pos2); double ra = 0; double dec = 0; int num6 = (int)NOVAS2.Vector2RADec(pos2, ref ra, ref dec); double num7 = Math.Sqrt(Math.Pow(pos2[0], 2.0) + Math.Pow(pos2[1], 2.0) + Math.Pow(pos2[2], 2.0)); RefractionOption ref_option = RefractionOption.NoRefraction; if (Refract) { bool flag = true; try { siteInfo.Temperature = site.Temperature; } catch (Exception ex) { //ProjectData.SetProjectError(ex); flag = false; //ProjectData.ClearProjectError(); } try { siteInfo.Pressure = site.Pressure; } catch (Exception ex) { //ProjectData.SetProjectError(ex); flag = false; //ProjectData.ClearProjectError(); } ref_option = !flag ? RefractionOption.StandardRefraction : RefractionOption.LocationRefraction; } double zd = 0; double az = 0; double rar = 0; double decr = 0; if (this.m_bDTValid) { NOVAS2.Equ2Hor(tjd, this.m_deltat, 0.0, 0.0, ref siteInfo, ra, dec, ref_option, ref zd, ref az, ref rar, ref decr); } else { NOVAS2.Equ2Hor(tjd, DeltatCode.DeltaTCalc(tjd), 0.0, 0.0, ref siteInfo, ra, dec, ref_option, ref zd, ref az, ref rar, ref decr); } if (ref_option > RefractionOption.NoRefraction) { NOVAS2.RADec2Vector(rar, decr, num7, ref pos2); } return(new PositionVector(pos2[0], pos2[1], pos2[2], rar, decr, num7, num7 / 173.14463348, az, 90.0 - zd)); }
public void MakeCatEntry(string catalog, string star_name, int star_num, double ra, double dec, double pm_ra, double pm_dec, double parallax, double rad_vel, ref CatEntry star) { NOVAS2.MakeCatEntry(catalog, star_name, star_num, ra, dec, pm_ra, pm_dec, parallax, rad_vel, ref star); }