-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A suggestion to mass_downloader.domain: add distance restriction based on RectangularDomain #3355
Comments
It should be quite simple to achieve what you need. If I see this right, you can just set up a new subclass to See here class MyDomain(Domain):
def __init__(self, minlatitude, maxlatitude, minlongitude,
maxlongitude, latitude, longitude, minradius,
maxradius):
self.minlatitude = minlatitude
self.maxlatitude = maxlatitude
self.minlongitude = minlongitude
self.maxlongitude = maxlongitude
self.latitude = latitude
self.longitude = longitude
self.minradius = minradius
self.maxradius = maxradius
def get_query_parameters(self):
return {
"minlatitude": self.minlatitude,
"maxlatitude": self.maxlatitude,
"minlongitude": self.minlongitude,
"maxlongitude": self.maxlongitude,
"latitude": self.latitude,
"longitude": self.longitude,
"minradius": self.minradius,
"maxradius": self.maxradius} |
You can do the above with your existing installation, if you feel like this would be needed for more people feel free to make a pull request, it would need some new added tests though. from obspy.clients.fdsn.mass_downloader.domain import Domain
class MyDomain(Domain):
...
mydomain = MyDomain(...)
...
mdl.download(mydomain, ...) |
Yeah, I have tested to set up a new subclass to Anyway, the latter can truely achieve the requirement of combination of two domain.
|
you can set
The idea is for a custom subclass with more complex geometry logic, you could actually implement that method yourself so that it returns |
Avoid duplicates
Bug Summary
No distance restrictions.
I can't find any epicentrical distance restrictions based on mass_downloader.domain.RectangularDomain and mass_downloader.restrictions.Restrictions when I use the massdownloader to download seismic data.
For RectangularDomain, obspy just offers the longitude and latitude restrictions. However, if I use the CircularDomain to constrain the domain, I don't need to download total seismic data from all direction (full azimuth). And I don't need to define a new domain based on the Domain which means too complex for me.
Suggestions:
Code to Reproduce
No response
Error Traceback
No response
ObsPy Version?
1.4.0
Operating System?
Ubuntu
Python Version?
3.9.18
Installation Method?
conda
The text was updated successfully, but these errors were encountered: