Houdebine |
07/23/2008 06:40AM (Read 4084 times)
|
|
|
Status: offline
Registered: 07/12/2008
Posts: 8
|
I created some iraf files on a Sun station some years ago. I can't read them on my PC anymore. Unfortunately I don't have access to a sun station anymore. Could someone working on a sun station help me ?
Regards
Eric
|
|
|
|
fitz |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
A Mac system has the same byte order and should be able to read the files. If you can't find one of those, put a tarball of the image directory on ftp://iraf.noao.edu/pub and I'll have a look.-Mike
|
|
|
|
Houdebine |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 07/12/2008
Posts: 8
|
Hello MikeThanks for your advices. I put my files into iraf.noao.edu/pub.
Let me know if you can read them.
Regards
Eric
|
|
|
|
fitz |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Eric,The tar file appears to be corrupted, untarring terminates with an error. Also, I need to have BOTH the .imh and .pix files. Please try resending. When I'm done I put back a tarball of FITS images you should be able to read.-Mike
|
|
|
|
Houdebine |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 07/12/2008
Posts: 8
|
I put again a tar file into /pub. Its called houdebine.tar.gz. It contains all .pix and .imf files.
Thanks
|
|
|
|
jturner |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 12/29/2005
Posts: 165
|
Hi Eric,I think you could also do something like this in C, which worked for me some years ago.Cheers,James.[code:1:5b962c8147]/* Convert from 32 bit DEC Alpha binary to Sun binary */
/* James Turner, Nov.97 */#include<stdio.h>int main(int argc, char **argv){ char c[4], ct, n, newname[255];
FILE *input, *output; if (argc==1)
{ printf("Usage: %s <filenames>\n(ouput files have .sun appended)\n",
*argv);
return 1;
} printf("Converting %d %s\n", argc-1, argc > 2 ? "files" : "file"); while (--argc) { argv++; if ((input = fopen(*argv, "r")) == NULL)
{ printf("Can't open input file %s.\n", argv);
return 1;
} n = 0;
while (newname[n] = (*argv)[n++]); newname[--n] = '.';
newname[++n] = 's';
newname[++n] = 'u';
newname[++n] = 'n';
newname[++n] = 0; if ((output = fopen(newname, "w")) == NULL)
{ printf("Can't open %s for writing.\n", newname);
fclose(input);
return 1;
} n = 4; while(fread(c, 1, 4, input) == 4)
{ ct = c[0];
c[0] = c[3];
c[3] = ct; ct = c[1];
c[1] = c[2];
c[2] = ct; fwrite(c, 1, 4, output);
} fclose(output);
fclose(input);
}
}
[/code:1:5b962c8147]
|
|
|
|
fitz |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Sorry James, a simple byte-swap like this won't work to make the images readable. Aside from reconnecting the .pix and .imh files, the actual disk layout of the headers for these file needs to be rewritten to swap only certain things. A special task could be written, but was never a priority.In any case, Eric: I've replaced the houdebine.tar.gz file with one that contains 1) the rewritten .imh images that reconnect to the data (these are in the newer machine-independent format), 2) a subdirectory of the headers as text output (these appear to be MIDAS-written files and might have lost some keywords), and 3) a 'fits' subdirectory containing all the images as regular FITS files. You should be able to get at the data again.Cheers,
-Mike
|
|
|
|
jturner |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 12/29/2005
Posts: 165
|
OK. Sorry to confuse the issue. It works for some binary files, but I might have guessed it wouldn't work for data with headers.
|
|
|
|
Houdebine |
07/23/2008 06:40AM
|
|
|
Status: offline
Registered: 07/12/2008
Posts: 8
|
Thanks for your help Mike !!I've got the data. It works fine !!!
Eric
|
|
|
|