Skip to content

Commit

Permalink
Jcampinsp patch 3 (#40)
Browse files Browse the repository at this point in the history
* Rename plotvarbcpred.py to plotvarbccoeff.py

* Update plotvarbccoeff.py

* Create varbccoeff.md

* Update make.jl

* Update CMakeLists.txt

* Update varbccoeff.md

* Update varbccoeff.md

* Update README.md

---------

Co-authored-by: Eoin Whelan <[email protected]>
  • Loading branch information
jcampinsp and ewhelan authored Mar 14, 2024
1 parent 4a3ef3b commit cc4f76a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ Example:
varbcdiagnose -i /path/to/directory/with/varbc_files/ -o varbc_diag_out
```

#### VarBC predictor time-series plotting
#### VarBC coefficient time-series plotting
Help/usage:
```
plotvarbcpred -h
plotvarbccoeff -h
```

Example:
```
plotvarbcpred -i varbc_diag_out/VARBC_3_16_3309_210000 -b
plotvarbccoeff -i varbc_diag_out/VARBC_3_16_3309_210000 -b
```

### DFS
Expand Down
4 changes: 2 additions & 2 deletions doc/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ using Documenter


pages = [
"jbdiagnose" => "jbdiagnose.md"
"Jb diagnose" => "jbdiagnose.md",
"cv header list" => "cvheaderlist.md"
"VarBc Coeff" => "varbccoeff.md"
]


prettyurls = get(ENV, "CI", nothing) == "true"

format = Documenter.HTML(prettyurls = prettyurls)
Expand Down
58 changes: 58 additions & 0 deletions doc/src/varbccoeff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# VarBC coefficient diagnostic tool


## 1. Purpose

This diagnostic tool is intended for use in the evaluation of the performance of the variational bias correction (VarBC) used for satellite observations in the context of HARMONIE-AROME data assimilation systems. In particular for evaluating the performance in time of the VarBC coefficients.


## 2. Content

The tool comprises two scripts:

- **varbcdiagnosis** for data extraction

- **plotvarbccoeff** for VarBC coefficient time-series plotting

## 3. Usage

**varbcdiagnosis** extracts VarBC coefficients for a certain satellite/instrument and all the channels with data and for
a certain period of time. VarBC coefficients are extracted from VARBC.cycle files.

Script **varbcdiagnosis** arguments:

-i input-directory
where VARBC.cycle files are stored, usually in the form ./EXP/YYYY/MM/DD/HH (EXPERIMENT, Year, Month, Day and Hour)

-o output-directory
-S list-sat
colon separted list of satellites to process. For example, -S 3:4:5 to process Metop-A, Metop-B and Metop-C.
See https://apps.ecmwf.int/odbgov/satelliteidentifier/ for more etails.

-s list-sen
colon separted list of sensors to process. For example, -s 3:15 to process AMSU-A and MHS.
See https://apps.ecmwf.int/odbgov/sensor/ for more details.

-h Help! Print usage information.


**plotvarbccoeff** produces a plot for a selected satellite, sensor, channel and hour (optional, if not present all the assimilation cycles with observations are included).

Script **plotvarbccoef** arguments:

-h, --help show this help message and exit
-i IPATH Input file name
-l LLOC Legend location using matplotlib syntax
-d LABELS Optional experiment description
-b Batch mode, produce png only

For example for METOP-B (3), MHS (15), Channel 9 at 21 UTC (or at all assimilation cycles with data), IPATH is
output-directory/VARBC_3_15_9_210000 (or output-directory/VARBC_3_15_9).


## 4. Interpretation

Time-series of VarBC coefficients can be used for monitoring the performance of variational bias correction, specially at the initial steps of the bias correction, when usually initial bias is not corrected (cold-start) and satellite observations are assimilated in passive. Coefficients usually stabilize in time (it depends in many factors), and when they are stable it is assumed that satellite observations should be evaluated for active assimilatedo.


2 changes: 1 addition & 1 deletion scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endfunction()

install_scripts (jbdiagnose.sh plotjbbal.py plotjbdiag.py)
install_scripts (cv_header_list.sh)
install_scripts (varbcdiagnose.sh plotvarbcpred.py)
install_scripts (varbcdiagnose.sh plotvarbccoeff.py)
install_scripts (rundiacov.sh diag_diacov.sh plotdiacov.py)
install_scripts (dfscomp.sh plotdfs.py)
#install_scripts (diacov.sh festat.sh)
8 changes: 4 additions & 4 deletions scripts/plotvarbcpred.py → scripts/plotvarbccoeff.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def plot_varbc_pred_ts(datetime,data,labels,lloc,batch) :

fig, ax = plt.subplots(figsize=(8.27,3.6))

title_string='VarBC Predictors for '+sat_map[nsat]+': ' +sen_map[nsen]+ ' Channel '+str(nchn)
title_string='VarBC Coefficients for '+sat_map[nsat]+': ' +sen_map[nsen]+ ' Channel '+str(nchn)
plt.title(title_string)

ax2=ax.twinx()
Expand Down Expand Up @@ -169,7 +169,7 @@ def plot_varbc_pred_ts(datetime,data,labels,lloc,batch) :

# Ensure a major tick for each week using (interval=1)
ax.xaxis.set_major_locator(mdates.WeekdayLocator(interval=1))
ax.set_ylabel('Normalised Predictor Value',fontsize=10)
ax.set_ylabel('Coefficient Value',fontsize=10)
ax2.set_ylabel('Number of observations',fontsize=10)

#plot legend
Expand All @@ -179,7 +179,7 @@ def plot_varbc_pred_ts(datetime,data,labels,lloc,batch) :
plt.tight_layout()

figsuffix=str(nsat)+'_'+str(nsen)+'_'+str(nchn)
figname = 'varbc_pred_'+figsuffix+'.png'
figname = 'varbc_coeff_'+figsuffix+'.png'
plt.savefig(figname)
print("Output:",figname)
if not batch :
Expand Down Expand Up @@ -209,7 +209,7 @@ def read_data(filename):
#############################################################################################
def main(argv) :

parser = argparse.ArgumentParser(description='Plot VarBC predictor time-series')
parser = argparse.ArgumentParser(description='Plot VarBC coefficient time-series')
parser.add_argument('-i',dest="ipath",help='Input file name',default=None,required=True)
parser.add_argument('-l',dest="lloc",help='Legend location using matplotlib syntax',default=None,required=False)
parser.add_argument('-d',dest="labels",help='Optional experiment description',default=None,required=False)
Expand Down

0 comments on commit cc4f76a

Please sign in to comment.