Ejemplo n.º 1
0
def test_ang2ipix_dec_above_range():
	'''
	Test that out of range dec values (> 90) are caught.
	'''
	# The underlying Q3C code will truncate dec values outside of [-90,90].
	# Make sure that we check for this before calling the function.
	ra = 56.0
	dec = 255.0
	
	q = QLSC(depth=30)
	
	truncated_dec_ipix = q.ang2ipix(56.0, 90) # 864691128455135232
	correct_ipix = 6037741812941379589
	
	assert q.ang2ipix(ra,dec) == correct_ipix, "QLSC.ang2ipix is allowing out of range dec values (> 90) to be truncated."
Ejemplo n.º 2
0
def test_ang2ipix_dec_below_range():
	'''
	Test that out of range dec values (< -90) are caught.
	'''
	# The underlying Q3C code will truncate dec values outside of [-90,90].
	# Make sure that we check for this before calling the function.
	ra = 56.0
	dec = -135
	
	q = QLSC(depth=30)
	
	truncated_dec_ipix = q.ang2ipix(56.0, -90) # 6629298651489370112
	correct_ipix = 5816706551187910542
	
	assert q.ang2ipix(ra,dec) == correct_ipix, "QLSC.ang2ipix is allowing out of range dec values (< -90) to be truncated."
Ejemplo n.º 3
0
def test_ang2ipix_points_with_dec_out_of_range():
	'''
	Test ang2ipix from array with dec values out of range.
	'''
	points = np.array([[0, 102], [35, -132], [32, 99]], dtype=np.double)

	q = QLSC(depth=30)
	
	ipix = q.ang2ipix(points=points)
	
	assert (ipix == np.array([ 876126745706244234, 5824629191300107707,  680379582899038849], dtype=np.int64)).all(), "use of points array with dec out of range failed"
Ejemplo n.º 4
0
def test_ang2ipix_points():
	'''
	Test ang2ipix from array.
	'''
	points = np.array([[0, 12], [35, 32], [32, -32]], dtype=np.double)

	q = QLSC(depth=30)
	
	ipix = q.ang2ipix(points=points)
	
	assert (ipix == np.array([2029048250313091210, 2275510515682463237, 1550784043278934694], dtype=np.int64)).all(), "use of points array failed"
Ejemplo n.º 5
0
def test_ang2ipix_array( depth, ra, dec, ipix):
	'''
	Test ang2ipix using arrays, testing both float and double array types.
	'''
	q = QLSC(depth=depth)
	assert ipix == q.ang2ipix(ra, dec)
Ejemplo n.º 6
0
def test_ang2ipix_scalar(depth, ra, dec, ipix):
	'''
	Test QLSC ang2ipix using scalar values.
	'''
	q = QLSC(depth=depth)
	assert ipix == q.ang2ipix(ra, dec)