## 2015 MelCol ``` processed with pyrnet-0.2.16 ``` The PyrNet was setup for calibration in a dense array on the Melpitz measurement field from 2015-05-06 to 2015-05-11. Cross-calibration is done versus reference observations from the TROPOS MObile RaDiation ObseRvatory (MORDOR) station. ### Imports ```python #|dropcode import os import xarray as xr import pandas as pd import numpy as np import datetime as dt import matplotlib.pyplot as plt import jstyleson as json from pyrnet import pyrnet ``` ### Prepare PyrNet data For calibration preparation the PyrNet data is processed to level l1b using a calibration factor of **7 (uV W-1 m2)** for all pyranometers with the ```pyrnet process l1b``` tool. This is done to unify the conversion to sensor voltage during calibration and not run into valid_range limits for netcdf encoding. Here we generate the *calibration.json* file for the processing to l1b: ```python box_numbers = np.arange(1,101) calibrations = {f"{bn:03d}":[7,7] for bn in box_numbers} calibjson = {"2000-01-01": calibrations} with open("pyrnet_calib_prep.json","w") as txt: json.dump(calibjson, txt) ``` Within *pyrnet_config.json*: ``` {"file_calibration" : "pyrnet_calib_prep.json"} ``` **Workflow for preparation** 1. Prepare *pyrnet_config_calibration_prep.json* with contributors metadata and the dummy calibration config file. 1. ```$ pyrnet process l1a -c pyrnet_config.json raw_data/*.bin l1a/``` 1. ```$ pyrnet process l1b_network -c pyrnet_config.json l1a/*.nc l1b_network/``` ### Configuration Set local data paths and lookup metadata. ```python pf_mordor = "mordor/{date:%Y-%m-%d}_Radiation.dat" pf_pyrnet = "l1b_network/{date:%Y-%m-%d}_P1D_pyrnet_melcol_n000l1bf1s.c01.nc" dates = pd.date_range("2015-05-06","2015-05-11") stations = np.arange(1,101) # lookup which box contains actually a pyranometer/ extra pyranometer mainmask = [] for box in stations: _, serials, _, _ = pyrnet.meta_lookup(dates[0],box=box) mainmask.append( True if len(serials[0])>0 else False ) ``` #### Load reference MORDOR data ```python #|dropcode #|dropout for i,date in enumerate(dates): fname = pf_mordor.format(date=date) df = pd.read_csv( fname, header=0, skiprows=[0,2,3], date_format="ISO8601", parse_dates=[0], index_col=0 ) dst = df.to_xarray().rename({"TIMESTAMP":"time"}) # drop not needed variables keep_vars = ['TP2_Wm2'] # global shortwave irradiance drop_vars = [v for v in dst if v not in keep_vars] dst = dst.drop_vars(drop_vars) # merge if i == 0: ds = dst.copy() else: ds = xr.concat((ds,dst),dim='time', data_vars='minimal', coords='minimal', compat='override') mordor = ds.copy() mordor = mordor.drop_duplicates("time", keep="last") mordor ```
<xarray.Dataset>
Dimensions: (time: 5183535)
Coordinates:
* time (time) datetime64[ns] 2015-05-06 ... 2015-05-11T23:59:59.900000
Data variables:
TP2_Wm2 (time) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0<xarray.Dataset>
Dimensions: (station: 100, maintenancetime: 50, time: 518400)
Coordinates:
* station (station) int64 1 2 3 4 5 6 7 8 ... 94 95 96 97 98 99 100
* maintenancetime (maintenancetime) datetime64[ns] 2015-05-12T07:55:50 ......
* time (time) datetime64[ns] 2015-05-06 ... 2015-05-11T23:59:59
Data variables:
ghi (time, station) float64 0.0 nan nan 0.0 ... nan 0.0 0.0 nan
szen (time, station) float64 111.0 nan nan ... 109.4 109.4 nan
Attributes: (12/31)
Conventions: CF-1.10, ACDD-1.3
title: TROPOS pyranometer network (PyrNet) observatio...
history: 2024-11-04T23:59:36: Merged level l1b by pyrne...
institution: Leibniz Institute for Tropospheric Research (T...
source: TROPOS pyranometer network (PyrNet)
references: https://doi.org/10.5194/amt-9-1153-2016
... ...
geospatial_lon_units: degE
time_coverage_start: 2015-05-06T00:00:00
time_coverage_end: 2015-05-06T23:59:59
time_coverage_duration: P0DT23H59M59S
time_coverage_resolution: P0DT0H0M1S
site: ['', '', '', '', '', '', '', '', '', '', '', '...