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

Use QTable instead of Table #285

Open
jdtsmith opened this issue May 9, 2024 · 1 comment
Open

Use QTable instead of Table #285

jdtsmith opened this issue May 9, 2024 · 1 comment

Comments

@jdtsmith
Copy link
Contributor

jdtsmith commented May 9, 2024

See this note. As-is we can't take say, a power value from the Features table and use it directly in a unitful calculation (e.g. multiply by a solid angle and 4pid_L**2).

@jdtsmith
Copy link
Contributor Author

jdtsmith commented May 9, 2024

QTable doesn't seem to like masking. So possibly better is the new (but experimental) Masked class:

import numpy as np
import astropy.units as u
from astropy.utils.masked import Masked
PAR_DTYPE = np.dtype([("val", "f"), ("min", "f"), ("max", "f")])
a = np.ma.array([(np.pi, 2, 4.5), (np.pi / 2, 1, np.nan), (4, np.nan, np.nan)], dtype=PAR_DTYPE, mask=[1, 0, 0])
t['power'] = Masked(a) * u.MJy/u.sr
t.pprint()

Perhaps for down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant