JuliaAstro / FITSIO.jl

Flexible Image Transport System (FITS) file support for Julia
http://juliaastro.org/FITSIO.jl/
MIT License
55 stars 29 forks source link

getindex(FITS, String) does not work #141

Closed aplavin closed 3 years ago

aplavin commented 3 years ago

In version 0.16 this getindex method stopped working (works in 0.15): https://github.com/JuliaAstro/FITSIO.jl/blob/ac1e773ed7adaa7f838883ca9580173561a4ad3d/src/fits.jl#L111 It gives the following stacktrace:

  UndefVarError: fits_movnam_hdu not defined
  Stacktrace:
   [1] getindex(::FITSIO.FITS, ::String, ::Int64) at /home/runner/.julia/packages/FITSIO/KYCVW/src/fits.jl:113
   [2] getindex at /home/runner/.julia/packages/FITSIO/KYCVW/src/fits.jl:112 [inlined]

The fits_movnam_hdu function is indeed used here: https://github.com/JuliaAstro/FITSIO.jl/blob/ac1e773ed7adaa7f838883ca9580173561a4ad3d/src/fits.jl#L113 But I cannot find it defined anywhere in the FITSIO.jl repo. Was it just removed at some point? Everything is fine with version 0.15.

giordano commented 3 years ago

Was it just removed at some point?

It was moved to CFITSIO.jl: https://github.com/JuliaAstro/CFITSIO.jl/blob/9a1acf6c9ee278849a929d549c884076820a03d0/src/CFITSIO.jl#L812-L830

aplavin commented 3 years ago

Then I guess the reason why FITSIO.jl getindex method got broken is because fits_movnam_hdu is not imported here: https://github.com/JuliaAstro/FITSIO.jl/blob/master/src/FITSIO.jl#L38-L73 Right?

giordano commented 3 years ago

Probably

aplavin commented 3 years ago

I created a PR https://github.com/JuliaAstro/FITSIO.jl/pull/142 which imports the three functions required by this getindex method.

giordano commented 3 years ago

I guess we can close this issue now?