def get_physical_size(self): ''' Calculate the physical size of the box Returns: box size in comoving Mpc ''' redsh = hf.nu_to_z(self.get_nu_c()) cdist = hf.cdist(redsh) l = cdist * self.get_fov() * np.pi/180. return l
def set_nu_range_cubic(self): ''' Set the parameters nu_range and dnu so that the result of get_noise_cube and get_image_cube have the same comoving extent along the frequency axis as along the sides The uv grid must be set prior to running this method. ''' #Determine the size of the box redsh = hf.nu_to_z(self.get_nu_c()) cdist = hf.cdist(redsh) boxl = cdist*self.get_fov()*np.pi/180. #Determine frequency range z_lower = hf.cdist_to_z(cdist-boxl/2.) z_upper = hf.cdist_to_z(cdist+boxl/2.) nu_upper = hf.z_to_nu(z_upper) nu_lower = hf.z_to_nu(z_lower) self.set_nu_range((nu_lower,nu_upper)) #Determine frequency step if self.get_uv_grid() == None or self.get_uv_grid().shape[0] == 0: raise Exception('uv grid must be set before running set_nu_range_cubic') gridn = self.get_uv_grid().shape[0] self.set_dnu( (nu_lower-nu_upper)/float(gridn) )
def get_z(self): ''' Get redshift ''' return hf.nu_to_z(self.get_nu_c())