Commits

Shea Garrison-Kimmel  committed 30c1211

updated ahf.py to handle the new version of the output files (i.e. from v1 of AHF). Note that this breaks reading of older files; don't update to this commit if you need to read one of those files.

  • Participants
  • Parent commits 01ab96e

Comments (0)

Files changed (2)

File irate/ahf.py

 
 from .validate import Validator,add_validator_type
 
-def ahf_halos(fname,outname,snapnum,nogas=False,name="HaloCatalog_AHF",
+def ahf_halos(fname,outname,snapnum,name="HaloCatalog_AHF",
     posname="comoving Mpc/h",posunit=[3.08568025e24,-1,1],
     velname="km/s",velunit=[1e5,0,0],
     mname="M_sun/h",munit=[1.98892e33,-1,0],
         Specifies the snapshot number that the data will be saved under
         in the IRATE file; that is, the data ends up in the group
         "Snapshot"+snapnum
-    :param bool nogas:  
-        True if AHF was NOT compiled with -DGAS_PARTICLES; otherwise
-        this will fail in attempting to collimate the data because it will try
-        to combine columns (e.g. Lx_gas, Ly_gas, and Lz_gas) that don't exist.
     :param name:  
         Specifies the name of the group that holds the datasets.  Data is
         saved under "Snapshot"+snapnum+"/"+name
         file.
     """
     import h5py
-    from numpy import empty,loadtxt,array
+    from numpy import empty,loadtxt,array,where
     import os
     from .core import check_version        
     
     
     coldata = loadtxt(fname,comments='#',unpack=True)
     nhalos = len(coldata[0])
-
+    
     print "Read {0} columns of data for {1} halos from file...now combining spatial datasets into 3 column arrays.".format(len(coldata),nhalos)
+    
+    if "n_gas" in comments:
+        print "It appears you compiled with extra columns for gas particles; separting those as well."
+        nogas = False
+    else:
+        print "It appears you compiled without extra columns for gas particles; not dealing with those."
+        nogas = True
  
     #Now collimate the data, so I return a list of columns rather than a list of rows; however, there are a few things (center pos and Vel) that I want as 2D lists
+    #if not gas, then I only have to worry about the Center, Velocity, angular momentum, and the inertia tensor (Eax, etc.)
+    #if gas, then I have to worry about Center, Velocity, L, Inertia tensor, plus L_gas, inertia tensor_gas, L_star, and inertial tensor_star
+    if nogas:
+        toseparate = ['Xc','Yc','Zc','VXc','VYc','VZc','Lx','Ly','Lz','Eax','Eay','Eaz','Ebx','Eby','Ebz','Ecx','Ecy','Ecz']        #The column heads that I do need to combine
+        mycoldata = [coldata[i] for i in range(len(coldata)) if not comments[i] in toseparate]   #All the data that I don't need to combine    
+        mycolheads = [comments[i] for i in range(len(coldata)) if not comments[i] in toseparate]
+        
+        #After getting rid of the above columns, I have:
+        #             ID,HostID,Nsub,Mvir,npart, Rvir,   Rmax, r2,mbp_offset,com_offset, Vmax, v_esc, sigV, lambda,lambda E, b,c,ovdens,nbins,fMhires, Ekin, Epot, SurfP, Phi0, cNFW
+        unitnames = [None,None,None,mname,None,radname,radname,radname,radname,radname,velname,velname,velname,None,None,None,None,None,None,None,enname,enname,enname,phiname,None]
+        unitcgs =   [None,None,None,munit,None,radunit,radunit,radunit,radunit,radunit,velunit,velunit,velunit,None,None,None,None,None,None,None,enunit,enunit,enunit,phiunit,None]
+                
+        comments = array(comments)
+        #Ok, now I need to create N x 3 arrays to hold the groups that I want to combine
+        mycolheads.append('Center')
+        mycoldata.append(array(zip(coldata[where(comments=='Xc')[0][0]]/1000.0,coldata[where(comments=='Yc')[0][0]]/1000.0,coldata[where(comments=='Zc')[0][0]]/1000.0)))
+        #Divide by 1000 to get Mpc, rather than kpc, for consistency with other halo finders and older versions
+        unitnames.append(posname)
+        unitcgs.append(posunit)
+        
+        mycolheads.append('Velocity')
+        mycoldata.append(array(zip(coldata[where(comments=='VXc')[0][0]],coldata[where(comments=='VYc')[0][0]],coldata[where(comments=='VZc')[0][0]])))
+        unitnames.append(velname)
+        unitcgs.append(velunit)
+        
+        mycolheads.append('L')
+        mycoldata.append(array(zip(coldata[where(comments=='Lx')[0][0]],coldata[where(comments=='Ly')[0][0]],coldata[where(comments=='Lz')[0][0]])))        
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ea')
+        mycoldata.append(array(zip(coldata[where(comments=='Eax')[0][0]],coldata[where(comments=='Eay')[0][0]],coldata[where(comments=='Eaz')[0][0]])))     
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Eb')
+        mycoldata.append(array(zip(coldata[where(comments=='Ebx')[0][0]],coldata[where(comments=='Eby')[0][0]],coldata[where(comments=='Ebz')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ec')
+        mycoldata.append(array(zip(coldata[where(comments=='Ecx')[0][0]],coldata[where(comments=='Ecy')[0][0]],coldata[where(comments=='Ecz')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+    
+    else:    
+        toseparate = ['Xc','Yc','Zc','VXc','VYc','VZc','Lx','Ly','Lz','Eax','Eay','Eaz','Ebx','Eby','Ebz','Ecx','Ecy','Ecz',
+            'Lx_gas','Ly_gas','Lz_gas','Eax_gas','Eay_gas','Eaz_gas','Ebx_gas','Eby_gas','Ebz_gas','Ecx_gas','Ecy_gas','Ecz_gas',
+            'Lx_star','Ly_star','Lz_star','Eax_star','Eay_star','Eaz_star','Ebx_star','Eby_star','Ebz_star','Ecx_star','Ecy_star','Ecz_star']        
+        mycoldata = [coldata[i] for i in range(len(coldata)) if not comments[i] in toseparate]   #All the data that I don't need to combine    
+        mycolheads = [comments[i] for i in range(len(coldata)) if not comments[i] in toseparate]
+        
+        #After getting rid of the above columns, I have:
+        #             ID,HostID,Nsub,Mvir,npart, Rvir,   Rmax, r2,mbp_offset,com_offset, Vmax, v_esc, sigV, lambda,lambda E, b,c,ovdens,nbins,fMhires, Ekin, Epot, SurfP, Phi0, cNFW
+        unitnames = [None,None,None,mname,None,radname,radname,radname,radname,radname,velname,velname,velname,None,None,None,None,None,None,None,enname,enname,enname,phiname,None]
+        unitcgs =   [None,None,None,munit,None,radunit,radunit,radunit,radunit,radunit,velunit,velunit,velunit,None,None,None,None,None,None,None,enunit,enunit,enunit,phiunit,None]
+        
+        comments = array(comments)
+        #Ok, now I need to create N x 3 arrays to hold the groups that I want to combine
+        mycolheads.append('Center')
+        mycoldata.append(array(zip(coldata[where(comments=='Xc')[0][0]]/1000.0,coldata[where(comments=='Yc')[0][0]]/1000.0,coldata[where(comments=='Zc')[0][0]]/1000.0)))
+        #Divide by 1000 to get Mpc, rather than kpc, for consistency with other halo finders and older versions
+        unitnames.append(posname)
+        unitcgs.append(posunit)
+        
+        mycolheads.append('Velocity')
+        mycoldata.append(array(zip(coldata[where(comments=='VXc')[0][0]],coldata[where(comments=='VYc')[0][0]],coldata[where(comments=='VZc')[0][0]])))
+        unitnames.append(velname)
+        unitcgs.append(velunit)
+        
+        mycolheads.append('L')
+        mycoldata.append(array(zip(coldata[where(comments=='Lx')[0][0]],coldata[where(comments=='Ly')[0][0]],coldata[where(comments=='Lz')[0][0]])))        
+        unitnames.append(None)
+        unitcgs.append(None)       
+        
+        mycolheads.append('Ea')
+        mycoldata.append(array(zip(coldata[where(comments=='Eax')[0][0]],coldata[where(comments=='Eay')[0][0]],coldata[where(comments=='Eaz')[0][0]])))     
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Eb')
+        mycoldata.append(array(zip(coldata[where(comments=='Ebx')[0][0]],coldata[where(comments=='Eby')[0][0]],coldata[where(comments=='Ebz')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ec')
+        mycoldata.append(array(zip(coldata[where(comments=='Ecx')[0][0]],coldata[where(comments=='Ecy')[0][0]],coldata[where(comments=='Ecz')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+    
+        mycolheads.append('L_gas')
+        mycoldata.append(array(zip(coldata[where(comments=='Lx_gas')[0][0]],coldata[where(comments=='Ly_gas')[0][0]],coldata[where(comments=='Lz_gas')[0][0]])))          
+        unitnames.append(None)
+        unitcgs.append(None)
+    
+        mycolheads.append('Ea_gas')
+        mycoldata.append(array(zip(coldata[where(comments=='Eax_gas')[0][0]],coldata[where(comments=='Eay_gas')[0][0]],coldata[where(comments=='Eaz_gas')[0][0]])))     
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Eb_gas')
+        mycoldata.append(array(zip(coldata[where(comments=='Ebx_gas')[0][0]],coldata[where(comments=='Eby_gas')[0][0]],coldata[where(comments=='Ebz_gas')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ec_gas')
+        mycoldata.append(array(zip(coldata[where(comments=='Ecx_gas')[0][0]],coldata[where(comments=='Ecy_gas')[0][0]],coldata[where(comments=='Ecz_gas')[0][0]])))      
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('L_star')
+        mycoldata.append(array(zip(coldata[where(comments=='Lx_star')[0][0]],coldata[where(comments=='Ly_star')[0][0]],coldata[where(comments=='Lz_star')[0][0]])))          
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ea_star')
+        mycoldata.append(array(zip(coldata[where(comments=='Eax_star')[0][0]],coldata[where(comments=='Eay_star')[0][0]],coldata[where(comments=='Eaz_star')[0][0]])))     
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Eb_star')
+        mycoldata.append(array(zip(coldata[where(comments=='Ebx_star')[0][0]],coldata[where(comments=='Eby_star')[0][0]],coldata[where(comments=='Ebz_star')[0][0]])))  
+        unitnames.append(None)
+        unitcgs.append(None)
+        
+        mycolheads.append('Ec_star')
+        mycoldata.append(array(zip(coldata[where(comments=='Ecx_star')[0][0]],coldata[where(comments=='Ecy_star')[0][0]],coldata[where(comments=='Ecz_star')[0][0]])))     
+        unitnames.append(None)
+        unitcgs.append(None)
+    
     """
     coldata = empty([len(data[0]),len(data)])   #So it's an array with N_attributes columns and N_halos rows
     for j in range(len(data)):
             coldata[i][j] = data[j][i]
     """
     
+    """
     mycen = empty([nhalos,3])
     myvel = empty([nhalos,3])
     myL = empty([nhalos,3])
 
     mycoldata = [coldata[0],coldata[1],mycen,myvel,coldata[8],coldata[9],coldata[10],coldata[11],coldata[12],coldata[13],myL,coldata[17],myEA,coldata[21],myEB,coldata[25],myEC] #Re-assemble the data into columns with (x,y,z) things in 2D lists
     mycomments = [comments[0],comments[1],"Center","Velocity","Mvir","Rvir","Vmax","Rmax","sigV","lambda","L","a","Ea","b","Eb","c","Ec"]
-    
+
     #Build the unit lists, including what I haven't yet included manually (so that I don't have to add it again)
     #So I'm also including the untis for ovdens, Redge,nbins,Ekin,Epot,mbp_offset,com_offset,r2,lambdaE,v_est,and Phi0
     unitnames = [None,None,posname,velname,mname,radname,velname,radname,velname,None,None,None,None,None,None,None,None,None,radname,None,enname,enname,radname,radname,radname,None,velname,phiname]
         for i in range(29,len(coldata)):    #Add the rest of the columns to mycoldata, but skip those that I've already added.  Also, I've already done the units above.
             mycoldata.append(coldata[i])
             mycomments.append(comments[i])
-    
+    """    
     #Check again that I haven't messed up anywhere.  If this runs successfully, remove this bit:
     assert len(unitnames) == len(unitcgs)
-    assert len(unitnames) == len(mycomments)
-    assert len(mycomments) == len(mycoldata)  
+    assert len(unitnames) == len(mycolheads)
+    assert len(mycolheads) == len(mycoldata)  
     
     #Now to write the data to a file
     if os.path.isfile(outname):
                 raise ValueError(msg)
             print "Saving halo catalog under existing group /Snapshot{0:05} as {1}".format(snapnum,name)
             #Now I can add the data to cat
-            for i in range(len(mycomments)):
-                cat.create_dataset(mycomments[i],data=mycoldata[i])
+            for i in range(len(mycolheads)):
+                cat.create_dataset(mycolheads[i],data=mycoldata[i])
                 if unitnames[i] != None:
-                    cat[mycomments[i]].attrs['unitname'] = unitnames[i]
-                    cat[mycomments[i]].attrs['unitcgs'] = unitcgs[i]
+                    cat[mycolheads[i]].attrs['unitname'] = unitnames[i]
+                    cat[mycolheads[i]].attrs['unitcgs'] = unitcgs[i]
         else:
             print "Creating group /Snapshot{0:05} and saving halo catalog under it as {1}".format(snapnum,name)
             irate.create_group("Snapshot{0:05}".format(snapnum))
             cat = irate["Snapshot{0:05}".format(snapnum)].create_group(name)
-            for i in range(len(mycomments)):
-                cat.create_dataset(mycomments[i],data=mycoldata[i])
+            for i in range(len(mycolheads)):
+                cat.create_dataset(mycolheads[i],data=mycoldata[i])
                 if unitnames[i] != None:
-                    cat[mycomments[i]].attrs['unitname'] = unitnames[i]
-                    cat[mycomments[i]].attrs['unitcgs'] = unitcgs[i]
+                    cat[mycolheads[i]].attrs['unitname'] = unitnames[i]
+                    cat[mycolheads[i]].attrs['unitcgs'] = unitcgs[i]
                 
     else:
         print "Creating new IRATE file {0}".format(outname)
         check_version(irate,update=True)
         irate.create_group('Snapshot{0:05}'.format(snapnum))
         cat = irate['Snapshot{0:05}'.format(snapnum)].create_group(name)
-        for i in range(len(mycomments)):
-            cat.create_dataset(mycomments[i],data=mycoldata[i])
+        for i in range(len(mycolheads)):
+            cat.create_dataset(mycolheads[i],data=mycoldata[i])
             if unitnames[i] != None:
-                cat[mycomments[i]].attrs['unitname'] = unitnames[i]
-                cat[mycomments[i]].attrs['unitcgs'] = unitcgs[i]
+                cat[mycolheads[i]].attrs['unitname'] = unitnames[i]
+                cat[mycolheads[i]].attrs['unitcgs'] = unitcgs[i]
             
     irate.close()
     
-    return array(mycoldata[19])    #nbins
+    nbinsindex = where(array(mycolheads) == 'nbins')[0][0]
+    
+    return array(mycoldata[nbinsindex])    #nbins
     
 def awked_ahf_particles(fname,outname,snapnum,filename=None,
     name="HaloCatalog_AHF"):
     mname="M_sun/h",munits=[1.98892e33,-1,0],
     velname="km/s",velunits=[1e5,0,0],
     angname="(M_sun/h)*(Mpc/h)*(km/s)",angunits=[1e5*1.98892e33*3.08568025e24,-2,1],
-    enname="M_sun/h*(km/s)^2",enunits=[1.98892e33*1e5*1e5,-1,0],
-    nogas=False):
+    enname="M_sun/h*(km/s)^2",enunits=[1.98892e33*1e5*1e5,-1,0]):
     
     """
     Read an ASCII .AHF_profiles file, collimate it, and return a list of
         conversion factor between the units of * and CGS, the second of which
         gives the exponent on h as it appears in those units, and the third
         gives the exponent on a as it appears in those units.
-    :param bool nogas:  
-        True if AHF was NOT compiled with -DGAS_PARTICLES; otherwise
-        this will fail in attempting to collimate the data because it will try
-        to combine columns (e.g. Lx_gas, Ly_gas, and Lz_gas) that don't exist.
         
     """
     #Read a *.AHF_profiles file based on the total number of halos and a list of the number of radial bins that each halo has
     mylen = max(nbins)
     coldata = []
     mycomments = []
-    if nogas:
-        unitnames = [radname,None,mname,None,None,velname,velname,angname,None,None,None,None,None,None,enname,enname,velname]
-        unitcgs = [radunits,None,munits,None,None,velunits,velunits,angunits,None,None,None,None,None,None,enunits,enunits,velunits]
+    if "M_gas" not in comments:
+        unitnames = [radname,None,mname,None,None,velname,velname,velname,angname,None,None,None,None,None,enname,enname]
+        unitcgs = [radunits,None,munits,None,None,velunits,velunits,velunits,angunits,None,None,None,None,None,enunits,enunits]
     else:
-        unitnames = [radname,None,mname,None,None,velname,velname,angname,None,None,None,None,None,None,enname,enname,velname,mname,mname,enname]
-        unitcgs = [radunits,None,munits,None,None,velunits,velunits,angunits,None,None,None,None,None,None,enunits,enunits,velunits,munits,munits,enunits]
-    for i in range(0,7):
+        unitnames = [radname,None,mname,None,None,velname,velname,velname,angname,None,None,None,None,None,enname,enname,mname,mname,enname]
+        unitcgs = [radunits,None,munits,None,None,velunits,velunits,velunits,angunits,None,None,None,None,None,enunits,enunits,munits,munits,enunits]
+    for i in range(0,8):
         coldata.append([])      #So each list within coldata corresponds to a column
         mycomments.append(comments[i])
     #Add on the columns that I'm concatenating (L, Ea, Eb, and Ec) plus those in the middle
     coldata.append([])
     mycomments.append("L")
     coldata.append([])
-    mycomments.append("a")
+    mycomments.append("b")
+    coldata.append([])
+    mycomments.append("c")
     coldata.append([])
     mycomments.append("Ea")
     coldata.append([])
-    mycomments.append("b")
-    coldata.append([])
     mycomments.append("Eb")
     coldata.append([])
-    mycomments.append("c")
-    coldata.append([])
     mycomments.append("Ec")
     for i in range(22,len(comments)):       #Add on the rest of the columns
         coldata.append([])
         mycomments.append(comments[i])
         
-    for i in range(len(coldata)):       #Now prep the columns to receive a series of information about each halo that's at least as long as necessary
+    print len(coldata)
+        
+    toskip = [9,10,14,15,20,21]
+    for i in range(len(mycomments)):       #Now prep the columns to receive a series of information about each halo that's at least as long as necessary
         for j in range(nhalos):
-            if i == 7 or i == 9 or i == 11 or i == 13:
+            if i == 8 or i == 11 or i == 12 or i == 13:
                 coldata[i].append(zeros((mylen,3)))     #L, Ea, Eb, and Ec get 3D arrays
+            #elif i in toskip:
+            #    continue
             else:
                 coldata[i].append(zeros(mylen))
+        
+    for i in range(len(coldata)):
+        print i,len(coldata[i]),mycomments[i]
+        
+    for i in range(len(coldata)):
+        print i,coldata[i][0].shape
+        
+    print "\n"
+    #print coldata[10][0][0,0]
     
     #Now I have to fill out those arrays using the info in data
     #Data is as long as the number of halos, and data[x] is as long as the number of columns\
         for j in range(len(data[i])):       #So this loops over the radial bins--data[i][j] is all the data at a single radial bin
             for k in range(len(data[i][j])):    #k should actually always be the same, because all the radial bins have the same info calculated in them
             #Now I have to be careful of the fact that I have fewer data column in my final because of concatentation
-                if k < 7:
+                if k < 8:
                     coldata[k][i][j] = data[i][j][k]                    
-                elif k == 7:    #Lx
-                    coldata[k][i][j,0] = data[i][j][k]
-                elif k == 8:    #Ly
-                    coldata[7][i][j,1] = data[i][j][k]
-                elif k == 9:
-                    coldata[7][i][j,2] = data[i][j][k]
+                elif k == 8:    #Lx
+                    coldata[8][i][j,0] = data[i][j][k]
+                elif k == 9:    #Ly
+                    coldata[8][i][j,1] = data[i][j][k]
                 elif k == 10:
-                    coldata[8][i][j] = data[i][j][k]
+                    coldata[8][i][j,2] = data[i][j][k]
                 elif k == 11:
-                    coldata[9][i][j,0] = data[i][j][k]
-                elif k == 12:
-                    coldata[9][i][j,1] = data[i][j][k]
-                elif k == 13:
-                    coldata[9][i][j,2] = data[i][j][k]
+                    coldata[9][i][j] = data[i][j][k]
+                elif k == 12:       # c
+                    coldata[10][i][j] = data[i][j][k]
+                elif k == 13:       #Eax
+                    coldata[11][i][j,0] = data[i][j][k]
                 elif k == 14:
-                    coldata[10][i][j] = data[i][j][k]
-                elif k == 15:
-                    coldata[11][i][j,0] = data[i][j][k]
-                elif k == 16:
                     coldata[11][i][j,1] = data[i][j][k]
+                elif k == 15:       #Eaz
+                    coldata[11][i][j,2] = data[i][j][k]
+                elif k == 16:       #Ebx
+                    coldata[12][i][j,0] = data[i][j][k]
                 elif k == 17:
-                    coldata[11][i][j,2] = data[i][j][k]
-                elif k == 18:
-                    coldata[12][i][j] = data[i][j][k]
-                elif k == 19:
+                    coldata[12][i][j,1] = data[i][j][k]
+                elif k == 18:       #Ebz
+                    coldata[12][i][j,2] = data[i][j][k]
+                elif k == 19:       #Ecx
                     coldata[13][i][j,0] = data[i][j][k]
                 elif k == 20:
                     coldata[13][i][j,1] = data[i][j][k]
-                elif k == 21:
+                elif k == 21:       #Ecz
                     coldata[13][i][j,2] = data[i][j][k]
                 else:   #So k >= 22, and subtract off the columns that I concatenated
                     coldata[k-8][i][j] = data[i][j][k]
 
     
     #Now to save that to a file, but first to make sure I didn't mess up anywhere
+    print "Checking units"
+    print len(unitnames)
+    print len(coldata)
+    print len(unitcgs)
+    print len(mycomments)
+    
     assert len(unitnames) == len(coldata)
+    print "Check 1 complete"
     assert len(unitcgs) == len(mycomments)
+    print "Check 2 complete"
     assert len(mycomments) == len(unitnames)
+    print "Check 3 complete"
     
     #Now let's save to a file:
     irate = h5py.File(outname,'a')

File scripts/ahf2irate

 inopts.add_option("--particles",action="store_true",dest="particles",help="Include particle data from *.AHF_particles file?  Default = %default",default=False)
 inopts.add_option("--profiles",action="store_true",dest="profiles",help="Include radial profile data from *.AHF_profiles file?  Default = %default",default=False)
 inopts.add_option("-p",action="store_true",dest="p",help="Include both radial data and particle data.  Default = %default.",default=False)
-inopts.add_option("--nogas",action="store_true",dest="nogas",help="Enable if AHF was compiled without -DGAS_PARTICLES or code will fail.",default=False)
+#inopts.add_option("--nogas",action="store_true",dest="nogas",help="Enable if AHF was compiled without -DGAS_PARTICLES or code will fail.",default=False)
 inopts.add_option("--paramfile",dest="header",help="Specify the location of the parameter file outputted by AHF build 311 and up and add it as attributes to the halo catalog.",default=None)
 
 parser.add_option_group(unitops)
 angunits = array([ops.angunit,ops.anghfact,ops.angafact])
 
 try:
-    nbins = ahf_halos(inbase+"halos",outname,snapnum,ops.nogas,ops.name,ops.posname,
+    nbins = ahf_halos(inbase+"halos",outname,snapnum,ops.name,ops.posname,
                       posunits,ops.velname,velunits,ops.massname,massunits,
                       ops.radname,radunits,ops.energyname,energyunits,ops.phiname,
                       phiunits)
     try:
         ahf_profiles(inbase+"profiles",nhalos,nbins,outname,snapnum,ops.name,
                  ops.radname,radunits,ops.massname,massunits,ops.velname,
-                 velunits,ops.angname,angunits,ops.energyname,energyunits,
-                 ops.nogas)
+                 velunits,ops.angname,angunits,ops.energyname,energyunits)
     except Exception,e:
         print e.__class__.__name__+':',e
         sys.exit(1337)