<div dir="ltr">Hi Marie,<div><br></div><div>I threw together a python reader function for the WPS formatted intermediate files to show how you can read the files using the struct module. This only does the read and not the write. Writing the files is a little trickier because each fortran record requires the record size at the beginning and end, but for the most part you can look at this code and do the reverse operation. I should warn you that this isn't completely tested, so it might crash on you. </div><div><br></div><div>This function will return a list of WPSData objects, and to collect a common variable type, you'll have to do some searching through the list since they could be in random order, depending on how the file was written. Hopefully you'll find it useful.</div><div><br></div><div>Best of luck,</div><div><br></div><div>Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 3, 2017 at 9:44 AM, Bill Ladwig <span dir="ltr"><<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Marie,<div><br></div><div>Not currently, but NCL can read the WPS files. I will make a ticket to add this to the wrf-python package, but don't think this will make it in to the soon-to-be released 1.0.0 version (beta versions are available now from conda using the conda-forge channel if you want the diagnostic and interpolation routines in python). </div><div><br></div><div>Here is the description of the WPS/intermediate binary files:</div><div><br></div><div><a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Basics/IM_files/" target="_blank">http://www2.mmm.ucar.edu/wrf/<wbr>OnLineTutorial/Basics/IM_<wbr>files/</a><br></div><div><br></div><div>You should be able to use the struct, array, or scipy.io.FortranFile modules from python to read/write the files, or you can modify the sample Fortran code and use f2py to work in Fortran. </div><div><br></div><div>Hope this helps,</div><div><br></div><div>Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Mar 3, 2017 at 6:23 AM, Marie Pontoppidan <span dir="ltr"><<a href="mailto:Marie.Pontoppidan@uni.no" target="_blank">Marie.Pontoppidan@uni.no</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word">Hi.<div>I have been trying for a while to find a way of reading one variable from multiple intermediate files into python for analysis and plotting. However this seems to be more or less impossible. One could read from the met_em files instead, but I would really like to do some analysis on these intermediate files, before the met_em interpolation. </div><div>Is there a pyngl/pynio function for reading selected variables directly from the intermediatefiles?</div><div><br></div><div>Cheers,<br><div>
<div><div style="word-wrap:break-word"><b>Marie Pontoppidan</b></div><div style="word-wrap:break-word"><span>PhD student</span></div><div style="word-wrap:break-word"><span>Uni Research Climate</span></div><div style="word-wrap:break-word"></div><div style="word-wrap:break-word">email: <a href="mailto:marie.pontoppidan@uni.no" target="_blank">marie.pontoppidan@uni.n<wbr>o</a></div><div style="word-wrap:break-word">mobile: <a href="tel:+47%20975%2073%20215" value="+4797573215" target="_blank">+47 975 73 215</a><br>office: +47 555 89 832</div></div><div><br></div><br class="m_1317667864841582405m_8833525513564050982Apple-interchange-newline">
</div>
<br></div></div><br></div></div>______________________________<wbr>_________________<br>
pyngl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/pyngl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>