MET error when loading netCDF file #2274
-
Hi there, I am attempting to load in a netCDF file into plot_data_plane just to see if I can generate an output image. However, when I try to run plot_data_plane with that netCDF file, the following error is displayed: ERROR : MetNcFile::data(NcVar *, const LongArray &, DataPlane &) const -> star found in bad slot It has been a rather long time since I’ve used MET (just now getting spun back up using MET 11.0.2 as part of the coordinated release for METplus 5.0) and am not too sure what this error means, so I was looking for more of an explanation to this and if you have any ideas on how I can get around this error. Any help is greatly appreciated and feel free to let me know of any questions you may have. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi Brian, thanks for posting your question to GitHub discussions. I searched the earlier discussions and found this one: #1411 @j-opatz provided a great description of the problem and solution there. Please take a look and let me know if that answers it. If not, please post a sample data file to our anonymous ftp site following these instructions, along with the command you're running to produce the error. I do want to note that MET 11.0.0 includes this enhancement which makes requesting data from NetCDF files much more intuitive. If reading data from a NetCDF variable like this
That'd extract the 2D field of data for the first time step and fourth pressure level (the integers are 0-based). After this change, you can specify their VALUES instead:
With this, MET will figure out which |
Beta Was this translation helpful? Give feedback.
-
Hi John, Just got to seeing your response this afternoon... Thanks very much for getting back to me on this. Those instructions are very useful and I'll look to those as a starting point. I'll give that a spin with some of the data I've got here and follow up with you soon if I come across issues. |
Beta Was this translation helpful? Give feedback.
-
Hi again John, So I've had a look at the response in the earlier discussion you mentioned and tried to get the file I was looking to get plot_data_plane running with. Unfortunately, I have not been successful in doing so. I've gone ahead and placed a copy of the file I have along with the command I am using to run plot_data_plane with in a separate text file through the ftp server. Please let me know if you have any issues seeing the files or any other questions that come up. |
Beta Was this translation helpful? Give feedback.
-
@bmatilla sorry for the delay in responding. I was out of the office mid-week. I see the source of the issue here. The MET software supports a few different flavors of gridded NetCDF files:
For (3), we'd actually like to stop using a custom internal format and switch entirely to follow the CF-convention. But that change hasn't bubbled up to the top of the priority list yet. MET has separate library code for reading data from each of these flavors. The challenge is after opening up the NetCDF file, how to determine which library should be used. If you're curious about that logic, it lives in the grd_file_type() utility function. Your NetCDF file straddles the CF-convention and the internal MET format. Since the global attributes include
But you're specifying timing information in a CF-convention type of way. And that leads to the error. You have 2 options to fix this:
The presence of the Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Hi John, No worries; I appreciate your detailed response. It appears that did the trick on my end as I'm able to match your outcome! I'll look to modify my code so that I can rewrite the output files to include the updated CF convention attribute as in the latter of the two options. Thanks for also passing along the logic for the libraries. I'll need to take a more detailed look to learn more about that. For now, I'll mark your above response as the answer. Thanks very much once again! |
Beta Was this translation helpful? Give feedback.
@bmatilla sorry for the delay in responding. I was out of the office mid-week.
I see the source of the issue here. The MET software supports a few different flavors of gridded NetCDF files:
For (3), we'd actually like to stop using a custom internal format and switch entirely to follow the CF-convention. But that change hasn't bubbled up to the top of the priority list yet.
MET has separate library code for reading data from each of these flavors. The challenge is after opening up the NetCDF file, how to determine which library should be used. If you're curious about that logic, it liv…