astrohack.utils.ray_tracing_general =================================== .. py:module:: astrohack.utils.ray_tracing_general Attributes ---------- .. autoapisummary:: astrohack.utils.ray_tracing_general.nanvec3d astrohack.utils.ray_tracing_general.return_line Classes ------- .. autoapisummary:: astrohack.utils.ray_tracing_general.GlobalQPS astrohack.utils.ray_tracing_general.LocalQPS Functions --------- .. autoapisummary:: astrohack.utils.ray_tracing_general.generalized_dot astrohack.utils.ray_tracing_general.generalized_norm astrohack.utils.ray_tracing_general.generalized_dist astrohack.utils.ray_tracing_general.normalize_vector_map astrohack.utils.ray_tracing_general.reflect_light astrohack.utils.ray_tracing_general.simple_axis astrohack.utils.ray_tracing_general.np_qps_fitting astrohack.utils.ray_tracing_general.degrade_pcd astrohack.utils.ray_tracing_general.qps_compute_point_and_normal astrohack.utils.ray_tracing_general.qps_compute_point_and_normal_jit astrohack.utils.ray_tracing_general.qps_compute_normal_jit astrohack.utils.ray_tracing_general.local_qps_image_jit astrohack.utils.ray_tracing_general.global_qps_image_jit astrohack.utils.ray_tracing_general.global_qps_normal_image_jit Module Contents --------------- .. py:data:: nanvec3d .. py:data:: return_line :value: '\x1b[F' .. py:function:: generalized_dot(vec_map_a, vec_map_b) .. py:function:: generalized_norm(vecmap) .. py:function:: generalized_dist(vec_map_a, vec_map_b) .. py:function:: normalize_vector_map(vector_map) .. py:function:: reflect_light(light, normals) .. py:function:: simple_axis(minmax, resolution, margin=0.05) Creates an array spaning from min to max (may go over max if resolution is not an integer division) spaced by resolution :param minmax: the minimum and maximum of the axis :param resolution: The spacing between array elements :param margin: Add a margin at the edge of the array beyonf min and max :returns: A numpy array representation of a linear axis. .. py:function:: np_qps_fitting(pcd) .. py:function:: degrade_pcd(pcd, degrading_factor) Degrades de number of points in a pcd by an integer factor :param pcd: pcd data, assumes [:, 3] :param degrading_factor: integer pcd degrading factor Returns: degraded pcd .. py:function:: qps_compute_point_and_normal(pnt, qps_coeffs, pcd) .. py:function:: qps_compute_point_and_normal_jit(pnt, qps_coeffs, pcd) .. py:function:: qps_compute_normal_jit(pnt, qps_coeffs, pcd) .. py:function:: local_qps_image_jit(global_pcd, local_qps_coeffs, local_pcds, points) .. py:function:: global_qps_image_jit(pcd, qps_coeffs, points) .. py:function:: global_qps_normal_image_jit(pcd, qps_coeffs, points) .. py:class:: GlobalQPS .. py:attribute:: n_qps_extra_vars :value: 6 .. py:attribute:: n_points :value: None .. py:attribute:: point_cloud :value: None .. py:attribute:: qps_coefficients :value: None .. py:method:: from_point_cloud(pcd_data, degradation_factor=None, displacement=(0, 0, 0)) :classmethod: .. py:method:: from_point_cloud_and_coefficients(point_cloud, qps_coefficients) :classmethod: .. py:method:: from_pickle(filename) :classmethod: .. py:method:: to_pickle(filename) .. py:method:: from_zarr(filepath) :classmethod: .. py:method:: to_zarr(filepath) .. py:method:: compute_gridded_z_cos(u_axis, v_axis, mask, light=(0, 0, 1)) .. py:method:: compute_gridded_z_val_and_z_cos(u_axis, v_axis, mask, light=(0, 0, 1)) .. py:class:: LocalQPS .. py:attribute:: n_qps_extra_vars :value: 6 .. py:attribute:: npnt :value: -1 .. py:attribute:: local_qps_n_pnt :value: -1 .. py:attribute:: global_pcd :value: None .. py:attribute:: local_qps_coeffs :value: None .. py:attribute:: local_pcds :value: None .. py:attribute:: current_z_val :value: None .. py:attribute:: current_z_cos :value: None .. py:attribute:: current_u_axis :value: None .. py:attribute:: current_v_axis :value: None .. py:attribute:: high_res_z_val :value: None .. py:attribute:: high_res_z_cos :value: None .. py:attribute:: high_res_u_axis :value: None .. py:attribute:: high_res_v_axis :value: None .. py:method:: from_pcd(pcd_data, local_qps_n_pnt=20, displacement=(0, 0, 0)) :classmethod: .. py:method:: export_to_xr_data_variables() Idea is to return pcd values and qpd coeffs as Xarray data variables for storage. Returns: xarray data variables .. py:method:: from_xr_data_variable() :classmethod: Idea is to init an object from a few xarray Data variables from storage Returns: initialized obj .. py:method:: compute_z_val_and_z_cos(point) Idea is to compute value of QPS and angle with boresight :param point: Returns: .. py:method:: vectorized_z_val_and_z_cos(point_arr) .. py:method:: plot_z_val_and_z_cos(colormap='viridis', zlim=None, dpi=300, display=False) .. py:method:: compute_gridded_z_val_and_z_cos(u_axis, v_axis, mask, gridding_engine='2D regrid', light=(0, 0, -1), vectorized=True) .. py:method:: downgrid_high_resolution_z_val_and_z_cos(u_axis, v_axis, gridding_engine) .. py:method:: compute_high_resolution_z_val_and_z_cos(x_resolution, y_resolution) .. py:method:: from_pickle(filename) :classmethod: .. py:method:: get_local_qps(ipnt) .. py:method:: to_pickle(filename)