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

getps grabs the wrong data in a SDFITS file with multiple extensions #397

Open
astrofle opened this issue Oct 7, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@astrofle
Copy link
Collaborator

astrofle commented Oct 7, 2024

Describe the bug
When working on a file with multiple binary tables, using getps returns the wrong data.

How to Reproduce

from dysh.fits.gbtfitsload import GBTFITSLoad
filename = "/home/sdfits/TRCO_240809_Ku/TRCO_240809_Ku.raw.vegas"
sdf = GBTFITSLoad(filename)
ps_ta = sdf.getps(scan=21, fdnum=0, plnum=0, ifnum=0).timeaverage()
ps_ta.data.shape
    (1024,)

So, dysh returns a Spectrum that has 1024 channels. However, if we look at the raw data we see scan 21 has 2**14 channels:

from astropy.io import fits
hdu = fits.open("/home/sdfits/TRCO_240809_Ku/TRCO_240809_Ku.raw.vegas/TRCO_240809_Ku.raw.vegas.A.fits")
table = hdu[5].data
print(set(table["SCAN"]), table["DATA"].shape)
    {32, 33, 34, 36, 37, 38, 39, 21, 22, 23, 24, 30, 31} (2420, 16384)

Environment

  • Dysh version 0.4.0a
  • Python version 3.9
  • OS RH7
@astrofle astrofle added the bug Something isn't working label Oct 7, 2024
@astrofle
Copy link
Collaborator Author

May be related to #405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant