Hello Frédéric,

Without a minimal working example, I made my own, but if you have a better 
example it would be good to see it!

pdl> $bsub = sequence(3,4);
pdl> $FST = xvals(20);
pdl> $bsub->fhdr; #initialize an empty Astro::FITS::Header, let wfits correct it
pdl> $FST->fhdr;
pdl> wfits([$bsub,$FST],'test.fits');
pdl> ^Z
[2]+  Stopped                 pdl
$ more test.fits 
#I see the primary header and then two extension headers which are correct
$ fg
pdl> $bsub_read = rfits('test.fits[1]'); #try to read them in one at a time
Unexpected end of FITS file at …PDL/IO/FITS.pm line 412.
##########
So it seems like there is a problem with the extension READING in PDL::IO::FITS.

Forcing a read of the primary extension seems to be OK:

pdl> $primary = rfits('test.fits[0]')
pdl> p keys %$primary
SIMPLE BITPIX NAXIS EXTEND COMMENT HDUNAME END

cheers,
Derek


On Jul 15, 2014, at 6:51 AM, Frédéric Royer <[email protected]> wrote:

> Hello,
> 
>   I am trying to write Fits files with 2 extensions.
> When using:
>       wfits([$bsub,$FST],$skysubfits);
> the header of the primary extension $bsub is not propagated and the output 
> file has a simplistic primary header,
> whereas if I only write the first extension using
>       wfits($bsub,$skysubfits);
> the output file has the correct header.
> 
> Is there a way to propagate the header when writing multi extension FITS 
> files with wfits ?
> 
>       Thank you in advance
>         Best regards.
> 
> -- 
>   _
> |// \|_  _ _ ._   _._|_ _ o._ _  |
> | \_/|_)_>(/_| \/(_| |_(_)|| (/_ |--- G E P I
>                  de  Paris      |
> ROYER Frederic
> GEPI / CNRS UMR 8111
> Observatoire de Paris   Tel: +33 1 45 07 78 44
> 92195 MEUDON cedex      Fax: +33 1 45 07 78 78
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> 


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to