Filename Filtering #7

Open
opened 11 months ago by miili · 1 comments
miili commented 11 months ago
Owner

Discard invalid filenames.

idas_convert pyrocko_env_io/idas_convert_DEEPEN_long-period_250Hz --resume
/home/wollin/pyrocko_env_io/.progress-idas_convert_DEEPEN_long-period_250Hz
INFO:idas_convert.app:Using checkpoint file /home/wollin/pyrocko_env_io/.progress-idas_convert_DEEPEN_long-period_250Hz, Resuming from 2021-07-16 23:53:11
INFO:idas_convert:Detecting files...
Traceback (most recent call last):
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 406, in in_timeframe
    fn_tmin = tdms_guess_time(fn)
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 48, in tdms_guess_time
    return datetime.strptime(time_str, '%Y%m%d_%H%M%S.%f%z').timestamp()
  File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '5km_incrGain_OD4_P5+0000' does not match format '%Y%m%d_%H%M%S.%f%z'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wollin/pyrocko_env/bin/idas_convert", line 8, in <module>
    sys.exit(main())
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/app.py", line 67, in main
    converter = config.get_converter()
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 681, in get_converter
    return iDASConvert(
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 419, in __init__
    files = list(filter(in_timeframe, files))
  File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 408, in in_timeframe
    logger.warning('Could not guess time for %s', op.filename(fn))
AttributeError: module 'posixpath' has no attribute 'filename'


==============================================
Discard invalid filenames. ``` idas_convert pyrocko_env_io/idas_convert_DEEPEN_long-period_250Hz --resume /home/wollin/pyrocko_env_io/.progress-idas_convert_DEEPEN_long-period_250Hz INFO:idas_convert.app:Using checkpoint file /home/wollin/pyrocko_env_io/.progress-idas_convert_DEEPEN_long-period_250Hz, Resuming from 2021-07-16 23:53:11 INFO:idas_convert:Detecting files... Traceback (most recent call last): File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 406, in in_timeframe fn_tmin = tdms_guess_time(fn) File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 48, in tdms_guess_time return datetime.strptime(time_str, '%Y%m%d_%H%M%S.%f%z').timestamp() File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '5km_incrGain_OD4_P5+0000' does not match format '%Y%m%d_%H%M%S.%f%z' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/wollin/pyrocko_env/bin/idas_convert", line 8, in <module> sys.exit(main()) File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/app.py", line 67, in main converter = config.get_converter() File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 681, in get_converter return iDASConvert( File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 419, in __init__ files = list(filter(in_timeframe, files)) File "/home/wollin/pyrocko_env/lib/python3.8/site-packages/idas_convert/idas_convert.py", line 408, in in_timeframe logger.warning('Could not guess time for %s', op.filename(fn)) AttributeError: module 'posixpath' has no attribute 'filename' ============================================== ```
miili changed title from Filename to Filename Filtering 11 months ago
Poster
Owner
files = filter(lambda filename: op.splitext(filename)[-1] == 'tdms', files)
```python files = filter(lambda filename: op.splitext(filename)[-1] == 'tdms', files) ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.