Skip to content

Failed to connect #8

@chyiever

Description

@chyiever

hello, dear authors,

Question 1
when I run the Usage Example from https://github.com/SCEDC/pystp/tree/master, I am sometimes faced this error:
(Sometimes, code is right at the beginning, but this error occurs after serval debugging times )

Exception has occurred: Exception
Failed to connect
  File ".\Untitled-1.py", line 73, in <module>
    client.connect()   # Open a connection.
Exception: Failed to connect

my codes are follows, do you know what's wrong? Very thanks!

from pystp import STPClient

client = STPClient()
client.connect()   # Open a connection.

# Download a catalog.
events = client.get_events(times=[datetime.datetime(2019, 10, 17), datetime.datetime(2019, 10, 17, 23, 59, 59)], mags=[2, 4])
# Get event IDs.
evids = [ev.resource_id.id for ev in events]
# Download all CI.CLC.BH waveforms for the events in the catalog.
waveforms = client.get_trig(evids, net='CI', sta='CLC', chan= 'BH_')

# Disconnect from the STP server.
client.disconnect()

Question 2

besides, when i run this codes, I find I can only download the first SAC file , because the PermissionError occured:

exception has occurred: PermissionError
[WinError 32] Another program is using this file, and the process can not access it: '.\39136904\39136904.CI.CLC.BHZ.sac'
File ".\Untitled-1.py", line 81, in <module>
waveforms = client.get_trig(evids, net='CI', sta='CLC', chan= 'BHZ')
PermissionError: [WinError 32] Another program is using this file, and the process can not access it : '.\39136904\39136904.CI.CLC.BHZ.sac'

I don't know if you've ever encountered this problem, but I'd be grateful if I could get your discussion and guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions