LUT(3pm)

πŸ’– LUT(3pm) β€” bestie, it's the PDL::Graphics::LUT manual page πŸ’–

okay so real talk: this is a User Contributed Perl Documentation page (yes, the 3pm in LUT(3pm) means perl module docs, iykyk). It's for PDL::Graphics::LUT, and it's literally just your ✨colour closet✨ β€” a whole wardrobe of look-up tables and intensity ramps that you can pull out and slap onto your plots.


🌈 NAME 🌈

PDL::Graphics::LUT β€” provides access to a number of look-up tables πŸŽ€


✨ SYNOPSIS ✨

use PDL::Graphics::PGPLOT;
use PDL::Graphics::LUT;

# what tables are available
my @tables = lut_names();

# get the reversed colour table 'smooth',
# with the gamma intensity ramp
my ( $l, $r, $g, $b ) = lut_data( 'smooth', 1, 'gamma' );

# use the table idl5 in ctab
ctab( lut_data('idl5') );

see how easy that is?? three lines and you're serving looks πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

PDL::Graphics::LUT is holding a whole collection of colour look-up tables (in rgb format) plus intensity ramps, and it hands you the routines to go get that data. The format is exactly the vibe that ctab wants, so it's a match made in heaven fr fr.

Now here's the glow-up: unlike the initial release of the package, the data tables are no longer crammed inside the module itself β€” they now live in the PDL distribution as FITS files (peep $tabledir and $rampdir for the receipts). And the cute part? Changes to those directories get picked up on the next call to one of the package functions. No restart, no drama. πŸ”₯


πŸ‘‘ FUNCTIONS πŸ‘‘

🌸 lut_names()

Return, as a list, the names of the available colour tables.

@tables = lut_names();

πŸŽ€ lut_ramps()

Return, as a list, the names of the available intensity ramps.

@ramps = lut_ramps();

🧚 lut_data()

Load in the requested colour table and intensity ramp. the main character function honestly

my ( $l, $r, $g, $b ) = lut_data( $table, [ $reverse, [ $ramp ] ] );

Returns the levels and r, g, b components of the colour table $table. If $reverse is 1 (it defaults to 0 if you don't supply it), then the r, g, and b components get reversed before they come back to you. πŸ”„

If you don't supply $ramp, it defaults to "ramp" β€” that's a linear intensity ramp, the vanilla-but-always-works option.

heads up bestie: the returned values are ndarrays containing values in the range 0 to 1 inclusive, and they are floats. Don't come for me when you get floats, I warned you πŸ’€

πŸ’œ VARIABLES πŸ’œ

  • $tabledir β€” the directory where the colour tables (in rgb format) are stored. πŸ“
  • $rampdir β€” the directory where the intensity ramps are stored. πŸ“‚
  • $suffix β€” the suffix for the data files in $tabledir and $rampdir. 🏷️

⭐ FURTHER INFORMATION ⭐

The colour tables were taken from the STARLINK GAIA package, and they're provided under the GNU copyleft. Want the lore? See http://star-www.rl.ac.uk/ and http://star-www.dur.ac.uk/~pdraper/ for more details. 🫢


🌟 AUTHOR 🌟

Doug Burke (djburke@cpan.org), with thanks to Peter Draper/STARLINK for providing the colour-table data, and Christian Soeller and Karl Glazebrook for their help. 🫢✨

All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file.

no warranty, bestie β€” that's the fine print, not me being dramatic 😭

and that's the whole page, periodt πŸ’…

sign-off szn: this gorgeous thing is from perl v5.38.2, dated 2024-04-10, and it lives at LUT(3pm) in the User Contributed Perl Documentation. mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from