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

ERROR: MethodError: no method matching length(::Nothing) #53

Open
denfc opened this issue Feb 4, 2025 · 0 comments
Open

ERROR: MethodError: no method matching length(::Nothing) #53

denfc opened this issue Feb 4, 2025 · 0 comments

Comments

@denfc
Copy link

denfc commented Feb 4, 2025

Here's the full code:

using AstroImages

AstroImages.set_cmap!(nothing)
antred = AstroImage(download("http://www.astro.uvic.ca/~wthompson/astroimages/fits/antenae/red.fits"))
antgreen = AstroImage(download("http://www.astro.uvic.ca/~wthompson/astroimages/fits/antenae/green.fits"))
rgb2 = composecolors(
    [antred, antgreen]
    )

Running Julia Version 1.11.3 in VSCode through WSL2 (same error when excuting directly in WSL2 without using VSCode) , the separate images can be viewed when after the error, just antred, for example, is typed into the REPL. Here's the full error message:

ERROR: MethodError: no method matching length(::Nothing)
The function `length` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  length(::FITSIO.FITSHeader)
   @ FITSIO ~/.julia/packages/FITSIO/VqV3x/src/header.jl:351
  length(::DimensionalData.Dimensions.Lookups.NoMetadata)
   @ DimensionalData ~/.julia/packages/DimensionalData/VxDQB/src/Lookups/metadata.jl:84
  length(::Core.SimpleVector)
   @ Base essentials.jl:933
  ...

Stacktrace:
 [1] composecolors(images::Vector{…}, cmap::Nothing; clims::Percent, stretch::Function, contrast::Float64, bias::Float64, multiplier::Float64)
   @ AstroImages ~/.julia/packages/AstroImages/eSsEw/src/ccd2rgb.jl:59
 [2] composecolors
   @ ~/.julia/packages/AstroImages/eSsEw/src/ccd2rgb.jl:41 [inlined]
 [3] composecolors(images::Vector{AstroImageMat{Float32, Tuple{X{…}, Y{…}}, Tuple{}, Matrix{Float32}, Tuple{X{…}, Y{…}}}})
   @ AstroImages ~/.julia/packages/AstroImages/eSsEw/src/ccd2rgb.jl:41
 [4] top-level scope
   @ ~/Gitted/Fractals/tests/Untitled-1.jl:6
Some type information was truncated. Use `show(err)` to see complete types.

What do you think is happening? Is a work around possible on my end? Many thanks!

-- dfc

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

No branches or pull requests

1 participant