When could I realistically raise my masts on a sub without detection...at what distance? I realise AI doesn't detect masts

but, I consider this an exploit (so I'm not going to use it). So at what approximate distance from an enemy surface platform should I not raise my mast?