Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebas-io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBAS
ebas-io
Commits
9c2300a0
Commit
9c2300a0
authored
9 months ago
by
Paul Eckhardt
Browse files
Options
Downloads
Patches
Plain Diff
ADD example for MAAP lev0 template
parent
38d9e201
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb
+384
-0
384 additions, 0 deletions
Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb
with
384 additions
and
0 deletions
Examples/Doc/Notebooks/WriteNasaAmes-MAAP-lev0.ipynb
0 → 100644
+
384
−
0
View file @
9c2300a0
{
"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
}
%% Cell type:code id: tags:
```
python
import
datetime
from
ebas.io.file
import
SUPPRESS_SORT_VARIABLES
,
SUPPRESS_METADATA_OCCURRENCE
from
ebas.io.file.nasa_ames
import
EbasNasaAmes
from
nilutility.datatypes
import
DataObject
,
HexInt
from
nilutility.datetime_helper
import
DatetimeInterval
```
%% Cell type:code id: tags:
```
python
def
setup_global_metadata
(
outfile
):
outfile
.
metadata
.
revdate
=
datetime
.
datetime
.
utcnow
()
outfile
.
metadata
.
revision
=
'
1
'
outfile
.
metadata
.
revdesc
=
'
initial revision
'
outfile
.
metadata
.
datalevel
=
'
0
'
outfile
.
metadata
.
duration
=
'
1mn
'
outfile
.
metadata
.
rescode_sample
=
'
1mn
'
outfile
.
metadata
.
station_code
=
'
NO0002R
'
# optional station metadata, are on record in ebas
# can be left out in submissions:
outfile
.
metadata
.
station_name
=
'
Birkenes II
'
outfile
.
metadata
.
station_wdca_id
=
'
GAWANO__BIR
'
outfile
.
metadata
.
station_gaw_id
=
'
BIR
'
outfile
.
metadata
.
station_gaw_name
=
'
Birkenes Atmospheric Observatory
'
outfile
.
metadata
.
station_airs_id
=
''
outfile
.
metadata
.
station_other_ids
=
'
201(NILUDB)
'
outfile
.
metadata
.
station_state_code
=
''
outfile
.
metadata
.
station_landuse
=
'
Forest
'
outfile
.
metadata
.
station_setting
=
'
Rural
'
outfile
.
metadata
.
station_gaw_type
=
'
R
'
outfile
.
metadata
.
station_wmo_region
=
6
outfile
.
metadata
.
station_latitude
=
58.380
outfile
.
metadata
.
station_longitude
=
8.250
outfile
.
metadata
.
station_altitude
=
220
# Measurement lat/lon/alt can be left out when equal registed station position.
# Else, it's a possibility to specify the position of the instrument within
# the station area.
outfile
.
metadata
.
mea_latitude
=
58.380
outfile
.
metadata
.
mea_longitude
=
8.250
outfile
.
metadata
.
mea_altitude
=
220
outfile
.
metadata
.
mea_height
=
4
outfile
.
metadata
.
comp_name
=
'
black_carbon
'
outfile
.
metadata
.
unit
=
'
ug/m3
'
outfile
.
metadata
.
matrix
=
'
pm10
'
outfile
.
metadata
.
lab_code
=
'
NO01L
'
outfile
.
metadata
.
instr_type
=
'
filter_absorption_photometer
'
outfile
.
metadata
.
instr_name
=
'
Thermo_5012_BIR
'
outfile
.
metadata
.
instr_manufacturer
=
'
Thermo
'
outfile
.
metadata
.
instr_model
=
'
5012
'
outfile
.
metadata
.
instr_serialno
=
'
70810508
'
outfile
.
metadata
.
method
=
'
NO01L_MAAP_5012
'
outfile
.
metadata
.
std_method
=
'
Multi-angle_Correction=Petzold2004
'
outfile
.
metadata
.
inlet_type
=
'
Impactor--direct
'
outfile
.
metadata
.
inlet_desc
=
'
PM10 at ambient humidity inlet, Digitel, flow 140 l/min
'
outfile
.
metadata
.
hum_temp_ctrl
=
'
None
'
outfile
.
metadata
.
hum_temp_ctrl_desc
=
'
passive, sample heated from atmospheric to lab temperature
'
outfile
.
metadata
.
vol_std_temp
=
273.15
outfile
.
metadata
.
vol_std_pressure
=
1013.25
outfile
.
metadata
.
detection_limit
=
(
0.1
,
'
ug/m3
'
)
outfile
.
metadata
.
detection_limit_desc
=
'
Determined by instrument noise characteristics, no detection limit flag used
'
outfile
.
metadata
.
uncertainty_desc
=
'
typical value of unit-to-unit variability
'
outfile
.
metadata
.
zero_negative
=
'
Zero/negative possible
'
outfile
.
metadata
.
zero_negative_desc
=
'
Zero and neg. values may appear due to statistical variations at very low concentrations
'
outfile
.
metadata
.
qa
=
[
DataObject
({
'
qa_number
'
:
1
,
'
qm_id
'
:
'
WCCAP-AP-2016-3
'
,
'
qa_date
'
:
datetime
.
datetime
(
2016
,
12
,
9
),
'
qa_doc_url
'
:
'
http://www.actris-ecac.eu/files/ECAC-report-AP-2016-3-2.pdf
'
,
}),
]
outfile
.
metadata
.
originator
.
append
(
DataObject
(
PS_LAST_NAME
=
u
'
Fiebig
'
,
PS_FIRST_NAME
=
'
Markus
'
,
PS_EMAIL
=
'
Markus.Fiebig@nilu.no
'
,
PS_ORG_NAME
=
'
Norwegian Institute for Air Research
'
,
PS_ORG_ACR
=
'
NILU
'
,
PS_ORG_UNIT
=
'
Atmosphere and Climate Department
'
,
PS_ADDR_LINE1
=
'
Instituttveien 18
'
,
PS_ADDR_LINE2
=
None
,
PS_ADDR_ZIP
=
'
2007
'
,
PS_ADDR_CITY
=
'
Kjeller
'
,
PS_ADDR_COUNTRY
=
'
Norway
'
,
PS_ORCID
=
'
0000-0002-3380-3470
'
,
))
outfile
.
metadata
.
originator
.
append
(
DataObject
(
PS_LAST_NAME
=
u
'
Someone
'
,
PS_FIRST_NAME
=
'
Else
'
,
PS_EMAIL
=
'
Someone@somewhere.no
'
,
PS_ORG_NAME
=
'
Some nice Institute
'
,
PS_ORG_ACR
=
'
WOW
'
,
PS_ORG_UNIT
=
'
Super interesting division
'
,
PS_ADDR_LINE1
=
'
Street 18
'
,
PS_ADDR_LINE2
=
None
,
PS_ADDR_ZIP
=
'
X-9999
'
,
PS_ADDR_CITY
=
'
Paradise
'
,
PS_ADDR_COUNTRY
=
'
Norway
'
,
PS_ORCID
=
None
,
))
outfile
.
metadata
.
submitter
.
append
(
DataObject
(
PS_LAST_NAME
=
u
'
Fiebig
'
,
PS_FIRST_NAME
=
'
Markus
'
,
PS_EMAIL
=
'
Markus.Fiebig@nilu.no
'
,
PS_ORG_NAME
=
'
Norwegian Institute for Air Research
'
,
PS_ORG_ACR
=
'
NILU
'
,
PS_ORG_UNIT
=
'
Atmosphere and Climate Department
'
,
PS_ADDR_LINE1
=
'
Instituttveien 18
'
,
PS_ADDR_LINE2
=
None
,
PS_ADDR_ZIP
=
'
2007
'
,
PS_ADDR_CITY
=
'
Kjeller
'
,
PS_ADDR_COUNTRY
=
'
Norway
'
,
PS_ORCID
=
'
0000-0002-3380-3470
'
,
))
outfile
.
metadata
.
acknowledgements
=
'
Request acknowledgement details from data originator
'
outfile
.
metadata
.
org
=
DataObject
(
OR_CODE
=
'
NO01L
'
,
OR_NAME
=
'
Norwegian Institute for Air Research
'
,
OR_ACRONYM
=
'
NILU
'
,
OR_UNIT
=
'
Atmosphere and Climate Department
'
,
OR_ADDR_LINE1
=
'
Instituttveien 18
'
,
OR_ADDR_LINE2
=
None
,
OR_ADDR_ZIP
=
'
2007
'
,
OR_ADDR_CITY
=
'
Kjeller
'
,
OR_ADDR_COUNTRY
=
'
Norway
'
)
outfile
.
metadata
.
projects
=
[
'
GAW-WDCA
'
]
```
%% Cell type:code id: tags:
```
python
def
add_sample_times
(
outfile
):
outfile
.
sample_times
=
[
DatetimeInterval
(
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
0
),
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
1
)),
DatetimeInterval
(
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
1
),
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
2
)),
DatetimeInterval
(
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
2
),
datetime
.
datetime
(
2020
,
1
,
1
,
0
,
3
))
]
```
%% Cell type:code id: tags:
```
python
def
setup_variables
(
outfile
):
# variable 1: pressure
values
=
[
839.40
,
None
,
839.40
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
pressure
'
metadata
.
matrix
=
'
instrument
'
metadata
.
unit
=
'
hPa
'
metadata
.
title
=
'
pint
'
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
))
outfile
.
add_var_characteristics
(
-
1
,
'
Location
'
,
'
instrument internal
'
)
# variable 2: temperature
values
=
[
299.70
,
None
,
299.70
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
temperature
'
metadata
.
matrix
=
'
instrument
'
metadata
.
unit
=
'
K
'
metadata
.
title
=
'
Tint
'
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
))
outfile
.
add_var_characteristics
(
-
1
,
'
Location
'
,
'
instrument internal
'
)
# variable 3: relative_humidity
values
=
[
2.4
,
None
,
2.4
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
relative_humidity
'
metadata
.
matrix
=
'
instrument
'
metadata
.
unit
=
'
%
'
metadata
.
title
=
'
RH
'
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
))
outfile
.
add_var_characteristics
(
-
1
,
'
Location
'
,
'
instrument outlet
'
)
# variable 4: flow_rate
values
=
[
3.4
,
None
,
3.42
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
flow_rate
'
metadata
.
matrix
=
'
instrument
'
metadata
.
unit
=
'
l/min
'
metadata
.
title
=
'
FlowR
'
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
))
outfile
.
add_var_characteristics
(
-
1
,
'
Location
'
,
'
sample line
'
)
# variable 5: status
values
=
[
HexInt
(
0
),
None
,
HexInt
(
0
)]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
status
'
metadata
.
matrix
=
'
instrument
'
metadata
.
unit
=
'
no unit
'
metadata
.
title
=
'
SFlag
'
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
,
vmiss
=
'
0xffffff
'
))
outfile
.
add_var_characteristics
(
-
1
,
'
Status type
'
,
'
overall instrument status
'
)
# variable 6: equivalent_black_carbon
values
=
[
0.00005566
,
None
,
0.00005923
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
equivalent_black_carbon
'
metadata
.
unit
=
'
ug/m3
'
metadata
.
title
=
'
BCconc670
'
metadata
.
uncertainty
=
(
6
,
'
%
'
)
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
False
,
metadata
=
metadata
,
vmiss
=
'
9999.99999999
'
))
outfile
.
add_var_characteristics
(
-
1
,
'
Wavelength
'
,
670
)
# variable 7: equivalent_black_carbon_loading
values
=
[
0.00003196
,
None
,
0.00003512
]
# values for the three samples; missing value is None!
flags
=
[[],
[
999
],
[]]
# flags for the three samples (the last sample is flagged as missing)
metadata
=
DataObject
()
metadata
.
comp_name
=
'
equivalent_black_carbon_loading
'
metadata
.
unit
=
'
ug
'
metadata
.
title
=
'
BCmass670
'
metadata
.
uncertainty
=
(
6
,
'
%
'
)
# add the variable
outfile
.
variables
.
append
(
DataObject
(
values_
=
values
,
flags
=
flags
,
flagcol
=
True
,
metadata
=
metadata
,
vmiss
=
'
9999.99999999
'
))
outfile
.
add_var_characteristics
(
-
1
,
'
Wavelength
'
,
670
)
```
%% Cell type:code id: tags:
```
python
nas
=
EbasNasaAmes
()
setup_global_metadata
(
nas
)
add_sample_times
(
nas
)
setup_variables
(
nas
)
nas
.
write
(
suppress
=
SUPPRESS_SORT_VARIABLES
|
SUPPRESS_METADATA_OCCURRENCE
)
```
%% Output
89 1001
Fiebig, Markus; Someone, Else
NO01L, Norwegian Institute for Air Research, NILU, Atmosphere and Climate Department, Instituttveien 18, , 2007, Kjeller, Norway
Fiebig, Markus
GAW-WDCA
1 1
2020 01 01 2024 06 03
0.000695
days from file reference point
9
1 1 1 1 1 1 1 1 1
9.999999 9999.9 9999.9 99.9 99.99 0xffffff 9999.99999999 9999.99999999 9.999
end_time of measurement, days from the file reference point
pressure, hPa, Location=instrument internal, Matrix=instrument
temperature, K, Location=instrument internal, Matrix=instrument
relative_humidity, %, Location=instrument outlet, Matrix=instrument
flow_rate, l/min, Location=sample line, Matrix=instrument
status, no unit, Status type=overall instrument status, Matrix=instrument
equivalent_black_carbon, ug/m3, Wavelength=670.0 nm, Measurement uncertainty=6 %
equivalent_black_carbon_loading, ug, Wavelength=670.0 nm, Measurement uncertainty=6 %
numflag, no unit
0
66
Data definition: EBAS_1.1
Set type code: TU
Timezone: UTC
File name: NO0002R.20200101000000.20240603223507.filter_absorption_photometer.black_carbon.pm10.3mn.1mn.NO01L_Thermo_5012_BIR.NO01L_MAAP_5012.lev0.nas
File creation: 20240603223507992723
Startdate: 20200101000000
Revision date: 20240603223507
Version: 1
Version description: initial revision
Statistics: arithmetic mean
Data level: 0
Period code: 3mn
Resolution code: 1mn
Sample duration: 1mn
Orig. time res.: 1mn
Station code: NO0002R
Platform code: NO0002S
Station name: Birkenes II
Station WDCA-ID: GAWANO__BIR
Station GAW-ID: BIR
Station GAW-Name: Birkenes Atmospheric Observatory
Station AIRS-ID:
Station other IDs: 201(NILUDB)
Station state/province:
Station land use: Forest
Station setting: Rural
Station GAW type: R
Station WMO region: 6
Station latitude: 58.38
Station longitude: 8.25
Station altitude: 220 m
Measurement latitude: 58.38
Measurement longitude: 8.25
Measurement altitude: 220 m
Measurement height: 4 m
Regime: IMG
Component: black_carbon
Unit: ug/m3
Matrix: pm10
Laboratory code: NO01L
Instrument type: filter_absorption_photometer
Instrument name: Thermo_5012_BIR
Instrument manufacturer: Thermo
Instrument model: 5012
Instrument serial number: 70810508
Method ref: NO01L_MAAP_5012
Standard method: Multi-angle_Correction=Petzold2004
Inlet type: Impactor--direct
Inlet description: PM10 at ambient humidity inlet, Digitel, flow 140 l/min
Humidity/temperature control: None
Humidity/temperature control description: passive, sample heated from atmospheric to lab temperature
Volume std. temperature: 273.15 K
Volume std. pressure: 1013.25 hPa
Detection limit: 0.1 ug/m3
Detection limit expl.: Determined by instrument noise characteristics, no detection limit flag used
Measurement uncertainty expl.: typical value of unit-to-unit variability
Zero/negative values code: Zero/negative possible
Zero/negative values: Zero and neg. values may appear due to statistical variations at very low concentrations
QA1 measure ID: WCCAP-AP-2016-3
QA1 date: 20161209
QA1 document URL: "http://www.actris-ecac.eu/files/ECAC-report-AP-2016-3-2.pdf"
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
Originator: Someone, Else, Someone@somewhere.no, Some nice Institute, WOW, Super interesting division, Street 18, , X-9999, Paradise, Norway
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
Acknowledgement: Request acknowledgement details from data originator
starttime endtime pint Tint RH FlowR SFlag BCconc670 BCmass670 flag
0.000000 0.000694 839.4 299.7 2.4 3.40 0x000000 0.00005566 0.00003196 0.000
0.000694 0.001389 9999.9 9999.9 99.9 99.99 0xffffff 9999.99999999 9999.99999999 0.999
0.001389 0.002083 839.4 299.7 2.4 3.42 0x000000 0.00005923 0.00003512 0.000
%% Cell type:code id: tags:
```
python
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment