광원(Sources)
COMPASS는 다양한 광학 시나리오를 시뮬레이션하기 위해 여러 조명 광원(illumination source) 유형을 지원합니다.
PlanewaveSource
compass.sources.planewave.PlanewaveSource는 단일 평면파(plane wave) 또는 여러 파장에서의 평면파 세트를 모델링합니다.
생성자
@dataclass
class PlanewaveSource:
wavelengths: np.ndarray # 파장 배열 (um)
theta_deg: float = 0.0 # 극 입사각 (도)
phi_deg: float = 0.0 # 방위각 (도)
polarization: str = "unpolarized" # "TE", "TM", 또는 "unpolarized"팩토리 메서드
@classmethod
def from_config(cls, source_config: dict) -> PlanewaveSource:광원 설정 딕셔너리에서 PlanewaveSource를 생성합니다. 세 가지 파장 모드를 지원합니다:
단일 파장:
source:
wavelength:
mode: single
value: 0.55 # 550 nm파장 스윕(sweep):
source:
wavelength:
mode: sweep
sweep:
start: 0.38 # 380 nm
stop: 0.78 # 780 nm
step: 0.01 # 10 nm 간격파장 목록:
source:
wavelength:
mode: list
values: [0.45, 0.55, 0.65]속성(Properties)
| 속성 | 타입 | 설명 |
|---|---|---|
theta_rad | float | 극각 (라디안) |
phi_rad | float | 방위각 (라디안) |
n_wavelengths | int | 파장 수 |
is_unpolarized | bool | TE+TM 평균이 필요한지 여부 |
메서드
get_polarization_runs
def get_polarization_runs(self) -> List[str]:비편광(unpolarized)인 경우 ["TE", "TM"]을 반환하고, 편광(polarized)인 경우 ["TE"] 또는 ["TM"]을 반환합니다.
편광 상태 뷰어
3D 투시도에서 애니메이션 전기장 벡터 전파를 통해 다양한 편광 상태를 시각화합니다.
to_solver_params
def to_solver_params(self) -> dict:솔버 호환 매개변수 딕셔너리로 변환합니다. 키: wavelengths, theta_rad, phi_rad, polarization, polarization_runs.
ConeIllumination
compass.sources.cone_illumination.ConeIllumination은 주광선각(Chief Ray Angle, CRA)과 f-넘버(f-number)로 지정된 카메라 렌즈의 사출 동공 조명(exit-pupil illumination)을 모델링합니다.
생성자
class ConeIllumination:
def __init__(
self,
cra_deg: float = 0.0,
f_number: float = 2.0,
n_points: int = 37,
sampling: str = "fibonacci",
weighting: str = "cosine",
):매개변수:
cra_deg-- 주광선각(Chief Ray Angle) (도 단위). 조명 콘의 중심 방향입니다.f_number-- 렌즈 f-넘버. 콘 반각을 결정합니다:. n_points-- 콘 내부의 각도 샘플링 포인트 수.sampling-- 샘플링 방법:"fibonacci"(기본값),"rings","halton","hammersley","gauss"/"gaussian_quadrature", 또는"grid".weighting-- 각도 가중치:"uniform","cosine"(기본값),"cos4", 또는"gaussian".
인터랙티브 콘 조명 뷰어
CRA(주광선 각도)와 콘 반각이 픽셀 조명에 미치는 영향을 시각화합니다. 콘은 방향별 평행 광선 묶음들로 표현되며, 각 묶음은 마이크로렌즈와 고굴절률 스택을 통과하면서 스넬 법칙에 따라 굴절되어 방향별 초점으로 수렴합니다.
설정
source:
type: cone_illumination
cone:
cra_deg: 15.0
f_number: 2.0
pupil_shape: circular
sampling:
type: fibonacci
n_points: 37
weighting: cosine메서드
get_sampling_points
def get_sampling_points(self) -> List[Tuple[float, float, float]]:조명 콘의 각도 샘플링을 나타내는 (theta_deg, phi_deg, weight) 튜플 리스트를 반환합니다. 가중치의 합은 1로 정규화됩니다.
샘플링 방법
피보나치 나선(Fibonacci spiral): 황금비(golden ratio)를 사용하여 콘 캡 위에 준균일 샘플링을 생성합니다. 정규 그리드보다 적은 포인트로 우수한 각도 커버리지를 제공합니다.
동일 면적 ring(Equal-area rings): cone cap을 동심 band로 나누고, 둘레가 큰 바깥 ring에 더 많은 방위각 샘플을 배치합니다. 눈으로 검토하기 쉬운 deterministic 패턴이 필요할 때 유용합니다.
Halton: cone cap 위의 low-discrepancy 샘플링입니다. 눈에 띄는 각도 대칭 없이 deterministic 수렴 확인을 할 때 유용합니다.
Hammersley: cone cap 위의 fixed-budget low-discrepancy point set입니다. 시뮬레이션 전에 n_points를 정하고 실행할 때 사용합니다.
Gauss-Legendre: radial angle 방향 quadrature node와 균일 방위각 샘플을 사용합니다. n_points를 정확히 맞추는 것보다 적분 정확도가 중요할 때 사용합니다.
그리드(Grid): legacy 극좌표
가중치 옵션
| 가중치 | 수식 | 사용 사례 |
|---|---|---|
uniform | 모든 각도에 동일한 가중치 | |
cosine | 램버시안 조명(Lambertian illumination) (기본값) | |
cos4 | 보다 현실적인 카메라 렌즈 감쇠 | |
gaussian | 아포다이즈된 조명(apodized illumination) |
COMPASS에서의 사용
콘형 조명(cone illumination)은 평면파 시뮬레이션의 가중 합으로 구현됩니다:
러너(runner)는 샘플링 포인트마다 하나의 RCWA 또는 FDTD 시뮬레이션을 수행하고 결과를 평균합니다.
RayFileReader
compass.sources.ray_file_reader는 광학 설계 도구(예: Zemax)의 광선 데이터를 가져옵니다.
설정
source:
ray_file:
enabled: true
path: "data/zemax_rays.json"
format: zemax_json # 또는 "csv"이를 통해 렌즈 설계 시뮬레이션에서 현실적인 조명 조건을 직접 가져올 수 있습니다.
광원 설정 레퍼런스
source:
type: "planewave" # "planewave" 또는 "cone_illumination"
wavelength:
mode: "single" # "single", "sweep", 또는 "list"
value: 0.55 # 단일 모드용
sweep: # 스윕 모드용
start: 0.38
stop: 0.78
step: 0.01
values: [0.45, 0.55, 0.65] # 목록 모드용
angle:
theta_deg: 0.0 # 극각 (도)
phi_deg: 0.0 # 방위각 (도)
polarization: "unpolarized" # "TE", "TM", 또는 "unpolarized"
cone: # cone_illumination 유형용
cra_deg: 0.0
f_number: 2.0
pupil_shape: "circular"
sampling:
type: "fibonacci"
n_points: 37
weighting: "cosine"
ray_file: # 외부 광선 가져오기
enabled: false
path: ""
format: "zemax_json"