This page has infomation how to read data files. |
How to Read Data
We prefer to distribute the mock SDSS-III data only in format of C binary because there are too many variants in the Fortran binary, all of which we couldn't follow and make corresponding files. Files downloadable in this page are all in the Little-Endian which can be readable on computers having such CPUs as AMD, Intel, HP, etc. For those who have CPUs made by SUN, Silicon Graphics, and, IBM, we will provide the data on a special request. To check "Endianness" of your computer, please download this program endian.c, compile it, and run the output command. Then, it will tell the Endianness of your computer. To know Endianness, please refer to the Wikipedia. Each subdirectory has 8 files as below; [astro]#ls -al -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_mass_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_vx_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_vy_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_vz_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_x_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_y_ultradeep.dat -rw-r--r-- 1 kjhan Ph.D. 85865712 Feb 19 07:32 halo_z_ultradeep.dat where halo_(x,y,z)_ultradeep.dat has positions of mock LRGs in unit of Mpc/h, halo_(vx,vy,vz)_ultradeep.dat has velocities in unit of km/second, halo_mass_ultradeep.dat has the halo masses in unit of M_sun/h. ------------------------------------------------------------------------ fread(&np,sizeof(int),1,fp); fread(array,sizeof(float),np,fp); ------------------------------------------------------------------------ ------------------------------------------------------------------------ METHOD 1: Download sub.c and compile it using a proper C compiler with an option "-c". And, you can link sub.o to the fortran main program. A fortran caller can read the file as; c234567 character*80 filename real array(MLARGE) integer np,length filename='x_sdss3_00.dat' C This is the length of filename. C It is needed due to the different definitions on the string between C and Fortran. length = 18 call getnp(filename,np,length) call getdata(filename,array,length) stop end ------------------------------------------------------------------------ METHOD 2: If you have a fortran compiler supporting 'form=binary', then try this c234567 character*80 filename real array(MLARGE) integer np,length filename='x_sdss3_00.dat' open(1,file=filename,form='binary') read(1) np read(1)(array,i=1,np) stop end ------------------------------------------------------------------------ |