diff --git a/doc/source/ch07_simulation.rst b/doc/source/ch07_simulation.rst index be02c8c129f8a976063a31a00f1eb1550f247b5f..97a72c9f292f8cebfa19260f2d0f47eb9320306b 100644 --- a/doc/source/ch07_simulation.rst +++ b/doc/source/ch07_simulation.rst @@ -30,18 +30,19 @@ Naming conventions .. code-block:: python - import re - pattern = re.compile( - r"CSST_" - r"(?P<facility>[A-Z]+)_" - r"(?P<project>[A-Z]+)_" - r"(?P<data_type>[A-Z]+)_" - r"(?P<t_start>[0-9]{14})_" - r"(?P<t_stop>[0-9]{14})_" - r"(?P<obs_id>[0-9]{9})_" - r"(?P<detector>[0-9]{2})_" - r"L(?P<level>[0-9]+)_" - r"(?P<version>[A-Z0-9]+).fits" - ) - mo = re.search(pattern, r"CSST_MSC_MS_SCI_20270626203558_20270626203828_100000066_01_L0_1.fits") - print(mo.groupdict()) + >>> import re + >>> pattern = re.compile( + >>> r"CSST_" + >>> r"(?P<facility>[A-Z]+)_" + >>> r"(?P<project>[A-Z]+)_" + >>> r"(?P<data_type>[A-Z]+)_" + >>> r"(?P<t_start>[0-9]{14})_" + >>> r"(?P<t_stop>[0-9]{14})_" + >>> r"(?P<obs_id>[0-9]{9})_" + >>> r"(?P<detector>[0-9]{2})_" + >>> r"L(?P<level>[0-9]+)_" + >>> r"(?P<version>[A-Z0-9]+).fits" + >>> ) + >>> mo = re.search(pattern, r"CSST_MSC_MS_SCI_20270626203558_20270626203828_100000066_01_L0_1.fits") + >>> print(mo.groupdict()) + {'facility': 'MSC', 'project': 'MS', 'data_type': 'SCI', 't_start': '20260612100759', 't_stop': '20260612101029', 'obs_id': '100000036', 'detector': '16', 'level': '0', 'version': '1'}