Now we will run a die loss cutback analysis on the die data we uploaded earlier.
As before, make sure you have the following environment variables set or added to a .env file:
GDSFACTORY_HUB_API_URL="https://{org}.gdsfactoryhub.com"
GDSFACTORY_HUB_QUERY_URL="https://query.{org}.gdsfactoryhub.com"
GDSFACTORY_HUB_KEY="<your-gdsfactoryplus-api-key>"
project_id = f"spirals-{getpass.getuser()}"
client = gfh.create_client_from_env(project_id=project_id)
api = client.api()
query = client.query()
utils = client.utils()
Lets Define the Upper and Lower Spec limits for Known Good Die (KGD).
For example:
| waveguide width (nm) | Lower Spec Limit (dB/cm) | Upper Spec limit (dB/cm) |
|---|---|---|
| 300 | 0 | 3.13 |
| 500 | 0 | 2.31 |
| 800 | 0 | 1.09 |
As for waveguide loss you can define no minimum loss (0 dB/cm) and you only define the maximum accepted loss (Upper Spec Limit)
Lets find a wafer pkey for this project, so that we can trigger the wafer analysis on it.
from gdsfactoryhub.functions.wafer import aggregate_die_analyses
aggregate_die_analyses.run(
wafer_pkey=wafer_pkeys[0],
die_function_id="propagation-loss",
output_key="propagation_loss",
min_output=0.065,
max_output=0.10,
)
{'output': {'mean_propagation_loss': np.float64(0.08296279661949407)},
'summary_plot': <Figure size 1000x450 with 4 Axes>,
'wafer_pkey': '89edb89b-520d-44f5-ac44-c0210f364ac9'}

with gfh.suppress_api_error():
result = api.upload_function(
function_id="aggregate_die_analyses",
target_model="wafer",
file=gfh.get_module_path(aggregate_die_analyses),
test_target_model_pk=wafer_pkeys[0],
test_kwargs={
"die_function_id": "propagation-loss",
"output_key": "propagation_loss",
"min_output": 0.065,
"max_output": 0.10,
},
)
Duplicate function
results = []
for wafer_pk in (pb := tqdm(wafer_pkeys)):
pb.set_postfix(wafer_pk=wafer_pk)
result = api.start_analysis( # start_analysis triggers the analysis task, but does not wait for it to finish.
analysis_id=f"wafer_propagation_loss_{wafer_pk}",
function_id="aggregate_die_analyses",
target_model="wafer",
target_model_pk=wafer_pk,
kwargs={
"wafer_pkey": wafer_pk,
"die_function_id": "propagation-loss",
"output_key": "propagation_loss",
"min_output": 0.065,
"max_output": 0.10,
},
)
results.append(result)
0%| | 0/1 [00:00<?, ?it/s]
Let's have a look at the last analysis:
analysis_pks = [r["pk"] for r in results]
utils.analyses().wait_for_completion(pks=analysis_pks)
analyses = query.analyses().in_("pk", analysis_pks).execute().data
succesful_analyses = [a for a in analyses if a["status"] == "COMPLETED"]
analysis = succesful_analyses[-1]
img = api.download_plot(analysis["summary_plot"]["path"])
img.resize((530, 400))
Waiting for analyses: 0%| | 0/1 [00:00<?, ?it/s]
