All Projects → astrogo → Fitsio

astrogo / Fitsio

Licence: bsd-3-clause
fitsio is a pure-Go package to read and write `FITS` files

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Fitsio

Alfa
Automated Line Fitting Algorithm
Stars: ✭ 6 (-85%)
Mutual labels:  astronomy
Homer Api
HOMER 5: Back-End (API) DEPRICATED - use sipcapture/homer-app
Stars: ✭ 26 (-35%)
Mutual labels:  hep
Javacore
☕️ JavaCore 是对 Java 核心技术的经验总结。
Stars: ✭ 909 (+2172.5%)
Mutual labels:  io
Baas.io Sdk Ios
baas.io SDK for iOS
Stars: ✭ 16 (-60%)
Mutual labels:  io
Jasmineio
A Jasmine BDD port for Io Language
Stars: ✭ 25 (-37.5%)
Mutual labels:  io
Gitscience
A curated list of science- and engineering related repositories on GitHub and in neighboring counties
Stars: ✭ 8 (-80%)
Mutual labels:  astronomy
Cmssw
CMS Offline Software
Stars: ✭ 783 (+1857.5%)
Mutual labels:  hep
Pydis
A simple longslit spectroscopy pipeline in Python
Stars: ✭ 37 (-7.5%)
Mutual labels:  astronomy
Medio
Medical images I/O python package
Stars: ✭ 26 (-35%)
Mutual labels:  io
May
rust stackful coroutine library
Stars: ✭ 909 (+2172.5%)
Mutual labels:  io
Xdf Gan
A GAN for the generation of mock astronomical surveys
Stars: ✭ 17 (-57.5%)
Mutual labels:  astronomy
Wide Residual Nets For Seti
Classification of simulated radio signals using Wide Residual Networks for use in the search for extra-terrestrial intelligence
Stars: ✭ 22 (-45%)
Mutual labels:  astronomy
System.io.abstractions
Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
Stars: ✭ 844 (+2010%)
Mutual labels:  io
Bayesflare
A python module to detect stellar flares using Bayesian model comparison
Stars: ✭ 6 (-85%)
Mutual labels:  astronomy
Tokio File Unix
Asynchronous support for epollable files via Tokio on Unix-like platforms
Stars: ✭ 29 (-27.5%)
Mutual labels:  io
Celestia
Real-time 3D visualization of space.
Stars: ✭ 785 (+1862.5%)
Mutual labels:  astronomy
Osinysuhomework
🚪Own experiments operating systems🚪
Stars: ✭ 8 (-80%)
Mutual labels:  io
Gaia tools
Tools for working with the @ESAGaia data and related data sets
Stars: ✭ 40 (+0%)
Mutual labels:  astronomy
Apogee
Tools for dealing with APOGEE data
Stars: ✭ 34 (-15%)
Mutual labels:  astronomy
Homer
HOMER - 100% Open-Source SIP / VoIP Packet Capture & Monitoring
Stars: ✭ 855 (+2037.5%)
Mutual labels:  hep

fitsio

Build Status codecov GoDoc

fitsio is a pure-Go package to read and write FITS files.

Installation

$ go get github.com/astrogo/fitsio

Documentation

http://godoc.org/github.com/astrogo/fitsio

Contribute

astrogo/fitsio is released under BSD-3. Please send a pull request to astrogo/license, adding yourself to the AUTHORS and/or CONTRIBUTORS file.

Example

import fits "github.com/astrogo/fitsio"

func dumpFitsTable(fname string) {
    r, err := os.Open(fname)
    if err != nil {
        panic(err)
    }
    defer r.Close()
	f, err := fits.Open(r)
	if err != nil {
		panic(err)
	}
	defer f.Close()

	// get the second HDU
	table := f.HDU(1).(*fits.Table)
	nrows := table.NumRows()
    rows, err := table.Read(0, nrows)
    if err != nil {
        panic(err)
    }
    defer rows.Close()
	for rows.Next() {
        var x, y float64
        var id int64
        err = rows.Scan(&id, &x, &y)
        if err != nil {
            panic(err)
        }
        fmt.Printf(">>> %v %v %v\n", id, x, y)
	}
    err = rows.Err()
    if err != nil { panic(err) }
    
    // using a struct
    xx := struct{
        Id int     `fits:"ID"`
        X  float64 `fits:"x"`
        Y  float64 `fits:"y"`
    }{}
    // using a map
    yy := make(map[string]interface{})
    
    rows, err = table.Read(0, nrows)
    if err != nil {
        panic(err)
    }
    defer rows.Close()
	for rows.Next() {
        err = rows.Scan(&xx)
        if err != nil {
            panic(err)
        }
        fmt.Printf(">>> %v\n", xx)

        err = rows.Scan(&yy)
        if err != nil {
            panic(err)
        }
        fmt.Printf(">>> %v\n", yy)
	}
    err = rows.Err()
    if err != nil { panic(err) }
    
}

TODO

  • [DONE] add support for writing tables from structs
  • [DONE] add support for writing tables from maps
  • [DONE] add support for variable length array
  • provide benchmarks wrt CFITSIO
  • add support for TUNITn
  • add support for TSCALn
  • add suport for TDIMn
  • add support for (fast, low-level) copy of FITS tables
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].