adaptive sampling script