Point_stat: Python Embedding for Forecast Fields, attrs dictionary question #2645
-
Hello, I am trying to pass in a model field into point_stat using python embedding. I have a python routine that is communicating two main variables to point_stat: met_data (numpy array) and attrs (standard dictrionary).
How does point_stat use the grid sub dictionary to determine its forecast grid? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 18 replies
-
Hi @justintsu. I see that this question was submitted on July 26, but has gone unanswered. I apologize that this question was missed. Unfortunately, the person best able to answer your question is out until later in the week. @JohnHalleyGotway could you please take a look at this question when you get back into the office? |
Beta Was this translation helpful? Give feedback.
-
Still haven't heard back from the MET team yet but I dug up some more information on this in my debugging. I set point_stat debug verbosity to 4 so that it would print out the rejected observations while running the point observation PYTHON embedding routine in interactive mode. For some reason, I believe that some part of point_stat is setting my longitude to negative. My python routine reads in raobs from a IODA file, organizes it in a dataframe and then converts it in a MET compatible dictionary called met_point_obs. The point_stat debug statement prints this out:
It makes sense that this observation was rejected because the lvl (300) does not match up with the 500 mb lvl of the forecast. However, the longitudes (italicized) of the observation point_stat registers and the observation I pass in do not match up (see below) From Python: Note that the 4th index in the list is a positive 16.59 but point_stat thinks this is a negative 16.59. Another separate error I am noticing is in my forecast grid being passed into point_stat via attrs. when I run the python embedding function on its own, the grid I pass into point_stat is:
The grid that point_stat tells me it interprets from python embedding is:
Notice that it takes the complement of my lon_orient, which is not the same (it should be -42.211, if point_stat conforms to a [-180 180]. Everything else seems to pass correctly (although, i am not sure what Bx, By and Alpha are). |
Beta Was this translation helpful? Give feedback.
Hi Justin,
Just a note of clarification- this observation:
Is actually over Germany, because longitude is +7.10E, and thus it is off your grid. MET reports it as -7.10 because it uses degrees west internally, but requires degrees east as input. Therefore, the DEBUG statement there is printing the longitude in the units used internally not the units we request users to provide their longitude in. Indeed, an observation of -7.10E would be on your grid, but it would be printed in a DEBUG statement as +7.10 (degrees west). So behind the scenes in the code MET is: