Skip to content

FITSByte_* normalization returns wrong values #20

@JuergenTerpe

Description

@JuergenTerpe

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions