diff --git a/Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb b/Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..f46a2a3746d5e9852f3c841b49be589d6dda1cf5
--- /dev/null
+++ b/Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb
@@ -0,0 +1,384 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import datetime\n",
+    "from ebas.io.file import SUPPRESS_SORT_VARIABLES, SUPPRESS_METADATA_OCCURRENCE\n",
+    "from ebas.io.file.nasa_ames import EbasNasaAmes\n",
+    "from nilutility.datatypes import DataObject, HexInt\n",
+    "from nilutility.datetime_helper import DatetimeInterval"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def setup_global_metadata(outfile):\n",
+    "    outfile.metadata.revdate = datetime.datetime.utcnow()\n",
+    "    outfile.metadata.revision = '1'\n",
+    "    outfile.metadata.revdesc = 'initial revision'\n",
+    "    outfile.metadata.datalevel = '0'\n",
+    "    outfile.metadata.duration = '1mn'\n",
+    "    outfile.metadata.rescode_sample = '1mn'\n",
+    "    \n",
+    "    outfile.metadata.station_code ='NO0002R'\n",
+    "    # optional station metadata, are on record in ebas\n",
+    "    # can be left out in submissions:\n",
+    "    outfile.metadata.station_name = 'Birkenes II'\n",
+    "    outfile.metadata.station_wdca_id = 'GAWANO__BIR'\n",
+    "    outfile.metadata.station_gaw_id = 'BIR'\n",
+    "    outfile.metadata.station_gaw_name = 'Birkenes Atmospheric Observatory'\n",
+    "    outfile.metadata.station_airs_id = ''\n",
+    "    outfile.metadata.station_other_ids = '201(NILUDB)'\n",
+    "    outfile.metadata.station_state_code = ''\n",
+    "    outfile.metadata.station_landuse = 'Forest'\n",
+    "    outfile.metadata.station_setting = 'Rural'\n",
+    "    outfile.metadata.station_gaw_type = 'R'\n",
+    "    outfile.metadata.station_wmo_region = 6\n",
+    "    outfile.metadata.station_latitude = 58.380\n",
+    "    outfile.metadata.station_longitude = 8.250\n",
+    "    outfile.metadata.station_altitude = 220\n",
+    "    # Measurement lat/lon/alt can be left out when equal registed station position.\n",
+    "    # Else, it's a possibility to specify the position of the instrument within\n",
+    "    # the station area.\n",
+    "    outfile.metadata.mea_latitude = 58.380\n",
+    "    outfile.metadata.mea_longitude = 8.250\n",
+    "    outfile.metadata.mea_altitude = 220\n",
+    "    outfile.metadata.mea_height = 4\n",
+    "\n",
+    "    outfile.metadata.comp_name = 'black_carbon'\n",
+    "    outfile.metadata.unit = 'ug/m3'\n",
+    "    outfile.metadata.matrix = 'pm10'\n",
+    "    outfile.metadata.lab_code = 'NO01L'\n",
+    "    outfile.metadata.instr_type = 'filter_absorption_photometer'\n",
+    "    outfile.metadata.instr_name = 'Thermo_5012_BIR'\n",
+    "    outfile.metadata.instr_manufacturer = 'Thermo'\n",
+    "    outfile.metadata.instr_model = '5012'\n",
+    "    outfile.metadata.instr_serialno = '70810508'\n",
+    "    outfile.metadata.method = 'NO01L_MAAP_5012'\n",
+    "    outfile.metadata.std_method = 'Multi-angle_Correction=Petzold2004'\n",
+    "    outfile.metadata.inlet_type = 'Impactor--direct'\n",
+    "    outfile.metadata.inlet_desc = 'PM10 at ambient humidity inlet, Digitel, flow 140 l/min'\n",
+    "    outfile.metadata.hum_temp_ctrl = 'None'\n",
+    "    outfile.metadata.hum_temp_ctrl_desc = 'passive, sample heated from atmospheric to lab temperature'\n",
+    "    outfile.metadata.vol_std_temp = 273.15\n",
+    "    outfile.metadata.vol_std_pressure = 1013.25\n",
+    "    outfile.metadata.detection_limit = (0.1, 'ug/m3')\n",
+    "    outfile.metadata.detection_limit_desc = 'Determined by instrument noise characteristics, no detection limit flag used'\n",
+    "    outfile.metadata.uncertainty_desc = 'typical value of unit-to-unit variability'\n",
+    "    outfile.metadata.zero_negative = 'Zero/negative possible'\n",
+    "    outfile.metadata.zero_negative_desc = 'Zero and neg. values may appear due to statistical variations at very low concentrations'\n",
+    "    outfile.metadata.qa = [\n",
+    "        DataObject({\n",
+    "            'qa_number': 1,\n",
+    "            'qm_id': 'WCCAP-AP-2016-3',\n",
+    "            'qa_date': datetime.datetime(2016, 12, 9),\n",
+    "            'qa_doc_url': 'http://www.actris-ecac.eu/files/ECAC-report-AP-2016-3-2.pdf',\n",
+    "        }),\n",
+    "    ]\n",
+    "    outfile.metadata.originator.append(DataObject(\n",
+    "        PS_LAST_NAME=u'Fiebig', PS_FIRST_NAME='Markus',\n",
+    "        PS_EMAIL='Markus.Fiebig@nilu.no',\n",
+    "        PS_ORG_NAME='Norwegian Institute for Air Research',\n",
+    "        PS_ORG_ACR='NILU', PS_ORG_UNIT='Atmosphere and Climate Department',\n",
+    "        PS_ADDR_LINE1='Instituttveien 18', PS_ADDR_LINE2=None,\n",
+    "        PS_ADDR_ZIP='2007', PS_ADDR_CITY='Kjeller',\n",
+    "        PS_ADDR_COUNTRY='Norway',\n",
+    "        PS_ORCID='0000-0002-3380-3470',\n",
+    "    ))\n",
+    "    outfile.metadata.originator.append(DataObject(\n",
+    "        PS_LAST_NAME=u'Someone', PS_FIRST_NAME='Else',\n",
+    "        PS_EMAIL='Someone@somewhere.no',\n",
+    "        PS_ORG_NAME='Some nice Institute',\n",
+    "        PS_ORG_ACR='WOW', PS_ORG_UNIT='Super interesting division',\n",
+    "        PS_ADDR_LINE1='Street 18', PS_ADDR_LINE2=None,\n",
+    "        PS_ADDR_ZIP='X-9999', PS_ADDR_CITY='Paradise',\n",
+    "        PS_ADDR_COUNTRY='Norway',\n",
+    "        PS_ORCID=None,\n",
+    "    ))\n",
+    "    outfile.metadata.submitter.append(DataObject(\n",
+    "        PS_LAST_NAME=u'Fiebig', PS_FIRST_NAME='Markus',\n",
+    "        PS_EMAIL='Markus.Fiebig@nilu.no',\n",
+    "        PS_ORG_NAME='Norwegian Institute for Air Research',\n",
+    "        PS_ORG_ACR='NILU', PS_ORG_UNIT='Atmosphere and Climate Department',\n",
+    "        PS_ADDR_LINE1='Instituttveien 18', PS_ADDR_LINE2=None,\n",
+    "        PS_ADDR_ZIP='2007', PS_ADDR_CITY='Kjeller',\n",
+    "        PS_ADDR_COUNTRY='Norway',\n",
+    "        PS_ORCID='0000-0002-3380-3470',\n",
+    "    ))\n",
+    "    outfile.metadata.acknowledgements = 'Request acknowledgement details from data originator'    \n",
+    "\n",
+    "    outfile.metadata.org = DataObject(\n",
+    "        OR_CODE='NO01L',\n",
+    "        OR_NAME='Norwegian Institute for Air Research',\n",
+    "        OR_ACRONYM='NILU', OR_UNIT='Atmosphere and Climate Department',\n",
+    "        OR_ADDR_LINE1='Instituttveien 18', OR_ADDR_LINE2=None,\n",
+    "        OR_ADDR_ZIP='2007', OR_ADDR_CITY='Kjeller', OR_ADDR_COUNTRY='Norway'\n",
+    "    )\n",
+    "    outfile.metadata.projects = ['GAW-WDCA']"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def add_sample_times(outfile):\n",
+    "    outfile.sample_times = [\n",
+    "        DatetimeInterval(datetime.datetime(2020, 1, 1, 0, 0), datetime.datetime(2020, 1, 1, 0, 1)),\n",
+    "        DatetimeInterval(datetime.datetime(2020, 1, 1, 0, 1), datetime.datetime(2020, 1, 1, 0, 2)),\n",
+    "        DatetimeInterval(datetime.datetime(2020, 1, 1, 0, 2), datetime.datetime(2020, 1, 1, 0, 3))\n",
+    "    ]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def setup_variables(outfile):\n",
+    "\n",
+    "    # variable 1: pressure\n",
+    "    values = [839.40, None, 839.40]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'pressure'\n",
+    "    metadata.matrix = 'instrument'\n",
+    "    metadata.unit = 'hPa'\n",
+    "    metadata.title = 'pint'\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata))\n",
+    "    outfile.add_var_characteristics(-1, 'Location', 'instrument internal')\n",
+    "    \n",
+    "    # variable 2: temperature\n",
+    "    values = [299.70, None, 299.70]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'temperature'\n",
+    "    metadata.matrix = 'instrument'\n",
+    "    metadata.unit = 'K'\n",
+    "    metadata.title = 'Tint'\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata))\n",
+    "    outfile.add_var_characteristics(-1, 'Location', 'instrument internal')\n",
+    "\n",
+    "    # variable 3: relative_humidity\n",
+    "    values = [2.4, None, 2.4]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'relative_humidity'\n",
+    "    metadata.matrix = 'instrument'\n",
+    "    metadata.unit = '%'\n",
+    "    metadata.title = 'RH'\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata))\n",
+    "    outfile.add_var_characteristics(-1, 'Location', 'instrument outlet')\n",
+    "\n",
+    "    # variable 4: flow_rate\n",
+    "    values = [3.4, None, 3.42]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'flow_rate'\n",
+    "    metadata.matrix = 'instrument'\n",
+    "    metadata.unit = 'l/min'\n",
+    "    metadata.title = 'FlowR'\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata))\n",
+    "    outfile.add_var_characteristics(-1, 'Location', 'sample line')\n",
+    "\n",
+    "    # variable 5: status\n",
+    "    values = [HexInt(0), None, HexInt(0)]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'status'\n",
+    "    metadata.matrix = 'instrument'\n",
+    "    metadata.unit = 'no unit'\n",
+    "    metadata.title = 'SFlag'\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata, vmiss='0xffffff'))\n",
+    "    outfile.add_var_characteristics(-1, 'Status type', 'overall instrument status')\n",
+    "\n",
+    "    # variable 6: equivalent_black_carbon\n",
+    "    values = [0.00005566, None, 0.00005923]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'equivalent_black_carbon'\n",
+    "    metadata.unit = 'ug/m3'\n",
+    "    metadata.title = 'BCconc670'\n",
+    "    metadata.uncertainty = (6, '%')\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=False,\n",
+    "                                        metadata=metadata, vmiss='9999.99999999'))\n",
+    "    outfile.add_var_characteristics(-1, 'Wavelength', 670)\n",
+    "\n",
+    "    # variable 7: equivalent_black_carbon_loading\n",
+    "    values = [0.00003196, None, 0.00003512]  # values for the three samples; missing value is None!\n",
+    "    flags = [[], [999], []]  # flags for the three samples (the last sample is flagged as missing)\n",
+    "    metadata = DataObject()\n",
+    "    metadata.comp_name = 'equivalent_black_carbon_loading'\n",
+    "    metadata.unit = 'ug'\n",
+    "    metadata.title = 'BCmass670'\n",
+    "    metadata.uncertainty = (6, '%')\n",
+    "    # add the variable\n",
+    "    outfile.variables.append(DataObject(values_=values, flags=flags, flagcol=True,\n",
+    "                                        metadata=metadata, vmiss='9999.99999999'))\n",
+    "    outfile.add_var_characteristics(-1, 'Wavelength', 670)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "89 1001\n",
+      "Fiebig, Markus; Someone, Else\n",
+      "NO01L, Norwegian Institute for Air Research, NILU, Atmosphere and Climate Department, Instituttveien 18, , 2007, Kjeller, Norway\n",
+      "Fiebig, Markus\n",
+      "GAW-WDCA\n",
+      "1 1\n",
+      "2020 01 01 2024 06 03\n",
+      "0.000695\n",
+      "days from file reference point\n",
+      "9\n",
+      "1 1 1 1 1 1 1 1 1\n",
+      "9.999999 9999.9 9999.9 99.9 99.99 0xffffff 9999.99999999 9999.99999999 9.999\n",
+      "end_time of measurement, days from the file reference point\n",
+      "pressure, hPa, Location=instrument internal, Matrix=instrument\n",
+      "temperature, K, Location=instrument internal, Matrix=instrument\n",
+      "relative_humidity, %, Location=instrument outlet, Matrix=instrument\n",
+      "flow_rate, l/min, Location=sample line, Matrix=instrument\n",
+      "status, no unit, Status type=overall instrument status, Matrix=instrument\n",
+      "equivalent_black_carbon, ug/m3, Wavelength=670.0 nm, Measurement uncertainty=6 %\n",
+      "equivalent_black_carbon_loading, ug, Wavelength=670.0 nm, Measurement uncertainty=6 %\n",
+      "numflag, no unit\n",
+      "0\n",
+      "66\n",
+      "Data definition:              EBAS_1.1\n",
+      "Set type code:                TU\n",
+      "Timezone:                     UTC\n",
+      "File name:                    NO0002R.20200101000000.20240603223507.filter_absorption_photometer.black_carbon.pm10.3mn.1mn.NO01L_Thermo_5012_BIR.NO01L_MAAP_5012.lev0.nas\n",
+      "File creation:                20240603223507992723\n",
+      "Startdate:                    20200101000000\n",
+      "Revision date:                20240603223507\n",
+      "Version:                      1\n",
+      "Version description:          initial revision\n",
+      "Statistics:                   arithmetic mean\n",
+      "Data level:                   0\n",
+      "Period code:                  3mn\n",
+      "Resolution code:              1mn\n",
+      "Sample duration:              1mn\n",
+      "Orig. time res.:              1mn\n",
+      "Station code:                 NO0002R\n",
+      "Platform code:                NO0002S\n",
+      "Station name:                 Birkenes II\n",
+      "Station WDCA-ID:              GAWANO__BIR\n",
+      "Station GAW-ID:               BIR\n",
+      "Station GAW-Name:             Birkenes Atmospheric Observatory\n",
+      "Station AIRS-ID:              \n",
+      "Station other IDs:            201(NILUDB)\n",
+      "Station state/province:       \n",
+      "Station land use:             Forest\n",
+      "Station setting:              Rural\n",
+      "Station GAW type:             R\n",
+      "Station WMO region:           6\n",
+      "Station latitude:             58.38\n",
+      "Station longitude:            8.25\n",
+      "Station altitude:             220 m\n",
+      "Measurement latitude:         58.38\n",
+      "Measurement longitude:        8.25\n",
+      "Measurement altitude:         220 m\n",
+      "Measurement height:           4 m\n",
+      "Regime:                       IMG\n",
+      "Component:                    black_carbon\n",
+      "Unit:                         ug/m3\n",
+      "Matrix:                       pm10\n",
+      "Laboratory code:              NO01L\n",
+      "Instrument type:              filter_absorption_photometer\n",
+      "Instrument name:              Thermo_5012_BIR\n",
+      "Instrument manufacturer:      Thermo\n",
+      "Instrument model:             5012\n",
+      "Instrument serial number:     70810508\n",
+      "Method ref:                   NO01L_MAAP_5012\n",
+      "Standard method:              Multi-angle_Correction=Petzold2004\n",
+      "Inlet type:                   Impactor--direct\n",
+      "Inlet description:            PM10 at ambient humidity inlet, Digitel, flow 140 l/min\n",
+      "Humidity/temperature control: None\n",
+      "Humidity/temperature control description: passive, sample heated from atmospheric to lab temperature\n",
+      "Volume std. temperature:      273.15 K\n",
+      "Volume std. pressure:         1013.25 hPa\n",
+      "Detection limit:              0.1 ug/m3\n",
+      "Detection limit expl.:        Determined by instrument noise characteristics, no detection limit flag used\n",
+      "Measurement uncertainty expl.: typical value of unit-to-unit variability\n",
+      "Zero/negative values code:    Zero/negative possible\n",
+      "Zero/negative values:         Zero and neg. values may appear due to statistical variations at very low concentrations\n",
+      "QA1 measure ID:               WCCAP-AP-2016-3\n",
+      "QA1 date:                     20161209\n",
+      "QA1 document URL:             \"http://www.actris-ecac.eu/files/ECAC-report-AP-2016-3-2.pdf\"\n",
+      "Originator:                   Fiebig, Markus, Markus.Fiebig@nilu.no, Norwegian Institute for Air Research, NILU, Atmosphere and Climate Department, Instituttveien 18, , 2007, Kjeller, Norway, ORCID=0000-0002-3380-3470\n",
+      "Originator:                   Someone, Else, Someone@somewhere.no, Some nice Institute, WOW, Super interesting division, Street 18, , X-9999, Paradise, Norway\n",
+      "Submitter:                    Fiebig, Markus, Markus.Fiebig@nilu.no, Norwegian Institute for Air Research, NILU, Atmosphere and Climate Department, Instituttveien 18, , 2007, Kjeller, Norway, ORCID=0000-0002-3380-3470\n",
+      "Acknowledgement:              Request acknowledgement details from data originator\n",
+      "starttime endtime pint Tint RH FlowR SFlag BCconc670 BCmass670 flag\n",
+      "0.000000 0.000694  839.4  299.7  2.4  3.40 0x000000    0.00005566    0.00003196 0.000\n",
+      "0.000694 0.001389 9999.9 9999.9 99.9 99.99 0xffffff 9999.99999999 9999.99999999 0.999\n",
+      "0.001389 0.002083  839.4  299.7  2.4  3.42 0x000000    0.00005923    0.00003512 0.000\n"
+     ]
+    }
+   ],
+   "source": [
+    "nas = EbasNasaAmes()\n",
+    "setup_global_metadata(nas)\n",
+    "add_sample_times(nas)\n",
+    "setup_variables(nas)\n",
+    "nas.write(suppress=SUPPRESS_SORT_VARIABLES|SUPPRESS_METADATA_OCCURRENCE)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.9.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}