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

get_cat function replacement #96

Closed
JuanCab opened this issue Jun 8, 2023 · 0 comments · Fixed by #230
Closed

get_cat function replacement #96

JuanCab opened this issue Jun 8, 2023 · 0 comments · Fixed by #230
Assignees
Labels
refactor Summer 2023 project to rewrite stellarphot

Comments

@JuanCab
Copy link
Contributor

JuanCab commented Jun 8, 2023

The get_cat function in differential_photometry/magnitude_transforms.py is

  1. located in the wrong file given its purpose
  2. somewhat redundant.

I would suggest importing catalog_search.py into magnitude_transforms.py and delete

def get_cat(image):
    our_coords = SkyCoord(image['RA'], image['Dec'], unit='degree')
    # Get catalog via cone search
    Vizier.ROW_LIMIT = -1  # Set row_limit to have no limit
    desired_catalog = 'II/336/apass9'
    a_star = our_coords[0]
    rad = 1 * u.degree
    cat = Vizier.query_region(a_star, radius=rad, catalog=desired_catalog)
    cat = cat[0]
    cat_coords =  SkyCoord(cat['RAJ2000'], cat['DEJ2000'])
    return cat, cat_coords

and replace the call to cat, cat_coords = get_cat(one_image) in magnitude_transforms.py with a the following code:

cat = catalog_search(one_image, None, 'II/336/apass9',
                               ra_column='RAJ2000', dec_column='DEJ2000', radius= 1 * u.degree,
                               clip_by_frame=False)
cat_coords =  SkyCoord(cat['RAJ2000'], cat['DEJ2000'])

which uses the existing catalog_search functionality.

@mwcraig mwcraig added the refactor Summer 2023 project to rewrite stellarphot label Oct 15, 2023
mwcraig added a commit to mwcraig/stellarphot that referenced this issue Dec 21, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in stellarphot refactoring Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Summer 2023 project to rewrite stellarphot
Projects
Status: Done
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants