Skip to content

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

@denfc

Description

@denfc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions