Giter Club home page Giter Club logo

rttov-wrf's Introduction

RTTOV-WRF

Simulate SEVIRI satellite channels from WRF output

  • Input: wrfout file (NetCDF format) written by WRF
  • Output: brightness temperatures or reflectances

Usage examples

Use on command line: NetCDF output

Usage: python rttov_wrf.py /path/to/wrfout (VIS|IR|both)

For example, python rttov_wrf.py /somepath/wrfout_d01_2008-07-30_12:00:00 both

creates /somepath/RT_wrfout_d01_2008-07-30_12:00:00.nc

Option: Use VIS to get VIS 0.6 µm reflectance, IR to get WV 6.2 µm, 7.3 µm and IR 10.8 µm brightness temperature or both to get all channels. You can add or remove channels in rttov_wrf.py.

Use within python: Xarray output

from rttov_wrf import call_pyrttov
#config = setup_IR()
config = setup_VIS()  

ds = xr.open_dataset(wrfout_path)
times = ds.Time

for t in times:
    rad = call_pyrttov(ds.sel(Time=t), config)

Run all ensemble members wrfout files from one forecast init (12z) at 13z with:

python run_pattern.py /path_to_exp/2008-07-30_12\:00/*/wrfout_d01_2008-07-30_13\:00\:00

Install

  1. Download and compile RTTOV from nwpsaf.eu.
  2. Download RTTOV-WRF for example by running git clone https://github.com/lkugler/RTTOV-WRF.git
  3. Run cd RTTOV-WRF; pip install -e . in the command line
  4. Set paths in paths.py
  5. optional: configure the python script rttov_wrf.py, it sets various assumptions for radiative transfer.
  6. when running rttov_wrf.py, ensure that you have loaded the same libraries which you used to install RTTOV. For me, this is intel-mpi intel netcdf netcdf-fortran zlib hdf5 (on VSC: module purge; module load intel-mpi/2019.3 intel/19.1.0 netcdf/4.7.0-intel-19.0.5.281-75t52g6 netcdf-fortran/4.4.5-intel-19.0.5.281-qye4cqn zlib/1.2.11-intel-19.1.0.166-hs6m2qh hdf5/1.10.5-intel-19.0.5.281-qyzojtm)

In order to run, it needs:

  1. compiled RTTOV / pyrttov (the python wrapper); with the path of pyrttov in PYTHONPATH (is ensured in rttov_wrf.py)
  2. installed RTTOV-WRF (including dependencies)
  3. loaded libraries for RTTOV

Dependencies

Will be installed by the pip command.

Note:

If you receive an ImportError similar to this one

ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

at line import pyrttov, then your python can not find the pyrttov module. You must call rttov_wrf.py with the same python as was used for compiling RTTOV.

Documentation

For the configuration of RTTOV or in case there are errors with RTTOV, consult the documentation of RTTOV or the RTTOV-python-wrapper. (https://nwp-saf.eumetsat.int/site/software/rttov/documentation/)

rttov-wrf's People

Contributors

lkugler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rttov-wrf's Issues

dependence on QICE

Is there a way to run call_pyrttov without the QICE field? I have simulations in the tropics in WRF that are not generating a QICE field and cannot run pyrttov to simulate IR

Problem with the execution

Thank you very much for sharing the software
I have followed all the steps and I get messages when I run the program rttov_wrf.py. Below are the errors
running RTTOV for wrfout_d01_2020-09-03_00:00:00
2020-09-03 00:00:00+00:00
nlevels: 50 nprofiles: 27489
solar angles: zenith= 127.5452088584527 , azimuth= 0.21534615746321606
Traceback (most recent call last):
File "/home/aldieng/WRF/RTTOV-WRF/rttov_wrf.py", line 451, in
out = call_pyrttov(ds.sel(Time=t), config)
File "/scratchu/aldieng/WRF/RTTOV-WRF/rttov_wrf.py", line 203, in call_pyrttov
seviriRttov.SurfEmisRefl = surfemisrefl_seviri
File "/home/aldieng/rttov13/wrapper/pyrttov/decorator.py", line 55, in thesetattr
object.setattr(self, name, value)
File "/home/aldieng/rttov13/wrapper/pyrttov/init.py", line 509, in _setSurfEmisRefl
raise TypeError("Incorrect value type/shape for SurfEmisRefl")
TypeError: Incorrect value type/shape for SurfEmisRefl

Regarding WRF input issues

Hi,
The code is not working with the WRF model outputs when values are not realistic like negative or undefine values of cloud, ice, cloud fraction, TSK, etc.
What should be the undefine values in these cases that need to add in rttov_wrf.py?
Thanks

Is there any example for generating MW channel?

I've tried it for simulating Himawari-8 channel, it works successfully.
If your microphysics with more ice phase, you need to accumulate all ice phase variable.
However, is there any example for generating MW channel (such as DMSP F16/F17)?
Thank you.

error working with pyRTTOV

Hi

I installed latest RTTOV 13 and python wrapper
when I use code below

from rttov_wrf import call_pyrttov,setup_VIS
import pyrttov

import xarray as xr
#config = setup_IR()
config = setup_VIS()
wrfout_path="/mnt/hgfs/wrf/wrfout_d01_2020-10-26_12_00_00/wrfout_d01_2020-10-26_12_00_00"
ds = xr.open_dataset(wrfout_path)
times = ds.Time

for t in times:
rad = call_pyrttov(ds.sel(Time=t), config )

I face this error

AttributeError: module 'pyrttov' has no attribute 'Rttov'

The files are compiled and installed in .pyc format in python cache folder.

could you helpwhat I can do tosolve issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.