Skip to content

Units with matrix inversion #8622

@atcnofs

Description

@atcnofs

When inverting a matrix with units using numpy.linalg.inv, the units of the inverted matrix stay the same as the input matrix. The units should also be inverted. As an example:

import numpy
import astropy.units
scale = numpy.matrix([[-1, 0], [0, 1]])*astropy.units.arcsec/astropy.units.pixel
numpy.linalg.inv(scale)

The returned value should be in units of pix/arcsec but are instead kept as arcsec/pix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions