Hello, this is an update to the nested flag issue. The problem is more
bizzare than I first reported, and I have updated the bitbucket issues.
Here, I copy/paste from the bitbucket report. Again, if these is a
preferred way for me to report such things, I will gladly abide :)
Thanks,
Don
===========================================================
The nesting option for the read header methods is misleading, wrong and
inconsistent.
The documentation within pflexible.py for the various methods says to use a
"nest=0" or "nest=1" argument to specify nesting. However, I have found
that if "nest=0" or "nest=1" is specified, then it will always flag as no
nesting, but if "nested=0" or "nested=1" is specified, then it will always
flag as nesting.
A sample code follows, along with output, to demonstrate the issue, is
inserted in Comment section.
#!/usr/bin/env python
FLEXPARTOutputDir =
'/home/morton/Research/CTBTO/FLEXPART_Benchmarking/NestExperiments/OutputNestOnlyWithDryWetConv/output'
# From NILU pflexible project
# Users will need to add the location of pflexible to $PYTHONPATH
import pflexible as pf
# Read the general header information common to all files
H = pf.Header(FLEXPARTOutputDir, nested=1)
isNested = H.nested # 0 = not nested, 1 = nested
print 'isNested: ' + str(isNested)
H = pf.Header(FLEXPARTOutputDir, nested=0)
isNested = H.nested # 0 = not nested, 1 = nested
print 'isNested: ' + str(isNested)
H = pf.Header(FLEXPARTOutputDir, nest=1)
isNested = H.nested # 0 = not nested, 1 = nested
print 'isNested: ' + str(isNested)
H = pf.Header(FLEXPARTOutputDir, nest=0)
isNested = H.nested # 0 = not nested, 1 = nested
print 'isNested: ' + str(isNested)
The resulting output is:
Header read:
/home/morton/Research/CTBTO/FLEXPART_Benchmarking/NestExperiments/OutputNestOnlyWithDryWetConv/output/header_nest
isNested: 1 Header read:
/home/morton/Research/CTBTO/FLEXPART_Benchmarking/NestExperiments/OutputNestOnlyWithDryWetConv/output/header_nest
isNested: 1 Header read:
/home/morton/Research/CTBTO/FLEXPART_Benchmarking/NestExperiments/OutputNestOnlyWithDryWetConv/output/header
isNested: 0 Header read:
/home/morton/Research/CTBTO/FLEXPART_Benchmarking/NestExperiments/OutputNestOnlyWithDryWetConv/output/header
isNested: 0
--
Voice: +1 907 450 8679
Arctic Region Supercomputing Center
http://weather.arsc.edu/
http://people.arsc.edu/~morton/ <http://www.arsc.edu/%7Emorton/>
|