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

Read task out shape does not match PSRFITS data shape #121

Open
luojing1211 opened this issue Aug 20, 2019 · 5 comments
Open

Read task out shape does not match PSRFITS data shape #121

luojing1211 opened this issue Aug 20, 2019 · 5 comments

Comments

@luojing1211
Copy link
Collaborator

luojing1211 commented Aug 20, 2019

In PR #119 I added the data writing functionality. The file handler shape is (nsample, nbin, npol, nchan), but the PSRFITS shape is (nsample, nbin, nchan, npol). So the

read(nsample, out = PSRFITS)

will report the bug of not the same shape. Where should the reshape happen?

@mhvk
Copy link
Owner

mhvk commented Aug 25, 2019

In your text above, the shapes are in fact the same... At long as nsample is first, I think the easiest route for now is somehing like:

reshape_to_fits = Reshape(result, <fits_shape>)
reshape_to_fits.read(nsample, out=...)

Maybe eventually we can adjust the Reshape task so that it works in front of a writer as well?

@luojing1211
Copy link
Collaborator Author

I made a mistake on the file shape and I just fixed it. Do you mean, we can add reshape task as part of the writer? I think it will work.

@mhvk
Copy link
Owner

mhvk commented Aug 25, 2019

OK, now makes more sense. So, yes, we can already do the reshape pre-write, and I agree that we should be able to make it work on the writer as well. Given properly named sample_shape, it could even become automatic...

@luojing1211
Copy link
Collaborator Author

To make it automatic, we should know the sample label from the upstream file hander. However, this information may be lost at some steps of the pipeline.

@mhvk
Copy link
Owner

mhvk commented Aug 26, 2019

Part of it we can infer from .frequency and .polarization, but it would be hard to do this reliably. Probably best for now to just stick with the Reshape option.

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

No branches or pull requests

2 participants