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$tabledirand$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
- ubuntu noble: pdl 1:2.085-1ubuntu1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms