Skip to content

Commit

Permalink
Changelog and removed some documentation clutter
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlend committed Dec 4, 2024
1 parent 67bbcee commit cac4b82
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 56 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Comet Magnitude estimates now accepts two phase correction values instead of 1.

### Fixed

- Fixed a text case-sensitivity but on Horizons parameter parsing.
- Thermal model example had function arguments out of order.


## [v1.0.4]

Expand Down
8 changes: 4 additions & 4 deletions src/examples/plot_thermal_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
# result is not used in this example.

# Compute the temperature at the subsolar point on the object.
# Note that FRM uses a beaming = pi
neatm_subsolar_temp = kete.flux.sub_solar_temperature(
-obj2sun, vis_albedo, g_phase, emissivity, beaming
-obj2sun, vis_albedo, g_phase, beaming, emissivity
)
# Note that FRM uses a beaming = pi
frm_subsolar_temp = kete.flux.sub_solar_temperature(
-obj2sun, vis_albedo, g_phase, emissivity
-obj2sun, vis_albedo, g_phase, np.pi, emissivity
)

# Compute the FRM and NEATM facet temperatures for the object
Expand All @@ -60,7 +60,7 @@
plt.subplot(121, projection="3d")

norm = mpl.colors.Normalize(vmin=0, vmax=max(neatm_facet_temps))
m = cm.ScalarMappable(norm=norm, cmap=mpl.colormaps["RdBu_r"])
m = cm.ScalarMappable(norm=norm, cmap=mpl.colormaps["inferno"])
colors = m.to_rgba(neatm_facet_temps, alpha=1)
polygons = Poly3DCollection(geom.facets, edgecolor="black", lw=0.2, color=colors)
plt.gca().add_collection3d(polygons)
Expand Down
3 changes: 1 addition & 2 deletions src/kete/neos.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np
from .fov import NeosCmos, NeosVisit


__all__ = ["sunshield_rotation", "NeosCmos", "NeosVisit", "FOV_WIDTH", "FOV_HEIGHT"]
__all__ = ["sunshield_rotation", "FOV_WIDTH", "FOV_HEIGHT"]


BANDS: list[float] = [4700.0, 8000.0]
Expand Down
15 changes: 6 additions & 9 deletions src/kete/rust/flux/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ pub fn solar_flux_py(dist: f64, wavelength: f64) -> PyResult<f64> {
/// emissivity :
/// Emissivity of the object, 0.9 by default.
#[pyfunction]
#[pyo3(name = "sub_solar_temperature", signature = (obj2sun, geom_albedo, g_param, beaming, emissivity=None))]
#[pyo3(name = "sub_solar_temperature", signature = (obj2sun, geom_albedo, g_param, beaming, emissivity=0.9))]
pub fn sub_solar_temperature_py(
obj2sun: VectorLike,
geom_albedo: f64,
g_param: f64,
beaming: f64,
emissivity: Option<f64>,
emissivity: f64,
) -> f64 {
let emissivity = emissivity.unwrap_or(0.9);
let obj2sun = obj2sun.into_vec(PyFrames::Ecliptic);
sub_solar_temperature(&obj2sun, geom_albedo, g_param, beaming, emissivity)
}
Expand Down Expand Up @@ -222,7 +221,7 @@ pub fn frm_facet_temperature_py(
/// float
/// Flux in units of Jy.
#[pyfunction]
#[pyo3(name = "neatm_flux", signature = (sun2obj, sun2obs, v_albedo, g_param, beaming, diameter, wavelength, emissivity=None))]
#[pyo3(name = "neatm_flux", signature = (sun2obj, sun2obs, v_albedo, g_param, beaming, diameter, wavelength, emissivity=0.9))]
#[allow(clippy::too_many_arguments)]
pub fn neatm_thermal_py(
sun2obj: VectorLike,
Expand All @@ -232,9 +231,8 @@ pub fn neatm_thermal_py(
beaming: f64,
diameter: f64,
wavelength: f64,
emissivity: Option<f64>,
emissivity: f64,
) -> f64 {
let emissivity = emissivity.unwrap_or(0.9);
let sun2obj = sun2obj.into_vec(PyFrames::Ecliptic);
let sun2obs = sun2obs.into_vec(PyFrames::Ecliptic);

Expand Down Expand Up @@ -292,7 +290,7 @@ pub fn neatm_thermal_py(
/// float
/// Flux in units of Jy.
#[pyfunction]
#[pyo3(name = "frm_flux", signature = (sun2obj, sun2obs, v_albedo, g_param, diameter, wavelength, emissivity=None))]
#[pyo3(name = "frm_flux", signature = (sun2obj, sun2obs, v_albedo, g_param, diameter, wavelength, emissivity=0.9))]
#[allow(clippy::too_many_arguments)]
pub fn frm_thermal_py(
sun2obj: VectorLike,
Expand All @@ -301,9 +299,8 @@ pub fn frm_thermal_py(
g_param: f64,
diameter: f64,
wavelength: f64,
emissivity: Option<f64>,
emissivity: f64,
) -> f64 {
let emissivity = emissivity.unwrap_or(0.9);
let sun2obj = sun2obj.into_vec(PyFrames::Ecliptic);
let sun2obs = sun2obs.into_vec(PyFrames::Ecliptic);
let hg_params = HGParams::try_fill(
Expand Down
63 changes: 24 additions & 39 deletions src/kete/rust/flux/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,20 @@ impl PyNeatmParams {
#[new]
#[allow(clippy::too_many_arguments, missing_docs)]
#[pyo3(signature = (desig, band_wavelength, band_albedos, h_mag=None, diam=None,
vis_albedo=None, beaming=None, g_param=None, c_hg=None, emissivity=None, zero_mags=None))]
vis_albedo=None, beaming=1.0, g_param=0.15, c_hg=None, emissivity=0.9, zero_mags=None))]
pub fn new(
desig: String,
band_wavelength: Vec<f64>,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
beaming: Option<f64>,
g_param: Option<f64>,
beaming: f64,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
zero_mags: Option<Vec<f64>>,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let beaming = beaming.unwrap_or(1.0);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;

let obs_bands = ObserverBands::Generic {
Expand Down Expand Up @@ -256,21 +253,18 @@ impl PyNeatmParams {
#[staticmethod]
#[allow(clippy::too_many_arguments)]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None,
beaming=None, g_param=None, c_hg=None, emissivity=None))]
beaming=1.0, g_param=0.15, c_hg=None, emissivity=0.9))]
pub fn new_wise(
desig: String,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
beaming: Option<f64>,
g_param: Option<f64>,
beaming: f64,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let beaming = beaming.unwrap_or(1.0);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;

let band_albedos = match band_albedos.try_into() {
Expand Down Expand Up @@ -311,23 +305,20 @@ impl PyNeatmParams {
/// emissivity:
/// Emissivity of the object, defaults to `0.9`.
#[staticmethod]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, beaming=None,
g_param=None, c_hg=None, emissivity=None))]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, beaming=1.0,
g_param=0.15, c_hg=None, emissivity=0.9))]
#[allow(clippy::too_many_arguments)]
pub fn new_neos(
desig: String,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
beaming: Option<f64>,
g_param: Option<f64>,
beaming: f64,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let beaming = beaming.unwrap_or(1.0);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;

let band_albedos = match band_albedos.try_into() {
Expand Down Expand Up @@ -533,21 +524,19 @@ impl PyFrmParams {
#[new]
#[allow(clippy::too_many_arguments, missing_docs)]
#[pyo3(signature = (desig, band_wavelength, band_albedos, h_mag=None, diam=None,
vis_albedo=None, g_param=None, c_hg=None, emissivity=None, zero_mags=None))]
vis_albedo=None, g_param=0.15, c_hg=None, emissivity=0.9, zero_mags=None))]
pub fn new(
desig: String,
band_wavelength: Vec<f64>,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
g_param: Option<f64>,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
zero_mags: Option<Vec<f64>>,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;
let obs_bands = ObserverBands::Generic {
solar_correction: vec![1.0; band_wavelength.len()],
Expand Down Expand Up @@ -589,20 +578,18 @@ impl PyFrmParams {
/// Emissivity of the object, defaults to `0.9`.
#[staticmethod]
#[allow(clippy::too_many_arguments)]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, g_param=None,
c_hg=None, emissivity=None))]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, g_param=0.15,
c_hg=None, emissivity=0.9))]
pub fn new_wise(
desig: String,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
g_param: Option<f64>,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;

let band_albedos = match band_albedos.try_into() {
Expand Down Expand Up @@ -639,20 +626,18 @@ impl PyFrmParams {
/// Emissivity of the object, defaults to `0.9`.
#[staticmethod]
#[allow(clippy::too_many_arguments)]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, g_param=None,
c_hg=None, emissivity=None))]
#[pyo3(signature = (desig, band_albedos, h_mag=None, diam=None, vis_albedo=None, g_param=0.15,
c_hg=None, emissivity=0.9))]
pub fn new_neos(
desig: String,
band_albedos: Vec<f64>,
h_mag: Option<f64>,
diam: Option<f64>,
vis_albedo: Option<f64>,
g_param: Option<f64>,
g_param: f64,
c_hg: Option<f64>,
emissivity: Option<f64>,
emissivity: f64,
) -> PyResult<Self> {
let emissivity = emissivity.unwrap_or(0.9);
let g_param = g_param.unwrap_or(0.15);
let hg_params = HGParams::try_fill(desig, g_param, h_mag, c_hg, vis_albedo, diam)?;

let band_albedos = match band_albedos.try_into() {
Expand Down
3 changes: 1 addition & 2 deletions src/kete/wise.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
from .time import Time
from .vector import Vector, Frames
from .irsa import IRSA_URL, query_irsa_tap, plot_fits_image, zoom_plot, annotate_plot
from .fov import WiseCmos, FOVList

from ._core import (
WiseCmos,
FOVList,
w1_color_correction,
w2_color_correction,
w3_color_correction,
Expand Down

0 comments on commit cac4b82

Please sign in to comment.