github.com/astrogo/fitsio@v0.3.0/type.go (about) 1 // Copyright 2015 The astrogo Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package fitsio 6 7 import ( 8 "reflect" 9 ) 10 11 // typecode represents FITS types 12 type typecode int 13 14 const ( 15 tcInvalid typecode = iota 16 tcByte 17 tcBool 18 tcString 19 tcUint16 20 tcUint32 21 tcUint64 22 tcInt8 23 tcInt16 24 tcInt32 25 tcInt64 26 tcFloat32 27 tcFloat64 28 tcComplex64 29 tcComplex128 30 31 tcByteVLA = -tcByte 32 tcBoolVLA = -tcBool 33 tcStringVLA = -tcString 34 tcUint16VLA = -tcUint16 35 tcUint32VLA = -tcUint32 36 tcUint64VLA = -tcUint64 37 tcInt8VLA = -tcInt8 38 tcInt16VLA = -tcInt16 39 tcInt32VLA = -tcInt32 40 tcInt64VLA = -tcInt64 41 tcFloat32VLA = -tcFloat32 42 tcFloat64VLA = -tcFloat64 43 tcComplex64VLA = -tcComplex64 44 tcComplex128VLA = -tcComplex128 45 ) 46 47 // Type describes a FITS type and its associated Go type 48 type Type struct { 49 tc typecode // FITS typecode 50 len int // number of elements (slice or array) 51 dsize int // type size in bytes in main data table 52 hsize int // type size in bytes in heap area 53 gotype reflect.Type // associated go type 54 }