-
Hello, I'm having issues reading a netCDF file into GridStat. I'm getting this error in my output file,... --- NcCfFile::get_grid_from_lat_lon_vars() -> lon[367]=-112.672 lon[368]=-112.644 0.00133514 > 0.00133324 I believed the issue originates from the original netCDF file. From searching other discussion threads I believed the issue was similar to this (#1931). I proceeded to writing a python script to manually read the original netCDF file and set the correct file attributes. Then I ran pcp_combine with python_embedding (using the python code) using the following command... --- pcp_combine -add PYTHON_NUMPY $Output_filename -field 'name="$Path_to_ascii_numpy_script.py $Path_to_nc_file $nc_file_var";' The pcp_combine command above successfully runs and outputs a netCDF file. However, when I pass this output netCDF file into GridStat I get the evenly spaced lat/lon error (see above). Any assistance would be greatly appreciated! Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 18 replies
-
Hi: It sounds like the error is occurring when reading the output from Pcp-Combine into Grid-Stat? Would you be able to send a sample netCDF file so that we could take a closer look at this file? Instructions for sending data can be found here. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi Jake: I am able to get the data file to go directly into Grid-Stat using python embedding with MET version 11.1.0. Are you running this using a METplus configuration file or directly in MET? I tested directly in MET. Assuming this is your forecast data, you would want to set the following to get it to work: In the MET configuration file, for the forecast variable set: name = "read_ascii_numpy.py 01_test.nc refc"; If you are running from METplus, the setup would be a bit different, and I would need to see your METplus configuration to help get it up and running. When using python embedding, it's always a good idea to run a test using plot_data_plane to see if the data is correctly read into MET. I did this using the following command: The image created by MET's plot_data_plane is flipped compared to what I see when using ncview, which looks like the following: As you can see, in ncview, the precipitation is in the upper right corner of the image whereas in the plot_data_plane output, it's in the lower right. If the ncview version is correct, then you would want to change line 27 in your script to have the following 2 lines: With that change, I get an output image that matches what is displayed in ncview: Also, I think the date format you have in the python embedding script may be incorrect. If the date of your data is May 1, 2023, then the init and valid should look like this: I've attached the python embedding script here with the changes I made. Christina |
Beta Was this translation helpful? Give feedback.
-
Thank you for the help. I am wondering if there is also an issue with the lat/lon data being read by MET as I'm fairly sure the data is suppose to be over the ECONUS (maybe a -360 type issue?). I am planning on running from METplus. I moved the conf file I use over to you to try. The command I use to run METplus is... /usr/bin/python3.6 /usr/local/met10/METplus-4.0.0/ush/run_metplus.py -c $PATH_to_conf_file -c _$PATH_to_metplus_user.conf Okay, I'll make those grid flipping changes once I confirm the location of the grid over the CONUS. Ah, you are correct on the date format issue, I'll make that change as well. Jake |
Beta Was this translation helpful? Give feedback.
-
Hi Christina, Thank you for all of your help. I'll try setting up the conf file changes you attached for the METPlus python embedding run (with Grid-Stat). Ah, okay I'll double the grid specifications as well. Okay, I'll see if I can track down the original GRIB files and try those as well. Jake |
Beta Was this translation helpful? Give feedback.
-
Hi Christina,
Sorry for the very delayed response. This email got buried in my inbox and then I have been away due to an ongoing medical issue. But yes, I was able to get the files read and processed from METplus. Thank you so much for all of your help.
Thanks,
Jake
…________________________________
From: Christina Kalb ***@***.***>
Sent: Wednesday, March 27, 2024 5:39 PM
To: dtcenter/METplus ***@***.***>
Cc: Vancil, Jake T. ***@***.***>; Author ***@***.***>
Subject: Re: [dtcenter/METplus] Error reading netCDF file GridStat (Discussion #2511)
Hi Jake:
I'm following up on this discussion. Were you able to get this working?
Chrisinta
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/dtcenter/METplus/discussions/2511*discussioncomment-8934015__;Iw!!GNU8KkXDZlD12Q!_GV9Dh61hcQb0HvMx_HgiFjGRozfMOFjvCRL751faqj6GBnCroiNWwtgJ6Gy6RzPuMgEt_yXrfgdREodAtf3F5gwBQ$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7X6A7IIQH6VTGDSERUKMPLY2NDDDAVCNFSM6AAAAABEJ46P3GVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DSMZUGAYTK__;!!GNU8KkXDZlD12Q!_GV9Dh61hcQb0HvMx_HgiFjGRozfMOFjvCRL751faqj6GBnCroiNWwtgJ6Gy6RzPuMgEt_yXrfgdREodAtcLXxLXqA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi Jake:
I am able to get the data file to go directly into Grid-Stat using python embedding with MET version 11.1.0. Are you running this using a METplus configuration file or directly in MET? I tested directly in MET. Assuming this is your forecast data, you would want to set the following to get it to work:
In the MET configuration file, for the forecast variable set: name = "read_ascii_numpy.py 01_test.nc refc";
The level variable is omitted here in the configuration. When you run Grid-Stat, you would want to do the following on the command line:
grid_stat PYTHON_NUMPY observation_input_file GridStatConfigurationFile
If you are running from METplus, the setup would be a bit different,…