@@ -358,19 +358,42 @@ def scaled_coordinates_2d_from(
358358
359359
360360def pixel_coordinates_wcs_2d_from (
361- scaled_coordinates_2d ,
362- shape_native ,
363- pixel_scales ,
364- origins = (0.0 , 0.0 ),
365- ):
361+ scaled_coordinates_2d : Tuple [ float , float ] ,
362+ shape_native : Tuple [ int , int ] ,
363+ pixel_scales : ty . PixelScales ,
364+ origins : Tuple [ float , float ] = (0.0 , 0.0 ),
365+ ) -> Tuple [ float , float ] :
366366 """
367367 Return FITS / WCS pixel coordinates (1-based, pixel-centre convention) as floats.
368368
369369 This function returns continuous pixel coordinates suitable for Astropy WCS
370- transforms (e.g. wcs_pix2world with origin=1). Pixel centres lie at integer
371- values; for an image of shape (ny, nx) the geometric centre is:
372- ((ny + 1)/2, (nx + 1)/2)
373- e.g. (100, 100) -> (50.5, 50.5).
370+ transforms (e.g. ``wcs_pix2world`` with ``origin=1``). Pixel centres lie at
371+ integer values; for an image of shape ``(ny, nx)`` the geometric centre is::
372+
373+ ((ny + 1) / 2, (nx + 1) / 2)
374+
375+ e.g. ``(100, 100) -> (50.5, 50.5)``.
376+
377+ Parameters
378+ ----------
379+ scaled_coordinates_2d
380+ The 2D (y, x) coordinates in scaled units which are converted to WCS
381+ pixel coordinates.
382+ shape_native
383+ The (y, x) shape of the 2D array on which the scaled coordinates are
384+ defined, used to determine the geometric centre in WCS pixel units.
385+ pixel_scales
386+ The (y, x) conversion factors from scaled units to pixel units.
387+ origins
388+ The (y, x) origin in scaled units about which the coordinates are
389+ defined. The scaled coordinates are shifted by this origin before being
390+ converted to WCS pixel coordinates.
391+
392+ Returns
393+ -------
394+ pixel_coordinates_wcs_2d
395+ A 2D (y, x) WCS pixel coordinate in the 1-based, pixel-centre
396+ convention, returned as floats.
374397 """
375398 ny , nx = shape_native
376399
0 commit comments