fromstarplotimportMapPlot,Equidistant,_fromstarplot.stylesimportPlotStyle,extensionsstyle=PlotStyle().extend(extensions.BLUE_GOLD,extensions.MAP,)style.figure.padding=40p=MapPlot(projection=Equidistant(center_ra=11*15),ra_min=10*15,ra_max=12*15,dec_min=-70,dec_max=-55,style=style,resolution=3000,scale=1.1,)p.gridlines(ra_locations=[dfordinrange(8*15,14*15,8)],dec_locations=[dfordinrange(-50,-80,-4)],ra_label_fn=lambdara:f"{ra}\u00b0",)p.constellations()p.constellation_borders()p.stars(where=[_.magnitude<9],bayer_labels=True,where_labels=[_.magnitude<5])defdso_label(d):ifd.common_names:returnd.common_names[0]ifd.ngc:returnd.ngcifd.ic:returnf"IC{d.ic}"returnd.namemag_filters=(_.magnitude<11)|(_.magnitude.isnull())p.open_clusters(where=[_.size<0.2,_.magnitude<11],label_fn=dso_label,where_true_size=[False],)withp.style.dso_open_clusterasoc:oc.label.font_size=26oc.label.font_weight=800p.open_clusters(# plot larger clusters as their true apparent sizewhere=[_.size>0.2,mag_filters],label_fn=dso_label,)p.nebula(where=[mag_filters,_.size<0.2],label_fn=dso_label,where_true_size=[False],)withp.style.dso_nebulaasneb:neb.label.font_size=26neb.label.font_weight=800p.nebula(where=[mag_filters,_.size>0.2],label_fn=dso_label,)p.constellation_labels()p.legend(style__location="inside_bottom_right",style__margin_x=20,)p.export("map_carina.png")