Skip to content

world_to_pixel does not allow units on input #288

Description

@brechmos-stsci

I tried passing a Quantity to world_to_pixel:

In [6]: spectrum.wcs.world_to_pixel([0.58*u.um])

but it returns an error:

TypeError: only dimensionless scalar quantities can be converted to Python scalars

It is based on this line:
https://github.com/astropy/specutils/blob/master/specutils/wcs/adapters/gwcs_adapter.py#L38

I am not sure if I am misunderstanding how this should work or if this is a bug.

This is indirectly related to #287 (comment) as well.

It should be easy to fix and I can create a PR, just want to confirm that this isn't something by design.

@eteq @crawfordsm @nmearl

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions