Giter VIP home page Giter VIP logo

Comments (2)

Bill-Gray avatar Bill-Gray commented on July 23, 2024

Hi Peter,

Interesting. I've always run with multiple files (and there is an ascp2050.421 available). Looking at the code, though, I think I can see why running with only one file.

"Normally", DE421 would be provided as two files, ascp1900.421 and ascp2050.421. In that case, the determine_year_range() function would (eventually) find both files and set *year_start = 1900, *year_end = 2050, and *year_step = 150. And similarly with any other multi-file case.

With just one file, *year_step is left at the default value of five years, and both *year_start and *year_end are left at 1900. So the program figures it has data covering 1900 to 1905 and thinks : well, I don't have anything that covers your desired time span.

I see two possible fixes :

(1) Make sure both files are available, even though only one is going to get used. Requires no changes to the code.

(2) Add code to say that if only one file is found, *year_step = 1000; That way, if only one file is found, the program says : I don't really know what time span each ASCII file covers, so let's set it to be really long. Worst that'll happen is that we'll read in the entire file and realize that none of it covers the desired time span.

I've implemented the latter and pushed it to GitHub. Shortly after doing so, I saw that I'd made it more complicated than it needed to be; all that was really required was

    if( 1 == n_found)       /* year step wasn't actually determined */
       *year_step = 10000;

I'll probably fix that, but it'll work Just Fine as it is.

BTW, a note of thanks for your work on ASCOM. I am now out of the desktop planetarium business (my Guide 9.1 software is getting increasingly obsolete). But when I was in it, the ability to ignore the bazillion different telescope control protocols saved me a lot of trouble. I had already added code to control various Meade, Celestron, and other telescopes... just enough to make me perfectly happy to delegate further telescopes to ASCOM.

from jpl_eph.

Peter-Simpson avatar Peter-Simpson commented on July 23, 2024

Hi Bill,

Many thanks, your fix works well here and will save anyone else heading down this path! I'm glad ASCOM was of use, you are exactly the target audience we are trying to help.

Best wishes, Peter

from jpl_eph.

Related Issues (9)

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.