Platform macOS-13.3-arm64-arm-64bit
Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)]
Executable /usr/local/bin/python3
CPU Apple M2 Max (12 cores)
Memory 64.0 GiB
Dear all
I am trying to remove time of acquisition for eeg data
Code
##################
import mne
from mne.io import read_raw_edf
from mne.export
import export_raw file_name = ‘d001.edf’
Replace with your EDF file path raw = read_raw_edf(file_name)
# Define a new datetime object in UTC
# Example: January 1st, 2000 at 12:00:00 PM UTC
new_date_utc = ‘2000-01-01 00:00:00 UTC’
rawrewrite=raw.copy()
print(rawrewrite.info)”
# Set the new measurement date
rawrewrite.set_meas_date(new_date_utc)
print(‘’) print(‘Original Time Info Removed’) print(‘’) print(rawrewrite.info)
# Define the output filename with the .edf extension
output_fname = ‘d001nodate.edf’
# Export the raw object to EDF format
# The fmt=‘edf’ parameter ensures the correct format is used
# You can also specify the filename with a .edf extension and set fmt=‘auto’
export_raw(output_fname, rawrewrite, fmt=‘edf’, overwrite=True)
############################
See code above i try to modify meas_date to 2000-01-01 00:00:00 UTC
when i recheck the data info it is unspecified
but if i write and read the modified data, the date is 1985-01-01 00:00:00 UTC
Thank you
Anne-Cecile Lesage
Research scientist UTMB
To get the correct formatting, paste your Python code, then select it, and click on the Preformatted text toolbar button.
Please avoid sharing screenshots of code and error messages! Screenshots are difficult to work with especially on mobile devices; they don’t allow others to copy code and other text; and they don’t show up in the search.
Please edit or remove the above text before submitting your posting.
![]()