Die Analysis

Now we will run a die analysis on the power envelopes 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>"
import getpass

from tqdm.auto import tqdm

import gdsfactoryhub as gfh
project_id = f"spirals-{getpass.getuser()}"
client = gfh.create_client_from_env(project_id=project_id)
api = client.api()
query = client.query()

Die Analysis

You can trigger a die analysis for 300, 500 and 800nm wide waveguides.

from gdsfactoryhub.functions.die import propagation_loss

propagation_loss.run?
die_pkey = query.dies().limit(1).execute().data[0]["pk"]
len(die_pkey)
propagation_loss.run(die_pkey=die_pkey)

Lets aggregate the data from different dies to extract the die propagation loss

result = api.validate_function(
    function_id="propagation-loss",
    target_model="die",
    file=gfh.get_module_path(propagation_loss),
    test_target_model_pk=die_pkey,
    test_kwargs={},
)
result.summary_plot()
with gfh.suppress_api_error():
    result = api.upload_function(
        function_id="propagation-loss",
        target_model="die",
        file=gfh.get_module_path(propagation_loss),
    )
dies = query.dies().execute().data

task_ids = []
for die in tqdm(dies):
    task_id = api.start_analysis(
        analysis_id="die_loss_cutback",
        function_id="propagation-loss",
        target_model="die",
        target_model_pk=die["pk"],
        kwargs={},
    )
    task_ids.append(task_id)
result = api.wait_for_result(task_ids[-1])
result.summary_plot()
On This Page