Skip to content

Commit

Permalink
Power calculations added
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihir-DG committed Jun 27, 2024
1 parent c6dc3a4 commit 4cc97b8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions LabExT/Movement/Stages/DMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from LabExT.View.Controls.DriverPathDialog import DriverPathDialog
import numpy as np
import time
import math

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
Expand Down Expand Up @@ -371,6 +372,22 @@ def fiber_sweep(self) -> np.ndarray:
p -= 1
return dat

def powerCalc_in_mW(self,
voltList: list,
lossRatio: float = 0.2,
responsivity: float = 0.45) -> list:
# in mV
p = []
for voltage in voltList:
photoCurrent = voltage/200 # mA
power = photoCurrent/responsivity
p.append(power)
return p

def powerConV_mW_to_dBm(self,
mW_pow: float):
return 10*math.log10(mW_pow)




Expand Down

0 comments on commit 4cc97b8

Please sign in to comment.