Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support to Interpolate for Commonly Used Parameters #13

Open
xebadir opened this issue Oct 26, 2019 · 2 comments
Open

Add Support to Interpolate for Commonly Used Parameters #13

xebadir opened this issue Oct 26, 2019 · 2 comments

Comments

@xebadir
Copy link
Contributor

xebadir commented Oct 26, 2019

Many parameters are calculated by interpolating some parameter against a reference coordinate (T, P, HAGL, H) - need to implement code that could wrap interpolation for:
2-4km AGL Lapse rate. (interpolate temperatures to height AGL level and difference, divide by height difference)
700-500mb LAPSE Rate (interpolate temperatures to pressure level and difference, divide by height difference)
500mb Temperature (in C) (interpolate temperature to pressure level)
0-6km Shear, 0-1km shear (interpolate u, v to height agl, and then take vector difference relative to surface level).

Example Code for the old way:
LAPSE = np.zeros((ny,nx)) T500 = np.zeros((ny,nx)) LAPSE_3km = np.zeros((ny,nx)) LAPSE_24km = np.zeros((ny,nx)) THGZ = np.zeros((ny,nx)) for i in range(0,nx): for j in range(0,ny): if(T[0,j,i]>0.0): if(P[0,j,i]>=700.): T700 = vinterp3d.dinterp3dz(T[:,j,i],P[:,j,i],700.) T500[j,i] = vinterp3d.dinterp3dz(T[:,j,i],P[:,j,i],500.) Z700 = vinterp3d.dinterp3dz(H[:,j,i],P[:,j,i],700.) Z500 = vinterp3d.dinterp3dz(H[:,j,i],P[:,j,i],500.) LAPSE[j,i]=(T700-T500[j,i])/((Z500-Z700)/1000.) T3km = vinterp3d.dinterp3dz(T[:,j,i],AGLH[:,j,i],3000.) HT30 = vinterp3d.dinterp3dz(H[:,j,i],T[:,j,i],-30.) HT10 = vinterp3d.dinterp3dz(H[:,j,i],T[:,j,i],-10.) T4km = vinterp3d.dinterp3dz(T[:,j,i],AGLH[:,j,i],4000.) T2km = vinterp3d.dinterp3dz(T[:,j,i],AGLH[:,j,i],2000.) LAPSE_3km[j,i]=(T[0,j,i]-T3km)/3. LAPSE_24km[j,i]=(T2km-T4km)/2. THGZ[j,i]=HT30-HT10

S06 = np.zeros((ny,nx)) u6km = vinterp3d.dinterp3dz(U[:,:,:],AGLH[:,:,:],6000.) v6km = vinterp3d.dinterp3dz(V[:,:,:],AGLH[:,:,:],6000.) S06[:,:] = np.sqrt((u6km[:,:] - U[1,:,:])**2 + (v6km[:,:] - V[1,:,:])**2)

@chiaral
Copy link
Collaborator

chiaral commented Oct 29, 2019

Cleaning up Feature request above:

  • T700, T500 = intepolate T on P
  • Z700, Z500 = interpolate AGLH/H on P (since we use the difference in LAPSE, we can use either AGLH or H.
  • LAPSE = (T700-T500)(z500-z700)/1000 (in km)
  • T2km, T3km, T4km = interpolate T on AGLH
  • LAPSE3km = (T3km-Ts)/3
  • LAPSE24km = (T4km-T2km)/2
  • HTminus30, HTminus10 = interpolate AGLH on T
  • THGZ = HTminus30 - HTminus10
  • U1km, V1km, U6km, V6km = interpolate U,V on AGLH
  • S06km = ( (U6km-Us)**2 + (V6km-Vs)**2 )**0.5
  • S01km = ( (U1km-Us)**2 + (V1km-Vs)**2 )**0.5

@xebadir
Copy link
Contributor Author

xebadir commented Oct 29, 2019

Note all of the parameters with height references should be AGL interpolated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants