
Crossing_points for LEO Satellite at the equator
2 次查看(过去 30 天)
显示 更早的评论
This code should give equatorial crossing points. Seems to work but not complete. This is sample sateltite latitude and I want to get the coresspodning equatorial crossing points.
Any comments on this code?
Thank you
latitude = [10, -5, -2, 8, -12, 15, 0, -3, 7, -9];
equatorial_crossing_indices = find(sign(latitude(1:end-1)) ~= sign(latitude(2:end))) + 1;
% Plotting
figure;
plot(latitude);
hold on;
scatter(equatorial_crossing_indices, latitude(equatorial_crossing_indices), 'red');
ax = gca;
ax.YAxisLocation = 'origin';
ax.XAxisLocation = 'origin';
ax.XAxis.TickLabelFormat = '%g°';
ax.YAxis.TickLabelFormat = '%g°';
plot([1, numel(latitude)], [0, 0], 'color', 'black', 'linestyle', '--', 'label', 'Equator');
title('Latitude Data with Equatorial Crossings');
xlabel('X');
ylabel('Latitude');
legend();
hold off;
0 个评论
回答(1 个)
nick
2023-12-18
Hi root,
I understand from your query that you are seeking assistance in detecting equatorial crossing points of latitude data, particularly in edge cases where transitions involve one of the latitudes being 0.
To detect the transitions in the sign of consecutive array elements in the “latitude” array, you can use an element-wise logical "AND" to check if one of the elements is 0 and then compute the "equatorial_crossing_indices" array using the "find" function. The following code snippet demonstrates how to handle such cases:
latitude = [10, -5, -2, 8, -12, 15, 0, -3, 7, -9];
%handling edge cases where there is 0
equatorial_crossing_indices = find((sign(latitude(1:end-1)) == -1* sign(latitude(2:end))) & sign(latitude(1:end-1)) ~= 0) + 1;
Here is the output observed for the given “latitude” array:

Hope this helps,
Regards,
Neelanshu
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Single-Rate Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!