You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I encountered a problem when trying to use a "for loop" to get a sequence of different interpolation planes.
So I have tried this line, which works fine:
p_certain_level = wrf.interplevel(p,z,2893.9905)
I can plot this to get:
I also have other different height values that I want to plot. So I write a list:
height = [588.0741, 1751.7858, 2893.9905, 4019.048, 5129.8022, 6228.1494, ... ]
Then I write the for loop:
for a in range(0,3): ## here i'm just trying the first three heights, not the whole list
ss = wrf.interplevel(p, z, float(height[a]))
print(ss)
This returns something like:
As you can see, there are a lot of nan in the printed array. I also tried to plot the result:
As you can see, the middle values are kept unchanged. However, the other values are all missing. I'm not sure what's happening that leads to interplevel method not working. I've tried a few times and believe this is related to list and numpy.array (both list and np.array are producing the same problem).
I've tried wrf.getvar, in which I use a "timeidx = blabla_list [3]", which turns out to work properly.
The text was updated successfully, but these errors were encountered:
Hello, I encountered a problem when trying to use a "for loop" to get a sequence of different interpolation planes.
So I have tried this line, which works fine:
p_certain_level = wrf.interplevel(p,z,2893.9905)
I can plot this to get:
![image](https://private-user-images.githubusercontent.com/97600799/285519904-6e8f12c8-3a16-4937-8b3b-69d1f4839853.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjgwMzAsIm5iZiI6MTczODg2NzczMCwicGF0aCI6Ii85NzYwMDc5OS8yODU1MTk5MDQtNmU4ZjEyYzgtM2ExNi00OTM3LThiM2ItNjlkMWY0ODM5ODUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE4NDg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyNzJlMTY5N2NiMjM3NWM2NzQ2OWNhNmJmMTc5ZWVjM2Q1NTAyZWVlMGVkMWZjZDNkNmYyNmEyMzkyNjNjN2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.k8qtHp6v-0VMxyiSyJaTDN10dV7qqegeladYlT6sY5s)
I also have other different height values that I want to plot. So I write a list:
height = [588.0741, 1751.7858, 2893.9905, 4019.048, 5129.8022, 6228.1494, ... ]
Then I write the for loop:
for a in range(0,3): ## here i'm just trying the first three heights, not the whole list
ss = wrf.interplevel(p, z, float(height[a]))
print(ss)
This returns something like:
![image](https://private-user-images.githubusercontent.com/97600799/285519572-4420cdf2-14bf-4643-ad9f-e2518b0640aa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjgwMzAsIm5iZiI6MTczODg2NzczMCwicGF0aCI6Ii85NzYwMDc5OS8yODU1MTk1NzItNDQyMGNkZjItMTRiZi00NjQzLWFkOWYtZTI1MThiMDY0MGFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE4NDg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBkMTUyNzg1ODI3YTYyNWZmYWIxNjc2MWMyOGNlNjFjYmY5ZmQ0MTI5NTU4NTBlZWQ4OTkxYzc1Yjk4Yjg3MzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mw_R6vxap8UbKRVCNc3UH21bxXMgX9HL7Ue_Op4KFbM)
As you can see, there are a lot of nan in the printed array. I also tried to plot the result:
![image](https://private-user-images.githubusercontent.com/97600799/285519966-db3bcb70-b3f4-4b68-acd4-6d4fcc28a67c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjgwMzAsIm5iZiI6MTczODg2NzczMCwicGF0aCI6Ii85NzYwMDc5OS8yODU1MTk5NjYtZGIzYmNiNzAtYjNmNC00YjY4LWFjZDQtNmQ0ZmNjMjhhNjdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE4NDg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3YzlmNmJlM2MyNTM5MDQwZGIyNjM4NjAxYmY3NTJhZTE2Mzc3ODU3ZjdjNmM1NDRiY2RiMDg3OGRlNGQwMDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QNhAEJD4ax6c87whQzd05fAJuG-K5sPxT70diTXOPis)
As you can see, the middle values are kept unchanged. However, the other values are all missing. I'm not sure what's happening that leads to interplevel method not working. I've tried a few times and believe this is related to list and numpy.array (both list and np.array are producing the same problem).
I've tried wrf.getvar, in which I use a "timeidx = blabla_list [3]", which turns out to work properly.
The text was updated successfully, but these errors were encountered: