phases2hypoellipse (VICIC BLAZ [PHD0900016])

Hello Blaž,

The mixing of P and S on one line can be problematic with modern data sets containing many phases and phase types. But if you have only P and S, then, if you can sort on station and then phase (P or S), or if your phases already come out of NonLinLoc in this order, then you should be able to write the hypo phase format: For each P phase, check the following phase to see if it is S from the same station, if so, add the S reading to the current line, and skip over the S reading to continue.

Best regards,


Thank you.

I managed to do it, sadly not so straight forward due to my beginners knowledge of python, but it does the trick.

You should consider using a dictionary structure..


station_phases = {
"ABC": {'P': t1, 'S': t2},
"XYZ": {'P': t3}}

for station, phases in station_phases.items():
    if "P" in phases:
        if "S" in phases:
            # write both
            # only write P

Of course if phase types get more complex you need more detailed checks..