multicolorfits.reproject_image#

multicolorfits.reproject_image(mapin, hdrfrom, hdrto, scale=False, method='interp', interpdict={'cval': nan, 'mode': 'constant', 'order': 1}, returnfootprint=False, parallel=True)[source]#

Function that reprojects a 2D map from the parameters in one header to the parameters in another header.

Parameters:
  • mapin (array) – Input map / data array (np.ndarray). Usually would get this from astropy.io.fits.getdata(…)

  • hdrfrom (astropy.io.fits.header) – Header for the original image, specifying the original pixel size, etc.

  • hdrto (astropy.io.fits.header) – Header to reproject to (usually just a second image’s header)

  • scale (bool) – True if units are Flux [W/m^2, Jy, or similar]. False for brightness [W/m^2/sr, Jy/sr, or similar] –> Note that when convolving maps in beam units [e.g., Jy/beam], the reprojection will need scale=True because the beam sizes change.

  • method (str) – One of ‘kapteyn’ (kapteyn package, interpolation), ‘interp’ (reproject package), or ‘spi’ (reproject package, spherical polygon intersection). Drizzle not yet implemented

  • interpdict (dict) – For method=’kapteyn’. Sets the interpol_dict (interpolation). interpdict={order:<>,mode:<>,cval:<>} –> order = spline order, 0 to 5; mode=’constant’,’nearest’,’reflect’,’wrap’; cval = value outside bounds (NaN)

  • returnfootprint (bool) – True to also return the footprint of which reprojected pixels fell on original image grid

  • parallel (bool) – True to use parallel processing (method=’spi’ only)

Returns:

array (, array) – Reprojected map (, optional footprint)