Python script to calculate interfacial depth of insertion