mirror of
https://gitea.psi.ch/APOG/acsmnode.git
synced 2025-06-24 13:11:08 +02:00
Update data chain notebook with step to adjust uncertainties
This commit is contained in:
@ -57,6 +57,7 @@
|
||||
"from pipelines.steps.utils import load_project_yaml_files\n",
|
||||
"from pipelines.steps.update_datachain_params import main as update_datachain_params\n",
|
||||
"from pipelines.steps.drop_column_from_nas_file import main as drop_column_from_nas_file\n",
|
||||
"from pipelines.steps.adjust_uncertainty_column_in_nas_file import main as adjust_uncertainty_column_in_nas_file\n",
|
||||
"\n",
|
||||
"campaign_descriptor = load_project_yaml_files(project_path, \"campaignDescriptor.yaml\")\n",
|
||||
"YEAR = campaign_descriptor['year']\n",
|
||||
@ -94,6 +95,8 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Uncomment and define the following variables manually to reanalize previous data collections\n",
|
||||
"#CAMPAIGN_DATA_FILE = '../data/collection_PAY_2024_2025-05-26_2025-05-26.h5'\n",
|
||||
"#APPEND_DATA_DIR = '../data/collection_PAY_2024_2025-05-26_2025-05-26'\n",
|
||||
"#CAMPAIGN_DATA_FILE = '../data/collection_PAY_2024_2025-05-21_2025-05-21.h5'\n",
|
||||
"#APPEND_DATA_DIR = '../data/collection_PAY_2024_2025-05-21_2025-05-21'"
|
||||
]
|
||||
@ -230,6 +233,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import warnings\n",
|
||||
"\n",
|
||||
"DATA_DIR = f\"{APPEND_DATA_DIR}/ACSM_TOFWARE_processed/{YEAR}\"\n",
|
||||
"FLAGS_DIR = f\"{APPEND_DATA_DIR}/ACSM_TOFWARE_flags/{YEAR}\"\n",
|
||||
"\n",
|
||||
@ -238,9 +243,19 @@
|
||||
"PATH3 = f\"{DATA_DIR}/ACSM_{STATION_ABBR}_{YEAR}_timeseries_calibration_factors.csv\"\n",
|
||||
"PATH4 = f\"{FLAGS_DIR}/ACSM_{STATION_ABBR}_{YEAR}_timeseries_flags.csv\"\n",
|
||||
"\n",
|
||||
"month = \"2-3\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" # Your code that might generate warnings\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"update_actris_header('../campaignDescriptor.yaml')\n",
|
||||
"prepare_ebas_submission([PATH1, PATH2, PATH3], PATH4, month)\n"
|
||||
"\n",
|
||||
"month = \"2-3\"\n",
|
||||
"with warnings.catch_warnings():\n",
|
||||
" warnings.simplefilter('ignore')\n",
|
||||
" prepare_ebas_submission([PATH1, PATH2, PATH3], PATH4, month)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -258,10 +273,40 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#path_to_data_file = '../data/CH0001G.20240201010000.20250519140310.aerosol_mass_spectrometer.chemistry_ACSM.pm1_non_refractory.2mo.1h.CH02L_Aerodyne_ToF-ACSM_017.CH02L_Aerodyne_ToF-ACSM_JFJ.lev2.nas'\n",
|
||||
"path_to_data_file = '../data/CH0002G.20240201010000.20250526113003.aerosol_mass_spectrometer.chemistry_ACSM.pm1_non_refractory.7w.1h.CH02L_Aerodyne_ToF-ACSM_092.CH02L_Aerodyne_ToF-ACSM_PAY.lev2.nas'\n",
|
||||
"path_to_data_file = '../data/CH0002G.20240201010000.20250526175557.aerosol_mass_spectrometer.chemistry_ACSM.pm1_non_refractory.7w.1h.CH02L_Aerodyne_ToF-ACSM_092.CH02L_Aerodyne_ToF-ACSM_PAY.lev2.nas'\n",
|
||||
"\n",
|
||||
"drop_column_from_nas_file(path_to_data_file, column_to_remove='inletP')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#print(((0.5*0.9520)**2 + (0.5*0.0554)**2)**0.5)\n",
|
||||
"#from math import sqrt\n",
|
||||
"#print(':)',sqrt((0.5*0.9520)**2 + (0.5*0.0554)**2))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Step 5.2: Adjust uncertainty of selected column name / variable by adding a constant\n",
|
||||
"* Select a nas file from the data folder"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"path_to_data_file = '../data/CH0002G.20240201010000.20250526175557.aerosol_mass_spectrometer.chemistry_ACSM.pm1_non_refractory.7w.1h.CH02L_Aerodyne_ToF-ACSM_092.CH02L_Aerodyne_ToF-ACSM_PAY.lev2.nas'\n",
|
||||
"adjust_uncertainty_column_in_nas_file(path_to_data_file, base_column_name='Org')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
Reference in New Issue
Block a user