[Pflexible-users] Use of pflexible 0.9 to access basic 2D fields
A python tool for data analysis of FLEXPART transport modeling.
Status: Beta
Brought to you by:
jfburkhart
|
From: Don M. <Don...@al...> - 2012-10-28 16:13:56
|
Dear Colleagues (Delia Arnold cc'd, because I don't know if she's on this list): Delia and I have been working together to create some easy to use scripts for FLEXPART outputs (also for SRS files generated by any model). To date, we have been using someone's flex81.py module, but prefer to use something supported by the FLEXPART community, and perhaps something cleaner to use in the long run. So, we have started exploring the recent pflexible v0.9. Our immediate interest is simply in extracting the data from the FLEXPART output files (as we already do with the flex81.py module) and then use our own matplotlib routines for plotting. First, please let me offer my thanks to those of you who put this together over the summer. I was trying to use v0.2 earlier, and although I got it working through some hacking, it wasn't pretty. This version seems to be much cleaner and, what I really love is that if the Fortran shared lib isn't available, it automagically uses the native python binary class for extraction. So now the questions - I have sample script and stdout available in http://weather.arsc.edu/Miscellaneous/pflexibleTry1/ I'm a relaitvely new user of FLEXPART, so there may be lots of underlying detail I'm ignorant of, but I find that if I want to pull out a basic concentration grid for processing and plotting, the following will not work: FD = pf.read_grid(H, date=theTimeStamp) print FD.shape Instead, I need to actually index the whole structure by a tuple, as follows: theTuple = (0, theTimeStamp) theGrid = FD[theTuple] print 'Shape: ' + str(theGrid.shape) This is fine, but it's not clear to me what the "0" in the tuple actually indexes. Is it a species number? On the other hand, I can easily extract the grids for dry and wet deposition without passing in any kind of tuple: WD = pf.read_grid(H, date=theTimeStamp, getwet=True) print 'Shape: ' + str(WD.shape) My basic question is whether I should expect this inconsistency between extracting concentration (or the counterpart in backward mode) and deposition grids. Obviously, we can work with it. Also, it's not clear to me whether the get_slabs() routine has been thoroughly checked out, and whether I might be doing something wrong. If I try the following (this is also in the sample script I pointed you to): FD = pf.read_grid(H, date=theTimeStamp) ########### # The call to get_slabs() fails - there is a statement in there, # "grid_shape = G.shape" in which the shape attribute is not recognized. #grid = pf.get_slabs(H, FD) Then I run into the same error I ran into when trying to access FD as a grid, rather than a structure with a grid in it. It seems that, in this case, maybe get_slabs() itself would need to form that tuple first, and then grab the slab. --------------------------------------- Thank you for your time. As we move ahead with this, we would be happy to create simple "HOWTO's" that demonstrate the use of pflexible in "extraction" operations, and will even contribute our own scripts for plotting once they're a little more mature. You can see one example at http://weather.arsc.edu/Miscellaneous/FLEXPART-FairbanksFire.png First, we just want to make sure we're using pflexible as intended :) Best Regards, Don Morton and Delia Arnold -- Voice: +1 907 450 8679 Arctic Region Supercomputing Center http://weather.arsc.edu/ http://people.arsc.edu/~morton/ <http://www.arsc.edu/%7Emorton/> |