WCS (pyobs.images.processors.wcs)
SolarHelioprojective
- class SolarHelioprojective(keyword_x: str = 'DISKPOS1', keyword_y: str = 'DISKPOS2', keyword_radius: str = 'DISKRAD', **kwargs: Any)
Add a time-aware solar helioprojective WCS to the image header based on disk center, radius, and DATE-OBS.
This processor writes a helioprojective Cartesian WCS (HPLN/HPLT, tangent projection) to the image’s FITS header. It reads the solar disk center pixel coordinates and disk radius (in pixels) from header keywords and computes the angular pixel scale at the observation time using the Sun’s apparent angular radius. The observation time is taken from
DATE-OBSand interpreted as UTC.The WCS fields set are:
CRPIX1/CRPIX2: the disk center pixel coordinates (x, y).
CRVAL1/CRVAL2: 0.0, i.e., the helioprojective longitude/latitude at the center.
CTYPE1/CTYPE2: “HPLN-TAN” and “HPLT-TAN”.
CDELT1/CDELT2: angular pixel scale in degrees per pixel, computed as
sunpy.coordinates.sun.angular_radius(obs_time).degree / disk_radius_pixels, whereobs_time = astropy.time.Time(DATE-OBS, scale="utc").
- Parameters:
keyword_x (str) – FITS header keyword holding the x coordinate of the solar disk center in pixels. Default: “DISKPOS1”.
keyword_y (str) – FITS header keyword holding the y coordinate of the solar disk center in pixels. Default: “DISKPOS2”.
keyword_radius (str) – FITS header keyword holding the solar disk radius in pixels. Default: “DISKRAD”.
kwargs – Additional keyword arguments forwarded to
pyobs.images.processor.ImageProcessor.
Behavior
Parses the observation time from
DATE-OBSwithobs_time = Time(image.header["DATE-OBS"], scale="utc").Computes the angular pixel scale (CDELT) as the Sun’s apparent angular radius at
obs_time(in degrees) divided by the disk radius in pixels.Writes CRPIX1/CRPIX2 from the specified center keywords and sets CRVAL1/CRVAL2 to 0.0 with helioprojective tangent CTYPEs.
Returns a copy of the input image with the updated header; pixel data are unchanged.
Input/Output
Input:
pyobs.images.Imagewhose header contains:the disk center and radius keywords specified by
keyword_x,keyword_y, andkeyword_radius, andDATE-OBSparsable byastropy.time.Time(UTC assumed here).
Output:
pyobs.images.Image(copied) with a helioprojective WCS written into the FITS header.
Configuration (YAML)
Use disk center/radius estimated upstream (e.g., via SimpleDisk):
class: pyobs.images.processors.wcs.SolarHelioprojective keyword_x: "DISKPOS1" keyword_y: "DISKPOS2" keyword_radius: "DISKRAD"
Notes
Coordinate convention: CRPIX values in FITS/WCS are defined in 1-based pixel coordinates. Ensure the disk center stored under
keyword_x/keyword_yis in FITS convention; if zero-based values were written previously, add 1 before using them as CRPIX.Units: This implementation sets CDELT in degrees per pixel and does not add CUNIT keywords. If arcseconds are preferred, convert CDELT to arcseconds and set
CUNIT1 = CUNIT2 = "arcsec".Time dependence: The angular pixel scale is computed at the observation time from
DATE-OBS(UTC). IfDATE-OBSis missing or not parseable, the step cannot proceed.Disk radius must be positive and non-zero; otherwise the scale is undefined.