Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify converting units to strings #508

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions gwcs/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import astropy.io.fits as fits
import numpy as np
import numpy.linalg as npla
from astropy import units as u
from astropy.modeling import fix_inputs, projections
from astropy.modeling.bounding_box import CompoundBoundingBox
from astropy.modeling.bounding_box import ModelBoundingBox as Bbox
Expand Down Expand Up @@ -2031,16 +2030,12 @@ def find_frame(axis_number):

# index of the axis in this frame's
fidx = frame.axes_order.index(axno)
if hasattr(frame.unit[fidx], 'get_format_name'):
cunit = frame.unit[fidx].get_format_name(u.format.Fits).upper()
else:
cunit = ''

axis_info = _WorldAxisInfo(
axis=axno,
frame=frame,
world_axis_order=self.output_frame.axes_order.index(axno),
cunit=cunit,
cunit=frame.unit[fidx].to_string('fits', fraction=True).upper(),
ctype=cf.get_ctype_from_ucd(self.world_axis_physical_types[axno]),
input_axes=mapping[axno]
)
Expand Down
Loading