Can someone running iraf on a Sun help me ?
Houdebine wrote on Jul 23, 2008
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
Regards
Eric
Mike Fitzpatrick wrote on Jul 23, 2008
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
-Mike
Houdebine wrote on Jul 23, 2008
Hello Mike
Thanks for your advices. I put my files into iraf.noao.edu/pub.
Let me know if you can read them.
Regards
Eric
Thanks for your advices. I put my files into iraf.noao.edu/pub.
Let me know if you can read them.
Regards
Eric
Mike Fitzpatrick wrote on Jul 23, 2008
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
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 wrote on Jul 23, 2008
I put again a tar file into /pub. Its called houdebine.tar.gz. It contains all .pix and .imf files.
Thanks
Thanks
James Turner wrote on Jul 23, 2008
Hi Eric,
I think you could also do something like this in C, which worked for me some years ago.
Cheers,
James.
I think you could also do something like this in C, which worked for me some years ago.
Cheers,
James.
/* 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);
}
}
Mike Fitzpatrick wrote on Jul 23, 2008
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
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
James Turner wrote on Jul 23, 2008
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 wrote on Jul 23, 2008
Thanks for your help Mike !!
I've got the data. It works fine !!!
Eric
I've got the data. It works fine !!!
Eric
Last post on Jul 23, 2008