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

Refactor wcsmod module into individual modules for each wrapper #516

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

ejeschke
Copy link
Owner

  • puts each WCS wrapper in a separate module
  • for easier administration and editing

- puts each wrapper in a separate module
- for easier administration and editing
@pllim
Copy link
Collaborator

pllim commented Jun 23, 2017

I think __init__.py needs some extra imports into the ginga.util.wcsmod namespace to make it backward-compatible.

@ejeschke
Copy link
Owner Author

I was wondering about that. But I didn't find any grepping through the Ginga source code or testing so far. Are there some STScI plugins that are importing things that are not present in this version?

@pllim
Copy link
Collaborator

pllim commented Jun 23, 2017

Are there some STScI plugins that are importing things that are not present in this version?

Not that I can grep but STScI is not the only user of Ginga. What about SunPy etc?

@ejeschke
Copy link
Owner Author

ejeschke commented Jun 23, 2017

@pllim, from what I can tell, the only "interesting" imports from wcsmod were "WCS", "display_types", "coord_types" and "use". These are all preserved. The only other thing of interest might be if someone wanted to import one of the WCS wrapper classes directly. But there is no place in Ginga that does that, and we don't in any of our Subaru plugins. Sounds like STScI doesn't either. I don't think that would be likely for any end users either--they would be using the native WCS, not the wrapper. So I think we are ok here, actually, so long as these four are preserved.

@pllim
Copy link
Collaborator

pllim commented Jun 23, 2017

I briefly did import one of the wrapper classes directly for #495 but then undid it as part of your reviews. Therefore, I am satisfied by your explanation above.

@ejeschke
Copy link
Owner Author

Ginga has unit tests for wcsmod, and these pass with the PR.

@ejeschke
Copy link
Owner Author

One thing I am thinking about (and I guess I will leave it for a future PR) is to refactor pixtoradec, radectopix and pixtosystem to just be wrappers around the vectorized versions that you created.

@ejeschke
Copy link
Owner Author

Another thing that this PR does is open the door for using different WCS packages with different images. So for example, you could have a "gwcs" wrapper for some images and "astropy" for some others. You can imagine other possibilities. Pretty straightforward with the changes made here.

@ejeschke
Copy link
Owner Author

Merging.

@ejeschke ejeschke merged commit 9a79aab into ejeschke:master Jun 23, 2017
@ejeschke
Copy link
Owner Author

Oh, you might need to remove wcsmod.pyc or other cached versions in order to avoid accidentally importing the old module.

@pllim
Copy link
Collaborator

pllim commented Jun 23, 2017

Yes, this would be useful for #327 and #434.

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.

2 participants