juliahci / adi.jl Goto Github PK
View Code? Open in Web Editor NEWAlgorithms for performing angular differential imaging (ADI)
Home Page: https://juliahci.github.io/ADI.jl/dev/
License: MIT License
Algorithms for performing angular differential imaging (ADI)
Home Page: https://juliahci.github.io/ADI.jl/dev/
License: MIT License
Since I couldn't install the Python environment on my system (multiple errors for psutil and scipy), I created the following Docker container to reproduce them:
FROM python:3.8
# Install Julia
RUN curl -q -o - 'https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz' | tar xzf -
ENV PATH="/julia-1.5.3/bin:${PATH}"
# Install ADI
RUN julia -e 'import Pkg; Pkg.add(name="ADI", version="0.5.2")'
# Instantiate Julia environment for benchmark
WORKDIR /root/.julia/packages/ADI/OCUJ4/bench
# We need to add ADI because the current Manifest file hard-codes a local path.
RUN julia --project=. -e 'import Pkg; Pkg.add(name="ADI", version="0.5.2"); Pkg.instantiate(); Pkg.precompile()'
# Prepare Python environment
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -qq -y gfortran libblas-dev liblapack-dev < /dev/null > /dev/null
# Cleanup apt cache
RUN rm -rf /var/lib/apt/lists/*
RUN pip install -r requirements.txt
I had also a problem with the Julia environment, but the solution was to not hard-code the local path of ADI (see #31).
However, when finally running the script adi.jl
I get the following error:
/usr/local/lib/python3.8/site-packages/hciplot/hciplot.py:28: MatplotlibDeprecationWarning: Passing raw data via parameters data and lut to register_cmap() is deprecated since 3.3 and will become an error two minor releases later. Instead use: register_cmap(cmap=LinearSegmentedColormap(name, data, lut))
register_cmap('ds9cool', data=ds9cool)
/usr/local/lib/python3.8/site-packages/hciplot/hciplot.py:29: MatplotlibDeprecationWarning: Passing raw data via parameters data and lut to register_cmap() is deprecated since 3.3 and will become an error two minor releases later. Instead use: register_cmap(cmap=LinearSegmentedColormap(name, data, lut))
register_cmap('ds9heat', data=ds9heat)
ERROR: LoadError: KeyError: key :medsub not found
Stacktrace:
[1] __getproperty(::PyObject, ::Symbol) at /root/.julia/packages/PyCall/BcTLp/src/PyCall.jl:307
[2] getproperty(::PyObject, ::Symbol) at /root/.julia/packages/PyCall/BcTLp/src/PyCall.jl:312
[3] top-level scope at /root/.julia/packages/ADI/OCUJ4/bench/adi.jl:33
[4] include(::String) at ./client.jl:457
[5] top-level scope at REPL[3]:1
in expression starting at /root/.julia/packages/ADI/OCUJ4/bench/adi.jl:33
ADI.jl needs desperately updated to use [email protected]
, [email protected]
, [email protected]
, and [email protected]
. These are not trivial changes- the new PSF models and injection code will require lots of line-by-line changes, I'm not sure how much are already here. Fixing the column-orientation is going to be tedious, partly because the "convenient" helpers and abstractions get really messy for LOCI and the annulus views. In addition, the documentation will need to be carefully revisited to make sure the orientation convention is consistent.
It would be nice to have a method for creating contrast curves from a single frame. This is essentially just a radial profile of the inverse noise, but it's a convenient shorthand since the throughput doesn't have to be measured and the interface becomes much simpler. Right now I've used
cube = view(frame, :, :, 1)
alg(cube, args...; kwargs...) = cube[:, :, 1]
cc = contrast_curve(alg, cube, zeros(1), psf; kwargs...)
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.
Following up from #32, this is my new Dockerfile:
FROM python:3.8
# Install Julia
RUN curl -q -o - 'https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz' | tar xzf -
ENV PATH="/julia-1.5.3/bin:${PATH}"
# Install ADI
RUN julia -e 'using Pkg; pkg"dev ADI"'
# Instantiate Julia environment for benchmark
WORKDIR /root/.julia/dev/ADI/bench
# We need to dev ADI because the current Manifest file hard-codes a local path.
RUN julia --project=. -e 'using Pkg; pkg"dev ADI"; Pkg.instantiate(); Pkg.precompile()'
# Prepare Python environment
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -qq -y gfortran libblas-dev liblapack-dev < /dev/null > /dev/null
# Cleanup apt cache
RUN rm -rf /var/lib/apt/lists/*
RUN pip install -r requirements.txt
# Prefetch HCI data sets
ENV DATADEPS_ALWAYS_ACCEPT=true
RUN julia --project=. -e 'using HCIDatasets: BetaPictoris, HR8799; BetaPictoris[:cube]; BetaPictoris[:pa]; HR8799[:cube]; HR8799[:pa]'
Now when running bench/adi.jl
I get:
[ Info: Benchmarking - HCIDatasets.BetaPictorisDataset() ADI Reduction
[ Info: Python - #6
ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'RuntimeError'>
RuntimeError('Opencv python bindings cannot be imported. Install opencv or set imlib to skimage')
File "/usr/local/lib/python3.8/site-packages/vip_hci/medsub/medsub_source.py", line 168, in median_sub
cube_der = cube_derotate(cube_out, angle_list, imlib=imlib,
File "/usr/local/lib/python3.8/site-packages/vip_hci/preproc/derotation.py", line 199, in cube_derotate
array_der[i] = frame_rotate(array[i], -angle_list[i], imlib=imlib,
File "/usr/local/lib/python3.8/site-packages/vip_hci/preproc/derotation.py", line 118, in frame_rotate
raise RuntimeError(msg)
Stacktrace:
[1] pyerr_check at /root/.julia/packages/PyCall/BcTLp/src/exception.jl:62 [inlined]
[2] pyerr_check at /root/.julia/packages/PyCall/BcTLp/src/exception.jl:66 [inlined]
[3] _handle_error(::String) at /root/.julia/packages/PyCall/BcTLp/src/exception.jl:83
[4] macro expansion at /root/.julia/packages/PyCall/BcTLp/src/exception.jl:97 [inlined]
[5] #110 at /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:43 [inlined]
[6] disable_sigint at ./c.jl:446 [inlined]
[7] __pycall! at /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:42 [inlined]
[8] _pycall!(::PyObject, ::PyObject, ::Tuple{Array{Float32,3},Array{Float32,1}}, ::Int64, ::PyObject) at /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:29
[9] _pycall!(::PyObject, ::PyObject, ::Tuple{Array{Float32,3},Array{Float32,1}}, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:verbose,),Tuple{Bool}}}) at /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:11
[10] #_#117 at /root/.julia/packages/PyCall/BcTLp/src/pyfncall.jl:86 [inlined]
[11] (::var"#6#12")(::Array{Float32,3}, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /root/.julia/dev/ADI/bench/adi.jl:34
[12] #6 at /root/.julia/dev/ADI/bench/adi.jl:34 [inlined]
[13] ##core#295(::var"#6#12", ::Array{Float32,3}, ::Array{Float32,1}) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:371
[14] ##sample#296(::BenchmarkTools.Parameters) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:377
[15] _run(::BenchmarkTools.Benchmark{Symbol("##benchmark#294")}, ::BenchmarkTools.Parameters; verbose::Bool, pad::String, kwargs::Base.Iterators.Pairs{Symbol,Integer,NTuple{4,Symbol},NamedTuple{(:samples, :evals, :gctrial, :gcsample),Tuple{Int64,Int64,Bool,Bool}}}) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:405
[16] (::Base.var"#inner#2"{Base.Iterators.Pairs{Symbol,Integer,NTuple{5,Symbol},NamedTuple{(:verbose, :samples, :evals, :gctrial, :gcsample),Tuple{Bool,Int64,Int64,Bool,Bool}}},typeof(BenchmarkTools._run),Tuple{BenchmarkTools.Benchmark{Symbol("##benchmark#294")},BenchmarkTools.Parameters}})() at ./essentials.jl:713
[17] #invokelatest#1 at ./essentials.jl:714 [inlined]
[18] #run_result#37 at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:32 [inlined]
[19] run(::BenchmarkTools.Benchmark{Symbol("##benchmark#294")}, ::BenchmarkTools.Parameters; progressid::Nothing, nleaves::Float64, ndone::Float64, kwargs::Base.Iterators.Pairs{Symbol,Integer,NTuple{5,Symbol},NamedTuple{(:verbose, :samples, :evals, :gctrial, :gcsample),Tuple{Bool,Int64,Int64,Bool,Bool}}}) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:94
[20] #warmup#45 at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:141 [inlined]
[21] warmup(::BenchmarkTools.Benchmark{Symbol("##benchmark#294")}) at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:141
[22] top-level scope at /root/.julia/packages/BenchmarkTools/eCEpo/src/execution.jl:287
[23] top-level scope at /root/.julia/dev/ADI/bench/adi.jl:47
[24] include(::String) at ./client.jl:457
[25] top-level scope at REPL[1]:1
in expression starting at /root/.julia/dev/ADI/bench/adi.jl:39
Not sure what I'm supposed to do, whether to install opencv or set imlib to skimage.
Going through your documentation, I think it would be helpful to be more explicit in the requirements for the input data format. In particular:
For the SDI feature, I understand it is still under development but here are some suggestions:
scales
argument defined? I think there is a 1/x degeneracy without knowing its definition (or an example computing this term from the wavelength).While following the example of the reduction of β Pictoris in the documentation, in the section about the contrast curve I ran into the error
julia> head(filter(row -> isfinite(row.contrast_corr), cc))
ERROR: UndefVarError: head not defined
Stacktrace:
[1] top-level scope
@ REPL[41]:1
This is my environment:
(tmp) pkg> status
Status `/tmp/Project.toml`
[904a6c7d] ADI v0.5.2
[3b1b4be9] CFITSIO v1.0.0
[a93c6f00] DataFrames v0.22.0
[1893dc6a] HCIDatasets v0.2.0
[b6cd55e5] HCIToolbox v0.4.2
[91a5bcdd] Plots v1.9.1
I might be wrong, but I don't think the fact ADIAlgorithm <: Function
is used anywhere. The Function
type shouldn't really be used to restrict function arguments to functions: there are a lot of "callable" objects which aren't Function
s, e.g. all type constructors and Python functions from PyCall
.
I don't have a strong feeling about ADIAlgorithm <: Function
, but I'd like to hear your opinion about doing simply
abstract type ADIAlgorithm end
Overall, the paper looks great. The one thing I found confusing is the distinction between "posterior analysis" and "forward modeling". I agree there is a distinction here, but I feel like "posterior analysis" is quite vague, and forward modeling may also fall into that category since the forward models are compared to the residual images in similar ways. It seems like everything under the category of "posterior analysis" currently could be more precisely categorized as "detection metrics".
The table comparing existing packages is very useful for the community and overall I found this summary excellent. As the maintainer of pyklip, I would note that pyklip also supports nmf and weighted PCA algorithms, although they are not available in the forward modeling framework.
After going through the documentation, I can give some recommendations:
using ADI
, which can confuse newcomers. The first using ADI
in the whole documentation is in the Reduction Process section of the same page. Maybe the home page might mention that you need to do using ADI
to load it?w
and A
. The page is geared towards people familiar with ADI, but briefly mentioning what these terms are could improve understanding of newcomers, toomask_circle
doesn't seem to be re-exported by ADI.
julia> mask_cube = mask_circle(cube, 10)
ERROR: UndefVarError: mask_circle not defined
Stacktrace:
[1] top-level scope
@ REPL[29]:1
Kernels
and construct
in the contrast curve sectiondecompose
docstring only shows the syntax of the function without further details. Is it supposed to not give more details?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.