.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_light_curve.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_light_curve.py: Plot a Light Curve ================== This is an example plot of a light curve using NEATM. .. GENERATED FROM PYTHON SOURCE LINES 7-67 .. image-sg:: /auto_examples/images/sphx_glr_plot_light_curve_001.png :alt: plot light curve :srcset: /auto_examples/images/sphx_glr_plot_light_curve_001.png :class: sphx-glr-single-img .. code-block:: Python import kete import numpy as np import matplotlib.pyplot as plt # Using ceres as a source for a state vector state = kete.spice.get_state("ceres", 2460000.5) # Various input values albedo = 0.1 G = 0.15 diameter = 0.5 beaming = 1 wavelength = 22000 emissivity = 0.9 # Geometry and rotation information # Rotation rate is in rotations per day rotation_rate = 3.2 # sample 30 times over the course of 10 day, this will be highly nyquist limited. dts = np.linspace(0, 10, 30) # Construct an object which is twice the radius in they y axis. geom = kete.shape.TriangleEllipsoid(30, x_scale=1, y_scale=2, z_scale=1) normals = [kete.Vector(norm) for norm in geom.normals] # Pick an axis of rotation axis_of_rotation = kete.Vector.from_lat_lon(90, 0) jd = state.jd fluxes = [] for dt in dts: # Find the observer and object positions some time in the future. earth_pos = kete.spice.get_state("Earth", jd + dt).pos final_pos = kete.propagate_two_body([state], jd + dt, earth_pos)[0].pos obj2obs = final_pos - earth_pos # Rotate the normal vectors around the defined axis of rotation new_normals = np.array( [ norm.rotate_around(axis_of_rotation, rotation_rate * dt * 360) for norm in normals ] ) ss_temp = kete.flux.sub_solar_temperature(-obj2obs, albedo, G, emissivity, beaming) temps = kete.flux.neatm_facet_temps(new_normals, ss_temp, obj2obs) facet_fluxes = [kete.flux.black_body_flux(t, wavelength) for t in temps] facet_fluxes = np.array(facet_fluxes) * geom.areas flux = kete.flux.lambertian_flux( facet_fluxes, geom.normals, -obj2obs, diameter, emissivity ) fluxes.append(flux) plt.plot(dts, fluxes) plt.xlabel("Time (days)") plt.ylabel("Flux (Jy)") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.382 seconds) .. _sphx_glr_download_auto_examples_plot_light_curve.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_light_curve.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_light_curve.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_light_curve.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_