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

plot recipe for wcs info. integration #16

Merged
merged 9 commits into from
Aug 7, 2019

Conversation

aquatiko
Copy link
Member

Added recipe for showing xlabel and ylabel from WCS header. Also, pixel coordinates will be displayed as world coordinates by giving a WCS as plot(img, WCS).

@aquatiko aquatiko changed the title plot recipe for wcs info. integration [WIP]plot recipe for wcs info. integration Jun 23, 2019
@aquatiko
Copy link
Member Author

Results on IJulia:
Screenshot from 2019-06-24 06-22-00

I will be adding tests shortly.

@aquatiko aquatiko changed the title [WIP]plot recipe for wcs info. integration plot recipe for wcs info. integration Jun 26, 2019
@aquatiko
Copy link
Member Author

@giordano This PR is complete and ready to be reviewed.

@aquatiko
Copy link
Member Author

aquatiko commented Jul 1, 2019

Merge only after #19

@codecov-io
Copy link

codecov-io commented Jul 11, 2019

Codecov Report

Merging #16 into master will increase coverage by 1.85%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   94.91%   96.77%   +1.85%     
==========================================
  Files           3        3              
  Lines          59       93      +34     
==========================================
+ Hits           56       90      +34     
  Misses          3        3
Impacted Files Coverage Δ
src/plot-recipes.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0827e23...224870f. Read the comment docs.

REQUIRE Outdated
@@ -0,0 +1,8 @@
julia 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want this file back 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! It got in while merging things as this was an older branch.

@giordano
Copy link
Member

What happens if a file doesn't have the required WCS information?

@aquatiko
Copy link
Member Author

aquatiko commented Jul 11, 2019

Can't happen as the two keys NAXIS and CTYPE needed are defaulted when not present in a WCSTransform.
Also NAXIS is a required field for a WCSTransform.
I have added this case as a test too. (See wcs5 in the tests)

@giordano
Copy link
Member

I think other keys are used by pixel_to_world, they're just hidden in the C function called by it

@@ -17,3 +17,60 @@ end
color := :grays
img.data[1]
end

@recipe function f(img::AstroImage, wcs::WCSTransform)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this recipe applies only to a single colour image (AstroImg{T,C,1}), what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's only for a single colour now. The coloured ones are a simple tweak and is waiting for #15.
I explicitly wrote it this way because before #15 gets in, test won't pass otherwise.
I'm looking into #15 to solve the CI errors.

@giordano
Copy link
Member

giordano commented Jul 12, 2019

What happens if a file doesn't have the required WCS information?

My understanding is that pix_to_world simply returns the input array in this case, so it should be fine

@test pix2world_xformatter(255, wcs2) == 255.0

@test pix2world_yformatter(255, wcs1) == "13.98°"
@test pix2world_yformatter(255, wcs2) == 255.0
Copy link
Member Author

@aquatiko aquatiko Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, pix_to_world returns the same array for any of the types it does not recognize or doesn't have.
As tested here.

@aquatiko
Copy link
Member Author

aquatiko commented Aug 7, 2019

@giordano Do this need some fixing or is this good to be merged now?

@giordano giordano merged commit febce07 into JuliaAstro:master Aug 7, 2019
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.

3 participants