NCAR / NCAR/wrf-python

Wrfout to NetCDF

Open
#158 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
498
Forks
178
PR merge metrics
No merged PRs in 30d

Description

I have three wrfout files (sample) in the below link. These files are from NCAR wrf python tutorials.

https://actvet-my.sharepoint.com/:f:/g/personal/rajkumar_sivaprahasam_adpoly_ac_ae/EofPOyhq8UhPlq3VBrvqLJABVR0G8xj_y0gmKRgLW1wagA?e=0DvsZc

I got some code from wrf-py github as follows to read in the data for all timesteps:-


import glob
from netCDF4 import Dataset
from wrf import getvar, ALL_TIMES

list_of_paths = glob.glob(r'/home/rajkumar/wrf_python_tutorial/wrf_tutorial_data/wrfout_d0*')
list_of_paths.sort()
wrflist=[]
for i in range(0, len(list_of_paths)-1):
wrflist.append(Dataset(list_of_paths[i]))

HFX=getvar(wrflist, "HFX", timeidx=ALL_TIMES, method="join")
print(HFX)


Now I am trying to do two things:-

  1. Write the data in classic NetCDF (CF compliant) for the variable HFX for all times( time series).
  2. Create a 2D Plot for the time series for the variable HFX (some thing like an area average for all timesteps)

Would be grateful if someone can help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Python example using netCDF4.Dataset, wrf.getvar, ALL_TIMES, and the HFX variable, then inspect the linked wrfout samples. The issue does not name a repository file or test; done would require a clearly defined way to write CF-compliant NetCDF output and produce the requested HFX time-series plot.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.