diff --git a/examples/nIFTyCluster/Baryonic/data/README b/examples/nIFTyCluster/Baryonic/data/README new file mode 100644 index 0000000000000000000000000000000000000000..9c0ca0b643207cce6b597ffa38e8abcdf85ed8a7 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/README @@ -0,0 +1,3 @@ +Data extracted by hand using WebPlotDigitizer +(https://automeris.io/WebPlotDigitizer/) from the original +nIFTY paper (2016MNRAS.457.4063S). diff --git a/examples/nIFTyCluster/Baryonic/data/S/AREPO.csv b/examples/nIFTyCluster/Baryonic/data/S/AREPO.csv new file mode 100644 index 0000000000000000000000000000000000000000..df0ce396911495debecaa035f4bff93d57c14476 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/S/AREPO.csv @@ -0,0 +1,125 @@ +# R [h^-1 Mpc], S [keV h^-2 cm^2] +0.023656128029452744, 197.30575971432492 +0.024515266555991365, 199.37588425081265 +0.025405607103708764, 201.58458343126222 +0.026328282861369703, 203.7389767794876 +0.02728446817266185, 205.99601058640653 +0.028275380030852074, 208.15731290495506 +0.029302279627725258, 207.75536795372992 +0.030366473958777382, 206.5142643272681 +0.03146931748670533, 205.2805748929248 +0.03261221386531146, 203.9753900048567 +0.03379661772601604, 202.7960607999093 +0.03502403652925248, 201.62355014975722 +0.036296032483100586, 200.7292183648817 +0.037614224531600855, 199.87748278933032 +0.03898029041527962, 199.0678340926805 +0.04039596880650811, 198.26146506016715 +0.04186306152241299, 197.4202006721108 +0.04338343581815498, 196.65851290129496 +0.04495902676349428, 196.6205057493216 +0.04659183970566755, 196.6205057493216 +0.048283952821711475, 196.6205057493216 +0.05003751976348054, 196.6205057493216 +0.05185477239872673, 196.5825059427901 +0.053738023651728514, 196.848658892489 +0.05568967044708582, 197.72570117807027 +0.05771219676042677, 198.60665105019555 +0.05980817677990957, 199.53008804491353 +0.061980278182543105, 200.41907720768307 +0.06423126552949635, 201.3120271852814 +0.06656400378471788, 201.70150618524664 +0.06898146196134392, 201.70150618524664 +0.07148671690053612, 201.70150618524664 +0.07408295718755786, 201.70150618524664 +0.07677348721007463, 201.70150618524664 +0.07956173136384204, 202.32624052608202 +0.08245123841113604, 204.44903975654947 +0.0854456859974711, 206.7538979216158 +0.08854888533235596, 208.92315196529785 +0.09176478604004407, 211.27844907626476 +0.09509748118645256, 213.57772063716527 +0.09855121248864795, 215.19376395107116 +0.10213037571352886, 216.1107666160845 +0.10583952627257691, 216.94779586869444 +0.10968338501979692, 217.87227296936706 +0.11366684426022514, 218.75840307998902 +0.11779497397665378, 219.7330623482146 +0.1220730282824961, 222.59710741005512 +0.12650645210900544, 226.45939705661849 +0.1311008881353594, 230.34417540905585 +0.13586218397042943, 234.3408846843013 +0.1407963995953765, 238.36086534195974 +0.14590981507654527, 242.54354757507133 +0.151208938558474, 247.08600585747973 +0.1567005145471926, 251.7135372224491 +0.1623915324943522, 256.4773029682466 +0.1682892356931108, 261.33122462830795 +0.1744011304970989, 266.3284803330491 +0.18073499587419686, 271.2115312715363 +0.18729889330728464, 275.544272124096 +0.19410117705456523, 279.8380336925424 +0.20115050478252006, 284.52848077671246 +0.2084558485850304, 289.0739666068992 +0.21602650640268864, 293.69206886330807 +0.223872113856834, 297.6351441631316 +0.2320026565133744, 301.048718844887 +0.24042848259200325, 304.560304543979 +0.2491603161369873, 307.99376799051356 +0.2582092706662878, 311.5261456319614 +0.26758686331638887, 315.0381385532608 +0.277305029500834, 317.2992046316687 +0.2873761381011288, 319.32951881256776 +0.2978130072093433, 321.2486163873796 +0.30862892044245194, 323.24171852037404 +0.3198376438491737, 325.3729403946062 +0.33145344343083155, 327.26509653212355 +0.34349110329853155, 329.4865237681474 +0.3559659444897699, 331.53073582017134 +0.36889384446841844, 334.4268849447033 +0.4118970982150999, 342.274238611865 +0.4268562946484919, 347.8766936049769 +0.4423587761861066, 353.6391973657495 +0.4584242737477019, 359.6361523070299 +0.4750732348366332, 365.5934490109371 +0.49232684956459355, 371.9368728289524 +0.5102070776215141, 384.36104047810585 +0.5287366762249531, 399.43287005892876 +0.5479392290845448, 414.05401146476294 +0.5678391764183731, 429.2933233880519 +0.5884618460594737, 445.1795576768337 +0.6464923352317284, 512.9377179157074 +0.6656400378471785, 537.6271269271311 +0.6853548539386427, 563.5049198222947 +0.7056535801788674, 590.9074178880861 +0.7265535107216625, 619.496099038419 +0.7456503246236443, 647.4982856182813 +0.7627713390984185, 679.1227696999097 +0.7790212344563301, 711.3909582635638 +0.79561731363842, 745.720663452266 +0.8125669516608036, 780.8764637272163 +0.8298776806551467, 818.8494521328103 +0.8489326549689583, 860.4094744726675 +0.868425154058486, 905.4528683051662 +0.8883652240107086, 951.6973910993604 +0.9087631415826625, 1000.9116084137623 +0.9311380725083862, 1047.8857698881695 +0.9556122099605342, 1097.772798737779 +0.9807296283843355, 1148.81291023301 +1.0081406503468062, 1205.745836639583 +1.0363177999996016, 1265.50024779824 +1.063556493196812, 1325.7473178370237 +1.0915111312587078, 1387.018261801692 +1.1220184543019642, 1449.7075275386158 +1.170334099757356, 1458.8898287383624 +1.2128380595250574, 1463.1256538320197 +1.256885669602792, 1465.1065788725257 +1.3025329919737914, 1469.3604540380259 +1.3498381246691766, 1469.6444844643904 +1.398861275712749, 1478.7625052349354 +1.4496648397512706, 1492.8342275774417 +1.5023134774678115, 1507.3311686338693 +1.5568741978791918, 1521.6747468677868 +1.6134164436223084, 1536.451758745519 +1.6665984973394812, 1548.4763831466105 + diff --git a/examples/nIFTyCluster/Baryonic/data/S/G2-anarchy.csv b/examples/nIFTyCluster/Baryonic/data/S/G2-anarchy.csv new file mode 100644 index 0000000000000000000000000000000000000000..556547e4fbd7070bc677b488b88978336fa8c836 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/S/G2-anarchy.csv @@ -0,0 +1,132 @@ +# R [h^-1 Mpc], S [keV h^-2 cm^2] +0.021602650640268874, 347.54066206129767 +0.022387211385683413, 333.0078425270195 +0.023200265651337454, 318.4665915532779 +0.024042848259200337, 304.6780602024425 +0.024916031613698732, 291.3738686075044 +0.025820927066628776, 281.0305042268024 +0.026758686331638883, 281.5197964490719 +0.0277305029500834, 283.21166621618903 +0.028737613810112878, 285.18918226754585 +0.029781300720934344, 287.06951326666643 +0.030862892044245194, 288.9622418070897 +0.03198376438491738, 290.9799110614818 +0.03314534434308316, 292.84181500312786 +0.034349110329853175, 295.0005886407969 +0.03559659444897701, 297.00300915307866 +0.036889384446841866, 298.9612319738122 +0.03822912573329066, 299.1346349691304 +0.03961752347583191, 296.658774295449 +0.04105634476990667, 294.14654654760056 +0.0425474208879748, 291.655593371091 +0.04409264961028314, 289.18573460415513 +0.04569399764028186, 287.2360188471269 +0.04735350310776388, 287.06951326666643 +0.04907327816291211, 286.84765595907857 +0.05085551166455757, 286.4598181644131 +0.052702471966068344, 286.4598181644131 +0.05461650980241659, 285.9066736410082 +0.056600061282097, 285.2443099285707 +0.05865565098770536, 283.92418246858807 +0.060785895189123244, 282.6647937677751 +0.06299350517339852, 281.4109912762306 +0.06528129069555988, 280.1086046406557 +0.067652163554757, 279.243697231575 +0.070109141300279, 279.243697231575 +0.07265535107216625, 279.243697231575 +0.07529403358130603, 279.243697231575 +0.0780285472340751, 279.243697231575 +0.0808623724067817, 279.3516644385573 +0.08379911587534444, 279.8380336925424 +0.0868425154058486, 280.3252497467486 +0.08999644451182047, 281.0305042268024 +0.09326491738427596, 281.4109912762306 +0.0966520940008174, 282.22805622177844 +0.10016228542028172, 281.6830830920368 +0.10379995926967846, 280.9218881615315 +0.10756974543040143, 280.00034488227715 +0.11147644193095074, 279.3516644385573 +0.11552502105366615, 278.59676972331647 +0.11972063566324288, 278.65062305731004 +0.12406862576508564, 280.1627502154776 +0.12857452530184735, 281.57421481020026 +0.13324406919680348, 282.93809786528726 +0.13808320065302598, 284.3085872674406 +0.14309807871764735, 286.1278031622636 +0.14829508612084202, 288.79473556606786 +0.1536808373995024, 291.7119710028077 +0.1592621873159487, 294.6017275194088 +0.1650462395823884, 297.5201105359659 +0.17104035590222783, 300.4674036322541 +0.1772521653397455, 303.03361614635133 +0.18368957403005057, 305.4445825443507 +0.19036077524168585, 307.815229514304 +0.19727425980468238, 310.3841999528984 +0.20443882691733817, 312.7931847743365 +0.2118635953454751, 315.0990360795067 +0.21955801502842848, 317.2992046316687 +0.22753187910654032, 319.70006019199053 +0.23579533638546504, 321.93235524217675 +0.244358904253151, 324.117584616376 +0.2532334820659387, 326.6331583531207 +0.262430365020812, 329.23188511906943 +0.27196125853146014, 331.9795951061551 +0.2818382931264455, 334.620858668927 +0.29207403988844066, 337.4135440581907 +0.30268152645418456, 340.16378233113164 +0.31367425359552153, 342.9364376370908 +0.3250662124026278, 345.66487495802886 +0.33687190209129425, 348.54973171715926 +0.34910634845693106, 351.390740411305 +0.3617851229987809, 354.2549060029196 +0.37492436273868185, 357.4877325707256 +0.3885407907596031, 361.1686656291895 +0.40265173749009725, 364.8169801593987 +0.4172751627617544, 368.787159375885 +0.4289378456458218, 373.6662221042858 +0.44959026763494253, 375.98453541775336 +0.4659183970566755, 384.8814266853222 +0.4828395282171145, 392.6204990176873 +0.5003751976348053, 400.36039018631766 +0.518547723987267, 408.48965519198816 +0.537380236517285, 416.9451298453705 +0.5568967044708579, 430.2901822543164 +0.5771219676042677, 445.1795576768337 +0.5980817677990957, 460.5841516881443 +0.6198027818254311, 476.70603555923617 +0.6423126552949634, 493.2968804088424 +0.6634848122245312, 513.5439457556074 +0.6831357952014436, 538.0082814289949 +0.7033687977285311, 563.5049198222947 +0.724201057964169, 589.9310731968759 +0.7456503246236443, 617.7424240172813 +0.7677348721007459, 646.7121019541034 +0.7891927712315969, 676.9603775992875 +0.8086237240678166, 713.3743737236715 +0.827190682368812, 750.7203163463294 +0.8461839600199457, 790.0213606403505 +0.8642108575959873, 828.7746181014514 +0.8826217958198916, 869.0768303282124 +0.9028878374790444, 914.5739698886133 +0.9221227406891038, 959.3883928040095 +0.9417674196056702, 1006.0931089347177 +0.9649549587977603, 1058.5220462361754 +0.9903179430790581, 1112.1619988490186 +1.0163475708816814, 1167.5888402277278 +1.0430613643386564, 1226.4297004385676 +1.070477306136718, 1288.578269992149 +1.0986138516215547, 1353.5164153760545 +1.125663154040737, 1416.7698328364834 +1.159002858386986, 1479.3342562146825 +1.2010952923968496, 1492.5457153919215 +1.2447164310065815, 1496.879258933145 +1.289921793404095, 1501.8058207968631 +1.336768915112072, 1507.039854701129 +1.3853174212167954, 1511.9998573405976 +1.4356291022565106, 1523.1460300009153 +1.4877679928658685, 1536.7487580603745 +1.5418004532765797, 1550.4729677158282 +1.5977952537779734, 1564.3197438804 +1.6558236622449927, 1578.5952679249924 +1.6883589669589307, 1582.8726801377911 + diff --git a/examples/nIFTyCluster/Baryonic/data/S/G3-music.csv b/examples/nIFTyCluster/Baryonic/data/S/G3-music.csv new file mode 100644 index 0000000000000000000000000000000000000000..de958bcf61116f4ad7fc32c7379c031cd0458155 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/S/G3-music.csv @@ -0,0 +1,124 @@ +# R [h^-1 Mpc], S [keV h^-2 cm^2] +0.02532334820659387, 18.658664281116415 +0.0262430365020812, 19.379080441170494 +0.027196125853146014, 20.170150618524662 +0.02818382931264455, 20.993512938294945 +0.029207403988844083, 21.842040552870667 +0.030268152645418454, 22.742440583199127 +0.03136742535955217, 23.657084375555222 +0.03250662124026278, 24.622786230680124 +0.03368719020912944, 25.622955867948182 +0.03491063484569312, 26.6585989108688 +0.036178512299878104, 27.74146260277447 +0.03749243627386818, 28.879473556606786 +0.038854079075960314, 30.03512753592241 +0.040265173749009724, 31.237026683706542 +0.04172751627617544, 32.34917241797587 +0.0432429678667737, 33.526825067636985 +0.04481345732514833, 34.72720705460065 +0.04644098350557375, 35.970567072192644 +0.04812761785631392, 37.26564602440962 +0.04987550705607678, 38.62228001228843 +0.05168687574621804, 40.23774124901132 +0.053564029362173436, 41.96941641753095 +0.05550935706772161, 43.77561611939136 +0.05752533479581356, 45.65072321975329 +0.059614528399838, 47.615351982968264 +0.06177959691933385, 49.66453069205537 +0.06402329596430621, 51.79188656713497 +0.06634848122245313, 54.031249340532085 +0.06875811209376749, 56.35654320402382 +0.07125525545713905, 58.7591898877582 +0.07384308957375194, 61.2524283082932 +0.07652490813224404, 63.826780400584205 +0.07930412444077876, 66.52218522644235 +0.08218427577136243, 69.22429494078924 +0.08516902786193882, 71.980491427036 +0.08826217958198916, 74.84642711795493 +0.09146766776757671, 77.81143021840522 +0.09478957223198951, 80.87825647208776 +0.09823212095835863, 84.08220742115354 +0.10179969548086092, 87.39618739122974 +0.10549683646135512, 90.73549611521734 +0.10932824946854927, 94.16598753972622 +0.11329881096705453, 97.76396261255954 +0.11741357452394861, 101.49941221269262 +0.12167777724074763, 105.37758908514832 +0.1260968464189731, 109.40394667635054 +0.13067640646779777, 113.54024742907998 +0.13542228606256182, 117.8784908934817 +0.14034052556327067, 122.42981184995563 +0.14543738470251644, 127.1077154403787 +0.15071935055260746, 132.21966824345617 +0.1561931457820468, 138.4440317342558 +0.1618657372118677, 144.8493816848817 +0.16774434468271637, 151.6976184449593 +0.1738364502439674, 158.96177569439814 +0.18014980767656838, 166.57378270631526 +0.1866924523617326, 174.5502965343922 +0.19347271150804102, 182.90877186815007 +0.20049921474997057, 191.29739556707423 +0.20778090513133704, 199.26030961825003 +0.215327050487633, 207.67507214858904 +0.22314725524174683, 216.15254127594775 +0.23125147262807652, 225.23712391628064 +0.2396500173605962, 234.6581586827919 +0.24835357876099937, 244.2843113774384 +0.25737323436362647, 252.59079922912176 +0.2667204640144951, 260.3732759394005 +0.2764071644823743, 268.55120983870427 +0.286445664600502, 277.09309465818933 +0.29684874095821584, 285.79617297485805 +0.30762963416246963, 292.89842193394907 +0.31880206568993263, 299.3081385413651 +0.33038025535111926, 305.9763812506314 +0.34237893938877834, 312.7931847743365 +0.35481338923357547, 319.6382734501186 +0.36769943094094104, 326.696297220767 +0.38105346533382145, 333.9747167542396 +0.3948924888769701, 341.3493076134749 +0.4092341153093485, 351.32282897906805 +0.4240965980621671, 363.1987792063031 +0.43949885349110007, 375.47617842052716 +0.4554604849522437, 388.0935777185204 +0.47200180775246064, 401.29006410136617 +0.4891438750058646, 414.8550830379401 +0.5060871986919684, 430.68957364370954 +0.5236174176295533, 450.54649159508483 +0.5417548611260561, 471.2187143235674 +0.5596123933458592, 492.83943138173225 +0.5789966571661932, 516.2198715026071 +0.6000245419615925, 540.9394574810825 +0.620808631374834, 566.3608951034978 +0.6412719643924004, 592.3469781974583 +0.6634848122245312, 619.7888618396709 +0.6864670849437778, 648.0885505033483 +0.7067987530571936, 678.9423068431375 +0.7253763306947708, 711.832241099146 +0.744442203464997, 747.3078397587705 +0.7640092057718629, 784.5514365893058 +0.784090509360272, 823.432275064956 +0.804699632182747, 864.46968700977 +0.8258504474991899, 907.0700188496438 +0.8475571932158205, 952.2756868244468 +0.8698344814695815, 999.7342706432105 +0.892697308464461, 1049.000326262132 +0.9161610645663522, 1101.2793780100944 +0.9402415446632512, 1155.8566353013707 +0.9649549587977603, 1213.4610872136634 +0.9903179430790581, 1273.2594187999182 +1.0213037571352885, 1332.4586472492138 +1.0583952627257696, 1395.1853736668513 +1.0968338501979686, 1460.3004061318138 +1.1366684426022513, 1527.8637024122213 +1.1779497397665373, 1599.4801201741793 +1.220730282824961, 1661.2364875592195 +1.2650645210900537, 1710.4354545219762 +1.3110088813535938, 1760.7511349365304 +1.3586218397042937, 1813.2477517600967 +1.4079639959537649, 1853.286591902295 +1.459098150765452, 1848.635713609354 +1.5120893855847402, 1841.1473988916746 +1.5670051454719254, 1833.689417276887 +1.5977952537779734, 1829.087718681499 + diff --git a/examples/nIFTyCluster/Baryonic/data/kT/AREPO.csv b/examples/nIFTyCluster/Baryonic/data/kT/AREPO.csv new file mode 100644 index 0000000000000000000000000000000000000000..a5c18c1af29a88cfe29ffecb1a27df116aa52d73 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/kT/AREPO.csv @@ -0,0 +1,156 @@ +# R [h^-1 Mpc], kT [keV] +0.023571760518999674, 11.7465160158983 +0.02427417836094951, 11.670187891689121 +0.024997527640086278, 11.593859767479943 +0.02574243209492653, 11.517531643270765 +0.026509534050848896, 11.438772687080402 +0.027299494973966353, 11.360013730890039 +0.028112996041503385, 11.28222710749215 +0.028950738729169836, 11.228262637509863 +0.029813445416038028, 11.200551152924366 +0.03070186000744467, 11.173812001131342 +0.031616748576454703, 11.14512818375337 +0.03255890002444023, 11.117902865564108 +0.03352912676134405, 11.091163713771083 +0.03452826540621455, 11.06296606278935 +0.03555717750861585, 11.021641919109221 +0.03661675029153537, 10.965246617145752 +0.037707897416429347, 10.909337481578518 +0.03883155977106613, 10.854400678803758 +0.03998870628084644, 10.797519210444051 +0.041180334744300266, 10.743554740461766 +0.04240747269348094, 10.686673272102059 +0.043671178279997926, 10.649724625988064 +0.044972541187453106, 10.62590247257246 +0.04631268357106623, 10.602080319156855 +0.047692761025301046, 10.57874433213749 +0.049113963580325215, 10.555408345118122 +0.05057751672816446, 10.532072358098755 +0.05208468247943459, 10.50825020468315 +0.05363676045156391, 10.476163222531522 +0.0552350889894429, 10.43678374443634 +0.056881046319469185, 10.397890432737396 +0.05857605173798106, 10.358510954642215 +0.06032156683510627, 10.319131476547033 +0.062119096755079574, 10.28023816484809 +0.0639701914941172, 10.240858686752908 +0.06587644723696665, 10.197103711091597 +0.06783950773328443, 10.149945570656625 +0.06986106571502887, 10.102787430221653 +0.07194286435608972, 10.055629289786683 +0.07408669877541368, 10.00895731574795 +0.07629441758492166, 9.96179917531298 +0.07856792448355247, 9.91464103487801 +0.08090917989880797, 9.880609387141433 +0.08332020267721445, 9.852411736159699 +0.08580307182515849, 9.823727918781728 +0.08835992830159839, 9.795044101403755 +0.09099297686419607, 9.76684645042202 +0.09370448797046334, 9.738162633044048 +0.0964967997355592, 9.708020316477366 +0.0993723199484293, 9.658431344061214 +0.10233352814802307, 9.604466874078927 +0.10538297776138171, 9.547099239322984 +0.10852329830543826, 9.492162436548224 +0.11175719765443, 9.435767134584754 +0.11508746437487757, 9.379857999017522 +0.11851697013014431, 9.32686586182771 +0.12204867215664957, 9.30401604120458 +0.12568561581387086, 9.290889548506186 +0.12943093721033397, 9.278249222204028 +0.13328786590785513, 9.265608895901874 +0.13725972770636735, 9.25248240320348 +0.14134994751173208, 9.23838357771261 +0.14556205228900923, 9.225743251410455 +0.14989967410373198, 9.205810429164746 +0.15436655325380888, 9.1853914405228 +0.15896654149475398, 9.165944784673327 +0.16370360536102607, 9.146011962427618 +0.16858182958634063, 9.125106807389434 +0.17360542062590442, 9.105660151539963 +0.1787787102836094, 9.08329649731307 +0.18410615944731382, 9.04343085282165 +0.18959236193543158, 9.00064820995281 +0.1952420484581465, 8.957379400687737 +0.20106009069666717, 8.914110591422661 +0.20705150550404033, 8.871327948553823 +0.21322145923114444, 8.828545305684983 +0.2195752721815947, 8.781387165250012 +0.2261184231993994, 8.709434538606965 +0.23285655439332514, 8.633106414397785 +0.23979547600204393, 8.557264456584845 +0.24694117140425711, 8.481422498771902 +0.2542998022781169, 8.40558054095896 +0.26187771391439385, 8.32973858314602 +0.2696814406879725, 8.250493460559419 +0.27771771169239234, 8.161525010048084 +0.2859934565422934, 8.069639561159327 +0.29451581134876986, 7.976781779478097 +0.30329212487278334, 7.885868663381814 +0.3123299648619433, 7.793497048096819 +0.3216371245761173, 7.702583932000536 +0.33122162950749906, 7.609239983923071 +0.3410917443009288, 7.510548205486998 +0.3512559798804326, 7.412342593447162 +0.3617231007881269, 7.313164648614854 +0.3725021327418156, 7.214472870178782 +0.38360237041779705, 7.114808758950237 +0.3950333854655921, 7.016603146910402 +0.4068050347615034, 6.922773032436698 +0.4189274689081246, 6.847903407416229 +0.43141114098712613, 6.78227094392426 +0.4426391366046959, 6.7266656623546766 +0.45921856937733685, 6.594173165220239 +0.47239819753814777, 6.532381416258541 +0.48647525055199764, 6.466262786370336 +0.5009717874304928, 6.408408985218156 +0.5145249837853954, 6.374971540854757 +0.5427412930601848, 6.3510413504622125 +0.5589145087816455, 6.313120371555742 +0.5755696721826314, 6.2873535525551905 +0.5927211448823655, 6.261100567158403 +0.6103837164637591, 6.245543242478826 +0.6285726172263562, 6.272282394271851 +0.6473035313193026, 6.3019385444422955 +0.6665926102656677, 6.33159469461274 +0.6864564868897791, 6.3636816767643705 +0.7069122896595774, 6.393337826934815 +0.7279776574563634, 6.422993977105261 +0.7496707547846697, 6.475499947898836 +0.7709805600530688, 6.589894900933356 +0.7918385228733045, 6.705408036679222 +0.8132607730900733, 6.819851606353366 +0.8352625768282906, 6.935899525135092 +0.8578596132197389, 7.0530170099885385 +0.8810679855764783, 7.167460579662683 +0.9061128297044159, 7.286425496821829 +0.9331141993259596, 7.294204159161619 +0.9609201861403502, 7.235378025216965 +0.9895547670360233, 7.176551891272312 +1.0190426333917137, 7.1177257573276576 +1.0494092123676415, 7.058899623383004 +1.0777997314921062, 7.0083923366628476 +1.117562184309672, 6.887005076142133 +1.138424224089001, 6.752290682822991 +1.152694677254384, 6.622160144096938 +1.1676633986322162, 6.490692647781236 +1.1842557462550283, 6.341526379564435 +1.199253144232993, 6.203246766006224 +1.2182543524937854, 6.041029245128543 +1.235932118693666, 5.892308629441626 +1.2515839455194286, 5.755365973473065 +1.2684010212049035, 5.614985426559686 +1.2884978223498615, 5.4527679056820055 +1.3071948729336986, 5.304047289995088 +1.3237491702686597, 5.165767676436877 +1.3446730633428137, 5.0093436384476835 +1.3636506832733684, 4.85626199443262 +1.392620482339304, 4.727839790404454 +1.4283884082969245, 4.611197668249551 +1.4670317591890156, 4.490871485180941 +1.5047108569802587, 4.3760713934828885 +1.5412991303654127, 4.263172752579008 +1.5787770774995773, 4.150274111675127 +1.610703903524253, 4.051636351727526 +1.6765075331554564, 3.8782775176027524 + diff --git a/examples/nIFTyCluster/Baryonic/data/kT/G2-anarchy.csv b/examples/nIFTyCluster/Baryonic/data/kT/G2-anarchy.csv new file mode 100644 index 0000000000000000000000000000000000000000..c65e0a1356865586472d6a7142f317c7344d864a --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/kT/G2-anarchy.csv @@ -0,0 +1,162 @@ +# R [h^-1 Mpc], kT [keV] +0.02164182018928114, 13.29349748872382 +0.022286727497794135, 13.240505351534008 +0.02295085247991018, 13.182165383985591 +0.023634767805490255, 13.123825416437175 +0.02433906320945621, 13.069860946454888 +0.02506434600031464, 13.011034812510236 +0.02581124158383433, 12.958042675320424 +0.02658039400232886, 12.932762022716108 +0.027372466490009312, 12.91137070128169 +0.028188142044886032, 12.88997937984727 +0.029028124017712563, 12.869074224809088 +0.029893136718479593, 12.847682903374668 +0.03078392604098186, 12.826291581940248 +0.031701260105996665, 12.803441761317119 +0.03264592992362848, 12.780105774297752 +0.033618750075390884, 12.756769787278385 +0.03462055941661393, 12.732947633862782 +0.035652221799782655, 12.709125480447177 +0.03671462681943038, 12.685789493427812 +0.03780869057922936, 12.65564717686113 +0.03893535648193969, 12.59925187489766 +0.04009559604289855, 12.540425740953006 +0.041290409727750096, 12.481599607008352 +0.042520827815139585, 12.4227734730637 +0.04378791128511442, 12.363947339119045 +0.04509275273399938, 12.304635038778155 +0.04643647731653373, 12.241919573663607 +0.047820243716083746, 12.181634940530241 +0.04924524514376632, 12.118433309019458 +0.05071271036734574, 12.057662509489857 +0.05222390477079071, 11.995433210771544 +0.053780131445405194, 11.934176244845707 +0.05538273231347402, 11.875350110901053 +0.057033089285392136, 11.83013663605103 +0.05873262545127529, 11.786381660389718 +0.06048280630807974, 11.742626684728405 +0.062285141023288935, 11.698385542670856 +0.06414118373625706, 11.65511673340578 +0.06605253489833143, 11.610875591348229 +0.06802084265290938, 11.562745118120786 +0.0700478042566196, 11.511697646515922 +0.0721351675428535, 11.460650174911057 +0.07428473242890858, 11.409602703306192 +0.0764983524680429, 11.358069065305092 +0.0787779364477804, 11.307507760096463 +0.08112545003584301, 11.255487955699124 +0.08354291747513143, 11.195689488961996 +0.08603242332921363, 11.13443252303616 +0.08859611427982851, 11.075120222695269 +0.09123620097795254, 11.016294088750616 +0.09395495995002759, 10.957467954805962 +0.0967547355609916, 10.898155654465072 +0.09963794203580698, 10.830092358991918 +0.10260706554122782, 10.761542897122528 +0.10566466632960254, 10.69104876966819 +0.10881338094655969, 10.622499307798801 +0.11205592450448101, 10.552005180344464 +0.11539509302372193, 10.4824833856826 +0.11883376584359842, 10.417823254983105 +0.12237490810521909, 10.36531728418953 +0.12602157330830355, 10.312811313395954 +0.12977690594419172, 10.26030534260238 +0.13364414420731457, 10.20877170460128 +0.1376266227874642, 10.15675190020394 +0.14172777574527118, 10.10521826220284 +0.1459511394733686, 10.059518620956577 +0.15030035574579625, 10.017708310880213 +0.1547791748582744, 9.97541183440761 +0.15939145886205475, 9.933115357935009 +0.16414118489413773, 9.891305047858644 +0.16903244860672698, 9.848522404989804 +0.1740694676988787, 9.798447266177412 +0.1792565855533914, 9.731842469892971 +0.184598274982071, 9.66475150721229 +0.19009914208260223, 9.597174378135374 +0.19576393021035132, 9.528624916265985 +0.20159752406852474, 9.461533953585306 +0.2076049539202111, 9.39395682450839 +0.21379139992593846, 9.317142533902974 +0.22016219661048675, 9.23546657933519 +0.2267228374628075, 9.156707623144827 +0.2334789796730171, 9.075031668577044 +0.24043644901054825, 8.99627271238668 +0.2476012448476661, 8.914596757818899 +0.2549795453326809, 8.830976137666166 +0.26257771271731756, 8.741035354362356 +0.27040229884283645, 8.649636071869839 +0.2784600507896357, 8.55969528856603 +0.28675791669520684, 8.468782172469746 +0.29530305174545984, 8.378355222769699 +0.3041028243445854, 8.285983607484706 +0.3131648224687728, 8.184374830671214 +0.3224968602092636, 8.079362889084063 +0.3321069845103821, 7.973864781100675 +0.34200348210835385, 7.868366673117288 +0.35219488667689436, 7.763840897926374 +0.3626899861857299, 7.658342789942987 +0.3734978304783972, 7.550413849978416 +0.38462773907585274, 7.433247748485345 +0.3960893092126244, 7.315595480596039 +0.40789242411243315, 7.202318710272862 +0.42004726151042043, 7.09001427274216 +0.43256430242933114, 6.973334337645326 +0.4454543402172187, 6.859085234529678 +0.458728489854466, 6.766227452848446 +0.47239819753814777, 6.678717501525821 +0.48647525055199764, 6.591207550203196 +0.5009717874304928, 6.511962427616597 +0.5117853240522606, 6.458873057147537 +0.5284448457610844, 6.326733030650372 +0.544192039860134, 6.262559066347114 +0.560408486567062, 6.211511594742248 +0.577108169199062, 6.161436455929858 +0.5943054877639471, 6.115736814683599 +0.6120152713771655, 6.0783020021733645 +0.6302527910488327, 6.034060860115813 +0.6490337728518059, 5.990305884454502 +0.6683744114821556, 5.996139881209343 +0.686227468931639, 6.008719436711971 +0.7088018653288362, 6.050104351191628 +0.72992354082749, 6.065175509474971 +0.7516746237779194, 6.087052997305626 +0.7740738699715566, 6.111361317117467 +0.7971405941060102, 6.164839620703516 +0.8208946864399801, 6.277630224630455 +0.8453566299444747, 6.387989996576209 +0.8705475179651194, 6.502725266088097 +0.8964890724107856, 6.615029703618799 +0.923203662484226, 6.727334141149502 +0.9507143239708659, 6.835749247510309 +0.9790447791023836, 6.873184060020543 +1.0082194570122083, 6.893116882266252 +1.0382635148005739, 6.912563538115725 +1.066352500322889, 6.934116915015558 +1.0995955410507865, 6.938573440314395 +1.1369057642766107, 6.971875838456615 +1.1610031825856024, 6.900756639921402 +1.1723482700279304, 6.779475487145898 +1.1892339231617177, 6.659340298018668 +1.2040647592568248, 6.474649156705421 +1.216990323399776, 6.358333846405765 +1.2327939784612199, 6.210377206484363 +1.2465824370294991, 6.079578188963486 +1.2599644259345197, 5.957915048305225 +1.2734900697008127, 5.83692038644179 +1.287160910454834, 5.7139202881938775 +1.3009785068776827, 5.592257147535616 +1.3149444343828007, 5.471930964467006 +1.329060285295607, 5.348930866219094 +1.3433276690350335, 5.227267725560832 +1.3577482122970341, 5.106273063697397 +1.3723235592400478, 4.98260448665466 +1.3884960391215562, 4.8573761257573285 +1.418887678883871, 4.734376027509416 +1.4533890916018033, 4.61612955624693 +1.4887294343472832, 4.498477288357623 +1.5249291063890833, 4.380230817095137 +1.5620090030208615, 4.263172752579008 +1.5957251562683945, 4.147387981005405 +1.6520730623808917, 3.9976487309644675 +1.6809888357022051, 3.909027542164729 diff --git a/examples/nIFTyCluster/Baryonic/data/kT/G3-music.csv b/examples/nIFTyCluster/Baryonic/data/kT/G3-music.csv new file mode 100644 index 0000000000000000000000000000000000000000..c3cdead7c08418c3c21f9f74ce7e8cb759742aec --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/kT/G3-music.csv @@ -0,0 +1,166 @@ +# R [h^-1 Mpc], kT [keV] +0.020903674110940202, 4.081130446432558 +0.02152658531207827, 4.109328097414295 +0.02216805872206269, 4.138984247584739 +0.022828647478478115, 4.167668064962712 +0.023508921201925326, 4.196351882340684 +0.024209466487200678, 4.225521866114892 +0.02493088740911227, 4.255664182681572 +0.02567380604336903, 4.2872649984369655 +0.026438863002991773, 4.326158310135911 +0.027226717990708957, 4.365537788231091 +0.02803805036781311, 4.402486434345089 +0.028873559739969072, 4.4423520788365085 +0.029733966560478328, 4.481245390535452 +0.030620012751520577, 4.518680203045687 +0.0315324623439073, 4.5580596811408665 +0.03247210213589987, 4.596952992839812 +0.03343974237165944, 4.636332470934994 +0.034436217439914374, 4.673767283445228 +0.035462386593447165, 4.712660595144172 +0.03651913469002152, 4.752040073239355 +0.03760737295538841, 4.789474885749588 +0.038728039769028985, 4.831285195825954 +0.03988210147331202, 4.882332667430818 +0.04107055320676348, 4.934838638224393 +0.0422944197621668, 4.987830775414205 +0.04355475647023386, 5.04033674620778 +0.0448526501096085, 5.092842717001355 +0.04618921984398736, 5.145834854191168 +0.0475656181871662, 5.20660565372077 +0.04885244946031935, 5.317883739970526 +0.05004033666675292, 5.4289997707548725 +0.05125710832075868, 5.5424926150319305 +0.05250346677126926, 5.654202849189456 +0.053780131445405194, 5.768289896839693 +0.05508783926374505, 5.880000130997217 +0.05650270984832897, 5.999494429343377 +0.05795391982828354, 6.117681480268546 +0.059521794256896896, 6.230472084195485 +0.06129549165371255, 6.338401024160056 +0.063122043681252, 6.446329964124628 +0.06500302536127163, 6.553772737692961 +0.06694005864979798, 6.661215511261297 +0.06893481383572848, 6.769144451225866 +0.07098901098110824, 6.876587224794202 +0.07310442140432678, 6.959235512154459 +0.07528286920751173, 6.9859746639474825 +0.07752623284943862, 7.012713815740508 +0.0798364467653109, 7.037508301948584 +0.08221550303480891, 7.0623027881566625 +0.08466545309984463, 7.088555773553449 +0.08718840953350437, 7.113350259761527 +0.08978654786170424, 7.131824582818526 +0.09246210843912943, 7.120156589308842 +0.09521739838107475, 7.108488595799159 +0.09805479355285251, 7.095848269497002 +0.10097674061848276, 7.0836941095910815 +0.10398575915043295, 7.07153994968516 +0.10708444380222581, 7.057927290590531 +0.11027546654578914, 7.04723162987332 +0.11356157897547672, 7.037508301948584 +0.11694561468074673, 7.0302158060050335 +0.12043049168954437, 7.0238956428539545 +0.12401921498449475, 7.016116980514164 +0.12771487909407636, 7.0068798189856665 +0.13152067076100907, 7.0005596558345875 +0.13543987169015806, 6.994725659079746 +0.1394758613783224, 6.994725659079746 +0.14363212002834927, 6.9981288238534045 +0.14791223155008607, 7.005421319796955 +0.15231988665075832, 7.005421319796955 +0.15685888601743814, 7.011741482948034 +0.16153314359434728, 7.016116980514164 +0.16634668995782134, 7.018061646099111 +0.17130367579184458, 7.031674305193743 +0.17640837546715274, 7.046259297080848 +0.1816651907269902, 7.062788954552898 +0.18707865448269914, 7.076887780043766 +0.19265343472241417, 7.093903603912054 +0.19839433853623256, 7.108488595799159 +0.2043063162613311, 7.1240459204787365 +0.21039446575060364, 7.136686246780893 +0.2166640367685005, 7.148354240290577 +0.22312043551785982, 7.160022233800261 +0.2297692293016349, 7.171204060913706 +0.23661615132353644, 7.182385888027153 +0.24366710563173016, 7.194053881536837 +0.250928172209852, 7.2052357086502825 +0.25840561221973113, 7.206694207838994 +0.2661058734003419, 7.19502621432931 +0.2740355956276391, 7.1843305536121 +0.28220161664007254, 7.173634892894891 +0.2906109779347156, 7.162939232177681 +0.2992709308390943, 7.151757405064234 +0.30818894276395126, 7.140575577950788 +0.3173727036423364, 7.1240459204787365 +0.3268301325605771, 7.0963344358932385 +0.3365693845868452, 7.06862295130774 +0.34659885780321, 7.040425300326005 +0.3569272005472392, 7.012713815740508 +0.36756331886939425, 6.985002331155011 +0.378516384212649, 6.956804680173276 +0.3897958413209542, 6.923259198832936 +0.4014114163833679, 6.870753228039359 +0.4133731254208731, 6.817761090849547 +0.4256912829231158, 6.764768953659736 +0.4383765107425098, 6.710804483677451 +0.4514397472533784, 6.658298512883874 +0.46489225678403046, 6.604820209297825 +0.47874563932990405, 6.550855739315541 +0.493011840556153, 6.496405102937018 +0.5077031620983022, 6.440495967369785 +0.5228322721698535, 6.385072998198789 +0.5384122164859879, 6.330622361820266 +0.5544564295127864, 6.274227059856797 +0.5709787460516657, 6.219290257082038 +0.5879934131690222, 6.167270452684699 +0.6055151024813665, 6.1381004689104905 +0.6235589228065459, 6.114278315494888 +0.6421404331919619, 6.089483829286811 +0.6612756563310167, 6.066147842267442 +0.680981092379359, 6.042325688851841 +0.7012737331828403, 6.018503535436237 +0.7221710769294537, 5.996626047605579 +0.7436911432378863, 6.017045036247527 +0.7658524886956978, 6.051562850380341 +0.788674222860523, 6.086080664513153 +0.8121760247380967, 6.120112312249729 +0.8363781597513082, 6.15511629277878 +0.8613014972149204, 6.189147940515355 +0.8869675283310184, 6.22512425383688 +0.9133983847207084, 6.307286374800901 +0.9406168575080436, 6.415215314765472 +0.9686464169726356, 6.524602753918753 +0.9975112327878959, 6.633504026675798 +1.0272361948623585, 6.741432966640369 +1.0578469348020576, 6.850334239397414 +1.0893698480124634, 6.959235512154459 +1.1173491148395036, 6.946595185852301 +1.1414672306212095, 6.8195842148354355 +1.1645505564461764, 6.703650892418537 +1.188100684923771, 6.584948157851647 +1.21212705597258, 6.468346356639923 +1.2366393004099834, 6.350312100867857 +1.2616472438126052, 6.233041820861308 +1.287160910454834, 6.1156760438840685 +1.313190527326989, 5.997737285082694 +1.3379595395016624, 5.889252726379565 +1.3613774715763878, 5.7763116423776015 +1.381512499983937, 5.647072408711315 +1.4000753781319284, 5.515515781889636 +1.418887678883871, 5.385028721139676 +1.437952753640063, 5.25668079253316 +1.4572739988323442, 5.12512416571148 +1.4768548565291624, 4.994637104961521 +1.4966988150487839, 4.865219610283281 +1.5168094095807325, 4.734732549533325 +1.5371902228155758, 4.604245488783365 +1.557844885583188, 4.4748279941051265 +1.5787770774995773, 4.343271367283446 +1.5999905276224007, 4.212784306533488 +1.6214890151153045, 4.084436377926972 +1.6432763699211743, 3.9539493171770115 +1.6653564734444324, 3.8245318224987717 +1.683233976919969, 3.7557230718847237 + diff --git a/examples/nIFTyCluster/Baryonic/data/rho_gas/AREPO.csv b/examples/nIFTyCluster/Baryonic/data/rho_gas/AREPO.csv new file mode 100644 index 0000000000000000000000000000000000000000..22d672ecd52c751a9c0d067468a7badd1d5f8a3f --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/rho_gas/AREPO.csv @@ -0,0 +1,23 @@ +# R [h^-1 Mpc], rho_gas [h^-1 M_sun / (h^-3 Mpc)] +0.023312761045735087, 414774859727881.75 +0.028487568396294648, 352196519257984.7 +0.03490810225182011, 362003337896150.25 +0.04289496203552197, 356625573505578.2 +0.0525626371473216, 349464183288065.1 +0.06440921480692889, 324751663967946.1 +0.07914583279120943, 306632450201933.8 +0.09698373639500778, 271662379125504.47 +0.11884195027613696, 245842790067854.7 +0.1460326003558813, 209867603150716.38 +0.1789454569939827, 175392559947453.8 +0.21927621983549578, 145805123054012.47 +0.2694459027673423, 119931061606351 +0.3301736741546455, 101299135078543.39 +0.4045882827875415, 83321879761281.28 +0.497156760484846, 64308470986871.266 +0.6092060504695779, 44400170658160.59 +0.7465090318128236, 28309935701134.95 +0.9173078601577587, 17485329232128.578 +1.1240508889116114, 9358175624139.916 +1.3773897027827604, 5281411942909.416 +1.692531968159478, 3551005408166.5728 diff --git a/examples/nIFTyCluster/Baryonic/data/rho_gas/G2-anarchy.csv b/examples/nIFTyCluster/Baryonic/data/rho_gas/G2-anarchy.csv new file mode 100644 index 0000000000000000000000000000000000000000..0ad47d801a362d5ed24561140b99694e50cf5438 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/rho_gas/G2-anarchy.csv @@ -0,0 +1,25 @@ +# R [h^-1 Mpc], rho_gas [h^-1 M_sun / (h^-3 Mpc)] +0.021265069263568432, 205248241157412.56 +0.025689253667398475, 279951177802765.8 +0.031096170782104932, 262213161039334.62 +0.03759904152539372, 242507132183911.8 +0.045565623088149126, 248730378356210.84 +0.05509543653517412, 237942094300786.47 +0.06662006300083274, 237942094300786.47 +0.08055330322008279, 227621734885809.84 +0.0976156810924936, 211853106934796.5 +0.11816310190645761, 203952186463605.72 +0.14271386896315075, 186249981347129.06 +0.17255396600592612, 164781600577166.25 +0.20840096804172273, 144867217091572.5 +0.2528138864464032, 125756186881544.06 +0.306006737917123, 106434956941906.14 +0.3695637764571211, 87643129424068.7 +0.446806108699688, 69038907938108.26 +0.5401777052056586, 51805795482555.76 +0.6544909940291803, 36565289809315.08 +0.7912059173500027, 24173073924405.37 +0.9575115804830386, 15126973937525.086 +1.156169751748322, 9017385448022.969 +1.4022111788977407, 5056097601455.426 +1.6951278026832943, 3385169867783.922 diff --git a/examples/nIFTyCluster/Baryonic/data/rho_gas/G3-music.csv b/examples/nIFTyCluster/Baryonic/data/rho_gas/G3-music.csv new file mode 100644 index 0000000000000000000000000000000000000000..0c20e3fe79174d39ec03068e98b2cf5484b015de --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/data/rho_gas/G3-music.csv @@ -0,0 +1,19 @@ +# R [h^-1 Mpc], rho_gas [h^-1 M_sun / (h^-3 Mpc)] +0.025062976570965047, 3182364577568090 +0.03003516263444017, 2687691467446492.5 +0.04012229174855199, 1988943867821441.8 +0.050132679673772766, 1576470405785951.5 +0.0702154833774691, 1043846330375803.4 +0.08025535172618023, 881396497690922.2 +0.10027881421653238, 655518339776614.6 +0.15015566339373532, 376233399587329.8 +0.2005845417821262, 234945830379718.12 +0.24993291720468944, 163955475951628.3 +0.3003516263444014, 124531159006782.27 +0.40010736128087626, 82438195147480.19 +0.5013267967377272, 56622020355333.16 +0.7002025694664931, 29372421531383.96 +1.0027881421653229, 11626065702107.764 +1.2017289667307804, 6701370603962.383 +1.400593062935807, 4116124914936.153 +1.6008590055114547, 3348838975325.094 diff --git a/examples/nIFTyCluster/Baryonic/plotSolution.py b/examples/nIFTyCluster/Baryonic/plotSolution.py new file mode 100644 index 0000000000000000000000000000000000000000..e4200b4d313ea3a9f039ea7fbc8efbeb934b796b --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/plotSolution.py @@ -0,0 +1,409 @@ +""" +NIFTY Cluster Solution + +Josh Borrow (joshua.borrow@durham.ac.uk) +""" + +from swiftsimio import load, SWIFTDataset +from swiftsimio.visualisation.projection import scatter_parallel + +import numpy as np +import matplotlib.pyplot as plt +import scipy.stats as stat + +from matplotlib.colors import LogNorm + +import unyt +import h5py + +try: + plt.style.use("../../../tools/stylesheets/mnras.mplstyle") +except: + pass + +# Global constants +radial_bin_units = unyt.Mpc + +image_bounds = [-2.5, 2.5] * unyt.Mpc +image_cmap = "twilight" +image_res = 1024 +image_textcolor = "black" + +extra_data_directory = "data" +extra_data_schemes = ["G2-anarchy", "AREPO", "G3-music"] +h = 0.7 + +gas_density_units = unyt.Solar_Mass / unyt.Mpc ** 3 + +dm_density_units = gas_density_units + +temperature_units = unyt.keV + +entropy_units = unyt.keV * unyt.cm ** 2 + +info_fontsize = 5 + + +def image( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + """ + Creates the image of the gas density. + """ + + delta = image_bounds[1] - image_bounds[0] + + # Need to re-scale our x, y to 0:1 + x = data.gas.coordinates[:, 0] + y = data.gas.coordinates[:, 1] + + left = center[0] + image_bounds[0] + bottom = center[1] + image_bounds[0] + + x = x - left + x = x / delta + y = y - bottom + y = y / delta + + h = data.gas.smoothing_lengths + h = h / delta + + m = data.gas.masses + + image = scatter_parallel(y, x, m, h, image_res) + + ax.imshow(image, cmap=image_cmap, norm=LogNorm(), origin="lower") + + ax.text( + 0.025, + 0.975, + "Gas Density", + color=image_textcolor, + transform=ax.transAxes, + ha="left", + va="top", + ) + + ax.set_xticks([]) + ax.set_yticks([]) + + return + + +def bin_volumes(radial_bins: np.array) -> np.array: + """ + Returns the volumes of the bins. + """ + + single_vol = lambda x: (4.0 / 3.0) * np.pi * x ** 3 + outer = single_vol(radial_bins[1:]) + inner = single_vol(radial_bins[:-1]) + + return outer - inner + + +def bin_centers(radial_bins: np.array) -> np.array: + """ + Returns the centers of the bins. + """ + + outer = radial_bins[1:] + inner = radial_bins[:-1] + + return 0.5 * (outer + inner) + + +def gas_density( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + + r_gas = np.sqrt(np.sum((data.gas.coordinates - center) ** 2, axis=1)) + + mass, _, _ = stat.binned_statistic( + x=r_gas, + values=data.gas.masses, + statistic="sum", + bins=radial_bins.to(r_gas.units), + ) + + # binned_statistic strips unit info :/ + mass *= data.gas.masses.units + + density = (mass / bin_volumes(radial_bins)).to(gas_density_units) + + centers = bin_centers(radial_bins).to(radial_bin_units) + + ax.plot(centers, density, label="SWIFT") + + ax.loglog() + + ax.set_ylabel(f"Gas Density $\\left[{density.units.latex_repr}\\right]$") + ax.set_xlabel(f"Radius [${centers.units.latex_repr}$]") + + ax.set_xlim(centers[0], centers[-1]) + + for scheme_name in extra_data_schemes: + path = f"{extra_data_directory}/rho_gas/{scheme_name}.csv" + R, rho = np.loadtxt(path, delimiter=",").T + + # Correct h-factors + R /= h + rho *= (h * h) + ax.plot(R, rho, linestyle="dashed", lw=1, label=scheme_name) + + ax.legend() + + return + + +def dm_density( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + + r_dm = np.sqrt(np.sum((data.dark_matter.coordinates - center) ** 2, axis=1)) + + mass, _, _ = stat.binned_statistic( + x=r_dm, + values=data.dark_matter.masses, + statistic="sum", + bins=radial_bins.to(r_dm.units), + ) + + # binned_statistic strips unit info :/ + mass *= data.dark_matter.masses.units + + density = (mass / bin_volumes(radial_bins)).to(dm_density_units) + + centers = bin_centers(radial_bins).to(radial_bin_units) + + ax.plot(centers, density) + + ax.loglog() + + ax.set_ylabel(f"Dark Matter Density $\\left[{density.units.latex_repr}\\right]$") + ax.set_xlabel(f"Radius [${centers.units.latex_repr}$]") + + ax.set_xlim(centers[0], centers[-1]) + + return + + +def get_gas_temperatures(data: SWIFTDataset) -> np.array: + """ + We store the internal energy, not temperature. We can assume it's all ionized. + """ + + H_frac = data.metadata.hydro_scheme["Hydrogen mass fraction"][0] + gas_gamma = data.metadata.hydro_scheme["Adiabatic index"][0] + mu = 4.0 / (8.0 - 5.0 * (1.0 - H_frac)) + + T = mu * (gas_gamma - 1.0) * data.gas.internal_energies * unyt.mh / unyt.kb + + return T.to(unyt.K) + + +def temperature( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + + r_gas = np.sqrt(np.sum((data.gas.coordinates - center) ** 2, axis=1)) + temperatures = get_gas_temperatures(data) + + temp, _, _ = stat.binned_statistic( + x=r_gas, values=temperatures, statistic="mean", bins=radial_bins.to(r_gas.units) + ) + + # binned_statistic strips unit info :/ + temp *= temperatures.units + + kT = (temp * unyt.kb).to(temperature_units) + + centers = bin_centers(radial_bins).to(radial_bin_units) + + ax.plot(centers, kT) + + ax.semilogx() + + ax.set_ylabel(f"Gas Temperature (kT) [${kT.units.latex_repr}$]") + ax.set_xlabel(f"Radius [${centers.units.latex_repr}$]") + + for scheme_name in extra_data_schemes: + path = f"{extra_data_directory}/kT/{scheme_name}.csv" + R, kT = np.loadtxt(path, delimiter=",").T + + # Correct h-factors + R /= h + ax.plot(R, kT, linestyle="dashed", lw=1, label=scheme_name) + + ax.set_xlim(centers[0], centers[-1]) + + return + + +def entropy( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + + r_gas = np.sqrt(np.sum((data.gas.coordinates - center) ** 2, axis=1)) + + # Need temperatures _and_ densities here. + temperatures = get_gas_temperatures(data) + + temp, _, _ = stat.binned_statistic( + x=r_gas, values=temperatures, statistic="mean", bins=radial_bins.to(r_gas.units) + ) + + # binned_statistic strips unit info :/ + temp *= temperatures.units + + mass, _, _ = stat.binned_statistic( + x=r_gas, + values=data.gas.masses, + statistic="sum", + bins=radial_bins.to(r_gas.units), + ) + + # binned_statistic strips unit info :/ + mass *= data.gas.masses.units + + density = mass / bin_volumes(radial_bins) + + # Really need the number density + density = density / unyt.mh + + entropy = unyt.kb * temp / (density ** (2.0 / 3.0)) + entropy.convert_to_units(entropy_units) + + centers = bin_centers(radial_bins).to(radial_bin_units) + + ax.plot(centers, entropy) + + ax.loglog() + + ax.set_ylabel(f"Gas Entropy (T $n_e^{{2/3}}$) [${entropy.units.latex_repr}$]") + ax.set_xlabel(f"Radius [${centers.units.latex_repr}$]") + + for scheme_name in extra_data_schemes: + path = f"{extra_data_directory}/S/{scheme_name}.csv" + R, S = np.loadtxt(path, delimiter=",").T + + # Correct h-factors + R /= h + S /= (h * h) + ax.plot(R, S, linestyle="dashed", lw=1, label=scheme_name) + + ax.set_xlim(centers[0], centers[-1]) + + return + + +def info( + data: SWIFTDataset, ax: plt.Axes, radial_bins: np.array, center: np.array +) -> None: + + metadata = data.metadata + + try: + viscosity = metadata.viscosity_info + except: + viscosity = "No info" + + try: + diffusion = metadata.diffusion_info + except: + diffusion = "No info" + + output = ( + "$\\bf{SWIFT}$\n" + + metadata.code_info + + "\n\n" + + "$\\bf{Compiler}$\n" + + metadata.compiler_info + + "\n\n" + + "$\\bf{Hydrodynamics}$\n" + + metadata.hydro_info + + "\n\n" + + "$\\bf{Viscosity}$\n" + + viscosity + + "\n\n" + + "$\\bf{Diffusion}$\n" + + diffusion + ) + + ax.text( + 0.5, + 0.45, + output, + ha="center", + va="center", + fontsize=info_fontsize, + transform=ax.transAxes, + ) + + ax.axis("off") + +def get_center(snapshot): + catalogue_filename = f"halo_0303.properties" + + with h5py.File(catalogue_filename, "r") as handle: + highest_mass = handle["Mass_200crit"][...].argsort()[-1] + x = handle["Xcmbp"][highest_mass] + y = handle["Ycmbp"][highest_mass] + z = handle["Zcmbp"][highest_mass] + + return [x, y, z] * unyt.Mpc + + + +if __name__ == "__main__": + import matplotlib.gridspec as gridspec + + snapshot = "nifty_0303" + center = get_center(snapshot) + radial_bins = np.logspace(-1.5, 0.5, 25) * unyt.Mpc + + # Perform plotting to create the following figure structure: + # +---------------------+ +---------+ + # | | | | + # | | | Gas | + # | | | Density | + # | | | | + # | Image | +---------+ + # | | +---------+ + # | | | | + # | | | DM | + # | | | Density | + # | | | | + # +---------------------+ +---------+ + # +---------+ +---------+ +---------+ + # | | | | | | + # | Entropy | | Temp | | SWIFT | + # | | | | | Info | + # | | | | | | + # +---------+ +---------+ +---------+ + + fig = plt.figure(figsize=(8, 8)) + gs = gridspec.GridSpec(3, 3, figure=fig) + + axes = { + k: plt.subplot(x) + for k, x in { + "image": gs[0:2, 0:2], + "gas_density": gs[0, 2], + "dm_density": gs[1, 2], + "entropy": gs[2, 0], + "temperature": gs[2, 1], + "info": gs[2, 2], + }.items() + } + + data = load(f"{snapshot}.hdf5") + + for name, ax in axes.items(): + try: + locals()[name](data, ax, radial_bins, center) + except KeyError: + pass + + fig.tight_layout() + fig.savefig("nifty_cluster.pdf") diff --git a/examples/nIFTyCluster/Baryonic/run.sh b/examples/nIFTyCluster/Baryonic/run.sh index 1977ac4b76e41030562634acc6cc56ef37ede364..7c9451fa36f55102ffae74dde5f462f6a6d1a15d 100755 --- a/examples/nIFTyCluster/Baryonic/run.sh +++ b/examples/nIFTyCluster/Baryonic/run.sh @@ -2,13 +2,12 @@ #SBATCH -J nIFTyClusterSWIFT #SBATCH -N 1 -#SBATCH --tasks-per-node=2 #SBATCH -o nifty_%j.out #SBATCH -e nifty_%j.err -#SBATCH -p <CHANGEME> -#SBATCH -A <CHANGEME> +#SBATCH -p cosma7 +#SBATCH -A dp004 #SBATCH --exclusive #SBATCH -t 72:00:00 -mpirun -np 2 ../../swift_mpi --cosmology --hydro --self-gravity -v 1 --pin --threads=14 nifty.yml +../../swift --cosmology --hydro --self-gravity -v 1 --pin --threads=56 nifty.yml diff --git a/examples/nIFTyCluster/Baryonic/run_vr_swift.sh b/examples/nIFTyCluster/Baryonic/run_vr_swift.sh new file mode 100644 index 0000000000000000000000000000000000000000..92483282cba81bbd0a58bea6d1ce606c6eeecdb5 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/run_vr_swift.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +snapshot="nifty_0303" +out_name="halo_0303" +vr_loc="./stf" +config_file="vrconfig_swift.cfg" + +export OMP_NUM_THREADS=16 + +$vr_loc -i $snapshot -I 2 -o $out_name -C $config_file diff --git a/examples/nIFTyCluster/Baryonic/vrconfig_swift.cfg b/examples/nIFTyCluster/Baryonic/vrconfig_swift.cfg new file mode 100644 index 0000000000000000000000000000000000000000..92b8d2f8f2c82a79215ac2ee6cbd00db121a08e3 --- /dev/null +++ b/examples/nIFTyCluster/Baryonic/vrconfig_swift.cfg @@ -0,0 +1,191 @@ +#Configuration file for analysing Hydro +#runs 3DFOF + substructure algorithm, demands subhalos and FOF halos be self-bound, calculates many properties +#Units currently set to take in as input, Mpc, 1e10 solar masses, km/s, output in same units +#To set temporally unique halo ids, alter Snapshot_value=SNAP to appropriate value. Ie: for snapshot 12, change SNAP to 12 +# This is the same as the configuration file used in the EAGLE examples. + +################################ +#input options +#set up to use SWIFT HDF input, load gas, star, bh and dark matter +################################ +HDF_name_convention=6 #HDF SWIFT naming convention +Input_includes_dm_particle=1 #include dark matter particles in hydro input +Input_includes_gas_particle=1 #include gas particles in hydro input +Input_includes_star_particle=0 #include star particles in hydro input +Input_includes_bh_particle=0 #include bh particles in hydro input +Input_includes_wind_particle=0 #include wind particles in hydro input (used by Illustris and moves particle type 0 to particle type 3 when decoupled from hydro forces). Here shown as example +Input_includes_tracer_particle=0 #include tracer particles in hydro input (used by Illustris). Here shown as example +Input_includes_extradm_particle=1 #include extra dm particles stored in particle type 2 and type 3, useful for zooms + +Halo_core_phase_merge_dist=0.25 #merge substructures if difference in dispersion normalised distance is < this value +Apply_phase_merge_to_host=1 #merge substructures with background if centrally located and phase-distance is small + +#units conversion from input input to desired internal unit +Length_input_unit_conversion_to_output_unit=1.0 #default code unit, +Velocity_input_unit_conversion_to_output_unit=1.0 #default velocity unit, +Mass_input_unit_conversion_to_output_unit=1.0 #default mass unit, +#assumes input is in 1e10 msun, Mpc and km/s and output units are the same +Gravity=43.0211349 #for 1e10 Msun, km/s and Mpc +Hubble_unit=100.0 # assuming units are km/s and Mpc, then value of Hubble in km/s/Mpc +#converting hydro quantities +Stellar_age_input_is_cosmological_scalefactor=1 +Metallicity_input_unit_conversion_to_output_unit=1.0 +Stellar_age_input_unit_conversion_to_output_unit=1.0 +Star_formation_rate_input_unit_conversion_to_output_unit=1.0 + +#set the units of the output by providing conversion to a defined unit +#conversion of output length units to kpc +Length_unit_to_kpc=1000.0 +#conversion of output velocity units to km/s +Velocity_to_kms=1.0 +#conversion of output mass units to solar masses +Mass_to_solarmass=1.0e10 +Metallicity_to_solarmetallicity=1.0 +Star_formation_rate_to_solarmassperyear=1.0 +Stellar_age_to_yr=1.0 +#ensures that output is physical and not comoving distances per little h +Comoving_units=0 + +#sets the total buffer size in bytes used to store temporary particle information +#of mpi read threads before they are broadcast to the appropriate waiting non-read threads +#if not set, default value is equivalent to 1e6 particles per mpi process, quite large +#but significantly minimises the number of send/receives +#in this example the buffer size is roughly that for a send/receive of 10000 particles +#for 100 mpi processes +MPI_particle_total_buf_size=100000000 + +################################ +#search related options +################################ + +#how to search a simulation +Particle_search_type=1 #search dark matter particles only +#for baryon search +Baryon_searchflag=2 #if 1 search for baryons separately using phase-space search when identifying substructures, 2 allows special treatment in field FOF linking and phase-space substructure search, 0 treat the same as dark matter particles +#for search for substruture +Search_for_substructure=1 #if 0, end search once field objects are found +#also useful for zoom simulations or simulations of individual objects, setting this flag means no field structure search is run +Singlehalo_search=0 #if file is single halo in which one wishes to search for substructure. Here disabled. +#additional option for field haloes +Keep_FOF=0 #if field 6DFOF search is done, allows to keep structures found in 3DFOF (can be interpreted as the inter halo stellar mass when only stellar search is used).\n + +#minimum size for structures +Minimum_size=20 #min 20 particles +Minimum_halo_size=32 #if field halos have different minimum sizes, otherwise set to -1. + +#for field fof halo search +FoF_Field_search_type=5 #5 3DFOF search for field halos, 4 for 6DFOF clean up of field halos, 3 for 6DFOF with velocity scale distinct for each initial 3D FOF candidate +Halo_3D_linking_length=0.20 + +#for mean field estimates and local velocity density distribution funciton estimator related quantiites, rarely need to change this +Local_velocity_density_approximate_calculation=1 #calculates velocity density using approximative (and quicker) near neighbour search +Cell_fraction = 0.01 #fraction of field fof halo used to determine mean velocity distribution function. Typical values are ~0.005-0.02 +Grid_type=1 #normal entropy based grid, shouldn't have to change +Nsearch_velocity=32 #number of velocity neighbours used to calculate local velocity distribution function. Typial values are ~32 +Nsearch_physical=256 #numerof physical neighbours from which the nearest velocity neighbour set is based. Typical values are 128-512 + +#for substructure search, rarely ever need to change this +FoF_search_type=1 #default phase-space FOF search. Don't really need to change +Iterative_searchflag=1 #iterative substructure search, for substructure find initial candidate substructures with smaller linking lengths then expand search region +Outlier_threshold=2.5 #outlier threshold for a particle to be considered residing in substructure, that is how dynamically distinct a particle is. Typical values are >2 +Substructure_physical_linking_length=0.10 +Velocity_ratio=2.0 #ratio of speeds used in phase-space FOF +Velocity_opening_angle=0.10 #angle between velocities. 18 degrees here, typical values are ~10-30 +Velocity_linking_length=0.20 #where scaled by structure dispersion +Significance_level=1.0 #how significant a substructure is relative to Poisson noise. Values >= 1 are fine. + +#for iterative substructure search, rarely ever need to change this +Iterative_threshold_factor=1.0 #change in threshold value when using iterative search. Here no increase in threshold if iterative or not +Iterative_linking_length_factor=2.0 #increase in final linking final iterative substructure search +Iterative_Vratio_factor=1.0 #change in Vratio when using iterative search. no change in vratio +Iterative_ThetaOp_factor=1.0 #change in velocity opening angle. no change in velocity opening angle + +#for checking for halo merger remnants, which are defined as large, well separated phase-space density maxima +Halo_core_search=2 # searches for separate 6dfof cores in field haloes, and then more than just flags halo as merging, assigns particles to each merging "halo". 2 is full separation, 1 is flagging, 0 is off +#if searching for cores, linking lengths. likely does not need to change much +Use_adaptive_core_search=0 #calculate dispersions in configuration & vel space to determine linking lengths +Use_phase_tensor_core_growth=2 #use full stepped phase-space tensor assignment +Halo_core_ellx_fac=0.7 #how linking lengths are changed when searching for local 6DFOF cores, +Halo_core_ellv_fac=2.0 #how velocity lengths based on dispersions are changed when searching for local 6DFOF cores +Halo_core_ncellfac=0.005 #fraction of total halo particle number setting min size of a local 6DFOF core +Halo_core_num_loops=8 #number of loops to iteratively search for cores +Halo_core_loop_ellx_fac=0.75 #how much to change the configuration space linking per iteration +Halo_core_loop_ellv_fac=1.0 #how much to change the velocity space linking per iteration +Halo_core_loop_elln_fac=1.2 #how much to change the min number of particles per iteration +Halo_core_phase_significance=2.0 #how significant a core must be in terms of dispersions (sigma) significance + +################################ +#Unbinding options (VELOCIraptor is able to accurately identify tidal debris so particles need not be bound to a structure) +################################ + +#unbinding related items +Unbind_flag=1 #run unbinding +#objects must have particles that meet the allowed kinetic to potential ratio AND also have some total fraction that are completely bound. +Unbinding_type=0 +#alpha factor used to determine whether particle is "bound" alaph*T+W<0. For standard subhalo catalogues use >0.9 but if interested in tidal debris 0.2-0.5 +Allowed_kinetic_potential_ratio=0.95 +Min_bound_mass_frac=0.65 #minimum bound mass fraction +#run unbinding of field structures, aka halos. This is useful for sams and 6DFOF halos but may not be useful if interested in 3DFOF mass functions. +Bound_halos=0 +#don't keep background potential when unbinding +Keep_background_potential=1 +#use all particles to determine velocity frame for unbinding +Frac_pot_ref=1.0 +Min_npot_ref=20 +#reference frame only meaningful if calculating velocity frame using subset of particles in object. Can use radially sorted fraction of particles about minimum potential or centre of mass +Kinetic_reference_frame_type=0 +Unbinding_max_unbound_removal_fraction_per_iteration=0.5 +Unbinding_max_unbound_fraction=0.95 +Unbinding_max_unbound_fraction_allowed=0.005 + +################################ +#Calculation of properties related options +################################ +Virial_density=500 #user defined virial overdensity. Note that 200 rho_c, 200 rho_m and BN98 are already calculated. +#when calculating properties, for field objects calculate inclusive masses +Inclusive_halo_masses=3 #calculate inclusive masses for halos using full Spherical overdensity apertures +#ensures that output is physical and not comoving distances per little h +Comoving_units=0 +#calculate more (sub)halo properties (like angular momentum in spherical overdensity apertures, both inclusive and exclusive) +Extensive_halo_properties_output=1 +Extensive_gas_properties_output=1 +Extensive_star_properties_output=1 +#calculate aperture masses +Calculate_aperture_quantities=1 +Number_of_apertures=5 +Aperture_values_in_kpc=5,10,30,50,100, +Number_of_projected_apertures=5 +Projected_aperture_values_in_kpc=5,10,30,50,100, +#calculate radial profiles +Calculate_radial_profiles=1 +Number_of_radial_profile_bin_edges=20 +#default radial normalisation log rad bins, normed by R200crit, Integer flag of 0 is log bins and R200crit norm. +Radial_profile_norm=0 +Radial_profile_bin_edges=-2.,-1.87379263,-1.74758526,-1.62137789,-1.49517052,-1.36896316,-1.24275579,-1.11654842,-0.99034105,-0.86413368,-0.73792631,-0.61171894,-0.48551157,-0.3593042,-0.23309684,-0.10688947,0.0193179,0.14552527,0.27173264,0.39794001, +Iterate_cm_flag=0 #do not interate to determine centre-of-mass +Sort_by_binding_energy=1 #sort particles by binding energy +Reference_frame_for_properties=2 #use the minimum potential as reference frame about which to calculate properties + +################################ +#output related +################################ + +Write_group_array_file=0 #do not write a group array file +Separate_output_files=0 #do not separate output into field and substructure files similar to subfind +Binary_output=2 #Use HDF5 output (binary output 1, ascii 0, and HDF 2) +#output particles residing in the spherical overdensity apertures of halos, only the particles exclusively belonging to halos +Spherical_overdensity_halo_particle_list_output=1 + +#halo ids are adjusted by this value * 1000000000000 (or 1000000 if code compiled with the LONGINTS option turned off) +#to ensure that halo ids are temporally unique. So if you had 100 snapshots, for snap 100 set this to 100 and 100*1000000000000 will +#be added to the halo id as set for this snapshot, so halo 1 becomes halo 100*1000000000000+1 and halo 1 of snap 0 would just have ID=1 + +#ALTER THIS as part of a script to get temporally unique ids +Snapshot_value=SNAP + +################################ +#other options +################################ +Verbose=0 #how talkative do you want the code to be, 0 not much, 1 a lot, 2 chatterbox + +