Spaces:
Sleeping
Sleeping
Update app.py
Browse filesdecay calculation add
app.py
CHANGED
|
@@ -221,8 +221,9 @@ def patient_release_decision(neck_dose_microSv_hr: float, exposure_duration_hr:
|
|
| 221 |
|
| 222 |
Args:
|
| 223 |
neck_dose_microSv_hr (float): Measured neck dose in μSv/hr.
|
| 224 |
-
exposure_duration_hr (float):
|
| 225 |
-
|
|
|
|
| 226 |
sef (str): Socio-Economic Factor, which should be either "good" or "bad".
|
| 227 |
|
| 228 |
Returns:
|
|
@@ -242,9 +243,11 @@ def patient_release_decision(neck_dose_microSv_hr: float, exposure_duration_hr:
|
|
| 242 |
# Convert mSv to rem: multiply by 0.1 (since 1 mSv = 0.1 rem)
|
| 243 |
OF=OCCUPATIONAL_LIMITS.get("Occupancy factor (6/24)")
|
| 244 |
nuclide={RADIOACTIVE_NUCLIDES.get("I-131")}
|
| 245 |
-
|
|
|
|
|
|
|
| 246 |
total_dose_microSv = neck_dose_microSv_hr * 1.44*24*8.02*0.25
|
| 247 |
-
total_activity_microSv=(
|
| 248 |
total_dose_mSv = total_dose_microSv / 1000
|
| 249 |
tede_rem = total_dose_mSv * 0.1
|
| 250 |
tede_rem_activity=(total_activity_microSv)/10000
|
|
@@ -1003,3 +1006,4 @@ with gr.Blocks() as ui:
|
|
| 1003 |
# Launch the Gradio app with public URL
|
| 1004 |
#ui.launch()
|
| 1005 |
ui.launch(share=False, show_api=False) # Ensures no external sharing & API buttons
|
|
|
|
|
|
| 221 |
|
| 222 |
Args:
|
| 223 |
neck_dose_microSv_hr (float): Measured neck dose in μSv/hr.
|
| 224 |
+
exposure_duration_hr (float): elapsed time.
|
| 225 |
+
initial_activity (float): administered activity in mci.
|
| 226 |
+
remaining_activity(float): calculating decay
|
| 227 |
sef (str): Socio-Economic Factor, which should be either "good" or "bad".
|
| 228 |
|
| 229 |
Returns:
|
|
|
|
| 243 |
# Convert mSv to rem: multiply by 0.1 (since 1 mSv = 0.1 rem)
|
| 244 |
OF=OCCUPATIONAL_LIMITS.get("Occupancy factor (6/24)")
|
| 245 |
nuclide={RADIOACTIVE_NUCLIDES.get("I-131")}
|
| 246 |
+
decay_constant = math.log(2) / nuclide
|
| 247 |
+
# Compute remaining activity
|
| 248 |
+
remaining_activity = initial_activity * math.exp(-decay_constant * exposure_duration_hr )#mci
|
| 249 |
total_dose_microSv = neck_dose_microSv_hr * 1.44*24*8.02*0.25
|
| 250 |
+
total_activity_microSv=(remaining_activity*1.44*24*2.2*8.02*0.25)
|
| 251 |
total_dose_mSv = total_dose_microSv / 1000
|
| 252 |
tede_rem = total_dose_mSv * 0.1
|
| 253 |
tede_rem_activity=(total_activity_microSv)/10000
|
|
|
|
| 1006 |
# Launch the Gradio app with public URL
|
| 1007 |
#ui.launch()
|
| 1008 |
ui.launch(share=False, show_api=False) # Ensures no external sharing & API buttons
|
| 1009 |
+
x
|