From f7c2208131557cabc97fa922c43a7d521bdcb445 Mon Sep 17 00:00:00 2001 From: Farrah Molina Date: Thu, 31 Oct 2024 11:52:57 -0500 Subject: [PATCH] trying to run orbitize plot just with simulated ra and dec data --- mcmc_test.py | 21 ++++++-- .../example_data/simulated_ra_dec_data.csv | 51 +++++++++++++++++++ 2 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 orbitize/example_data/simulated_ra_dec_data.csv diff --git a/mcmc_test.py b/mcmc_test.py index fbafc358..46f0ae78 100644 --- a/mcmc_test.py +++ b/mcmc_test.py @@ -4,7 +4,7 @@ from orbitize import driver import multiprocessing as mp -filename = "{}/GJ504.csv".format(orbitize.DATADIR) +filename = "{}/simulated_ra_dec_data.csv".format(orbitize.DATADIR) # system parameters num_secondary_bodies = 1 @@ -33,8 +33,19 @@ "num_threads": num_threads, }, ) -total_orbits = 6000 # number of steps x number of walkers (at lowest temperature) -burn_steps = 10 # steps to burn in per walker -thin = 2 # only save every 2nd step +if __name__ == '__main__': + + total_orbits = 6000 # number of steps x number of walkers (at lowest temperature) + burn_steps = 10 # steps to burn in per walker + thin = 2 # only save every 2nd step + + my_driver.sampler.run_sampler(total_orbits, burn_steps=burn_steps, thin=thin) + + +if my_driver.sampler.results is not None: + print("Sampler results are available.") + print("Number of orbits:", len(my_driver.sampler.results.post)) +else: + print("No sampler results available. Sampler may not have run correctly.") + -my_driver.sampler.run_sampler(total_orbits, burn_steps=burn_steps, thin=thin) \ No newline at end of file diff --git a/orbitize/example_data/simulated_ra_dec_data.csv b/orbitize/example_data/simulated_ra_dec_data.csv new file mode 100644 index 00000000..d852e0c5 --- /dev/null +++ b/orbitize/example_data/simulated_ra_dec_data.csv @@ -0,0 +1,51 @@ +epoch,object,raoff,decoff,raoff_err,decoff_err +0.0,1,0.811231477773281,0.7594337387611091,0.01,0.01 +51.02040816326531,1,0.8086976534668815,0.7884882174763149,0.01,0.01 +102.04081632653062,1,0.8018051182543783,0.8135752998448389,0.01,0.01 +153.06122448979593,1,0.7904122778426745,0.8345316311433326,0.01,0.01 +204.08163265306123,1,0.7743165421613408,0.8511262472797302,0.01,0.01 +255.10204081632654,1,0.753249548414535,0.8630503873758559,0.01,0.01 +306.12244897959187,1,0.7268712100315663,0.8699046823746542,0.01,0.01 +357.14285714285717,1,0.694762808612201,0.871183254587578,0.01,0.01 +408.16326530612247,1,0.6564196199390899,0.8662543021471459,0.01,0.01 +459.18367346938777,1,0.6112440678303533,0.8543369207025031,0.01,0.01 +510.2040816326531,1,0.5585412933875817,0.8344743818340995,0.01,0.01 +561.2244897959184,1,0.49752057854752274,0.8055051180185213,0.01,0.01 +612.2448979591837,1,0.42730869340142713,0.7660347500990113,0.01,0.01 +663.265306122449,1,0.3469855704957162,0.7144164850051454,0.01,0.01 +714.2857142857143,1,0.25565954973242283,0.6487544841765712,0.01,0.01 +765.3061224489796,1,0.15260947588849744,0.5669573266103906,0.01,0.01 +816.3265306122449,1,0.037533685832437026,0.4668885487044668,0.01,0.01 +867.3469387755102,1,-0.08904312701616794,0.34668838046440426,0.01,0.01 +918.3673469387755,1,-0.22515974344986556,0.2053664293775624,0.01,0.01 +969.3877551020408,1,-0.36661560366594714,0.04375763921362707,0.01,0.01 +1020.4081632653061,1,-0.5061474469043882,-0.13417842573759436,0.01,0.01 +1071.4285714285716,1,-0.6330566925723007,-0.32005017911521655,0.01,0.01 +1122.4489795918369,1,-0.7340642827698997,-0.5005631649102175,0.01,0.01 +1173.4693877551022,1,-0.7960233988208258,-0.6590354524244593,0.01,0.01 +1224.4897959183675,1,-0.8100093753970008,-0.779341500288983,0.01,0.01 +1275.5102040816328,1,-0.7747106962319243,-0.8508197707379554,0.01,0.01 +1326.530612244898,1,-0.6968201319288353,-0.8712731010397949,0.01,0.01 +1377.5510204081634,1,-0.5881886796558359,-0.8463291454704698,0.01,0.01 +1428.5714285714287,1,-0.46179505907320606,-0.7861524685145167,0.01,0.01 +1479.591836734694,1,-0.32874319217715686,-0.7018568896193422,0.01,0.01 +1530.6122448979593,1,-0.19704231837725736,-0.603169261080095,0.01,0.01 +1581.6326530612246,1,-0.0717085052125464,-0.49753210156043054,0.01,0.01 +1632.6530612244899,1,0.04455725697773338,-0.39013739669169883,0.01,0.01 +1683.6734693877552,1,0.15061964729048624,-0.2843546293265123,0.01,0.01 +1734.6938775510205,1,0.246302320136533,-0.18222582266793214,0.01,0.01 +1785.7142857142858,1,0.3319636092307561,-0.08488826595156958,0.01,0.01 +1836.734693877551,1,0.4082247422781462,0.007108706138521259,0.01,0.01 +1887.7551020408164,1,0.47580638683140664,0.09358245909783232,0.01,0.01 +1938.7755102040817,1,0.5354357374912007,0.17456889152858981,0.01,0.01 +1989.795918367347,1,0.5877970769939762,0.25022587899384413,0.01,0.01 +2040.8163265306123,1,0.6335080358663165,0.3207715550593558,0.01,0.01 +2091.8367346938776,1,0.673110446052766,0.3864454566166559,0.01,0.01 +2142.857142857143,1,0.707069071798058,0.44748437788656903,0.01,0.01 +2193.877551020408,1,0.7357742511645264,0.5041075168486121,0.01,0.01 +2244.8979591836737,1,0.75954615418438,0.5565073629841016,0.01,0.01 +2295.918367346939,1,0.7786393591852832,0.6048440073048987,0.01,0.01 +2346.9387755102043,1,0.7932470300017178,0.6492413535736495,0.01,0.01 +2397.9591836734694,1,0.8035043081850315,0.6897842167972191,0.01,0.01 +2448.979591836735,1,0.8094907181927744,0.7265156142343624,0.01,0.01 +2500.0,1,0.811231477773281,0.7594337387611084,0.01,0.01