I think there are only two special cases to consider when the visibility from the propagated start time to the end time: the first is that there is no start visual time in the first lap of the propagated time period, and the first event is the end visual time; The second is that there is no end visual time on the last lap in the propagated time period, only the start visual time.
There are actually four cases :
The satellite IS NOT visible from the ground at the begining of the simulation
The satellite IS visible from the ground at the beginning of the simulation
The satellite IS NOT visible from the ground at the end of the simulation
The satellite IS visible from the ground at the end of the simulation
Considering these cases, I coded with this logic when desining the line of visibility.
Then whatever starting boolean (true for visible false for not visible) the boolean will alternate from true to false or false to true when in visibility or not.
But I am interested, in whatever you programmed, let me know when you are done. So that I can review it, don’t worry, I understood that you are new to programming
Hi,Sorry for the late reply!
the past few days that happened to be a traditional festival that I mainly used for vacation and rest. I think I have finished some basic logic and tried to do some coverage testing.
Basically, all of them are passed, except for one: when the actual calculation time period is too short, and it happens to be “included” by a visual arc(that means no detector event handled). So now the question becomes, how do I judge whether they are visible at a specific time (as at the begin time)?
I’m really embarrassing .As I didn’t use your “InterSatViewHandler” and didn’t notice that you had solved it.I’m going to rewrite my logic right now. I just try to use Gitlab and I have “forked” the project but didn’t dare “commit” any thing. And I always feel that my code is ugly, is there any other way to give you my code for review?
public void init(final SpacecraftState initialState, final AbsoluteDate target, final EventDetector detector) {
final double g = detector.g(initialState);
final boolean visible = g >= 0;
viewMap.addValidAfter(visible, initialState.getDate(), true);
}
After imitating your handler class, the last problem is solved. I think if I really want to contribute through Gitlab, I’ll have to refactor the code and write comments as prescriptively as possible? In addition, I only solved the problem of one pair of satellites. I have seen that your original class also provides a solution to list of satellite pairs. For me, this is a more complicated issue. I think it’s better for me to use a demo to share my thoughts?
It’s okay ! You can paste your code here, but you can also create a merge request with some code commited, I will review it anyway. It’s okay to write ugly code, but it’s better to know how to code properly that’s for sure !
Thank you for your reply. I only solved the single pair of satellites problem with some new functions in your InterSatVisu class (I just tested a few cases I could think of by combining orbital parameters).
I’m trying to learn how to merge correctly, and I’m going to do my best to write some comments and format the code (mainly to “mark up” my new functions in a more obvious way so you can spot them).
In addition, because I am not familiar with the TimeSpanMap class, I did not use TimeSpanMap to store the temporary calculation results, but used a self-defined TimeDataList to save them, and I apologize for the inconvenience.
It’s okay for the self-defined TimeDataList. Actually, TimeSpanMap is a Map that was build to manage time variables. If you are ok with this when you will commit and push your code into the merge request, I can replace the code you used with TimeDataList by a TimeSpanMap (and I will check that It will work the same) for code consistency.
Thanks to your help!!! I kind of understand how GitLab works. I don’t know if I’m doing it right, but I’m making a record for myself and for the newcomers who come after
I first fork your project to my own account and bring the dev branch over.
Clone the project under my account to the local computer.
Select the develop branch locally,
Modify my code on this branch,
Then commit my modifications,
Push the items to the project under my account,
I can create a new “merge request” on my web account.
Did I understand it right?PS:I don’t quite understand what “Draft” does yet. I will continue to learn.
Thank you again for your patience!
cheers!