Create multiple frames with fits file
显示 更早的评论
Hi,
I am trying to create a single fits file with multiple frames. I have attached the Coding. At the end, i need to get a single fits file with 26 frames, but my code is producing just a single frame. Can someone please help? TIA
9 个评论
Walter Roberson
2019-4-17
In your previous question https://www.mathworks.com/matlabcentral/answers/456817-select-multiple-frames-from-a-single-fits-file (which is waiting for a response from you), you were not dealing with multiple frames: you were dealing with a multidimensional array. Are you now trying to create multiple frames, or are you trying to create a multidimensional array?
Your previous question dealt with image frames, but the current one deals with primary data. Which one are you wanting to use?
Kiruthiga Sekar
2019-4-17
Walter Roberson
2019-4-17
编辑:Walter Roberson
2019-4-17
That code looks like it should work. Did you try the second example at https://www.mathworks.com/help/matlab/ref/fitswrite.html to see whether it generally works?
What shows up when you fitsdisp() the output file?
I do notice that fitswrite() seems to create the first array as primary instead of Image, so the maximum index using fitsread(filename, 'image', index) format is one less than expected.
Kiruthiga Sekar
2019-4-17
Walter Roberson
2019-4-17
Do HDU 2 to 76 all show up with XTENSION = 'IMAGE '
If so then 2 through 76 are all frames that can be indexed with fitsread(filename, 'image', index) by using the HDU number minus one as the index (so index 1 to 75 in this case.). The first frame would have to be read with fitsread(filename, 'primary', 1) it appears.
Kiruthiga Sekar
2019-4-17
Walter Roberson
2019-4-17
Remember you are not deleting the file before you append to it, so the more you run the code, the longer the file is going to get.
Kiruthiga Sekar
2019-4-17
Walter Roberson
2019-4-17
if exist('new.fits', 'file'); delete('new.fits'); end
before you start writing data to it.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!