Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    PDL::IO::HDF::SD 2.4.9_013

    Download button

    No screenshots available
    Downloads: 361  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Chris Marshall | More programs
    Perl Artistic License / FREE
    December 15th, 2011, 10:07 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    PDL::IO::HDF::SD description

    PDL interface to the HDF4 SD library.

    PDL::IO::HDF::SD is a PDL interface to the HDF4 SD library.

    SYNOPSIS

     use PDL;
     use PDL::IO::HDF::SD;
     
     #
     # Creating and writing an HDF file
     #

     # Create an HDF file:
     my $hdf = PDL::IO::HDF::SD->new("-test.hdf");

     # Define some data
     my $data = sequence(short, 500, 5);

     # Put data in file as 'myData' dataset with the names
     # of dimensions ('dim1' and 'dim2')
     $hdf->SDput("myData", $data , ['dim1','dim2']);

     # Put some local attributes in 'myData'
     #
     # Set the fill value to 0
     my $res = $hdf->SDsetfillvalue("myData", 0);
     # Set the valid range from 0 to 2000
     $res = $hdf->SDsetrange("myData", [0, 2000]);
     # Set the default calibration for 'myData' (scale factor = 1, other = 0)
     $res = $hdf->SDsetcal("myData");

     # Set a global text attribute
     $res = $hdf->SDsettextattr('This is a global text test!!', "myGText" );
     # Set a local text attribute for 'myData'
     $res = $hdf->SDsettextattr('This is a local text testl!!', "myLText", "myData" );

     # Set a global value attribute (you can put all values you want)
     $res = $hdf->SDsetvalueattr( PDL::short( 20 ), "myGValue");

     # Set a local value attribute (you can put all values you want)
     $res = $hdf->SDsetvalueattr( PDL::long( [20, 15, 36] ), "myLValues", "myData" );

     # Close the file
     $hdf->close();

     #
     # Reading from an HDF file:
     #

     # Open an HDF file in read only mode:
     my $hdf = PDL::IO::HDF::SD->new("test.hdf");

     # Get a list of all datasets:
     my @dataset_list = $hdf->SDgetvariablename();

     # Get a list of the names of all global attributes:
     my @globattr_list = $hdf->SDgetattributenames();

     # Get a list of the names of all local attributes for a dataset:
     my @locattr_list = $hdf->SDgetattributenames("myData");

     # Get the value of local attribute for a dataset:
     my $value = $hdf->SDgetattribut("myLText","myData");

     # Get a PDL var of the entire dataset 'myData':
     my $data = $hdf->SDget("myData");

     # Apply the scale factor of 'myData'
     $data *= $hdf->SDgetscalefactor("myData");

     # Get the fill value and fill the PDL var in with BAD:
     $data->inplace->setvaltobad( $hdf->SDgetfillvalue("myData") );

     # Get the valid range of a dataset:
     my @range = $hdf->SDgetrange("myData");
     
     #Now you can do what you want with your data
     $hdf->close();


    This library provides functions to read, write, and manipulate HDF4 files with HDF's SD interface.

    For more infomation on HDF4, see http://hdf.ncsa.uiuc.edu/

    There have been a lot of changes starting with version 2.0, and these may affect your code. PLEASE see the 'Changes' file for a detailed description of what has been changed. If your code used to work with the circa 2002 version of this module, and does not work anymore, reading the 'Changes' is your best bet.

    In the documentation, the terms dataset and SDS (Scientific Data Set) are used interchangably.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    PDL interface | HDF4 SD library | Perl module | HDF4 | PDL | SD

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM