Skip to content

Extended Source

Bases: Source

queue_listerner instance-attribute

queue_listerner = setup_logging()

logger instance-attribute

logger = getLogger()

external_logger_flag instance-attribute

external_logger_flag = False

optBand instance-attribute

optBand = optBand

wavelength instance-attribute

wavelength = tmp[0]

bandwidth instance-attribute

bandwidth = tmp[1]

nPhoton instance-attribute

nPhoton = tmp[2]

fluxMap instance-attribute

fluxMap = []

tag instance-attribute

tag = 'sun'

altitude instance-attribute

altitude = altitude

coordinates instance-attribute

coordinates = coordinates

fov instance-attribute

fov = fov

img_PS instance-attribute

img_PS = img_PS

nSubDirs instance-attribute

nSubDirs = nSubDirs

patch_padding instance-attribute

patch_padding = patch_padding

subDir_margin instance-attribute

subDir_margin = subDir_margin

type instance-attribute

type = 'SUN'

img_path instance-attribute

img_path = str(img_path)

subDirs_stars instance-attribute

subDirs_stars = []

filter_2D instance-attribute

filter_2D = zeros(
    (filt_width, filt_width, nSubDirs, nSubDirs)
)

is_initialized instance-attribute

is_initialized = True

__init__

__init__(
    optBand: str,
    coordinates: list = [0, 0],
    fov=10,
    altitude: float = np.inf,
    img_path="",
    img_PS=None,
    nSubDirs=1,
    maxnSubDirs=7,
    patch_padding=5,
    subDir_margin=1.0,
    logger=None,
)

Initialize an extended source (e.g., the Sun) for use in AO simulations.

Parameters:

Name Type Description Default
optBand str

Optical band identifier.

required
coordinates list

Sky position [zenith, azimuth] in [arcsec, degrees], by default [0, 0].

[0, 0]
fov float

Field of view in arcseconds, by default 10.

10
altitude float

Altitude of the source in meters. Default is infinity.

inf
img_path str

Path to the H5 image of the source (e.g., solar image).

''
img_PS float

Plate scale in arcsec/pixel, by default None to use the metadata of the image.

None
nSubDirs int

Number of sub-directions across the extended source.

1
maxnSubDirs int

Maximum number of sub-directions allowed for processing limits.

7
patch_padding float

Padding beyond FOV for sub-region extraction.

5
subDir_margin float

Margin added to avoid boundary effects.

1.0
logger Logger

Optional logger instance.

None

photometry

photometry(arg)

Return photometric properties specific to solar sources.

Parameters:

Name Type Description Default
arg str

Photometric band identifier.

required

Returns:

Type Description
list

[wavelength, bandwidth, zero point flux] or -1 if not found.

print_properties

print_properties()

Print key attributes of the extended source.

Returns:

Type Description
None

load_sun_img

load_sun_img()

Load the solar image patch and extract both padded and unpadded versions.

Returns:

Type Description
tuple of np.ndarray

(unpadded image patch, padded image patch)

get_subDirs

get_subDirs()

Compute the sub-direction coordinates and extract subregions from the image.

Returns:

Type Description
tuple of (np.ndarray, np.ndarray)

Coordinates [r, theta] and subregion image cubes.

setup_logging

setup_logging(logging_level=logging.WARNING)

__del__

__del__()