2.2.1 L1 PreProgrammed - wolfiex/AerVis GitHub Wiki

The idea of the L1 processing stage is that there is a preprogrammed function containing computations which are relevant to ALL simulations, and then a custom processing step for those who want something different within their analysis.

This addresses only the predefined L1 run case. (see 2.2.1 for other custom functions).

The relevant files for this can be seen either in the documentation, or the L1 subdirectory in the aervis library.

Run Example on an existing dataset.

In [1]: import aervis                                                           
AerVis 0.0.1
fi::VariableDictionary  

In [2]: d = aervis.AerData('ACURE_PPE_001_bs714a')                              
---- Loading File ---- : /Users/wolfiex/UKCA_postproc/data/ACURE_PPE_001_bs714a.nc
 0.24 s loadtimeself

In [3]: d.getL1() # optional mode config file supplied as imode = <mode path>
...


In [4]: d.data.L1_variables.split()                                                  
Out[4]: 
['temperature',
 'air_pressure',
 'air_density',
 'particle_density_air',
 'mcon_s34i109',
 'mcon_s34i108',
...
 'ccn0.1',
 'ccn0.2',
 'ccn0.5',
 'ccn1']

Removing L1 data

In running getL1 it is possible to supply an overwrite flag, however if data is written with incorrect dimensions, it needs to be removed from the dataset, before additional information is allowed to overwrite it.

In [19]: d.rmL1(overwrite=True)                                                 
Removing all L1 files - this can be a slow(ish) process as it invlolves rewriting the whole netCDF file.
computing data
Variables
 temperature
air_pressure
air_density
particle_density_air
mcon_s34i109
mcon_s34i108
...
mcon_s34i114
mcon_s34i116
mcon_s34i117
mcon_s34i102
mcon_s34i126
ccn0.1
ccn0.2
ccn0.5
ccn1
---coords---
r_specific
molar_mass_air
avogadro
---attrs---
L1_variables
L1_coords
L1_attrs
writing to  /Users/wolfiex/UKCA_postproc/data/noL1_ACURE_PPE_001_bs714a.nc
0.97 minutes - rewritten (-L1) to /Users/wolfiex/UKCA_postproc/data/noL1_ACURE_PPE_001_bs714a.nc
:copying file over the previous one:

In [20]: del d # remove class                                                                 

In [12]: d = aervis.AerData('ACURE_PPE_001_bs714a')                             
---- Loading File ---- : /Users/wolfiex/UKCA_postproc/data/ACURE_PPE_001_bs714a.nc
 0.32 s loadtimeself
⚠️ **GitHub.com Fallback** ⚠️