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

combine WCS and projection type #23

Merged
merged 1 commit into from
Feb 19, 2022
Merged

combine WCS and projection type #23

merged 1 commit into from
Feb 19, 2022

Conversation

xzackli
Copy link
Collaborator

@xzackli xzackli commented Feb 17, 2022

This very large PR removes the old projection types, which were redundant with the WCS. Instead, this PR introduces a custom immutable WCS struct,

struct CarClenshawCurtis{T} <: AbstractWCSTransform
    cdelt::Tuple{T,T}
    crpix::Tuple{T,T}
    crval::Tuple{T,T}
    unit::T  # conversion factor to radians. we follow convention and stay in degrees
end

One can choose between this or the C-based WCS.WCSTransform, and using this WCS makes certain parts of the package substantially faster. This struct stays on the stack, consists of 7 numbers, and is definitely more cache-friendly than the kb-sized WCS header we were dragging around. This also means that manipulation of small Enmaps, particularly ones that contain views, isn't dominated by repeatedly copying the WCS header. Although a lot of code changed, I don't think this is breaking.

We are losing some info since the WCS header can have lots of things in it. I should try to deal with this appropriately in the IO routines, probably by providing an option to convert back or follow a WCS template. @guanyilun just a quick clarification, is the default behavior to always convert to POLCCONV to COSMO, and then write to disk as COSMO?

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #23 (3a9a4cf) into main (85efcb2) will decrease coverage by 3.06%.
The diff coverage is 70.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   66.08%   63.01%   -3.07%     
==========================================
  Files           3        3              
  Lines         342      365      +23     
==========================================
+ Hits          226      230       +4     
- Misses        116      135      +19     
Impacted Files Coverage Δ
src/enmap_ops.jl 59.30% <60.00%> (-2.29%) ⬇️
src/enmap.jl 59.11% <62.50%> (-5.55%) ⬇️
src/enmap_geom.jl 100.00% <100.00%> (ø)

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 85efcb2...3a9a4cf. Read the comment docs.

@xzackli xzackli merged commit d032d0d into main Feb 19, 2022
@xzackli xzackli deleted the fast_safe_scalar_sky2pix branch February 19, 2022 03:56
@xzackli xzackli mentioned this pull request Feb 19, 2022
@guanyilun
Copy link
Collaborator

Yes I think that's right.

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