项目作者: JuliaAstro

项目描述 :
Flexible Image Transport System (FITS) file support for Julia
高级语言: Julia
项目地址: git://github.com/JuliaAstro/FITSIO.jl.git
创建时间: 2012-12-09T01:11:59Z
项目社区:https://github.com/JuliaAstro/FITSIO.jl

开源协议:MIT License

下载


FITSIO.jl

Flexible Image Transport System (FITS) support for Julia

Build Status
PkgEval
codecov

Stable
Dev
License

Note: The Libcfitsio submodule has been moved to CFITSIO.jl and will be deprecated in a future release.

Usage

For more in-depth usage and examples, see the documentation

  1. julia> using FITSIO
  2. julia> f = FITS("file.fits")
  3. File: file.fits
  4. Mode: "w" (read-write)
  5. HDUs: Num Name Type
  6. 1 Image
  7. 2 Table
  8. julia> f[1]
  9. File: file.fits
  10. HDU: 1
  11. Type: Image
  12. Datatype: Float64
  13. Datasize: (800, 800)
  14. # read an image from disk
  15. julia> data = read(f[1]);
  16. # read just a subset of image
  17. julia> data = read(f[1], :, 790:end);
  18. # Get info about binary table
  19. julia> f[2]
  20. File: file.fits
  21. HDU: 2
  22. Type: Table
  23. Rows: 20
  24. Columns: Name Size Type TFORM
  25. col2 String 5A
  26. col1 Int64 1K
  27. # Read a column from the table:
  28. julia> data = read(f[2], "col1")
  29. # Read the entire header into memory
  30. julia> header = read_header(f[1]);
  31. julia> header["NAXIS1"] # get value by keyword
  32. 800
  33. julia> header[4] # get value by position
  34. 800
  35. # Read single keys into memory
  36. julia> read_key(f[1], 4) # by position
  37. ("NAXIS1",800,"length of data axis 1")
  38. julia> read_key(f[1], "NAXIS1") # by keyword
  39. (800,"length of data axis 1")
  40. # write data to file
  41. julia> FITS("new_file.fits", "w") do f
  42. write(f, data)
  43. end