uafgeotools / lts_array

Least trimmed squares array processing for infrasound and seismic data
MIT License
12 stars 6 forks source link

Function argument and plotting changes #7

Closed jwbishop closed 4 years ago

jwbishop commented 4 years ago

Updates the order of ltsva output. Updates plotting for optional station dictionary input (addresses #5 ). Adjusts example to recommended default alpha = 0.75.

davidfee5 commented 4 years ago

lts Essentially no elements are flagged for the example with alpha=0.75. Is this correct? I'm surprised.

davidfee5 commented 4 years ago

When ALPHA=1.0 in the example, stdict is not "None" as expected. Instead it returns "{'size': 6}".

davidfee5 commented 4 years ago

When ALPHA=1.0 in the example, stdict is not "None" as expected. Instead it returns "{'size': 6}".

This was actually done on purpose to preserve the output types, i.e. a dictionary is consistently returned. In the case of ordinary least squares, it's an empty dictionary. As in the array_processing plotting script, I expect the plotting default stdict=None behavior to be used when the station pair plot is undesired. For least squares, the output stdict variable can be ignored entirely by assigning it to __ in the tuple unpacking.

Does that make sense?

OK, but then if stdict is not None: on line 87 of lts_array_plot.py does not pass and it still tries to plot the element pairs subplot. Try the example with alpha=1.0 and you'll see what I mean.

jwbishop commented 4 years ago

When ALPHA=1.0 in the example, stdict is not "None" as expected. Instead it returns "{'size': 6}".

This was actually done on purpose to preserve the output types, i.e. a dictionary is consistently returned. In the case of ordinary least squares, it's an empty dictionary. As in the array_processing plotting script, I expect the plotting default stdict=None behavior to be used when the station pair plot is undesired. For least squares, the output stdict variable can be ignored entirely by assigning it to __ in the tuple unpacking. Does that make sense?

OK, but then if stdict is not None: on line 87 of lts_array_plot.py does not pass and it still tries to plot the element pairs subplot. Try the example with alpha=1.0 and you'll see what I mean.

Are you still passing a station dictionary as an argument to the plotting script? That will not evaluate as None, so the plotting script will attempt to plot the empty dictionary. I can fix this by adding an additional check for empty dictionaries. This should be done for the array_processing plotting script as well.

jwbishop commented 4 years ago

When ALPHA=1.0 in the example, stdict is not "None" as expected. Instead it returns "{'size': 6}".

This was actually done on purpose to preserve the output types, i.e. a dictionary is consistently returned. In the case of ordinary least squares, it's an empty dictionary. As in the array_processing plotting script, I expect the plotting default stdict=None behavior to be used when the station pair plot is undesired. For least squares, the output stdict variable can be ignored entirely by assigning it to __ in the tuple unpacking. Does that make sense?

OK, but then if stdict is not None: on line 87 of lts_array_plot.py does not pass and it still tries to plot the element pairs subplot. Try the example with alpha=1.0 and you'll see what I mean.

Are you still passing a station dictionary as an argument to the plotting script? That will not evaluate as None, so the plotting script will attempt to plot the empty dictionary. I can fix this by adding an additional check for empty dictionaries. This should be done for the array_processing plotting script as well.

Fixed. This was actually an issue where ltsva was not returning a truly empty dictionary for least squares processing.