fits

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const FITS_STANDARD = "FITS Standard 4.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type FITSHeader

type FITSHeader struct {
	Bitpix   int32
	Naxis    int32
	Naxis1   int32
	Naxis2   int32
	Bools    map[string]FITSHeaderBool
	Ints     map[string]FITSHeaderInt
	Floats   map[string]FITSHeaderFloat
	Strings  map[string]FITSHeaderString
	Dates    map[string]FITSHeaderString
	Comments []string
	History  []string
	End      bool
	Length   int32
}

FITS Header struct:

func NewFITSHeader

func NewFITSHeader(naxis int32, naxis1 int32, naxis2 int32) FITSHeader

Create a new instance of FITS header:

func (*FITSHeader) ParseLine added in v0.15.0

func (h *FITSHeader) ParseLine(subNames []string, subValues [][]byte) error

Reads a FITS header line by line and returns a FITSHeader struct

func (*FITSHeader) Read added in v0.15.0

func (h *FITSHeader) Read(r io.Reader) error

func (*FITSHeader) WriteToBuffer added in v0.9.0

func (h *FITSHeader) WriteToBuffer(buf *bytes.Buffer) (*bytes.Buffer, error)

Writes a FITS header according to the FITS standard to output bytes buffer @see https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf

type FITSHeaderBool added in v0.15.0

type FITSHeaderBool struct {
	Value   bool
	Comment string
}

type FITSHeaderFloat added in v0.15.0

type FITSHeaderFloat struct {
	Value   float32
	Comment string
}

type FITSHeaderInt added in v0.15.0

type FITSHeaderInt struct {
	Value   int32
	Comment string
}

type FITSHeaderString added in v0.15.0

type FITSHeaderString struct {
	Value   string
	Comment string
}

type FITSImage

type FITSImage struct {
	ID       int          // Sequential ID number, for log output. Counted upwards from 0 for light frames. By convention, dark is -1 and flat is -2
	Filename string       // Original file name, if any, for log output.
	Header   FITSHeader   // The FITS Header with all keys, values, comments, history entries etc.
	Bitpix   int32        // Bits per pixel value from the header. Positive values are integral, negative floating.
	Bzero    float32      // Zero offset. (True pixel value is Bzero + Bscale * Data[i]).
	Bscale   float32      // Value scaler. (True pixel value is Bzero + Bscale * Data[i]).
	Naxisn   []int32      // Axis dimensions. Most quickly varying dimension first (i.e. X,Y)
	Pixels   int32        // Number of pixels in the image. Product of Naxisn[] or naxis1 and naxis2
	Data     []float32    // The image data
	ADU      int32        // The number of ADU (Analog to Digital Units) in the image.
	Exposure float32      // Image exposure in seconds
	Stats    *stats.Stats // Image statistics (mean, min, max, stdDev etc)
}

FITS Image struct: @see https://fits.gsfc.nasa.gov/fits_primer.html @see https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf

func NewFITSImage

func NewFITSImage(naxis int32, naxis1 int32, naxis2 int32, adu int32) *FITSImage

Creates a new instance of FITS image initialized with empty header

func NewFITSImageFrom2DData added in v0.9.0

func NewFITSImageFrom2DData(ex [][]uint32, naxis int32, naxis1 int32, naxis2 int32, adu int32) *FITSImage

Creates a new instance of FITS image from given 2D exposure array (Data is not copied, allocated if nil. naxisn is deep copied)

func NewFITSImageFromReader added in v0.20.0

func NewFITSImageFromReader(r io.Reader) *FITSImage

Creates a new instance of FITS image initialized from an io.Reader:

func (*FITSImage) AddObservationEntry added in v0.24.0

func (f *FITSImage) AddObservationEntry(observation *FITSObservation) *FITSImage

func (*FITSImage) ExtractHFR added in v0.18.0

func (f *FITSImage) ExtractHFR(radius float32, sigma float32, starInOut float32) float32

func (*FITSImage) Read added in v0.15.0

func (f *FITSImage) Read(r io.Reader) error

Read the FITS image from the given file.

func (*FITSImage) ReadFromFile added in v0.15.0

func (f *FITSImage) ReadFromFile(fp string) error

func (*FITSImage) WriteToBuffer added in v0.9.0

func (f *FITSImage) WriteToBuffer() (*bytes.Buffer, error)

Writes an in-memory FITS image to an io.Writer output stream

type FITSObservation added in v0.24.0

type FITSObservation struct {
	DateObs    time.Time `json:"dateObs"`    // Date of observation e.g., 2022-05-15
	MJDObs     float32   `json:"mjdObs"`     // Modified Julian Date (JD − 2,400,000.5) of the observation
	Equinox    float32   `json:"equinox"`    // Equinox of observation e.g., J2000
	RA         float32   `json:"ra"`         // Right Ascension of observation
	Dec        float32   `json:"dec"`        // Declination of observation
	Object     string    `json:"object"`     // The name for the object observed
	Telescope  string    `json:"telescope"`  // The telescope used to acquire the data
	Instrument string    `json:"instrument"` // The instrument used to acquire the data
	Observer   string    `json:"observer"`   // Who acquired the data
}

FITS Observation struct: @see https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL