You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first issue on GitHub. Sorry if something is wrong:-)
I found that most filters are insensitive to xarray coordinates names; only the order is important.
But filter reduction_to_pole works only if coordinates have names "northing" and "easting". Otherwise error "'freq_northing' is not a valid dimension or coordinate" appears.
So maybe it could be useful to change row 475 in _filters.py
from: da_filter.loc[dict(freq_northing=0, freq_easting=0)] = 0
to: da_filter.loc[{freq_northing.name:0, freq_easting.name:0}] = 0
The current version generates dict with string keys: "freq_northing" and "freq_easting" while the suggested one generates keys according to the initial coordinate names.
The text was updated successfully, but these errors were encountered:
zaarcvon
changed the title
Issue on page /_modules/harmonica/filters/_filters.html
Filter reduction_to_pole works only with "northing", "easting" coordinate names.
Sep 26, 2023
Hi @zaarcvon thank you for reporting this! Good catch! You'll see that in the rest of the function we avoid using the dimension names precisely for this reason but that line must have slipped past our tests.
The fix you suggests would work and so would something like:
da_filter.loc[{dims[0]=0, dims[1]=0}] =0
Would you be interested in contributing this fix? If so, have a look at our Contributing Guide. A good test for this would be to change the name the coordinates in one of our test datasets and then run the filter to make sure it doesn't produce an error.
leouieda
changed the title
Filter reduction_to_pole works only with "northing", "easting" coordinate names.
Filter reduction_to_pole works only with "northing", "easting" coordinate names
Oct 30, 2023
My first issue on GitHub. Sorry if something is wrong:-)
I found that most filters are insensitive to xarray coordinates names; only the order is important.
But filter reduction_to_pole works only if coordinates have names "northing" and "easting". Otherwise error "'freq_northing' is not a valid dimension or coordinate" appears.
So maybe it could be useful to change row 475 in _filters.py
from:
da_filter.loc[dict(freq_northing=0, freq_easting=0)] = 0
to:
da_filter.loc[{freq_northing.name:0, freq_easting.name:0}] = 0
The current version generates dict with string keys: "freq_northing" and "freq_easting" while the suggested one generates keys according to the initial coordinate names.
The text was updated successfully, but these errors were encountered: