rlancaste / stellarsolver

GNU General Public License v3.0
92 stars 47 forks source link

CLI example #8

Closed gehelem closed 2 years ago

gehelem commented 4 years ago

Hi, first off all this work is what i've been looking for for a long time ! thanks a lot, it works like a charm and i'm sure it's the way things should be done

Could you provide a really basic command line example ? For example 1- open fits file 2- SEP or Solve 3- ouput results

(yes : i'm lost in Qt cutties to understand your Tester)

Thanks again Gilles

rlancaste commented 4 years ago

HI there,

I was working pretty hard on this in the spring and got it to a point where the solver is ready to be integrated into KStars/Ekos and should work on Windows, Mac, and Linux. But then I got busy with some other projects during the summer and I haven't yet finished integrating it. But I am planning to work on this fairly soon. Once I do that, I will come back and make improvements to the Library including examples of how it could be used in other QT programs. One of the reasons that I didn't do that in the first place is because when integrating it into KStars, I found some things that needed to be changed. So I am using that to inform my revisions to the library.

Thanks,

Rob

martinberoiz commented 4 years ago

Hello,

Let me piggy back on this issue. I want to join @gehelem in saying that I was also looking for something like this. My highest commendations for your effort! Having astrometry.net into a more portable library instead of a CLI program opens up a lot of possibilities. I had trouble understanding the "entry points" to the library from a user point of view. I look forward to see the usage examples.

gehelem commented 4 years ago

thank you @rlancaste no rush, i'm just playing

i did try that way but nothing happens... (no stars) `

stellarSolver = new StellarSolver(stats, m_ImageBuffer);
stellarSolver->setSextractorType(SEXTRACTOR_INTERNAL);
stellarSolver->setSolverType(SOLVER_STELLARSOLVER);
stellarSolver->setProcessType(SEXTRACT_WITH_HFR);
stellarSolver->startProcess();
while(!stellarSolver.isNull() && stellarSolver->isRunning())
{
   /*waiting*/
}
printf("finished with %i stars found\n",stars.size());

` Previously m_ImageBuffer has been populated with some sample fits wich are giving positive results with your Tester Obviously i should set some parameters before to launch the process, i'm playing with that at the moment

Gilles.

rlancaste commented 4 years ago

I will certainly do this as soon as I am done with getting it integrated into KStars.

If you want to check out how I integrated it, I just created a pull request for my initial integration.

https://invent.kde.org/education/kstars/-/merge_requests/98

I have been using my integration into KStars to help me refine the library. So once this part is done, I will make some improvements in the tester program, then I will release a new version of StellarSolver, and then I can look into creating a simpler example for people to follow.

rlancaste commented 4 years ago

But I would like to answer a couple of your questions real quick and if you have any others, please feel free to ask.

First, Gilles, this library is not meant to be used from the command line. One of the biggest issues that we have had with astrometry.net is its reliance on the command line. That makes it not work very well on Windows at all, and it also means that many temporary and configuration files have to be saved, which is not good for things like Raspberry Pi's which can't take too many reads and writes due to the SD card hard drive. This library is meant to be incorporated into cross platform QT based programs so that they can have integrated star extraction and integrated plate solving and don't need external programs to do so. It can use external programs like ASTAP, local astrometry.net, online astrometry.net, and ANSVR, but it has the internal astrometry.net build which is cross platform. It sounds like in your later posting that you were using it in a program which is correct.

martinberoiz and Gilles, yes I know that the tester is pretty complex and is probably not a good example. The reason it is that way is because I wanted to test everything that it can do and compare different methods to perfect them and build the features. I definitely understand your desire for simple examples, and I will definitely add them later.

Gilles, for your later question, you stated that the imagebuffer contains the image file. Does the stats variable contain all the correct image information? I am assuming that it does, but if not, make sure all the info in the Statistic structure matches the image.

I would recommend setting the Parameters that will be used for the sextraction as well. Like this: stellarSolver->setParameterProfile(SSolver::Parameters::ALL_STARS); Or you can make your own Parameters object, set some parameters in it, and use the stellarSolver->setParameters method. It will still work if you don't set the profile, since there is a default profile, but you probably should set it to have more control.

Next, you used the "startProcess" command. This command is nonblocking, and is the way you should do it if you are using signals and slots to wait for the response to the solve. If you do it the way you showed above, it might still work, but I haven't tried it that way. I did make a blocking command to do exactly what you are trying to do above: stellarSolver->sextractWithHFR();

Hopefully this help.

gehelem commented 4 years ago

I will certainly do this as soon as I am done with getting it integrated into KStars.

If you want to check out how I integrated it, I just created a pull request for my initial integration.

https://invent.kde.org/education/kstars/-/merge_requests/98

I have been using my integration into KStars to help me refine the library. So once this part is done, I will make some improvements in the tester program, then I will release a new version of StellarSolver, and then I can look into creating a simpler example for people to follow.

Thank you very much, i'm sure it will be very helpfull, i'll take a look tomorrow

gehelem commented 4 years ago

But I would like to answer a couple of your questions real quick and if you have any others, please feel free to ask. (...) Hopefully this help.

Yep ! this helps a lot too

My "Command Line" question was certainly not well expressed... sorry for this i don't want to use your library directly with CLI command, of course, And at the moment, i had my first sucess playing with it a couple of days ago (really great job, again !!)

To go further : i'd like to use it in my own indi client :-) The best way you could help me would be to show me how to use your library here : https://github.com/indilib/indi/tree/master/examples/tutorial_six => I would like to process HFR calculation after a new blob arrives... But i'm completely lost ATM, still digging...

rlancaste commented 4 years ago

Sounds pretty cool. Once I finish this integration, I can probably help

rlancaste commented 4 years ago

We are making very steady progress, it is now in KStars master

rlancaste commented 2 years ago

Ok I have provided some basic examples of how to use StellarSolver and I will add some more soon.

rlancaste commented 2 years ago

They are in the 2.0 branch and will go into the master branch within the next two weeks or so.

gehelem commented 2 years ago

Ok I have provided some basic examples of how to use StellarSolver and I will add some more soon.

Ohhh !!! Thank you very much, this will help a lot

I must say your project is the key to make mine work, and since my first post i've managed to do many things with it : guiding/focusing/frame analyze ... Still work in progress but heavily depending on StellarSolver. (if you want to have a look : https://github.com/gehelem/OST)

Your examples will help me to make it cleaner, thanks again Gilles

rlancaste commented 2 years ago

Very cool, that sounds great. You might want to verify with the 2.0 branch and make sure everything is good before it goes live. I am still working on it, but there are some small changes.