fitscore icon indicating copy to clipboard operation
fitscore copied to clipboard

FITSByte_* normalization returns wrong values

Open JuergenTerpe opened this issue 1 year ago • 0 comments

The method should use bigEndian, perhaps also the property float!

This returns a very high value for a linear FITS image: public func normalize(_ bzero: Float = 0, _ bscale: Float = 1, _ min: FITSByte_16 = .min, _ max: FITSByte_16 = .max) -> Float { return (bzero + Float(self) * bscale) / Self.range }

This would return the correct value: public func normalize(_ bzero: Float = 0, _ bscale: Float = 1, _ min: FITSByte_16 = .min, _ max: FITSByte_16 = .max) -> Float { return (bzero + Float(self.bigEndian) * bscale) / Self.range }

JuergenTerpe avatar Jun 26 '24 19:06 JuergenTerpe