Skip to content

Commit

Permalink
Fix ambiguity error with 0-dimensional AstroImages
Browse files Browse the repository at this point in the history
  • Loading branch information
sefffal committed Oct 19, 2023
1 parent 39ddfe1 commit 2e4d539
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AstroImages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ Base.setindex!(img::AstroImage, v, ind::AbstractString, ::Type{Comment}) = set_
Base.getindex(img::AstroImage, ind::Symbol, ::Type{Comment}) = get_comment(header(img), string(ind)) # accessing header comment using symbol
Base.setindex!(img::AstroImage, v, ind::Symbol, ::Type{Comment}) = set_comment!(header(img), string(ind), v) # modifying header comment using Symbol

# Ambiguity fixes for 0-dimensional AstroImages
Base.getindex(img::AstroImage) = getindex(parent(img))
Base.setindex!(img::AstroImage, v) = setindex!(parent(img),v)

# Support for special HISTORY and COMMENT entries
function Base.getindex(img::AstroImage, ::Type{History})
hdr = header(img)
Expand Down

0 comments on commit 2e4d539

Please sign in to comment.