Wafer and die comparisons

You can compare any dies or wafers, as another type of aggregated analysis

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

import matplotlib.pyplot as plt
import pandas as pd

import gdsfactoryhub as gfh
project_id = f"resistance-{getpass.getuser()}"
client = gfh.create_client_from_env(project_id=project_id)
api = client.api()
query = client.query()
wafers = query.wafers().execute().data
wafer_ids = [w["wafer_id"] for w in wafers]
die_analyses_per_wafer = {}

for wafer_id in wafer_ids:
    die_analyses_per_wafer[wafer_id] = (
        query.analyses()
        .not_.is_("die", "null")  # only keep die analyses
        .eq("die.wafer.wafer_id", wafer_id)  # only keep die analyses for this wafer
        .eq("function.function_id", "die_iv_sheet_resistance")  # only keep die analyses for this function
        .execute()
        .data
    )
df = pd.DataFrame(
    [
        {
            "die_pkey": analysis["die"]["pk"],
            "sheet_resistance": analysis["output"]["sheet_resistance"],
            "wafer_id": wafer_id,
        }
        for wafer_id, analyses in die_analyses_per_wafer.items()
        for analysis in analyses
    ]
)
df.head()
def remove_outliers(df, column_name="sheet_resistance"):
    Q1 = df[column_name].quantile(0.25)
    Q3 = df[column_name].quantile(0.75)
    IQR = Q3 - Q1
    lower_bound = Q1 - 1.5 * IQR
    upper_bound = Q3 + 1.5 * IQR
    return df[(df[column_name] >= lower_bound) & (df[column_name] <= upper_bound)]


filtered_df = remove_outliers(df)
filtered_df.head()
df.boxplot(column="sheet_resistance", by="wafer_id", grid=False)
plt.title("before removing outliers")
plt.suptitle("")
plt.xlabel("Wafer ID")
plt.ylabel("Sheet Resistance")
plt.grid(True, which="major", axis="y", color="gray", alpha=0.5, linestyle="--")
plt.gca().xaxis.grid(True, color="gray", alpha=0.5, linestyle="--")
plt.tight_layout()
plt.show()
filtered_df.boxplot(column="sheet_resistance", by="wafer_id", grid=False)
plt.title("after removing outliers")
plt.suptitle("")
plt.xlabel("Wafer ID")
plt.ylabel("Sheet Resistance")
plt.grid(True, which="major", axis="y", color="gray", alpha=0.5, linestyle="--")
plt.gca().xaxis.grid(True, color="gray", alpha=0.5, linestyle="--")
plt.tight_layout()
plt.show()
On This Page