On Tue, Nov 22, 2011 at 6:24 PM, Puneet Kishor <[email protected]> wrote: > > On Nov 22, 2011, at 4:39 PM, Robert Young wrote: > >> It looks like your files have 16 bit short integers (NBITS 16), not >> bytes. Try replacing "byte" with "short" in your header. > > > Thanks Robert. The above info, plus a little bit of fiddling got me the > following working header > > short > 2 > 43200 18000 > > There were two other things that were confounding me... one, I was trying > everything in the pdl shell, but seems like the shell is not very chatty, and > pretty forgiving to boot... it doesn't seem to complain if there are errors, > so I wasn't really getting any notification of errors of my ways. Two, my > test file was name foo.bil, so I was naming the header file foo.hdr. It > actually should be foo.bil.hdr.
I'm assuming the shell you are using is perldl. If you are using pdl2, it should give more error feedback. In fact, you can enable 'use strict' so that you'll have to declare all variables used, etc. That is presently turned off because for quick interaction, most folks prefer to type less. If you are using an old version of PDL, then you're probably stuck with perldl. There have been some issues reported where not all error messages are returned to the user. I'm glad you got your IO working. If you use the hdr argument to the readflex call you can avoid having an actual header file (such as one named myfile.bil.hdr to go with myfile.bil). Cheers, Chris > Fixing the above two, gave me the helpful error that > >> Probably false alloc of over 1Gb PDL! (set $PDL::BIGPDL = 1 to enable) at >> /opt/local/lib/perl5/vendor_perl/5.14.1/darwin-multi-2level/PDL/Core.pm line >> 521. > > So, with the above setting, I can now read these files without any further > transformation. First step conquered. On to the next 100 steps. > > Many thanks again. > > >> >> Best, >> Robert >> >> On Tue, Nov 22, 2011 at 4:44 PM, Puneet Kishor <[email protected]> wrote: >>> >>> I have to figure out what information to extract from the above to create a >>> FlexRaw compatible header the way readenvi.pl does, but am a loss for now. >>> I have tried something like the following, but with no luck >>> >>> byte >>> 3 >>> 43200 18000 1 >>> >>> > > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
