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

Implement Getters for :PV #41

Open
andrew-saydjari opened this issue Jan 17, 2022 · 3 comments
Open

Implement Getters for :PV #41

andrew-saydjari opened this issue Jan 17, 2022 · 3 comments

Comments

@andrew-saydjari
Copy link

I am reading a WCS transform from a header and running into "getter for :pv not implemented". I would be willing to put some effort in this direction. Has there been any progress/thoughts on this? Where are the get_field() functions defined?

@mileslucas
Copy link
Member

mileslucas commented Jan 18, 2022

I don't know much about WCS or what pv is, but the definition is inside the getproperty method-

WCS.jl/src/WCS.jl

Lines 503 to 505 in ae3502a

# PVCard[]
elseif k === :pv
error("pv getter not yet implemented")

The git blame is Kyle Barbary, so there's probably no information about status or ideas. Perhaps astropy has some clues that can lead us to an implementation?

@andrew-saydjari
Copy link
Author

Sure. But I guess what I was asking is for an example of a getfield definition. I had found 503-505, but when looking at

    if k == :naxis
        v = getfield(wcs, k)

a property which is implemented, I could not find where the function getfield was defined.

And ok, translating astropy and benchmarking was my first plan.

@mileslucas
Copy link
Member

Oh, sorry for the misunderstanding!

getfield is a Julia base function for accessing the fields of a struct. So the "implementation" in that sense is just returning the stored value. This isn't something we overwrite in our code.

I looked in the WCS struct and there actually is a pv value, but it's stored in a card structure. I bet that's why it wasn't fully implemented.

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

No branches or pull requests

2 participants