Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Nfreqs = input_uv.Nfreqs
Nbls = input_uv.Nbls
tasks_shape = (Ntimes, Nfreqs, Nbls)
time_ax, freq_ax, bl_ax = range(3)
tloc = [np.float64(x) for x in input_uv.telescope_location]
world = input_uv.extra_keywords.get('world', 'earth')
if world.lower() == 'earth':
location = EarthLocation.from_geocentric(*tloc, unit='m')
elif world.lower() == 'moon':
if not hasmoon:
raise ValueError("Need lunarsky module to simulate an array on the Moon.")
location = MoonLocation.from_selenocentric(*tloc, unit='m')
else:
raise ValueError("If world keyword is set, it must be either 'moon' or 'earth'.")
telescope = Telescope(input_uv.telescope_name, location, beam_list)
freq_array = input_uv.freq_array * units.Hz
time_array = Time(input_uv.time_array, scale='utc', format='jd', location=telescope.location)
for src_i in src_iter:
sky = catalog.get_skymodel(src_i)
if sky.component_type == 'healpix' and hasattr(sky, 'healpix_to_point'):
sky.healpix_to_point()
if sky.spectral_type != 'flat' and hasattr(sky, 'at_frequencies'):
sky.at_frequencies(freq_array[0])
elif sky.spectral_type == 'full':
if not np.allclose(sky.freq_array, freq_array):
raise ValueError("SkyModel spectral type is 'full', and "
"its frequencies do not match simulation frequencies.")
for task_index in task_ids: