Method for magnetic characterization of nanowire structures