astrogo / Fitsio
Licence: bsd-3-clause
fitsio is a pure-Go package to read and write `FITS` files
Stars: ✭ 40
Projects that are alternatives of or similar to Fitsio
Homer Api
HOMER 5: Back-End (API) DEPRICATED - use sipcapture/homer-app
Stars: ✭ 26 (-35%)
Mutual labels: hep
Gitscience
A curated list of science- and engineering related repositories on GitHub and in neighboring counties
Stars: ✭ 8 (-80%)
Mutual labels: astronomy
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
Gaia tools
Tools for working with the @ESAGaia data and related data sets
Stars: ✭ 40 (+0%)
Mutual labels: astronomy
Homer
HOMER - 100% Open-Source SIP / VoIP Packet Capture & Monitoring
Stars: ✭ 855 (+2037.5%)
Mutual labels: hep
fitsio
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].