Adler phasecurve models

This notebook demonstrates how Adler implements phasecurve models. An example object with photometric observations is loaded. We can create a phasecurve model object from the SSObject parameters associated with this object. We can also fit a phasecurve model of our choice to the observations.

[1]:
from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid
from adler.science.PhaseCurve import PhaseCurve

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import astropy.units as u
[2]:
# ssObjectId of object to analyse
ssoid = "8268570668335894776"
[3]:
# retrieve the object data via adler

# # here we use an offline SQL database which contains the observations of the sso
fname = "../../tests/data/testing_database.db"
planetoid = AdlerPlanetoid.construct_from_SQL(ssoid, sql_filename=fname)

# alternatively we can retrieve the object data directly from the RSP
# planetoid = AdlerPlanetoid.construct_from_RSP(ssoid)
No observations found in u filter for this object. Skipping this filter.
No observations found in y filter for this object. Skipping this filter.
n unpopulated in MPCORB table for this object. Storing NaN instead.
uncertaintyParameter unpopulated in MPCORB table for this object. Storing NaN instead.
[4]:
# inspect the whole object
planetoid.__dict__
[4]:
{'ssObjectId': '8268570668335894776',
 'filter_list': ['g', 'r', 'i', 'z'],
 'date_range': [60000.0, 67300.0],
 'observations_by_filter': [Observations(ssObjectId='8268570668335894776', filter_name='g', diaSourceId=array([-2944975426380028364,   876531379606618901,  7181189902943136565,
          8990545481068594367, -2126876624488458371, -1345853232552594655,
         -6042805804744661297,  8676256258621564769,  1987070334504056147]), mag=array([21.33099937, 22.67099953, 23.5359993 , 22.85000038, 22.97599983,
         22.94499969, 23.13599968, 23.19400024, 23.1609993 ]), magErr=array([0.033, 0.07 , 0.141, 0.075, 0.048, 0.046, 0.068, 0.065, 0.066]), midPointMjdTai=array([62379.03985, 62414.11171, 63534.06359, 61323.17176, 60228.05559,
         60228.05606, 60229.03603, 60231.05795, 60233.03832]), ra=array([255.2300797, 304.1658794, 311.2951848, 315.6989729, 323.5328231,
         323.5329139, 323.7251118, 324.132392 , 324.5463505]), dec=array([-23.3427625, -17.1779969, -15.6242814, -13.5912723, -10.6707848,
         -10.6707602, -10.6150706, -10.4964008, -10.3753228]), phaseAngle=array([63.60055161, 38.03742981, 36.49517059, 31.97113991, 27.42666817,
         27.42672539, 27.53459549, 27.73578453, 27.90441322]), topocentricDist=array([0.33790752, 0.84168053, 1.27439773, 0.95509756, 0.99907744,
         0.99908602, 1.01725268, 1.05503416, 1.09241748]), heliocentricDist=array([1.11330199, 1.51804984, 1.66657984, 1.67151237, 1.77300227,
         1.7730068 , 1.78262854, 1.80235839, 1.82152498]), heliocentricX=array([0.85362464, 1.43080187, 1.61640382, 1.62202156, 1.74375689,
         1.74376225, 1.75487232, 1.77751791, 1.79934204]), heliocentricY=array([-0.65430725, -0.47870582, -0.38993949, -0.38800186, -0.31342503,
         -0.31342191, -0.30675474, -0.29295081, -0.27937177]), heliocentricZ=array([-0.28748593, -0.16769576, -0.1125801 , -0.11159874, -0.06792356,
         -0.06792168, -0.06394517, -0.05573085, -0.04767411]), topocentricX=array([-0.07909466,  0.45159483,  0.80994773,  0.66440284,  0.78956175,
          0.78956944,  0.80606216,  0.84066445,  0.8753168 ]), topocentricY=array([-0.29999858, -0.66535336, -0.92209905, -0.64838707, -0.58354515,
         -0.58354902, -0.59156793, -0.60781556, -0.62328976]), topocentricZ=array([-0.13388941, -0.24858221, -0.34323126, -0.22444235, -0.1849948 ,
         -0.18499595, -0.18738765, -0.19219932, -0.19673951]), eclipticLambda=array([256.46234765, 302.48283945, 309.50014344, 314.16059375,
         322.3574515 , 322.35754409, 322.55470043, 322.97278129,
         323.39797879]), eclipticBeta=array([-0.59491696,  2.49171234,  2.33321031,  3.12050169,  3.580407  ,
          3.58040171,  3.57252811,  3.55589093,  3.53862007]), reduced_mag=array([23.45394514, 22.13883298, 21.90034373, 21.83421374, 21.73445762,
         21.70343328, 21.84355119, 21.79846187, 21.66688044]), num_obs=9),
  Observations(ssObjectId='8268570668335894776', filter_name='r', diaSourceId=array([ 3143041177716967798, -3104998623142691451,  5751338980001415282,
          3286469592089350514,  5224425422607762094,  4560856135615553299,
          5155758115802430466, -5971538637416122678,  8249885337400201451,
         -8451684893195274998,  1835196257128010000, -3297106309337908787,
          1903461628503901062,  2646642141499836902, -3377529068683137916,
         -1627033925810759798,  3432357944307080584, -6886919974417000415,
         -2626645652075447222,   687890452005474276,   752193725415843661,
          -786563943595319518,  4625356763533857267, -2949619640806116520,
          6628439691429180033,  2763176974893874383,  1499244245090148039,
          2347544943023417500, -7353764788427149942,  8268675397298995882,
         -1795415124350038203,  9191430519381915082, -4780995102289103506,
           303469121011070742, -2092174335073920607, -4375146155029383212,
         -1334792330958883646,  4221003523165974753]), mag=array([21.91399956, 21.98600006, 21.75900078, 22.09399986, 21.61499977,
         21.72800064, 21.72200012, 20.4470005 , 21.78899956, 21.95899963,
         22.17900085, 22.44499969, 22.38999939, 22.92399979, 22.24799919,
         22.27599907, 22.29100037, 22.66200066, 22.69799995, 23.93300056,
         23.74200058, 22.14299965, 22.16799927, 22.24900055, 22.28499985,
         22.26199913, 22.44000053, 23.56800079, 23.70199966, 24.19499969,
         22.22900009, 22.04899979, 22.17700005, 23.52199936, 23.70199966,
         22.88699913, 23.06800079, 24.24200058]), magErr=array([0.095     , 0.049     , 0.07      , 0.047     , 0.036     ,
         0.038     , 0.034     , 0.011     , 0.052     , 0.06      ,
         0.042     , 0.098     , 0.1       , 0.116     , 0.046     ,
         0.06      , 0.082     , 0.083     , 0.063     , 0.35100001,
         0.2       , 0.057     , 0.034     , 0.036     , 0.054     ,
         0.051     , 0.046     , 0.17200001, 0.199     , 0.17      ,
         0.264     , 0.28299999, 0.31600001, 0.163     , 0.248     ,
         0.182     , 0.211     , 0.38299999]), midPointMjdTai=array([63492.00291, 63500.06856, 63479.0044 , 63502.00311, 62406.09011,
         62407.07445, 62407.09369, 61294.15865, 62412.12365, 62414.13572,
         62415.05691, 62422.06327, 62422.06596, 63534.03975, 61322.07319,
         61323.00925, 61326.03134, 61329.00043, 61330.01524, 63554.05676,
         63562.05437, 60223.98877, 60224.07621, 60226.02382, 60228.0802 ,
         60228.08066, 60230.03315, 61355.02232, 61355.02277, 60264.01472,
         61253.97055, 61253.96744, 61253.96433, 61052.13729, 63217.23761,
         62125.2233 , 62113.17449, 62095.28873]), ra=array([268.4639755, 281.1782352, 239.848597 , 283.7424099, 298.1255196,
         298.9437966, 298.9592036, 301.5682143, 302.7875618, 304.1818652,
         304.7993288, 309.1175392, 309.1190487, 311.280946 , 315.2799036,
         315.6390597, 316.7793075, 317.8804823, 318.2527231, 322.0860789,
         325.868688 , 322.7789008, 322.7931457, 323.1475474, 323.5372789,
         323.5373434, 323.9242256, 327.0967385, 327.0968451, 332.3781914,
         170.4323598, 170.4247983, 170.4172297,  62.6767601,  68.4459325,
          69.233718 ,  74.6917865,  81.7128501]), dec=array([-22.9543395, -21.8517282, -21.8243507, -21.5140075, -18.6306791,
         -18.443366 , -18.4396764, -17.709034 , -17.5230447, -17.1737751,
         -17.0169932, -15.874741 , -15.8743016, -15.6284188, -13.7156598,
         -13.6098197, -13.2712987, -12.9420707, -12.8300092, -12.3090787,
         -11.0256047, -10.889507 , -10.8850457, -10.7825671, -10.6694075,
         -10.6693695, -10.5571517, -10.035292 , -10.0351984,  -7.9025949,
          -3.6550378,  -3.6513877,  -3.6478445,  27.0535373,  28.5344673,
          28.6462634,  29.3204275,  29.563878 ]), phaseAngle=array([ 56.70839691,  50.07988358,  72.76689148,  48.80239868,
          40.30448914,  39.98022079,  39.97434235,  33.56268311,
          38.53084564,  38.03194427,  37.81433105,  36.34851074,
          36.34802628,  36.50101089,  32.00559616,  31.97466469,
          31.86707687,  31.74268913,  31.69605255,  31.88496971,
          30.16068649,  26.89824295,  26.91216087,  27.17892265,
          27.42977715,  27.42983437,  27.63732719,  29.76596832,
          29.76592445,  27.73990822, 126.7827301 , 126.78705597,
         126.79136658,  18.63666534,   5.73195124,   7.0533433 ,
           2.55333257,   9.17568874]), topocentricDist=array([0.58142245, 0.68610221, 0.47289231, 0.71412551, 0.70371586,
         0.72016948, 0.72049457, 0.45957258, 0.806705  , 0.8421095 ,
         0.85847169, 0.98606402, 0.98611432, 1.27393341, 0.93472457,
         0.95206416, 1.00859618, 1.06491303, 1.08432984, 1.67350197,
         1.8374033 , 0.92473841, 0.92631632, 0.96172243, 0.99953324,
         0.99954176, 1.03583491, 1.58487654, 1.58488584, 1.71470714,
         0.20776999, 0.20780498, 0.20783997, 1.4200809 , 1.59280014,
         1.50733411, 1.56365716, 1.73338318]), heliocentricDist=array([1.19897687, 1.29408848, 1.0418874 , 1.31655276, 1.42970574,
         1.44069195, 1.44090629, 1.35723567, 1.49640727, 1.51831007,
         1.52828085, 1.60294342, 1.60297179, 1.66633558, 1.66025329,
         1.66984999, 1.70058703, 1.73042095, 1.74053574, 1.86338043,
         1.93771982, 1.73265779, 1.73353231, 1.75293028, 1.77324426,
         1.77324879, 1.79237878, 1.97701716, 1.97702122, 2.10192013,
         0.87671232, 0.87667543, 0.87663853, 2.21820784, 2.55602884,
         2.46223307, 2.54469585, 2.65981913]), heliocentricX=array([0.98566008, 1.12571287, 0.73635548, 1.15778017, 1.31445014,
         1.32917261, 1.32945919, 1.21433091, 1.40272045, 1.43113804,
         1.44398427, 1.53844213, 1.53847742, 1.61610746, 1.60835254,
         1.6200074 , 1.65702462, 1.69250548, 1.70443583, 1.84563196,
         1.92748308, 1.69669056, 1.6977191 , 1.720438  , 1.74403691,
         1.74404216, 1.76608646, 1.96962559, 1.96962988, 2.09952807,
         0.43896684, 0.43889508, 0.43882334, 0.21914509, 0.60625774,
         0.49559182, 0.59499252, 0.7396673 ]), heliocentricY=array([-0.62823319, -0.591133  , -0.67211491, -0.58139241, -0.52635294,
         -0.52067292, -0.52056134, -0.56387866, -0.4907873 , -0.47855896,
         -0.47290507, -0.42888543, -0.4288682 , -0.39009613, -0.39520952,
         -0.38906994, -0.36910382, -0.34929019, -0.34247679, -0.25461146,
         -0.19891214, -0.34091538, -0.34032753, -0.32719636, -0.31325784,
         -0.31325474, -0.29995513, -0.16988276, -0.16987962, -0.06223172,
         -0.68560243, -0.68559992, -0.68559748,  1.96290016,  2.20046926,
          2.13928843,  2.19267511,  2.26149249]), heliocentricZ=array([-2.67100602e-01, -2.40826562e-01, -3.02607685e-01, -2.34177470e-01,
         -1.98070377e-01, -1.94404349e-01, -1.94332495e-01, -2.22553208e-01,
         -1.75322443e-01, -1.67603314e-01, -1.64049789e-01, -1.36677057e-01,
         -1.36666417e-01, -1.12675406e-01, -1.15985326e-01, -1.12248190e-01,
         -1.00141644e-01, -8.81937891e-02, -8.40995014e-02, -3.16579603e-02,
          9.86804022e-04, -8.43857080e-02, -8.40325207e-02, -7.61566833e-02,
         -6.78237751e-02, -6.78219125e-02, -5.98958135e-02,  1.76592711e-02,
          1.76611003e-02,  7.85964429e-02, -3.25395137e-01, -3.25397670e-01,
         -3.25400203e-01,  1.00967538e+00,  1.15050876e+00,  1.11374378e+00,
          1.14613962e+00,  1.18877327e+00]), topocentricX=array([-0.01435127,  0.1234522 , -0.22050345,  0.15782602,  0.31435132,
          0.33062559,  0.33094278,  0.22919159,  0.41657984,  0.45202053,
          0.46848297,  0.59839433,  0.59844565,  0.8094067 ,  0.6452319 ,
          0.66156477,  0.71535748,  0.7698307 ,  0.78880835,  1.28993249,
          1.4928441 ,  0.72311616,  0.72449768,  0.75596648,  0.78997087,
          0.7899785 ,  0.82303035,  1.31028664,  1.31029677,  1.50484931,
         -0.20446318, -0.2044939 , -0.20452462,  0.58050925,  0.51407999,
          0.46901953,  0.35993701,  0.21731049]), topocentricY=array([-0.53519064, -0.62472492, -0.37960306, -0.64535236, -0.58809692,
         -0.59784675, -0.5980404 , -0.37300903, -0.6467135 , -0.6655817 ,
         -0.67407537, -0.73586392, -0.73588711, -0.92194605, -0.6389581 ,
         -0.64696926, -0.67225099, -0.69607198, -0.70397091, -1.00468957,
         -1.01192188, -0.54929483, -0.55006027, -0.56661528, -0.58375275,
         -0.58375663, -0.59963137, -0.84776878, -0.84777045, -0.78744459,
          0.03446353,  0.03449643,  0.03452932,  1.1235975 ,  1.30146933,
          1.23689175,  1.31497216,  1.49196291]), topocentricZ=array([-0.22675332, -0.25537139, -0.17580356, -0.26189023, -0.22481389,
         -0.22783792, -0.22789675, -0.13979426, -0.24289058, -0.24865004,
         -0.25123635, -0.26972356, -0.26973024, -0.34319466, -0.22162651,
         -0.2240289 , -0.23153538, -0.2385039 , -0.24078552, -0.35676584,
         -0.3513993 , -0.17469768, -0.17492484, -0.17992155, -0.1850553 ,
         -0.18505643, -0.18978186, -0.27617133, -0.27617154, -0.23575412,
         -0.01324528, -0.01323442, -0.01322356,  0.64588523,  0.76086235,
          0.72261721,  0.76571345,  0.85524261]), eclipticLambda=array([268.58558081, 280.3680903 , 242.19930327, 282.77157013,
         296.55441997, 297.35233258, 297.36739748, 299.94604719,
         301.12232173, 302.49868464, 303.10960108, 307.40833212,
         307.40984948, 309.48581377, 313.73417695, 314.099399  ,
         315.26064109, 316.38419288, 316.76453376, 320.49051677,
         324.41453945, 321.58423352, 321.59894389, 321.96226343,
         322.36204967, 322.36212203, 322.75904945, 325.8839194 ,
         325.88404981, 331.52416508, 172.6562335 , 172.64779346,
         172.63938943,  65.73527931,  71.04391986,  71.74908298,
          76.60156794,  82.75348791]), eclipticBeta=array([ 0.47741032,  1.18614006, -1.24795459,  1.3180692 ,  2.25335252,
          2.2897149 ,  2.2905188 ,  2.50866696,  2.44401182,  2.4924115 ,
          2.51209177,  2.62982849,  2.62988902,  2.33282034,  3.11692547,
          3.11931728,  3.12462268,  3.12527436,  3.12476444,  2.47665892,
          2.49908301,  3.60933183,  3.6091223 ,  3.59552019,  3.58030813,
          3.58032381,  3.56440019,  3.03235519,  3.0324083 ,  3.24050077,
         -7.1501227 , -7.14975301, -7.14948424,  5.886738  ,  6.50256307,
          6.51321818,  6.59037966,  6.33281263]), reduced_mag=array([22.69748655, 22.2442361 , 23.29608557, 22.22793578, 21.60177977,
         21.64797142, 21.64066789, 21.47195362, 21.38017677, 21.42535443,
         21.5893551 , 21.45088317, 21.39573365, 21.28945381, 21.29370916,
         21.2692807 , 21.11941945, 21.33467112, 21.31877818, 21.46336177,
         20.98452321, 21.11934119, 21.13954299, 21.1149286 , 21.04217083,
         21.01914605, 21.09639885, 21.08797141, 21.22195309, 21.41096887,
         25.92680044, 25.74652589, 25.87425196, 21.03042275, 20.65336449,
         20.03930569, 20.06911369, 20.92326717]), num_obs=38),
  Observations(ssObjectId='8268570668335894776', filter_name='i', diaSourceId=array([ 6386372804556776040, -8182812319131800677,  5177818295213865764,
         -1880239172139727390, -4935719925628818731,  -754458044377129801,
         -3906880440347825424, -2673415461360519665,   167088273818138311,
          1358243393473452567,  6275647025491359574,   409580888230253248,
         -4035330621502502367,  7979497158116375738, -5617022325663446307,
         -6170042856434016515,  3934219734864801964,  6034111746850226845,
         -3728667975426995767, -5072634534293740711,   259335568584168272,
         -1382222152128961216, -3254722616638384098, -7615749179956835558,
          6580787600514698165, -4723531041471587285,  7927217196514403856,
          8911948846723472716,  2720017454127445284,  2598960366228049651,
          2505529183239164038, -7390697459616187650]), mag=array([21.6439991 , 21.36300087, 21.87800026, 21.9109993 , 21.13100052,
         21.31299973, 21.52899933, 21.4489994 , 21.9659996 , 22.34600067,
         22.1060009 , 22.8239994 , 22.1420002 , 22.22699928, 22.55699921,
         22.9260006 , 22.86000061, 23.03899956, 23.01000023, 23.01499939,
         21.69099998, 21.62800026, 21.73800087, 21.7670002 , 24.12299919,
         23.5720005 , 23.12000084, 22.00600052, 22.13199997, 21.44499969,
         21.8920002 , 22.96100044]), magErr=array([0.09      , 0.09      , 0.097     , 0.061     , 0.056     ,
         0.06      , 0.043     , 0.055     , 0.052     , 0.123     ,
         0.138     , 0.149     , 0.056     , 0.108     , 0.072     ,
         0.15099999, 0.108     , 0.161     , 0.17200001, 0.24699999,
         0.033     , 0.034     , 0.036     , 0.034     , 0.287     ,
         0.20900001, 0.162     , 0.236     , 0.25099999, 0.273     ,
         0.32800001, 0.20200001]), midPointMjdTai=array([63491.01061, 63492.02797, 63479.02886, 63502.02736, 62399.06072,
         62406.11472, 62407.05015, 62407.11748, 62415.0812 , 62422.08767,
         62422.09036, 62436.04279, 61322.99785, 61329.01185, 61330.03932,
         61336.03529, 61340.01945, 61341.11766, 61341.11811, 61342.06216,
         60220.01958, 60220.02049, 60221.12372, 60221.12557, 63562.07814,
         61355.01017, 60247.08273, 62349.97398, 62349.97087, 62349.96776,
         62349.96465, 61036.13418]), ra=array([266.6413363, 268.5086178, 239.9100993, 283.7730287, 291.4097759,
         298.145886 , 298.9243467, 298.9782853, 304.8150582, 309.1312689,
         309.1328297, 316.4041661, 315.6348596, 317.8845061, 318.2612529,
         320.4304128, 321.848623 , 322.2360534, 322.2361831, 322.569595 ,
         322.1115349, 322.1116543, 322.2881508, 322.2884132, 325.8794637,
         327.0925894, 327.8278286, 172.616229 , 172.6111715, 172.6060941,
         172.6010555,  68.9454695]), dec=array([-23.0326404, -22.9520606, -21.8321338, -21.5096171, -20.0492988,
         -18.625892 , -18.4479994, -18.4350998, -17.0128368, -15.8709103,
         -15.8704781, -13.7834185, -13.6110905, -12.9407809, -12.8273414,
         -12.1670727, -11.7275091, -11.6058333, -11.6058105, -11.5011345,
         -11.0839115, -11.0838709, -11.0316938, -11.0315926, -11.0218241,
         -10.0366378,  -9.382581 ,  -1.8195237,  -1.8173023,  -1.8150431,
          -1.8127825,  28.5483987]), phaseAngle=array([ 57.69313812,  56.68458939,  72.73178864,  48.7874794 ,
          43.18344498,  40.29655838,  39.98762894,  39.96704483,
          37.80903625,  36.34411621,  36.34362793,  33.94010925,
          31.97488785,  31.74231148,  31.69519234,  31.36940193,
          31.10543633,  31.02681541,  31.0267849 ,  30.95575333,
          26.25296974,  26.25314522,  26.44772339,  26.4480629 ,
          30.1556778 ,  29.76718521,  28.40824509, 111.80013275,
         111.80042267, 111.80072021, 111.80101013,  10.05950642]), topocentricDist=array([0.57015663, 0.58171409, 0.47300589, 0.71448445, 0.59068811,
         0.70412856, 0.71975976, 0.72089708, 0.85890698, 0.98651999,
         0.98657024, 1.25412667, 0.95185274, 1.06513095, 1.08479238,
         1.20115972, 1.2799077 , 1.30180955, 1.30181861, 1.32069123,
         0.85387373, 0.85388964, 0.87341589, 0.87344897, 1.83789635,
         1.58462429, 1.36697185, 0.4382202 , 0.43826094, 0.43830171,
         0.43834251, 1.41184878]), heliocentricDist=array([1.18712699, 1.19927573, 1.04218543, 1.31683338, 1.35009003,
         1.42998099, 1.44042122, 1.44117129, 1.52854323, 1.60319996,
         1.60322821, 1.74579298, 1.66973341, 1.73053503, 1.74077535,
         1.7996881 , 1.83804572, 1.84850955, 1.84851384, 1.85747135,
         1.69262958, 1.69263875, 1.70382977, 1.70384848, 1.93793714,
         1.97690809, 1.95307171, 0.76700246, 0.76696873, 0.76693499,
         0.76690125, 2.34223175]), heliocentricX=array([0.96768981, 0.98611164, 0.7368539 , 1.15817857, 1.20547211,
         1.31481993, 1.32881069, 1.32981336, 1.44432175, 1.5387615 ,
         1.53879666, 1.71108401, 1.61986601, 1.6926403 , 1.70471787,
         1.77321815, 1.8169328 , 1.82873857, 1.82874334, 1.83880925,
         1.6492151 , 1.64922607, 1.66257799, 1.66260028, 1.92771864,
         1.96950912, 1.94457173, 0.2120536 , 0.21197671, 0.21189982,
         0.21182293, 0.35552835]), heliocentricY=array([-0.63235146, -0.62812781, -0.67205614, -0.58126849, -0.56530327,
         -0.5262115 , -0.52081376, -0.52042341, -0.47275549, -0.42872921,
         -0.42871201, -0.33684295, -0.38914487, -0.34921363, -0.34231481,
         -0.30167541, -0.27435872, -0.26679114, -0.26678804, -0.26027068,
         -0.36743617, -0.36743015, -0.36009207, -0.36007974, -0.19874573,
         -0.16996816, -0.18176119, -0.66154474, -0.66153151, -0.66151834,
         -0.66150516,  2.05599046]), heliocentricZ=array([-0.27014548, -0.26702312, -0.30255142, -0.2340934 , -0.223634  ,
         -0.19797894, -0.1944951 , -0.19424364, -0.16395591, -0.13658075,
         -0.13657014, -0.08075707, -0.11229374, -0.08814774, -0.08400226,
         -0.05972192, -0.04352438, -0.03905324, -0.03905141, -0.03520612,
         -0.10037596, -0.10037233, -0.09593662, -0.09592915,  0.00108387,
          0.0176097 ,  0.00962856, -0.32509175, -0.32508913, -0.32508647,
         -0.32508382,  1.06421399]), topocentricX=array([-0.0307405 , -0.0139414 , -0.22013673,  0.15825523,  0.202555  ,
          0.31475365,  0.33022571,  0.33133566,  0.468916  ,  0.59885949,
          0.59891075,  0.88211143,  0.661367  ,  0.77004147,  0.78925782,
          0.90511703,  0.98548549,  1.0080924 ,  1.0081017 ,  1.02769458,
          0.66131353,  0.66132712,  0.67818874,  0.67821723,  1.49345517,
          1.31001139,  1.1415962 , -0.43436721, -0.43440315, -0.43443912,
         -0.43447509,  0.44554487]), topocentricY=array([-0.52380365, -0.53547919, -0.37991005, -0.6456117 , -0.51660013,
         -0.58834666, -0.59760255, -0.59828019, -0.67430353, -0.73607451,
         -0.73609769, -0.83990055, -0.64687043, -0.69616348, -0.70416123,
         -0.74796903, -0.77414715, -0.78094089, -0.78094375, -0.78659195,
         -0.51460487, -0.51461303, -0.52438813, -0.52440488, -1.01192451,
         -0.84772444, -0.71812755,  0.05628913,  0.05633292,  0.0563767 ,
          0.05642047,  1.15739107]), topocentricZ=array([-0.22307689, -0.2268457 , -0.17590547, -0.26197103, -0.20250471,
         -0.22488983, -0.22776359, -0.22796948, -0.25130412, -0.26978397,
         -0.26979062, -0.29879767, -0.22399984, -0.23852988, -0.24083902,
         -0.25316042, -0.26015076, -0.26189512, -0.26189584, -0.2633296 ,
         -0.16415417, -0.16415662, -0.16712984, -0.16713482, -0.35137329,
         -0.27616584, -0.22285172, -0.0139146 , -0.01389849, -0.01388239,
         -0.01386628,  0.67472416]), eclipticLambda=array([266.90928845, 268.62666372, 242.25681404, 282.80035133,
         290.06613386, 296.5742903 , 297.33331982, 297.38605737,
         303.12520802, 307.42209166, 307.42365505, 314.76267347,
         314.09511764, 316.38832663, 316.77328072, 318.99483567,
         320.45237384, 320.85139952, 320.85152747, 321.19502619,
         320.89987118, 320.89999543, 321.08119634, 321.08147322,
         324.42578206, 325.87961292, 326.78331876, 173.94052379,
         173.93498456, 173.92941199, 173.92387459,  71.4829109 ]), eclipticBeta=array([ 0.37062381,  0.48012106, -1.24418179,  1.31974447,  1.91095642,
          2.25443159,  2.28872183,  2.29151922,  2.51272095,  2.63021804,
          2.63025909,  2.73994765,  3.11926172,  3.12534774,  3.12483956,
          3.11422991,  3.10172839,  3.09807146,  3.09805309,  3.09427673,
          3.63189328,  3.63189496,  3.62686366,  3.62687849,  2.49916627,
          3.03245323,  3.40511614, -4.60154048, -4.60150095, -4.60143455,
         -4.60135149,  6.45251907]), reduced_mag=array([22.49154229, 22.14485771, 23.41394253, 22.04338125, 21.62239573,
         21.29808859, 21.45061395, 21.36605507, 21.3748803 , 21.35053275,
         21.11038412, 21.12232867, 21.1359157 , 20.89908229, 21.17655245,
         21.25201058, 21.0023258 , 21.1321538 , 21.10313432, 21.06638231,
         20.8912221 , 20.82817013, 20.87476443, 20.90365766, 21.36469569,
         21.09243657, 20.98761203, 24.37355475, 24.49944785, 23.8123411 ,
         24.259235  , 20.3639102 ]), num_obs=32),
  Observations(ssObjectId='8268570668335894776', filter_name='z', diaSourceId=array([ 5448230042093964301,   972652810026453187,  7906847851085460781,
         -5990593478163188226,  8202330308281804899,  1489828313374403661,
          4630182220690086078, -5119102073384694373,  5677779064138765585,
         -4219963069357948384,  -169722849336337265, -6812782019033823468,
          5110912155305228113,  8004705376234159923,  7807942826844615872]), mag=array([21.65099907, 20.8239994 , 21.2840004 , 21.27899933, 22.35499954,
         21.80500031, 21.54999924, 21.36400032, 22.88599968, 23.33099937,
         21.72400093, 21.83499908, 21.87899971, 22.81800079, 22.74699974]), magErr=array([0.14399999, 0.169     , 0.077     , 0.077     , 0.20900001,
         0.097     , 0.116     , 0.075     , 0.197     , 0.19400001,
         0.054     , 0.057     , 0.054     , 0.17299999, 0.245     ]), midPointMjdTai=array([63491.03495, 62370.9729 , 62399.08464, 62400.05034, 63520.05886,
         62411.05949, 62411.07292, 61309.15792, 62429.06267, 61340.00767,
         60220.04371, 60221.09951, 60221.10141, 60238.11179, 60247.05882]), ra=array([266.6862015, 228.9645547, 291.4352238, 292.4644191, 301.7031394,
         302.0220675, 302.0316622, 309.9445463, 312.9360241, 321.8445762,
         322.1149878, 322.2845177, 322.2848101, 325.6657983, 327.8220494]), dec=array([-23.0308381, -20.6945178, -20.0441634, -19.8413071, -18.1180487,
         -17.7117757, -17.7093386, -15.2786908, -14.804212 , -11.7288161,
         -11.0827998, -11.0328789, -11.0327917, -10.0432689,  -9.3844064]), phaseAngle=array([57.66902161, 80.89524078, 43.17203903, 42.70541382, 40.52689362,
         38.80998611, 38.80657959, 32.35914612, 35.09179688, 31.10615921,
         26.25766945, 26.44327354, 26.44362259, 28.21966362, 28.40810394]), topocentricDist=array([0.57043034, 0.29524919, 0.59106016, 0.60608381, 1.01253808,
         0.78817856, 0.78841257, 0.70432466, 1.11828279, 1.27967286,
         0.85429835, 0.87298429, 0.87301797, 1.18980193, 1.36648977]), heliocentricDist=array([1.18741798, 1.01504409, 1.35036433, 1.36142015, 1.51896226,
         1.48475397, 1.48490143, 1.52411139, 1.6754756 , 1.83793306,
         1.69287491, 1.70358479, 1.70360386, 1.86992252, 1.95285416]), heliocentricX=array([0.96813256, 0.69199771, 1.20585477, 1.22123384, 1.43165493,
         1.38748872, 1.38768184, 1.43781948, 1.62738478, 1.81680548,
         1.64950836, 1.6622864 , 1.66230917, 1.85369217, 1.94433808]), heliocentricY=array([-0.6322518 , -0.6761151 , -0.56517595, -0.56000501, -0.47906175,
         -0.49718454, -0.49710411, -0.47727916, -0.38339236, -0.27443984,
         -0.36727595, -0.36025336, -0.36024076, -0.24434902, -0.1819289 ]), heliocentricZ=array([-0.27007136, -0.30711913, -0.22354905, -0.22010711, -0.16766202,
         -0.17938001, -0.1793289 , -0.16671915, -0.10884694, -0.04357236,
         -0.10027902, -0.09603401, -0.09602639, -0.02699617,  0.00953094]), topocentricX=array([-0.03034521, -0.18133177,  0.20291889,  0.21784243,  0.50572437,
          0.39811817,  0.3983483 ,  0.4362258 ,  0.73646694,  0.98524523,
          0.66167599,  0.67781782,  0.67784679,  0.96743768,  1.14111459]), topocentricY=array([-0.52408606, -0.20833798, -0.51685232, -0.52684313, -0.81873667,
         -0.63657665, -0.63670754, -0.52089643, -0.79153347, -0.7740711 ,
         -0.51482284, -0.52416968, -0.52418673, -0.66078728, -0.71798611]), topocentricZ=array([-0.22316745, -0.10433682, -0.20258254, -0.20571467, -0.31487554,
         -0.23978645, -0.23982587, -0.18559955, -0.28574035, -0.2601316 ,
         -0.16421951, -0.16706495, -0.16707003, -0.20749252, -0.22281775]), eclipticLambda=array([266.95052545, 232.06636642, 290.09054613, 291.07800181,
         299.98622766, 300.36858559, 300.37804247, 308.33115016,
         311.24662588, 320.44819541, 320.90344455, 321.07743107,
         321.07773153, 324.54988767, 326.77732475]), eclipticBeta=array([ 0.37338144, -2.49541895,  1.91256214,  1.96922792,  2.08186074,
          2.41529125,  2.41574364,  3.00447306,  2.70073723,  3.10172839,
          3.63188263,  3.62686337,  3.62685564,  3.49231118,  3.40532086]), reduced_mag=array([22.49696788, 23.44063126, 21.77358717, 21.69637503, 21.4202078 ,
         21.46360474, 21.20774341, 21.2100523 , 21.52255093, 21.47385612,
         20.92282874, 20.97314817, 21.01704072, 21.08150939, 20.61561877]), num_obs=15)],
 'MPCORB': MPCORB(ssObjectId='8268570668335894776', mpcDesignation='2014 QL4', fullDesignation='2011 2014 QL433', mpcNumber=0, mpcH=19.8799991607666, mpcG=0.15000000596046448, epoch=60065.0, tperi=60112.79283678533, peri=260.5468204162153, node=322.8059, incl=4.427569999999975, e=0.7168805704972735, n=nan, q=0.5898291078470536, uncertaintyParameter=nan, flags='0'),
 'SSObject': SSObject(ssObjectId='8268570668335894776', filter_list=['g', 'r', 'i', 'z'], discoverySubmissionDate=60218.0, firstObservationDate=60220.01958, arc=3342.05859375, numObs=94, filter_dependent_values=[FilterDependentSSO(filter_name='g', H=20.292325973510742, G12=1.7233933210372925, Herr=0.030210301280021667, G12err=0.0404973067343235, nData=9.0), FilterDependentSSO(filter_name='r', H=19.805892944335938, G12=1.52932608127594, Herr=0.01974303089082241, G12err=0.05071713775396347, nData=38.0), FilterDependentSSO(filter_name='i', H=19.47262954711914, G12=1.7948637008666992, Herr=0.021644478663802147, G12err=0.04562043771147728, nData=32.0), FilterDependentSSO(filter_name='z', H=19.590879440307617, G12=1.7000616788864136, Herr=0.042724426835775375, G12err=0.0960792824625969, nData=15.0)], maxExtendedness=0.0, minExtendedness=0.0, medianExtendedness=0.0),
 'AdlerData': AdlerData(ssObjectId='8268570668335894776', filter_list=['g', 'r', 'i', 'z'], modelId='', updatedMJD=np.float64(61112.419436724296), filter_dependent_values=[FilterDependentAdler(filter_name='g', phaseAngle_min=nan, phaseAngle_range=nan, observationTime_max=nan, arc=nan, nobs=0, n_outliers=0, n_std_outliers=0, sustained_outliers=nan, model_name='', model_dependent_values=None, source_flags=None), FilterDependentAdler(filter_name='r', phaseAngle_min=nan, phaseAngle_range=nan, observationTime_max=nan, arc=nan, nobs=0, n_outliers=0, n_std_outliers=0, sustained_outliers=nan, model_name='', model_dependent_values=None, source_flags=None), FilterDependentAdler(filter_name='i', phaseAngle_min=nan, phaseAngle_range=nan, observationTime_max=nan, arc=nan, nobs=0, n_outliers=0, n_std_outliers=0, sustained_outliers=nan, model_name='', model_dependent_values=None, source_flags=None), FilterDependentAdler(filter_name='z', phaseAngle_min=nan, phaseAngle_range=nan, observationTime_max=nan, arc=nan, nobs=0, n_outliers=0, n_std_outliers=0, sustained_outliers=nan, model_name='', model_dependent_values=None, source_flags=None)])}
[5]:
# inspect just the ssObject table
planetoid.SSObject.__dict__
[5]:
{'ssObjectId': '8268570668335894776',
 'filter_list': ['g', 'r', 'i', 'z'],
 'discoverySubmissionDate': 60218.0,
 'firstObservationDate': 60220.01958,
 'arc': 3342.05859375,
 'numObs': 94,
 'filter_dependent_values': [FilterDependentSSO(filter_name='g', H=20.292325973510742, G12=1.7233933210372925, Herr=0.030210301280021667, G12err=0.0404973067343235, nData=9.0),
  FilterDependentSSO(filter_name='r', H=19.805892944335938, G12=1.52932608127594, Herr=0.01974303089082241, G12err=0.05071713775396347, nData=38.0),
  FilterDependentSSO(filter_name='i', H=19.47262954711914, G12=1.7948637008666992, Herr=0.021644478663802147, G12err=0.04562043771147728, nData=32.0),
  FilterDependentSSO(filter_name='z', H=19.590879440307617, G12=1.7000616788864136, Herr=0.042724426835775375, G12err=0.0960792824625969, nData=15.0)],
 'maxExtendedness': 0.0,
 'minExtendedness': 0.0,
 'medianExtendedness': 0.0}
[6]:
# retrieve all observations in the r filter
obs_r = planetoid.observations_in_filter("r")
[7]:
# inspect the fields available in the observations table
obs_r.__dict__
[7]:
{'ssObjectId': '8268570668335894776',
 'filter_name': 'r',
 'diaSourceId': array([ 3143041177716967798, -3104998623142691451,  5751338980001415282,
         3286469592089350514,  5224425422607762094,  4560856135615553299,
         5155758115802430466, -5971538637416122678,  8249885337400201451,
        -8451684893195274998,  1835196257128010000, -3297106309337908787,
         1903461628503901062,  2646642141499836902, -3377529068683137916,
        -1627033925810759798,  3432357944307080584, -6886919974417000415,
        -2626645652075447222,   687890452005474276,   752193725415843661,
         -786563943595319518,  4625356763533857267, -2949619640806116520,
         6628439691429180033,  2763176974893874383,  1499244245090148039,
         2347544943023417500, -7353764788427149942,  8268675397298995882,
        -1795415124350038203,  9191430519381915082, -4780995102289103506,
          303469121011070742, -2092174335073920607, -4375146155029383212,
        -1334792330958883646,  4221003523165974753]),
 'mag': array([21.91399956, 21.98600006, 21.75900078, 22.09399986, 21.61499977,
        21.72800064, 21.72200012, 20.4470005 , 21.78899956, 21.95899963,
        22.17900085, 22.44499969, 22.38999939, 22.92399979, 22.24799919,
        22.27599907, 22.29100037, 22.66200066, 22.69799995, 23.93300056,
        23.74200058, 22.14299965, 22.16799927, 22.24900055, 22.28499985,
        22.26199913, 22.44000053, 23.56800079, 23.70199966, 24.19499969,
        22.22900009, 22.04899979, 22.17700005, 23.52199936, 23.70199966,
        22.88699913, 23.06800079, 24.24200058]),
 'magErr': array([0.095     , 0.049     , 0.07      , 0.047     , 0.036     ,
        0.038     , 0.034     , 0.011     , 0.052     , 0.06      ,
        0.042     , 0.098     , 0.1       , 0.116     , 0.046     ,
        0.06      , 0.082     , 0.083     , 0.063     , 0.35100001,
        0.2       , 0.057     , 0.034     , 0.036     , 0.054     ,
        0.051     , 0.046     , 0.17200001, 0.199     , 0.17      ,
        0.264     , 0.28299999, 0.31600001, 0.163     , 0.248     ,
        0.182     , 0.211     , 0.38299999]),
 'midPointMjdTai': array([63492.00291, 63500.06856, 63479.0044 , 63502.00311, 62406.09011,
        62407.07445, 62407.09369, 61294.15865, 62412.12365, 62414.13572,
        62415.05691, 62422.06327, 62422.06596, 63534.03975, 61322.07319,
        61323.00925, 61326.03134, 61329.00043, 61330.01524, 63554.05676,
        63562.05437, 60223.98877, 60224.07621, 60226.02382, 60228.0802 ,
        60228.08066, 60230.03315, 61355.02232, 61355.02277, 60264.01472,
        61253.97055, 61253.96744, 61253.96433, 61052.13729, 63217.23761,
        62125.2233 , 62113.17449, 62095.28873]),
 'ra': array([268.4639755, 281.1782352, 239.848597 , 283.7424099, 298.1255196,
        298.9437966, 298.9592036, 301.5682143, 302.7875618, 304.1818652,
        304.7993288, 309.1175392, 309.1190487, 311.280946 , 315.2799036,
        315.6390597, 316.7793075, 317.8804823, 318.2527231, 322.0860789,
        325.868688 , 322.7789008, 322.7931457, 323.1475474, 323.5372789,
        323.5373434, 323.9242256, 327.0967385, 327.0968451, 332.3781914,
        170.4323598, 170.4247983, 170.4172297,  62.6767601,  68.4459325,
         69.233718 ,  74.6917865,  81.7128501]),
 'dec': array([-22.9543395, -21.8517282, -21.8243507, -21.5140075, -18.6306791,
        -18.443366 , -18.4396764, -17.709034 , -17.5230447, -17.1737751,
        -17.0169932, -15.874741 , -15.8743016, -15.6284188, -13.7156598,
        -13.6098197, -13.2712987, -12.9420707, -12.8300092, -12.3090787,
        -11.0256047, -10.889507 , -10.8850457, -10.7825671, -10.6694075,
        -10.6693695, -10.5571517, -10.035292 , -10.0351984,  -7.9025949,
         -3.6550378,  -3.6513877,  -3.6478445,  27.0535373,  28.5344673,
         28.6462634,  29.3204275,  29.563878 ]),
 'phaseAngle': array([ 56.70839691,  50.07988358,  72.76689148,  48.80239868,
         40.30448914,  39.98022079,  39.97434235,  33.56268311,
         38.53084564,  38.03194427,  37.81433105,  36.34851074,
         36.34802628,  36.50101089,  32.00559616,  31.97466469,
         31.86707687,  31.74268913,  31.69605255,  31.88496971,
         30.16068649,  26.89824295,  26.91216087,  27.17892265,
         27.42977715,  27.42983437,  27.63732719,  29.76596832,
         29.76592445,  27.73990822, 126.7827301 , 126.78705597,
        126.79136658,  18.63666534,   5.73195124,   7.0533433 ,
          2.55333257,   9.17568874]),
 'topocentricDist': array([0.58142245, 0.68610221, 0.47289231, 0.71412551, 0.70371586,
        0.72016948, 0.72049457, 0.45957258, 0.806705  , 0.8421095 ,
        0.85847169, 0.98606402, 0.98611432, 1.27393341, 0.93472457,
        0.95206416, 1.00859618, 1.06491303, 1.08432984, 1.67350197,
        1.8374033 , 0.92473841, 0.92631632, 0.96172243, 0.99953324,
        0.99954176, 1.03583491, 1.58487654, 1.58488584, 1.71470714,
        0.20776999, 0.20780498, 0.20783997, 1.4200809 , 1.59280014,
        1.50733411, 1.56365716, 1.73338318]),
 'heliocentricDist': array([1.19897687, 1.29408848, 1.0418874 , 1.31655276, 1.42970574,
        1.44069195, 1.44090629, 1.35723567, 1.49640727, 1.51831007,
        1.52828085, 1.60294342, 1.60297179, 1.66633558, 1.66025329,
        1.66984999, 1.70058703, 1.73042095, 1.74053574, 1.86338043,
        1.93771982, 1.73265779, 1.73353231, 1.75293028, 1.77324426,
        1.77324879, 1.79237878, 1.97701716, 1.97702122, 2.10192013,
        0.87671232, 0.87667543, 0.87663853, 2.21820784, 2.55602884,
        2.46223307, 2.54469585, 2.65981913]),
 'heliocentricX': array([0.98566008, 1.12571287, 0.73635548, 1.15778017, 1.31445014,
        1.32917261, 1.32945919, 1.21433091, 1.40272045, 1.43113804,
        1.44398427, 1.53844213, 1.53847742, 1.61610746, 1.60835254,
        1.6200074 , 1.65702462, 1.69250548, 1.70443583, 1.84563196,
        1.92748308, 1.69669056, 1.6977191 , 1.720438  , 1.74403691,
        1.74404216, 1.76608646, 1.96962559, 1.96962988, 2.09952807,
        0.43896684, 0.43889508, 0.43882334, 0.21914509, 0.60625774,
        0.49559182, 0.59499252, 0.7396673 ]),
 'heliocentricY': array([-0.62823319, -0.591133  , -0.67211491, -0.58139241, -0.52635294,
        -0.52067292, -0.52056134, -0.56387866, -0.4907873 , -0.47855896,
        -0.47290507, -0.42888543, -0.4288682 , -0.39009613, -0.39520952,
        -0.38906994, -0.36910382, -0.34929019, -0.34247679, -0.25461146,
        -0.19891214, -0.34091538, -0.34032753, -0.32719636, -0.31325784,
        -0.31325474, -0.29995513, -0.16988276, -0.16987962, -0.06223172,
        -0.68560243, -0.68559992, -0.68559748,  1.96290016,  2.20046926,
         2.13928843,  2.19267511,  2.26149249]),
 'heliocentricZ': array([-2.67100602e-01, -2.40826562e-01, -3.02607685e-01, -2.34177470e-01,
        -1.98070377e-01, -1.94404349e-01, -1.94332495e-01, -2.22553208e-01,
        -1.75322443e-01, -1.67603314e-01, -1.64049789e-01, -1.36677057e-01,
        -1.36666417e-01, -1.12675406e-01, -1.15985326e-01, -1.12248190e-01,
        -1.00141644e-01, -8.81937891e-02, -8.40995014e-02, -3.16579603e-02,
         9.86804022e-04, -8.43857080e-02, -8.40325207e-02, -7.61566833e-02,
        -6.78237751e-02, -6.78219125e-02, -5.98958135e-02,  1.76592711e-02,
         1.76611003e-02,  7.85964429e-02, -3.25395137e-01, -3.25397670e-01,
        -3.25400203e-01,  1.00967538e+00,  1.15050876e+00,  1.11374378e+00,
         1.14613962e+00,  1.18877327e+00]),
 'topocentricX': array([-0.01435127,  0.1234522 , -0.22050345,  0.15782602,  0.31435132,
         0.33062559,  0.33094278,  0.22919159,  0.41657984,  0.45202053,
         0.46848297,  0.59839433,  0.59844565,  0.8094067 ,  0.6452319 ,
         0.66156477,  0.71535748,  0.7698307 ,  0.78880835,  1.28993249,
         1.4928441 ,  0.72311616,  0.72449768,  0.75596648,  0.78997087,
         0.7899785 ,  0.82303035,  1.31028664,  1.31029677,  1.50484931,
        -0.20446318, -0.2044939 , -0.20452462,  0.58050925,  0.51407999,
         0.46901953,  0.35993701,  0.21731049]),
 'topocentricY': array([-0.53519064, -0.62472492, -0.37960306, -0.64535236, -0.58809692,
        -0.59784675, -0.5980404 , -0.37300903, -0.6467135 , -0.6655817 ,
        -0.67407537, -0.73586392, -0.73588711, -0.92194605, -0.6389581 ,
        -0.64696926, -0.67225099, -0.69607198, -0.70397091, -1.00468957,
        -1.01192188, -0.54929483, -0.55006027, -0.56661528, -0.58375275,
        -0.58375663, -0.59963137, -0.84776878, -0.84777045, -0.78744459,
         0.03446353,  0.03449643,  0.03452932,  1.1235975 ,  1.30146933,
         1.23689175,  1.31497216,  1.49196291]),
 'topocentricZ': array([-0.22675332, -0.25537139, -0.17580356, -0.26189023, -0.22481389,
        -0.22783792, -0.22789675, -0.13979426, -0.24289058, -0.24865004,
        -0.25123635, -0.26972356, -0.26973024, -0.34319466, -0.22162651,
        -0.2240289 , -0.23153538, -0.2385039 , -0.24078552, -0.35676584,
        -0.3513993 , -0.17469768, -0.17492484, -0.17992155, -0.1850553 ,
        -0.18505643, -0.18978186, -0.27617133, -0.27617154, -0.23575412,
        -0.01324528, -0.01323442, -0.01322356,  0.64588523,  0.76086235,
         0.72261721,  0.76571345,  0.85524261]),
 'eclipticLambda': array([268.58558081, 280.3680903 , 242.19930327, 282.77157013,
        296.55441997, 297.35233258, 297.36739748, 299.94604719,
        301.12232173, 302.49868464, 303.10960108, 307.40833212,
        307.40984948, 309.48581377, 313.73417695, 314.099399  ,
        315.26064109, 316.38419288, 316.76453376, 320.49051677,
        324.41453945, 321.58423352, 321.59894389, 321.96226343,
        322.36204967, 322.36212203, 322.75904945, 325.8839194 ,
        325.88404981, 331.52416508, 172.6562335 , 172.64779346,
        172.63938943,  65.73527931,  71.04391986,  71.74908298,
         76.60156794,  82.75348791]),
 'eclipticBeta': array([ 0.47741032,  1.18614006, -1.24795459,  1.3180692 ,  2.25335252,
         2.2897149 ,  2.2905188 ,  2.50866696,  2.44401182,  2.4924115 ,
         2.51209177,  2.62982849,  2.62988902,  2.33282034,  3.11692547,
         3.11931728,  3.12462268,  3.12527436,  3.12476444,  2.47665892,
         2.49908301,  3.60933183,  3.6091223 ,  3.59552019,  3.58030813,
         3.58032381,  3.56440019,  3.03235519,  3.0324083 ,  3.24050077,
        -7.1501227 , -7.14975301, -7.14948424,  5.886738  ,  6.50256307,
         6.51321818,  6.59037966,  6.33281263]),
 'reduced_mag': array([22.69748655, 22.2442361 , 23.29608557, 22.22793578, 21.60177977,
        21.64797142, 21.64066789, 21.47195362, 21.38017677, 21.42535443,
        21.5893551 , 21.45088317, 21.39573365, 21.28945381, 21.29370916,
        21.2692807 , 21.11941945, 21.33467112, 21.31877818, 21.46336177,
        20.98452321, 21.11934119, 21.13954299, 21.1149286 , 21.04217083,
        21.01914605, 21.09639885, 21.08797141, 21.22195309, 21.41096887,
        25.92680044, 25.74652589, 25.87425196, 21.03042275, 20.65336449,
        20.03930569, 20.06911369, 20.92326717]),
 'num_obs': 38}
[8]:
# plot the observations as a phasecurve
x_plot = "phaseAngle"
y_plot = "reduced_mag"

x = getattr(obs_r, x_plot)
y = getattr(obs_r, y_plot)
xerr = obs_r.magErr

fig = plt.figure()
gs = gridspec.GridSpec(1, 1)
ax1 = plt.subplot(gs[0, 0])

ax1.errorbar(x, y, xerr, fmt="o")

ax1.invert_yaxis()
ax1.set_xlabel(x_plot)
ax1.set_ylabel(y_plot)

plt.show()
../_images/notebooks_adler_phasecurve_example_8_0.png
[9]:
# retrieve the phase curve model parameters provided in the ssObject table

sso_r = planetoid.SSObject_in_filter("r")

r_H = sso_r.H
r_G12 = sso_r.G12

pc = PhaseCurve(H=r_H * u.mag, phase_parameter_1=r_G12, model_name="HG12_Pen16")
/home/docs/checkouts/readthedocs.org/user_builds/adler/envs/latest/lib/python3.10/site-packages/sbpy/photometry/iau.py:53: InvalidPhaseFunctionWarning: G12 parameter could result in an invalid phsae function
  warnings.warn(msg, exception)
[10]:
# what sbpy model is being used?
pc.model_function
[10]:
<HG12_Pen16(H=19.80589294 mag, G12=1.52932608)>
[11]:
# set up an array of phase angles to plot the model
alpha = np.linspace(0, np.amax(obs_r.phaseAngle)) * u.deg
alpha
[11]:
$[0,~2.5875789,~5.1751578,~7.7627367,~10.350316,~12.937895,~15.525473,~18.113052,~20.700631,~23.28821,~25.875789,~28.463368,~31.050947,~33.638526,~36.226105,~38.813684,~41.401263,~43.988841,~46.57642,~49.163999,~51.751578,~54.339157,~56.926736,~59.514315,~62.101894,~64.689473,~67.277052,~69.864631,~72.452209,~75.039788,~77.627367,~80.214946,~82.802525,~85.390104,~87.977683,~90.565262,~93.152841,~95.74042,~98.327999,~100.91558,~103.50316,~106.09074,~108.67831,~111.26589,~113.85347,~116.44105,~119.02863,~121.61621,~124.20379,~126.79137]\mathrm{{}^{\circ}}$
[12]:
# calculate the model reduced magnitude over these phase angles
red_mag = pc.ReducedMag(alpha)
red_mag
[12]:
$[19.805893,~19.920355,~20.052052,~20.202895,~20.360566,~20.513141,~20.658458,~20.794601,~20.920251,~21.035105,~21.140282,~21.238644,~21.334969,~21.432803,~21.532351,~21.633562,~21.736362,~21.840655,~21.946316,~22.053192,~22.161093,~22.2698,~22.379056,~22.488576,~22.598035,~22.706974,~22.814826,~22.920961,~23.024702,~23.12535,~23.222222,~23.314692,~23.402255,~23.484581,~23.561579,~23.633452,~23.700294,~23.761468,~23.816277,~23.864116,~23.904505,~23.937131,~23.961868,~23.978792,~23.988178,~23.990477,~23.986295,~23.97653,~23.964571,~23.955435] \; \mathrm{mag}$
[13]:
# plot the observations with the model phase curve
x_plot = "phaseAngle"
y_plot = "reduced_mag"

x = getattr(obs_r, x_plot)
y = getattr(obs_r, y_plot)
xerr = obs_r.magErr

fig = plt.figure()
gs = gridspec.GridSpec(1, 1)
ax1 = plt.subplot(gs[0, 0])

ax1.errorbar(x, y, xerr, fmt="o")

ax1.plot(alpha.value, red_mag.value)

ax1.invert_yaxis()
ax1.set_xlabel(x_plot)
ax1.set_ylabel(y_plot)

plt.show()
../_images/notebooks_adler_phasecurve_example_13_0.png
[14]:
# plot the observations as a lightcurve
x_plot = "midPointMjdTai"
y_plot = "reduced_mag"

x = getattr(obs_r, x_plot)
y = getattr(obs_r, y_plot)
xerr = obs_r.magErr

fig = plt.figure()
gs = gridspec.GridSpec(1, 1)
ax1 = plt.subplot(gs[0, 0])

ax1.errorbar(x, y, xerr, fmt="o")

ax1.invert_yaxis()
ax1.set_xlabel(x_plot)
ax1.set_ylabel(y_plot)

plt.show()
../_images/notebooks_adler_phasecurve_example_14_0.png
[15]:
# do a different phase curve fit to the data
# adler is able to fit different models, and perform more sophisticated fits
[16]:
# create a new PhaseCurve object with a different sbpy model
pc_fit = PhaseCurve(H=pc.H, model_name="HG")
[17]:
pc_fit.model_function
[17]:
<HG(H=19.80589294 mag, G=0.2)>
[18]:
# use adler to fit this new phase curve model to the data
pc_fit.FitModel(
    phase_angle=obs_r.phaseAngle * u.deg,
    reduced_mag=obs_r.reduced_mag * u.mag,
    mag_err=obs_r.magErr * u.mag,
)
[18]:
<HG(H=18.87964381 mag, G=-0.253 )>
[19]:
# plot the observations with both
x_plot = "phaseAngle"
y_plot = "reduced_mag"

x = getattr(obs_r, x_plot)
y = getattr(obs_r, y_plot)
xerr = obs_r.magErr

fig = plt.figure()
gs = gridspec.GridSpec(1, 1)
ax1 = plt.subplot(gs[0, 0])

ax1.errorbar(x, y, xerr, fmt="o")

ax1.plot(alpha.value, pc.ReducedMag(alpha).value, label=pc.model_name)
ax1.plot(alpha.value, pc_fit.ReducedMag(alpha).value, label=pc_fit.model_name)

ax1.invert_yaxis()
ax1.set_xlabel(x_plot)
ax1.set_ylabel(y_plot)
ax1.legend()

plt.show()
../_images/notebooks_adler_phasecurve_example_19_0.png
[20]:
# # now we would add our calculated values back into planetoid
# planetoid.AdlerSchema.r_H = pc_fit.abs_mag
# planetoid.AdlerSchema.r_G = pc_fit.phase_param
[ ]: