Skip to content
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

Mass downloader: ignoring unusual channels without channel_priorities keyword #1810

Closed
trichter opened this issue Jun 8, 2017 · 3 comments
Closed
Assignees

Comments

@trichter
Copy link
Member

trichter commented Jun 8, 2017

Consider the following script:

from obspy.core import UTCDateTime
from obspy.clients.fdsn.mass_downloader import CircularDomain, \
    Restrictions, MassDownloader

source_time = UTCDateTime('2011-10-25 19:00')
dt = 1000
domain = CircularDomain(latitude=37.2212, longitude=-116.0609,
                        minradius=0, maxradius=0.001)
restrictions = Restrictions(
    starttime=source_time,
    endtime=source_time + dt,
    chunklength_in_sec=86400,
#    channel='CLZ',
#    channel_priorities=['CLZ'],
    )

mdl = MassDownloader(providers=['IRIS'])
mdl.download(domain, restrictions, 'waveforms', 'stations')

This script does not find any data. Uncommenting channel='CLZ' does not find any data. Only uncommenting channel_priorities=['CLZ'] is working properly.

Problem is that the default value of channel_priorities does not include the above channel and/or the code block in download_helpers.py which always applies channel priorities contrary to what the documentation says.

                for location, _channels in itertools.groupby(
                        sorted(channels, key=get_loc), get_loc):
                    filtered_channels.extend(utils.filter_channel_priority(
                        list(_channels), key="channel",
                        priorities=self.restrictions.channel_priorities))
                channels = filtered_channels

PS Unrelated question: Can someone tell me why the following warning pops up? Did not recognize it using the normal FDSN client.

/home/eule/dev/obspy/obspy/io/mseed/util.py:654: UserWarning: Record contains a fractional seconds (.0001 secs) of 43010 - the maximum strictly allowed value is 9999. It will be interpreted as one or more additional seconds.
  category=UserWarning)
@Jollyfant
Copy link
Contributor

The answer to the unrelated question is that within the record header the data starttime can be given with a precision of 0.0001 seconds. The mSEED format specifies that the "10 microseconds" field can be anywhere between 0 and 9999. In this record it is over 10000 (thus > 1 second). ObsPy interprets the record start time to be 4 seconds later but nicely raises a warning.

Here is the related pull request: #1531

@trichter
Copy link
Member Author

trichter commented Jun 8, 2017

@Jollyfant Thank you for the explanation!

paride pushed a commit to paride/obspy that referenced this issue Jan 9, 2018
This makes the code works as documented, that is: if the 'channel'
variable is set, then the 'channel_priorities' list is ignored. The
same goes for the 'location' variable and 'location_priorities'.

Fixes obspy#1810.
Fixes obspy#2031.
paride pushed a commit to paride/obspy that referenced this issue Jan 12, 2018
@trichter
Copy link
Member Author

trichter commented Apr 3, 2019

This was fixed in the referencing PR.

@trichter trichter closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants