Giter Site home page Giter Site logo

aasharp's People

Contributors

elendil-software avatar jsauve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aasharp's Issues

AASharp.AASCoordinateTransformation.Equatorial2Horizontal probably wrong implementation

@jsauve
@elendil-software
@NameOfTheDragon

The AASharp.AASCoordinateTransformation.Equatorial2Horizontal method is incorrectly implemented.
It gives definitely wrong result for Polaris azimuth coordinate.
We all know that Polaris has a "special place" on the night sky and its azimuth coordinate regardless of the current geographic location must be always near 359° (or 0° - 1°, but always between these values).

But the current implementation gives cca 179° for Polaris azimuth, which is impossible!

Used following code to test it:

using System;
using System.Globalization;
using AASharp;

namespace ABC {
    class Program {
        static void Main(string[] args) {
            // constants
            var latitude = 47.832301400;    // enter your latitude in decimal degrees
            var longitude = 17.668490900;   // enter your longitude in decimal degrees
            var ra = 2.53030404466667;      // Polaris RA in decimal hours
            var de = 89.26410897;           // Polaris DE in decimal degrees

            // calculated values
            var utcNow = DateTime.UtcNow;
            var jd1 = new AASDate(utcNow.Year, utcNow.Month, utcNow.Day, utcNow.Hour, utcNow.Minute, utcNow.Second, true).Julian;
            var gmst = AASSidereal.MeanGreenwichSiderealTime(jd1);
            var lmst = gmst + AASCoordinateTransformation.DegreesToHours(longitude);
            var lha = lmst - ra;
            var coord = AASCoordinateTransformation.Equatorial2Horizontal(lha, de, latitude);

            // display values
            Console.WriteLine("{0,-30}{1}", "UTC",                          utcNow.ToString(@"HH\:mm\:ss", CultureInfo.InvariantCulture) );
            Console.WriteLine("{0,-30}{1}", "Greenwich mean sidereal time", TimeSpan.FromHours(gmst).ToString(@"hh\:mm\:ss", CultureInfo.InvariantCulture) );
            Console.WriteLine("{0,-30}{1}", "Local mean sidereal time",     TimeSpan.FromHours(lmst).ToString(@"hh\:mm\:ss", CultureInfo.InvariantCulture) );
            Console.WriteLine("{0,-30}{1}", "Local hour angle",             TimeSpan.FromHours(lha).ToString(@"hh\:mm\:ss", CultureInfo.InvariantCulture) );
            Console.WriteLine("{0,-30}{1}", "Azimuth",                      FormatDMS(coord.X) );
            Console.WriteLine("{0,-30}{1}", "Altitude",                     FormatDMS(coord.Y) );

            Console.Write(Environment.NewLine);
        }

        // Convert decimal degrees to DMS string
        private static string FormatDMS(double dd) {
            var ts = TimeSpan.FromHours(dd);
            return string.Format("{0:D}", ts.Days * 24 + ts.Hours) + "°" +
                string.Format("{0:D2}", ts.Minutes) + "'" +
                string.Format("{0:D2}", ts.Seconds) + "\"";
        }
    }
}

Link to SwiftAA?

Hi,

Not an issue per-se. I just discovered your code, and since I am the author of the Objective-C(++) / Swift and Javascript versions, I thought it would be cool to link to yours.

You may be interested to link back ? :-)
https://github.com/onekiloparsec/SwiftAA

Best

Is Mono Solution file still necessary ?

Hi,

I open this issue to discuss the need of the Mono solution version (AASharp.Mono.sln)

With .Net standard I'm not sure it is still necessary to keep this solution file.

Note : the solution AASharp.sln is targeting .Net Standard 2.0, .Net 4.0 and .Net 4.5. We could add .Net Standard 1.6 to support Mono 4.6

AASharp.Extension

@jsauve
I created a new repository for extension to AASharp : https://github.com/elendil-software/AASharp.Extension

  • I already put there a few classes that I initially pushed on AASharp.
  • On AASharp I have have set this classes as "Obsolete"

And I reported the modifications of AA+ 1.98 and 1.99. I will build the NuGet package soon. I have some problem with my CI server. As soon I solve that I build the package.

Julien

Used licensing

Would you possibly change the used license LGPL-3.0 to MIT_License?
It would make it easier to use in other projects.

Can't open the solution

Hi @jsauve

Cannot open the AASharp.sln solution, at least in Visual Studio 2013.

However, as far as I checked the source code, it looks a very good Astro library, with rich function set!

Did u consider to make it available as a nuget package at www.nuget.org ?

Implementation of the last AA+ additions

Hi @jsauve

I implemented the last AA+ additions on the develop branch. If you want to have a look before I merge it on Master and release the NuGet package.

  • CAAMoonPhases2
  • CAAMoonNodes2
  • CAAMoonPerigeeApogee2
  • CAAMoonMaxDeclinations2
  • CAAEquinoxesAndSolstices2
  • CAARiseTransitSet2

Regards,

Julien

Qingming Festival

Hello,

What amazing repository !

I'm searching a way to calculate the 5th solar term for the chinese calendar.
I know there is some calculation to do in order to get the gregorian date, but I have no idea to do this :/.
I think your libraries can do this, but have you any idea ?

If you can help we with your project it will be so cool ;)

Some link :
https://en.wikipedia.org/wiki/Solar_term
https://en.wikipedia.org/wiki/Qingming_Festival
http://www.math.nus.edu.sg/aslaksen/gem-projects/hm/Chinese_Calendar.pdf

Best regards,

Shaenn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.