dataConvertModels

package
v4.34.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeamLocation

type BeamLocation struct {
	X        float32
	Y        float32
	Z        float32
	GeomCorr float32
	IJ       map[int32]BeamLocationProj
}

BeamLocation - One beam location record for a given PMC. IJ is an array of coordinates for each context image (indexed by the PMC of the context image)

type BeamLocationByPMC

type BeamLocationByPMC map[int32]BeamLocation

BeamLocationByPMC - All beam location info we have per PMC

type BeamLocationProj

type BeamLocationProj struct {
	I float32
	J float32
}

BeamLocationProj - Beam location projected onto context image i/j direction

type DetectorSample

type DetectorSample struct {
	// Metadata for the spectrum, string->string
	Meta MetaData
	// Spectrum histogram values, generally 4096 of them
	Spectrum []int64
}

DetectorSample - Represents an individual spectrum

func (DetectorSample) ToString

func (d DetectorSample) ToString() string

ToString - for tests

type DetectorSampleByPMC

type DetectorSampleByPMC map[int32][]DetectorSample
func (d DetectorSample) detectorID() string {
	return d.Meta["DETECTOR_ID"].SValue // we know it's a string...
}

DetectorSampleByPMC - Detector data in a lookup by PMC

type FileMetaData

type FileMetaData struct {
	RTT        string
	SCLK       int32
	SOL        string
	SiteID     int32
	Site       string
	DriveID    int32
	TargetID   string
	Target     string
	Title      string
	Instrument string
	PMCOffset  int32 // The offset we added to PMCs from this dataset in case of combined dataset
}

FileMetaData - dataset metadata

type HousekeepingData

type HousekeepingData struct {
	Header           []string
	Data             map[int32][]MetaValue
	PerPMCHeaderIdxs map[int32][]int32 // Per-PMC order of meta string names. NOTE: This is OPTIONAL! If not specified, assumed order is order of []MetaValues
}

HousekeepingData - stores column names & data

type ImageMeta

type ImageMeta struct {
	LEDs     string // R, G, B, U, W (all LEDs on), PC = the processed floating point TIF image
	PMC      int32
	FileName string
	ProdType string
}

ImageMeta - metadata for the "disco" image

type MatchedAlignedImageMeta

type MatchedAlignedImageMeta struct {
	// PMC of the MCC image whose beam locations this image is matched with
	AlignedBeamPMC int32 `json:"aligned-beam-pmc"`

	// File name of the matched image - the one that was imported with an area matching the Aligned image
	MatchedImageName string `json:"matched-image"`

	// This is the x/y offset of the sub-image area where the Matched image matches the Aligned image
	// In other words, the top-left Aligned image pixel is at (XOffset, YOffset) in the matched image
	XOffset float32 `json:"x-offset"`
	YOffset float32 `json:"y-offset"`

	// The relative sizing of the sub-image area where the Matched image matches the Aligned image
	// In other words, if the Aligned image is 752x580 pixels, and the Matched image is much higher res
	// at 2000x3000, and within that a central area of 1600x1300, scale is (1600/752, 1300/580) = (2.13, 2.24)
	XScale float32 `json:"x-scale"`
	YScale float32 `json:"y-scale"`

	// Full path, no JSON field because this is only used internally during dataset conversion
	MatchedImageFullPath string `json:"-"`
}

MatchedAlignedImageMeta - metadata for an image that's transformed to match an AlignedImage (eg MCC)

type MetaData

type MetaData map[string]MetaValue

MetaData - Map of label->meta value variant

func (MetaData) ToString

func (a MetaData) ToString() string

ToString - for tests

type MetaValue

type MetaValue struct {
	SValue   string
	IValue   int32
	FValue   float32
	DataType protos.Experiment_MetaDataType
}

MetaValue - A variant to store an individual metadata value

func FloatMetaValue

func FloatMetaValue(f float32) MetaValue

FloatMetaValue - short-hand for creating a float metadata value variant

func IntMetaValue

func IntMetaValue(i int32) MetaValue

IntMetaValue - short-hand for creating a int metadata value variant

func StringMetaValue

func StringMetaValue(s string) MetaValue

StringMetaValue - short-hand for creating a string metadata value variant

type OutputData

type OutputData struct {
	// dataset ID that should be used to identify this dataset as part of the output path/file name, etc
	DatasetID string
	// The group the dataset will belong to
	Instrument protos.ScanInstrument

	Meta                FileMetaData
	DetectorConfig      string
	BulkQuantFile       string
	DefaultContextImage string

	// If file is composed from multiple sources, this stores all sources
	Sources []FileMetaData

	// Pseudo-intensity ranges defined for this experiment (they may not change, and this may be redundant!)
	PseudoRanges []PseudoIntensityRange

	// Housekeeping header names
	HousekeepingHeaders []string

	// Per-PMC data
	PerPMCData map[int32]*PMCData

	// RGBU images
	RGBUImages []ImageMeta

	// Disco images - visual spectroscopy using MCC, taken different coloured LEDs
	DISCOImages []ImageMeta

	// Images that reference and match aligned images
	MatchedAlignedImages []MatchedAlignedImageMeta

	// Who created this dataset
	CreatorUserId string

	// Beam generator version number
	BeamVersion uint32
}

OutputData - the outer structure holding everything required to save a dataset

func (*OutputData) EnsurePMC

func (o *OutputData) EnsurePMC(pmc int32)

EnsurePMC - allocates an item to store data for the given PMC if doesn't already exist

func (*OutputData) SetPMCData

func (o *OutputData) SetPMCData(
	beams BeamLocationByPMC,
	hk HousekeepingData,
	spectra DetectorSampleByPMC,
	contextImgsPerPMC map[int32]string,
	pseudoIntensityData PseudoIntensities,
	pmcSourceRTTs map[int32]string)

SetPMCData - Passing in all data by PMC lookups

type PMCData

type PMCData struct {
	SourceRTT              string // Can be left empty if only from one data source
	Housekeeping           []MetaValue
	HousekeepingHeaderIdxs []int32 // Index of value name in list of Headers
	Beam                   *BeamLocation
	DetectorSpectra        []DetectorSample
	ContextImageSrc        string
	ContextImageDst        string
	PseudoIntensities      []float32
}

PMCData - Used to pass everything we've read to the output saver package...

type PseudoIntensities

type PseudoIntensities map[int32][]float32

PseudoIntensities - PMC to pseudo-intensity float array

type PseudoIntensityRange

type PseudoIntensityRange struct {
	Name  string
	Start int
	End   int
}

PseudoIntensityRange - Range item

Jump to

Keyboard shortcuts

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