ism3d.simxy.render.xy_render¶
-
ism3d.simxy.render.
xy_render
(objs, w, psf=None, pb=None, normalize_kernel=False)[source]¶ Note: psf/pb should not contain missing data
map a cloudlets-based model into a gridd data model (i.a FITS image-like for exporting or XY->UV tranform)
objs: componnet list obj: target metadata (galactic center position (ra,dec), redshift, vsys, etc.)
whatever information nesscarity to convert WCS units to physical units
header: data frame loc: cloudlet position and velocity in the physical car on-sky frame weights: cloudlet weights
convert pixel index wthin a WCS to a position in the on-sky galactic coordinates defined in the cloudlet model (ppv)
# get the coordinate of tl tr pix in the galactic frame
# x/y_sky is along x/y_pix # here we directly map x/y_gal into x/y_pix without considering RA/DEC
- pb must match wcs
if pb is set the outcome is a images with a fluxscale of true_flux x pb
- output:
cube: the rendered/discretized intrinsic model with absolute flux-scaling scube: convolve(cube*PB,psf)
- Note: for a frequency-indepdent continuum+PSF model (narrow-band cases), only one convolve_fft run is needed.
for a spectral line model, the minimal number of convolve_fft runs will depend on its channel-wise extension avoid broadcasting in additional dimension as the memory allocation may slow down the process (even slower than loop versions) https://stackoverflow.com/questions/49632993/why-python-broadcasting-in-the-example-below-is-slower-than-a-simple-loop