juliaastro / astroimages.jl Goto Github PK
View Code? Open in Web Editor NEWVisualization of astronomical images
License: Other
Visualization of astronomical images
License: Other
cannot reverse an AstroImage
, not sure if this is a problem within this package or a dimensional data issue
julia> img = load("https://fits.gsfc.nasa.gov/samples/FOCx38i0101t_c0f.fits")
julia> reverse(img, dims=1)
ERROR: UndefKeywordError: keyword argument data not assigned
Stacktrace:
[1] setdims
@ ~/.julia/packages/DimensionalData/JmqYO/src/Dimensions/primitives.jl:311 [inlined]
[2] reverse(A::AstroImageMat{Float32, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Matrix{Float32}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}; dims::Int64)
@ DimensionalData ~/.julia/packages/DimensionalData/JmqYO/src/array/methods.jl:298
[3] top-level scope
@ REPL[9]:1
Everyone's favorite DS9/IRAF feature!
This feature would allow some way of defining the image scale according to IRAF's z-scale. This method requires some simple statistics and fitting and should return a minimum and maximum color.
using AstroImages
img = load("image.fits")
cmin, cmax = zscale(img, args...)
plot(img, cmin=cmin, cmax=cmax)
AstroImage loads the 1st HUD from the fits file given by default. If the first one is not of image type an error occurs. Eg: euve.fits
I suggest a patch to iterate over the fits file to find the first valid Image type file and use it as default or raise some suitable error to notify user if there is no such Image type file.
issue moved here from JuliaAstro/FITSIO.jl#90
Besides integration with Images.jl
(issue #1), it may be useful to have integration with Plots.jl
(or whatever will be the next-gen plotting package in Julia). This can be achieved with plot recipes. If there are WCS coordinates, they could be automatically used as tics on the axes.
There's a poor interaction between dimensions which should be broadcastable but which are not equal. For example:
julia> using AstroImages
julia> dark = AstroImage(zeros(1, 10, 10));
julia> raw = AstroImage(ones(5, 10, 10));
julia> calib = raw .- dark
ERROR: DimensionMismatch: Found both lengths 5 and 1 for X
this is inconvenient for working with collapsed frames (e.g., master dark frame).
I am not been able to modify the color map with implot
.
I would expect the following lines to display the image with colormap ice
.
Whatever the cmap
provided, the image is displayed with magma
.
using AstroImages, Plots
file = "Image.fits"
img = AstroImage(file)
implot(img, cmap=:ice)
I am able to display with a different colormap using imview
p = imview(img, cmap=:ice)
plot(p, frame=:none)
this displays with cmap=:ice
as expected.
Is this an issue or me misusing implot
?
This issue is intended as a continuation of JuliaAstro/FITSIO.jl#18
optical FITS, NAXIS = 2, dimensions 24900 x 26620, 2.5GB FITS file, the following code runs out of memory:
using AstroImages
#] pkg> add https://github.com/JuliaAstro/AstroImages.jl
using FITSIO
using Plots
dir = "/home/chris/ダウンロード"
file = "e20121211_0010500001_dp_sf_st_mos.fits"
fitspath = string(dir, "/", file)
println("loading ", fitspath)
fits = load(fitspath)
img = AstroImage(fits)
plot(img)
The FITS file can be downloaded from
Then the file extension needs to be changed from .fit to .fits .
As discussed on the JuliaAstro call, I'm interested in developing out AstroImages further. The following is a sort of wishlist of what I would want in such a package. I'm aware several of these features like plot recipes already exist in this package, but I've included them below anyways for completeness.
The purpose of all of this is just to start a discussion and summarize what the community would want.
In terms of previous work in this space, there are to my knowledge:
img.totexp=5
. This is really convenient but we'll still need another syntax for accessing header comments.img[<:Union{Number,Vector}]
for indexing into the imageimg[:head1]
for accessing a header valueimg[:head1, /]
for accessing a comment (but this may be too punny)img.head1
as a shortcut syntax for accessing a header value.imshow
that displays images with more customization, e.g. colorschemes, clipping. I prototyped this and found displaying a large image with full color this way was >10x faster than through plots. E.g. 1600x1600 takes about 150ms.plot()
ing images of course.
plot()
an array of Gray
for example than making a big heatmap. Hopefully we could leverage such an imshow
function to make plotting large images efficient automatically.plot
should be WCS aware vs imshow
that just shows the pixel data.ds9show
from DirectImages.jlcolorview(C, channels...)
is much more efficient than C.(channels...)
to create a colour Array, as this just reinterprets the input arrays. However, the returned value isn't simply Array{Gray{Float64},2}
, so this would probably require reworking the AstroImage
data type.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.