Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
150 lines (108 sloc) 4.39 KB


This repository contains all the utilities needed to run BEHR.


The various components of this version of BEHR-LNOx are linked as Git submodules, so they haven't actually been cloned yet.

To do so, Initialize the repository’s submodules by running git submodule init followed by git submodule update.

git submodule init
git submodule update

If you want to use https link for clone, run these command in this directory

sed -i 's/\/\/\//g' .gitmodules
git submodule init
git submodule update

If a future update to this repo updates submodules, then after "git pull" you will need to run "git submodule update" again.


./config will check the environment variable and paths used in BEHR algorithm.

It's better to set the environment variable 'BEHR' by yourself, like adding this line to .bashrc

export BEHR=****/BEHR-LNOx

Structure of repositories

├── BEHR-core
├── BEHR-core-utils
├── BEHR-PSM-Gridding
├── config
├── data
├── BEHR_Files
├── GLOBE_Database
│   ├── Land_Water_Mask_7Classes_UMD.hdf
│   ├── MCD43D
│   │   ├── yyyy
│   └── MYD06_L2
│   │   ├── yyyy
├── OMI
│   ├── OMNO2
│   │   └── version_3_3_0
│   │   │   ├── yyyy
│   │   │   │   ├── mm
│   └── OMPIXCOR
│       └── version_003
│   │   │   ├── yyyy
│   │   │   │   ├── mm
├── SP_Files
    └── staging
├── dirs
├── Matlab-Gen-Utils
├── MatlabPythonInterface
└── WRF_Utils

Download data

GLOBE database and


OMNO2 and OMPIXCOR | MCD43D07, MCD43D08, MCD43D09, MCD43D31 and MYD06_L2

check this BEHR-Automation which support downloading and sorting automatically

If you prefer downloading data by wget from web, please check this link: MODIS and OMI.

The website has updated and it's easier to download directly following the link.

Check data whether complete

You won't get error while running the script below, if the data is OK.

myDir = 'data_directory'; %gets directory
myFiles = dir(fullfile(myDir,'*.hdf')); %gets all hdf files in struct
for k = 1:length(myFiles)
  baseFileName = myFiles(k).name;
  fullFileName = fullfile(myDir, baseFileName);
  fprintf(1, 'Now reading %s\n', fullFileName);

Modify settings

  1. Initialize date_start, date_end, region and DEBUG_LEVEL in BEHR-core/Read_Data/read_main.m;
  2. Initialize parameters of BEHR-core/BEHR_MainBEHR_main.m;
  3. Compile omi according to help.txt;
  4. Initialize parameters of BEHR-core/HDF tools/BEHR_publishing_main.m


If you don't have permission to change Matlab path, you should add BEHR to Matlab path every time:


Then, run read_main.m BEHR_main.m and BEHR_publishing_main.m in Matlab successively.

If you want to run in parallel, please add these lines before running:

 global onCluster;
 onCluster = true;
 global numThreads;
 numThreads = ??; (?? = your numthreads)

If you meet this error when running BEHR_main.m:

rror using psm_wrapper (line 78)
Undefined variable "py" or class "py.PSM_Main.behr_datasets".

Error in BEHR_main_one_day (line 350)
OMI = psm_wrapper(Data, Data(1).Grid, 'only_cvm', ~use_psm, 'extra_cvm_fields', extra_gridding_fields, 'DEBUG_LEVEL', DEBUG_LEVEL);

Error in BEHR_main (line 227)
parfor(j=1:length(datenums), n_workers)

Check this link. You can create test.m under BEHR-PSM-Gridding to test whether it works:


Check ouput

Check files in data/WEBSITE/staging/behr-daily-us_native-hdf_v3-0B or data/WEBSITE/staging/behr-daily-us_gridded-hdf_v3-0B

You can’t perform that action at this time.