Skip to content

Instantly share code, notes, and snippets.

@julioxavierr
Created June 10, 2019 16:28
Show Gist options
  • Save julioxavierr/6bcf8d482d942023636d8bb617f6751e to your computer and use it in GitHub Desktop.
Save julioxavierr/6bcf8d482d942023636d8bb617f6751e to your computer and use it in GitHub Desktop.
import pyedflib
import numpy as np
import sys
from shutil import copyfile
import datetime
# copy input as output
copyfile(sys.argv[1], sys.argv[2])
# read input and get number of signals
f = pyedflib.EdfReader(sys.argv[1])
print(f.getStartdatetime())
n = f.signals_in_file
# write into output the current datetime
o = pyedflib.EdfWriter(sys.argv[2], 1)
now = datetime.datetime.now()
o.setStartdatetime(now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment