From 77b435b826b634b45b1836c0c62870ed9f20aae4 Mon Sep 17 00:00:00 2001 From: emilyhunt Date: Fri, 26 Sep 2025 16:14:39 +0200 Subject: [PATCH] Improve density test sample to also have ra/dec option --- tests/test_gaia.py | 161 +++++++++++++++++++++++++++------------------ 1 file changed, 96 insertions(+), 65 deletions(-) diff --git a/tests/test_gaia.py b/tests/test_gaia.py index e00ecba..64d82c2 100644 --- a/tests/test_gaia.py +++ b/tests/test_gaia.py @@ -67,78 +67,109 @@ def test_GaiaDensityEstimator(): np.testing.assert_allclose(result_actual, result_expected) -def _get_test_density_data(): +def _get_test_density_data(l_and_b=True): + l = [ + 162.9045963311823, + 222.2312721732947, + 128.44871235039162, + 160.9499288226896, + 213.06037341723444, + 199.36275026706875, + 128.60961396338558, + 136.28666583570796, + 125.97131795417525, + 213.97631324679773, + ] # noqa: E741 + b = [ + -0.9346927099010592, + 3.6108482027563507, + 1.9453330185828903, + 0.2056845242850199, + 1.1661362043217294, + 19.410708776697685, + 0.12021936533026821, + 1.3539080788454123, + -1.75718947932212, + 1.1693380678294931, + ] + ra = [ + 73.32579352199228, + 110.35512999194107, + 25.645086126893748, + 72.82866993029752, + 103.95590766540087, + 114.8592052923773, + 25.208684973667218, + 41.51797920137684, + 19.128741698462704, + 104.3764145121306, + ] + dec = [ + 42.41642894773442, + -6.5928011091731085, + 64.26790490403921, + 44.650500836239445, + 0.4174126564070922, + 20.39438531322255, + 62.44618488047631, + 61.2175017009223, + 60.966482841194676, + -0.39608875827834383, + ] + + x, y = ra, dec + if l_and_b: + x, y = l, b + return [ + x, + y, [ - 195.44967469843573, - 172.28930309346387, - 104.75874782403532, - 173.70832020346367, - 79.20595430423523, - 153.9832103408225, - 76.36865570717138, - 75.91799679118454, - 269.8536005362042, - 191.86293977733843, - ], - [ - -0.3109413445191218, - -0.09090826566516344, - -1.970488037640793, - -2.534745624741465, - 1.975546326136809, - -9.477611780892138, - -0.36600912016968506, - 2.33643211648706, - -2.839079251269452, - -8.251482667198461, - ], - [ - 0.41893829079702133, - 0.45112952571743464, - -0.8864160229048276, - -0.00944812985700761, - -1.945501466102864, - -0.2501085125841758, - -1.1535825632274828, - -1.9011820856534454, - -5.555678886414437, - 1.0248139396694183, + -0.7766432588848509, + -0.915231855730751, + -1.6372068440755732, + -0.2305765209103827, + -0.4524758968610532, + -0.9638938991196692, + -0.5086517349842387, + -1.0101726801170998, + 0.0820812064803136, + 0.6355885023846625, ], [ - 0.5954508838720914, - -0.5945587927019814, - -2.2983623730571368, - -1.2255169778814685, - -3.1292798157719655, - -0.4026029905131187, - -2.047954786200685, - -3.2077251711446126, - 5.1387683882097965, - 0.23107733843403835, + -0.14081969572092248, + 0.9609431030745171, + 0.12285028500838725, + -0.024477925088355806, + -0.0185474630769482, + -0.8602342854349014, + -0.3938208999571014, + 0.5334403415731419, + -0.1922518589849786, + -0.6764031476209058, ], [ - 0.11226267600669465, - 0.09336113589903527, - 0.1087746540178971, - 0.11248267295854439, - 0.07306373461755672, - 0.14866912811593022, - 0.09964444948414934, - 0.09891577538495654, - 0.16250218203179784, - 0.343948431873036, + 0.08060393781080663, + 0.12747343843901612, + 0.1004291966661565, + 0.08204558753982645, + 0.11759992793618043, + 0.15105175627504655, + 0.07888521783700321, + 0.09479025225955634, + 0.11303189760716631, + 0.06938962146299331, ], [ - 26670.688142002928, - 32035.043148849825, - 77662.2672329491, - 32962.30258016591, - 5788.030329350739, - 22917.85569373121, - 3136.150415190452, - 127494.21366708462, - 82293.64350935556, - 23629.392112275982, + 32393.884212237157, + 161238.37642755947, + 223081.47449782598, + 51176.42713227133, + 111278.63400948483, + 3853.1979999303608, + 123062.78494792822, + 76527.43449485092, + 142593.45652828, + 49079.85544204984, ], ] -- 2.54.0