Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add from_zone and union in from_cones #169

Merged
merged 6 commits into from
Sep 9, 2024
Merged

add from_zone and union in from_cones #169

merged 6 commits into from
Sep 9, 2024

Conversation

ManonMarchand
Copy link
Member

Fixes #165 (new feature from_zone + documentation zone versus box)

import matplotlib.pyplot as plt
from astropy import units as u
from astropy.coordinates import SkyCoord
from mocpy import MOC


moc = MOC.from_zone(
    SkyCoord([[-50, -50], [50, 50]], unit="deg"),
    max_depth=10,
)

fig = plt.figure()
wcs = moc.wcs(fig)  # automatically creates a wcs for the MOC
ax = fig.add_subplot(projection=wcs)
moc.fill(ax, wcs, color="teal", alpha=0.5)
ax.grid(True)

image

Fixes #164 (small_cones strategy is used in the new option of from_cones

import matplotlib.pyplot as plt
from astropy import units as u
from astropy.coordinates import SkyCoord
from mocpy import MOC

moc = MOC.from_cones(
    [10, 4, 2] * u.arcmin,
    [11, 3, 10] * u.arcmin,
    radius=2 * u.arcmin,
    max_depth=14,
    union_strategy="small_cones",
)

fig = plt.figure()
wcs = moc.wcs(fig)
ax = fig.add_subplot(projection=wcs)
moc.fill(ax, wcs, color="hotpink", alpha=0.5)

image

@ManonMarchand ManonMarchand merged commit 57f7e6b into master Sep 9, 2024
14 checks passed
@ManonMarchand ManonMarchand deleted the dev branch September 9, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

boxes and mocpy pixels do not match Switch between small cones and big cones strategy in from_cones
2 participants