Message Boards Message Boards

0
|
3100 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

What others are doing to write out Metadata into a FITS file?

Posted 10 years ago

When I export out images with accustomed metadata into a FITS file, Mathematica truncates and overwrites it.

Here is the metadata I got with Import:

In fpa425meta=Import["imga425.fits.seg.fit","Metadata"]

Out[530]= {SIMPLE->True,BITPIX->16,NAXIS->3,NAXIS1->256,NAXIS2->256,NAXIS3->1000,BZERO->32768.,BSCALE->1.,INSTRUME->KAF 4200,PMISGAIN->1,FILE->img_001,OBJECT->KOI,IMAGETYP->emccd speckle,FILTER->754.0 nm,OBSERVER->E. Horch, S. Howell, M. Everett, D. Ciardi,TELESCOP->Gemini-N,DETECTOR->Andor iXon EMCCD,EXPTIME->50,DATE-OBS->21/12/104,TIME-OBS->03:17:01,ORIGIN->PMIS Image Processing Software,ORIGIN->Copyright (C) 1991-1998 GKR Computer Consulting}

I make this modification to it: In[554]:= fpa425metaPos=Position[fpa425meta,"NAXIS3"]

Out[554]= {{6,1}}

In[555]:= fpa425metaPos[[1,2]]++

Out[555]= 1

In[558]:= fpa425meta=ReplacePart[fpa425meta,fpa425metaPos->Length[ext1fpa425]]

Out[558]= {SIMPLE->True,BITPIX->16,NAXIS->3,NAXIS1->256,NAXIS2->256,NAXIS3->3,BZERO->32768.,BSCALE->1.,INSTRUME->KAF 4200,PMISGAIN->1,FILE->img_001,OBJECT->KOI,IMAGETYP->emccd speckle,FILTER->754.0 nm,OBSERVER->E. Horch, S. Howell, M. Everett, D. Ciardi,TELESCOP->Gemini-N,DETECTOR->Andor iXon EMCCD,EXPTIME->50,DATE-OBS->21/12/104,TIME-OBS->03:17:01,ORIGIN->PMIS Image Processing Software,ORIGIN->Copyright (C) 1991-1998 GKR Computer Consulting}

Then I write my expression out into the fits file with the modified Metadata: Export["/Users/jancsi/Documents/MasterDegree/Theses/programs/scsu/Results/425/Exported/LessMin1sigMet.fits",{ext1fpa425},"Metadata"->fpa425meta];

When I read back the Metadata, I am getting something totally different: In[560]:= fpa425metaMod=Import["/Users/jancsi/Documents/MasterDegree/Theses/programs/scsu/Results/425/Exported/LessMin1sigMet.fits","Metadata"]

Out[560]= {SIMPLE->{True,Normal FITS file},BITPIX->{-32,Bits/pixel, negative is floating point},NAXIS->{3,Dimensionality of data},NAXIS1->256,NAXIS2->256,NAXIS3->3,EXTENDED->{True,Extensions may be present},PCOUNT->{0,Deprecated},GCOUNT->{1,Deprecated},BSCALE->{1,Scale factor},BZERO->{0,Zero factor real=tape*bscale+bzero},CREATOR->Created with the Wolfram Language : www.wolfram.com}

So, what others are doing to counteract this "feature" ?

POSTED BY: Janos Lobb
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract