steveberardi / starplot

✨ Star charts and maps in Python
https://starplot.dev
MIT License
17 stars 7 forks source link

Pass own stars or increase limiting magnitude #31

Closed mrosseel closed 9 months ago

mrosseel commented 9 months ago

I'm looking to plot a 2 deg by 2 deg star field. My RA values are between 0 and 360 degrees, DEC is between -90 and +90 degrees. The chart output hints that you are expecting RA in 24h format?

from starplot import MapPlot, Projection, SkyObject
from starplot.styles import PlotStyle, extensions

def starplot_region(filename):
    style = PlotStyle().extend(
        extensions.BLUE_LIGHT,
        extensions.MAP,
        {
            "bayer_labels": {
                "font_name": "Hack Nerd Font",  # use a better font for Greek letters
                "font_size": 7,
                "font_alpha": 0.9,
            },
        },
    )
    style.star.label.font_size = 11

    p = MapPlot(
        projection=Projection.MERCATOR,
        ra_min=12/15.0,
        ra_max=14/15.0,
        dec_min=33,

        dec_max=35,
        limiting_magnitude=15,
        style=style,
        resolution=3600,
    )
    p.export(filename, padding=0.5)
test
steveberardi commented 9 months ago

I'm looking into this, but to answer some of your questions:

  1. Yes, Starplot expects all right ascension values to be in 24hr format (as floats). I'll add this to the docs :)

  2. The built-in star catalog includes about 116k stars from the Hipparcos catalog, which I believe goes down to mag 12 or 14? More specifically, the starplot python package includes an abridged version of the Hipparcos catalog (down to mag 8), but if you request dimmer stars, then starplot will download the full Hipparcos catalog (via Skyfield).

  3. I agree, there should be more stars showing up in that plot. When I run your code, I get the same result. I'll continue investigating.

  4. I have started thinking about how best to support using other catalogs, or plotting objects in bulk. It might be a few versions away, but in the meantime you could use the plot_object method on the map plot, which is demonstrated in the Orion example -- Starplot currently uses this method to plot DSOs.

Thanks for reporting this issue (and the others)! Starplot is still very much a "work in progress" but I really value your feedback and help in reporting these bugs.

steveberardi commented 9 months ago

Ahh, there was a very tiny bug in loading the stars for map plots that I just fixed in version 0.3.4. The bug prevented Starplot from downloading the full Hipparcos catalog when specifying a limiting magnitude > 8 on map plots.

When I run your code with the new version, I get this:

mag15

The plot now includes 7 total stars:

HIP 3897 = MAG 7.26
HIP 3978 = MAG 8.04
HIP 4058 = MAG 6.87
HIP 4095 = MAG 8.43
HIP 4175 = MAG 7.82
HIP 4191 = MAG 8.27
HIP 4214 = MAG 9.79

Does this look correct to you?

I also confirmed that when specifying a limiting magnitude of 15, the full Hipparcos catalog of 118,218 stars is queried.

Also, the right ascension labels are not plotted because currently Starplot only plots RA labels for whole hours (e.g. 1, 2, ..., 24)