Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.081.107 Times

PDL::IO::Misc 2.4.3

  Date Added: June 13, 2010  |  Visits: 847

PDL::IO::Misc

Report Broken Link
Printer Friendly Version


Product Homepage
Download (87 downloads)



PDL::IO::Misc is a Perl module with misc IO routines for PDL. rcols() Read ASCII whitespaced cols from a file into piddles and perl arrays (also see "rgrep()"). There are two calling conventions - the old version, where a pattern can be specified after the filename/handle, and the new version where options are given as as hash reference. This reference can be given as either the second or last argument. The default behaviour is to ignore lines beginning with a # character and lines that only consist of whitespace. Options exist to only read from lines that match, or do not match, supplied patterns, and to set the types of the created piddles. Can take file name or *HANDLE, and if no columns are specified, all are assumed. For the allowed types, see "Datatype_conversions" in PDL::Core. Options: EXCLUDE or IGNORE - ignore lines matching this pattern (default /^#/). INCLUDE or KEEP - only use lines which match this pattern (default ). LINES - which line numbers to use. Line numbers start at 0 and the syntax is a:b:c to use every cth matching line between a and b (default ). DEFTYPE - default data type for stored data (if not specified, use the type stored in $PDL::IO::Misc::deftype, which starts off as double). TYPES - reference to an array of data types, one element for each column to be read in. Any missing columns use the DEFTYPE value (default []). PERLCOLS - an array of column numbers which are to be read into perl arrays rather than piddles. References to these arrays are returned after the requested piddles (default undef). Usage: ($x,$y,...) = rcols( *HANDLE|"filename", { EXCLUDE => /^!/ }, $col1, $col2, ... ) ($x,$y,...) = rcols( *HANDLE|"filename", $col1, $col2, ..., { EXCLUDE => /^!/ } ) ($x,$y,...) = rcols( *HANDLE|"filename", "/foo/", $col1, $col2, ... ) e.g., $x = PDL->rcols file1; ($x,$y) = rcols *STDOUT; # read in lines containing the string foo, where the first # example also ignores lines that with a # character. ($x,$y,$z) = rcols file2, 0,4,5, { INCLUDE => /foo/ }; ($x,$y,$z) = rcols file2, 0,4,5, { INCLUDE => /foo/, EXCLUDE => }; # ignore the first 27 lines of the file, reading in as ushorts ($x,$y) = rcols file3, { LINES => 27:-1, DEFTYPE => ushort }; ($x,$y) = rcols file3, { LINES => 27:, TYPES => [ ushort, ushort ] }; # read in the first column as a perl array and the next two as piddles ($x,$y,$name) = rcols file4, 1, 2, { PERLCOLS => [ 0 ] }; printf "Number of names read in = %dn", 1 + $#$name; Notes: 1. Quotes are required on patterns. 2. Columns are separated by whitespace by default, use $PDL::IO::Misc::colsep to specify an alternate separator. 3. For PDL-2.003, the meaning of the c value in the LINES option has changed: it now only counts matching lines rather than all lines as in previous versions of PDL. 4. LINES => -1:0:3 may not work as you expect, since lines are skipped when read in, then the whole array reversed. wcols() Write ASCII whitespaced cols into file from piddles efficiently. If no columns are specified all are assumed. Will optionally only process lines matching a pattern. Can take file name or *HANDLE, and if no file/filehandle is given defaults to STDOUT. Options: HEADER - prints this string before the data. If the string is not terminated by a newline, one is added (default ). Usage: wcols $piddle1, $piddle2,..., *HANDLE|"outfile", [%options]; e.g., wcols $x, $y+2, foo.dat; wcols $x, $y+2, *STDERR; wcols $x, $y+2, |wc; wcols $a,$b,$c; # Orthogonal version of print $a,$b,$c :-) wcols "%10.3f", $a,$b; # Formatted wcols "%10.3f %10.5g", $a,$b; # Individual column formatting wcols $a,$b, { HEADER => "# a b" }; Note: columns are separated by whitespace by default, use $PDL::IO::Misc::colsep to specify an alternate separator. swcols() generate string list from sprintf format specifier and a list of piddles swcols takes an (optional) format specifier of the printf sort and a list of 1d piddles as input. It returns a perl array (or array reference if called in scalar context) where each element of the array is the string generated by printing the corresponding element of the piddle(s) using the format specified. If no format is specified it uses the default print format. Usage: @str = swcols format, pdl1,pdl2,pdl3,...; or $str = swcols format, pdl1,pdl2,pdl3,...; rgrep() Read columns into piddles using full regexp pattern matching. Options: UNDEFINED: This option determines what will be done for undefined values. For instance when reading a comma-separated file of the type 1,2,,4 where the ,, indicates a missing value. The default value is to assign $PDL::undefval to undefined values, but if UNDEFINED is set this is used instead. This would normally be set to a number, but if it is set to Bad and PDL is compiled with Badvalue support (see "" in PDL::Bad) then undefined values are set to the appropriate badvalue and the column is marked as bad. DEFTYPE: Sets the default type of the columns - see the documentation for "rcols()" TYPES: A reference to a Perl array with types for each column - see the documentation for "rcols()" BUFFERSIZE: The number of lines to extend the piddle by. It might speed up the reading a little bit by setting this to the number of lines in the file, but in general "rasc()" is a better choice Usage ($x,$y,...) = rgrep(sub, *HANDLE|"filename") e.g. ($a,$b) = rgrep {/Foo (.*) Bar (.*) Mumble/} $file; i.e. the vectors $a and $b get the progressive values of $1, $2 etc. rdsa() Read a FIGARO/NDF format file. Requires non-PDL DSA module. Contact Frossie (frossie@jach.hawaii.edu) Usage: ([$xaxis],$data) = rdsa($file) $a = rdsa file.sdf Not yet tested with PDL-1.9X versions isbigendian() Determine endianness of machine - returns 0 or 1 accordingly rasc() Simple function to slurp in ASCII numbers quite quickly, although error handling is marginal (to nonexistent). $pdl->rasc("filename"|FILEHANDLE [,$noElements]); Where: filename is the name of the ASCII file to read or open file handle $noElements is the optional number of elements in the file to read. (If not present, all of the file will be read to fill up $pdl). $pdl can be of type float or double for more precision. # (test.num is an ascii file with 20 numbers. One number per line.) $in = PDL->null; $num = 20; $in->rasc(test.num,20); $imm = zeroes(float,20,2); $imm->rasc(test.num); rcube Read list of files directly into a large data cube (for efficiency) $cube = rcube &reader_function, @files; $cube = rcube &rfits, glob("*.fits"); This IO function allows direct reading of files into a large data cube, Obviously one could use cat() but this is more memory efficient. The reading function (e.g. rfits, readfraw) (passed as a reference) and files are the arguments. The cube is created as the same X,Y dims and datatype as the first image specified. The Z dim is simply the number of images..

Requirements: No special requirements
Platforms: Linux
Keyword: Ascii Default Deftype Exclude File Handle Io Libraries Lines Pdl Pdliomisc Perl Perl Module Piddles Read
Users rating: 0/10

License: Freeware Size: 2.1 MB
USER REVIEWS
More Reviews or Write Review


PDL::IO::MISC RELATED
Libraries  -  IO::Pipe::Producer 1.5
IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. SYNOPSIS # Module which provides 2 methods: getSubroutineProducer # and getSystemProducer. They take a subroutine reference # (with...
6.14 KB  
Libraries  -  dtRdr::Annotation::IO::YAML 0.0.11
dtRdr::Annotation::IO::YAML is a Perl module to read/write annotations from/to yml files. Methods init $io->init; items_for Return the hashrefs for a given book. @items = $io->items_for($book); insert $io->insert($object, %args);...
2.8 MB  
Libraries  -  File::Remote 1.17
File::Remote is a Perl module to read/write/edit remote files transparently. SYNOPSIS # # Two ways to use File::Remote # # First, the function-based style. Here, we can use the # special :replace tag to overload Perl builtins! # use...
15.36 KB  
Libraries  -  XML::TiePYX 0.05
XML::TiePYX is a Perl module to read or write XML data in PYX format via tied filehandle SYNOPSIS use XML::TiePYX; tie *XML,XML::TiePYX,file.xml open IN,file.xml or die $!; tie *XML,XML::TiePYX,*IN,Condense=>0; my $text=< tag...
7.17 KB  
Libraries  -  IO::Multiplex 1.08
IO::Multiplex is a Perl module that can manage IO on many file handles. SYNOPSIS use IO::Multiplex; my $mux = new IO::Multiplex; $mux->add($fh1); $mux->add(*FH2); $mux->set_callback_object(...); $mux->listen($server_socket); $mux->loop;...
14.34 KB  
Libraries  -  PDL::IO::FITS 2.4.3
PDL::IO::FITS Perl module offers a simple FITS support for PDL. SYNOPSIS use PDL; use PDL::IO::FITS; $a = rfits(foo.fits); # read a FITS file $a->wfits(bar.fits); # write a FITS file This module provides basic FITS support for PDL, in...
2.1 MB  
Libraries  -  App::Conf::File 0.965
App::Conf::File is a Perl module to load and access configuration data. SYNOPSIS use App::Conf; $config = App::Conf->new(); $config = App::Conf->new(configFile => $file); print $config->dump(), "n"; # use Data::Dumper to spit out the Perl...
122.88 KB  
Libraries  -  CAD::Drawing::IO::Compressed 0.26
CAD::Drawing::IO::Compressed is a Perl module to load and save compressed data. Requisite Plug-in Functions See CAD::Drawing::IO for a description of the plug-in architecture. check_type Returns true if $type is "compressed" or $filename...
39.94 KB  
Libraries  -  CAD::Drawing::IO::Image 0.02
CAD::Drawing::IO::Image is a Perl module with output methods for images. Requisite Plug-in Functions See CAD::Drawing::IO for a description of the plug-in architecture. check_type Returns true if $type is "img" or $filename matches one of...
5.12 KB  
Libraries  -  IO::Tty 1.07
IO::Tty is a Perl module to low-level allocate a pseudo-Tty, import constants. SYNOPSIS use IO::Tty qw(TIOCNOTTY); ... # use only to import constants, see IO::Pty to create ptys. IO::Tty is used internally by IO::Pty to create a...
21.5 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB