@@ -421,7 +421,7 @@ def __init__(self, path, cleaned=True, subsamples=False, convert_units=True, unp
421421 if halo_lc == None :
422422 halo_lc = self .is_path_halo_lc (path )
423423 if verbose and halo_lc :
424- print ('Detected halo light cone catalog' )
424+ print ('Detected halo light cone catalog. ' )
425425 self .halo_lc = halo_lc
426426
427427 # If loading halo light cones, turn off cleaning and bit unpacking because done already
@@ -820,6 +820,8 @@ def _read_halo_info(self, halo_fns, fields, cleaned_fns=None, cleaned_fields=Non
820820 print (f'{ len (fields )} halo catalog fields ({ len (cleaned_fields )} cleaned) requested. '
821821 f'Reading { len (raw_dependencies )} fields from disk. '
822822 f'Computing { len (extra_fields )} intermediate fields.' )
823+ if self .halo_lc :
824+ print ('\n For more information on the halo light cone catalog fields, see https://abacussummit.readthedocs.io/en/latest/data-products.html#halo-light-cone-catalogs' )
823825
824826 self .halos = Table (cols , copy = False )
825827 self .halos .meta .update (self .header )
@@ -969,9 +971,26 @@ def _sigmav_loader(m,raw,halos):
969971 pat = re .compile (r'SO(?:_L2max)?(?:_central_density)' )
970972 self .halo_field_loaders [pat ] = lambda m ,raw ,halos : raw [m [0 ]]
971973
972- # Halo light cone catalog specific fields
973- pat = re .compile (r'index_halo|origin| pos_avg|pos_interp| vel_avg|vel_interp |redshift_interp|N_interp' )
974+ # loader for halo light cone catalog specific fields
975+ pat = re .compile (r'index_halo|pos_avg|vel_avg|redshift_interp|N_interp' )
974976 self .halo_field_loaders [pat ] = lambda m ,raw ,halos : raw [m [0 ]]
977+
978+ # loader for halo light cone catalog field `origin`
979+ pat = re .compile (r'origin' )
980+ self .halo_field_loaders [pat ] = lambda m ,raw ,halos : raw [m [0 ]]% 3
981+
982+ # loader for halo light cone catalog fields: interpolated position and velocity
983+ pat = re .compile (r'(?P<pv>pos|vel)_interp' )
984+ def lc_interp_loader (m , raw , halos ):
985+ columns = {}
986+ interped = (raw ['origin' ] // 3 ).astype (bool )
987+ if m [0 ] == 'pos_interp' or 'pos_interp' in halos .colnames :
988+ columns ['pos_interp' ] = np .where (interped [:, None ], raw ['pos_avg' ], raw ['pos_interp' ])
989+ if m [0 ] == 'vel_interp' or 'vel_interp' in halos .colnames :
990+ columns ['vel_interp' ] = np .where (interped [:, None ], raw ['vel_avg' ], raw ['vel_interp' ])
991+ return columns
992+
993+ self .halo_field_loaders [pat ] = lc_interp_loader
975994
976995 # eigvecs loader
977996 pat = re .compile (r'(?P<rnv>sigma(?:r|n|v)_eigenvecs)(?P<which>Min|Mid|Maj)(?P<com>_(?:L2)?com)' )
@@ -1722,3 +1741,4 @@ def unpack_euler16(bin_this):
17221741 ('sigmavtan_L2com' , np .float32 ),
17231742 ('rvcirc_max_L2com' , np .float32 ),
17241743], align = True )
1744+
0 commit comments