Open jorgepiloto opened 1 year ago
If you run this addition to your code:
import numpy as np
times = time + np.linspace(-12, 12, 20) * u.hour
for target in targets:
max_altitude = max(telescope.altaz(times, target).alt)
print(f"{target.name} reaches max(alt): {max_altitude:.1f}" )
You'll see that only one target would fall within the axis limits on this plot:
12P/Pons-Brooks reaches max(alt): 88.4 deg
C/2023 H2 (Lemmon) reaches max(alt): 15.4 deg
You're seeing the airmass curve for 12P/Pons-Brooks
in the plot above.
How are you comparing to the results from other software?
Hi @bmorris3, you are right. The C/2023 H2
line was below the default air mass limit. I just changed and it is getting displayed as expected. All values look fine now compared to KStars.
One last issue I have noticed is the lack of a legend even after adding:
plt.legend(shadow=True)
I thought it would use the names of the Targets. I also tried to declare the labels using the style_kwargs
but it didn't work neither.
This is very weird. It looks like everything is working now including the legend. I did not modified the code in any way. Closing this for the moment.
Thanks for your support, @bmorris3. I really appreciate it 🚀
Opening this again. Using a "dummy" loop displays the legend with all labels:
# Displays the legend
for _ in targets:
plot_airmass(
targets,
telescope,
time,
altitude_yaxis=True,
brightness_shading=True,
style_kwargs={"linestyle": "--"},
max_airmass=5,
)
plt.legend(shadow=True)
plt.show()
But without the loop the legend shows empty.
Using a custom ax solves the issue.
🐞 Problem
I wanted to study the visibility of two comets. The coordinates for the comets are stored in a
comets.dat
file:The main code looks like this:
The output figure is this one:
Note that there is only one object instead of two. Furthermore, the values being displayed in the graph are not the ones I get with other software (KStars and Stellarium) for the same location and time.
I am missing something in my code? The documentation and tutorials are very clean and detailed on how to use the library.