Re: [Pdl-general] [Pdl-devel] project ordered sequence image

2024-10-25 Thread David Mertens
Hello Guillermo, You said something interesting. You discussed a sub-image with "a red circle" and another with "a blue rectangle". But what you have are full images: an image with a red circle is an image with a red circle and a black background. It sounds like you want to treat that background c

Re: [Pdl-general] PDL and bart

2024-05-15 Thread David Mertens
Regarding "using both in an optimal way": Have you considered extracting the source code for the useful algorithms and writing PDL::PP wrappers for them? I assume they are written in C, though if they are not this would be a silly idea. Otherwise I guess you could write Perl scripts that shell out

Re: [Pdl-general] Plotting flat xyz data as an image.

2024-04-18 Thread David Mertens
Hello Jovan, Did you try this? my $z = sequence(10,10)*rand(1); Seems to me you just need a z-value pdl that has the same dimensions as the x and y coordinates. David On Thu, Apr 18, 2024, 1:11 PM Jovan Trujillo wrote: > Hi Greg, > Yes, I've been looking into a heat map or flattened 3d scatte

Re: [Pdl-general] [Pdl-devel] naming conventions

2024-02-06 Thread David Mertens
Nice find! :-) On Tue, Feb 6, 2024, 7:14 PM Luis Mochan wrote: > On Tue, Jan 30, 2024 at 09:40:59PM -0600, Luis Mochan wrote: > > ...> > > On Mon, Jan 29, 2024 at 10:19:56PM -0500, David Mertens wrote: > > > Hello Luis, > > > > > > Ever crafty,

Re: [Pdl-general] [Pdl-devel] naming conventions

2024-01-29 Thread David Mertens
Hello Luis, Ever crafty, Perl gives you another way to solve this. You could put your functions under another name space and invoke them by explicitly naming the package and function. For example, if you have a function "do_it" in package MY, you could invoke it as $pdl->MY::do_it(...args...) Fo

Re: [Pdl-general] Check for all element eq 0

2023-12-22 Thread David Mertens
Hello Yury, I offer the following clarification, hopefully: all($stuff == 0) # checks if every element in $stuff is zero all($stuff == 5) # checks if every element in $stuff is 5 all($stuff) # checks if every element in $stuff is boolean true all($stuff) == 0 # checks if it is not the cas

Re: [Pdl-general] transparency in PDL::Graphics::Prima

2022-02-22 Thread David Mertens
Hello Ingo, I'm not quite sure I understand exactly what you're trying to do, so I'll spell out a few options. First, it is fairly easy to load images using Prima, then to use Prima's Drawable API to draw lines (see the line(), lines(), or polyline() functions, or the ), place text, and overlay o

Re: [Pdl-general] read videos

2021-06-01 Thread David Mertens
I am not aware of any function for this, but I have pipe-opened ffmpeg, which can generate a highly configurable stream of bits for you. I wanted to display the images in Prima, so got the bit pattern that was compatible with one of the Prima image formats. You could probably do something similar a

[Pdl-general] PDL::PP Segfaults on Windows when using GenericTypes and temp piddle

2020-06-19 Thread David Mertens
Hello everyone, In my research I needed the uncertainties in my linear fits. I've always used PDL::Fit::OO for linear fitting (because I wrote it, it has no Fortran dependencies, and know it well enough to work even on my students' machines), so I finally got around to implementing a covariance ma

Re: [Pdl-general] How to change a child piddle's data in C?

2020-06-19 Thread David Mertens
Hello Derek, As I recall (but this is a hazy recollection, Craig could answer this with greater authority and detail), the PDL version of the method will do quite a bit of work for you before calling pdl_times_ten_readdata. In particular, it'll make physical copies of all non-contiguous slice pidd

Re: [Pdl-general] heatmaps

2016-11-29 Thread David Mertens
I once worked in a group where we did this sort of plotting. The way that we did this was to simply use a Monte Carlo approach. Write a function that calculates the average distance from the diagonal with your current matrix arrangement. (If two items are very similar but not close together, their

Re: [Pdl-general] C::Blocks vs PDL performance

2016-04-26 Thread David Mertens
---because the differences were so surprising. Preliminary work on matrix multiplication shows PDL performing very well, as we would have expected. David On Tue, Apr 26, 2016 at 11:40 PM, David Mertens wrote: > Hello Chris, > > Would you like for me to post your response on blogs.perl.or

Re: [Pdl-general] C::Blocks vs PDL performance

2016-04-26 Thread David Mertens
Hello Chris, Would you like for me to post your response on blogs.perl.org? I'd be happy to do so (under my account, but starting with "Chris Marshal replied...") Believe it or not, this case is not too pathological for my research. My calculations often only need local or nearby information and

Re: [Pdl-general] Strawberry Perl PDL edition 5.22.1.1 (for MS Windows users)

2015-12-18 Thread David Mertens
(By which I meant "out-of-the-box cutting-edge" solution for Windows", of course) :-) On Fri, Dec 18, 2015 at 6:56 AM, David Mertens wrote: > kmx, > > This is excellent news, and wonderful work! It means a lot to have an > out-of-the-box solution for Windows. >

Re: [Pdl-general] Strawberry Perl PDL edition 5.22.1.1 (for MS Windows users)

2015-12-18 Thread David Mertens
kmx, This is excellent news, and wonderful work! It means a lot to have an out-of-the-box solution for Windows. kmx++ David On Fri, Dec 18, 2015 at 5:59 AM, kmx wrote: > For those of you who are using PDL on MS Windows there is a new release of > Strawberry Perl PDL edition at http://strawber

Re: [Pdl-general] SciPDL-2.015 status

2015-12-10 Thread David Mertens
rminal running pdl’ executable as an extra. > Anyone have any experience with that sort of thing? If so email me > privately. > > > Karl > > > > > On 7 Dec 2015, at 5:40 am, David Mertens > wrote: > > > > Hello Karl, > > > > I have looked into

[Pdl-general] Fwd: Algorithms in the Field (AitF)

2015-12-06 Thread David Mertens
Hello! I want to draw everyone's attention to a newly released NSF program solicitation for "Algorithms in the Field". I've pasted the synopsis below. The website is here: http://www.nsf.gov/pubs/2016/nsf16515/nsf16515.htm?WT.mc_id=USNSF_179 Something tells me that most of us PDL folk don't reall

Re: [Pdl-general] SciPDL-2.015 status

2015-12-06 Thread David Mertens
Hello Karl, I have looked into running OS X on virtualbox, but never got an install DVD for my Mac, and thus I don't have a disk image to use for 32-bit hardware. However, Dmitry (developer of Prima) mentioned that he had no trouble installing OS X on virtualbox using Niresh, presumably on a 64-bi

Re: [Pdl-general] Randomly reorder PDL piddle?

2015-08-06 Thread David Mertens
On Thu, Aug 6, 2015 at 1:11 PM, Marek Gierliński wrote: > I normally do it this way > > $shuffled = $data(qsorti(random($x))) > Now that is compact! Nice! I'll have to remember that. David -- ___

Re: [Pdl-general] Randomly reorder PDL piddle?

2015-08-06 Thread David Mertens
Hey Nick, I'm not sure how fast this is, but this is what I do when I need to randomly sort things: # Assuming you have $data already declared... $shuffled = cat($data->random, $data)->transpose->qsortvec->(1)->flat The call "->(1)" is a NiceSliceism; replace with a slice method call if that's n

Re: [Pdl-general] Introducing C::Blocks, a new way to interface C and Perl

2015-08-05 Thread David Mertens
cy perls could still have the benefits of > new JIT compiling while the modern perls could be C::Blocks based. > > I haven't yet gotten tcc to build on cygwin but I look forward to trying > out your code when I get a working tcc. > > Cheers, > Chris > > On Wed, Aug 5

Re: [Pdl-general] Introducing C::Blocks, a new way to interface C and Perl

2015-08-05 Thread David Mertens
well it would handle some of the most important features of C::Blocks, however, such as lexical scoping of shared C libraries. This would not be a small undertaking. David On Wed, Aug 5, 2015 at 12:21 PM, David Mertens wrote: > Yes, it absolutely requires the keyword API to work. > >

Re: [Pdl-general] Introducing C::Blocks, a new way to interface C and Perl

2015-08-05 Thread David Mertens
Marshall wrote: > Does C::Blocks really require the perl keyword API to work? > It would be nice if there was a version that could work with > perl 5.10.x. > > --Chris > > > On 8/4/2015 17:33, David Mertens wrote: > > Hey Chris, > > I wish I could say somethin

Re: [Pdl-general] Introducing C::Blocks, a new way to interface C and Perl

2015-08-04 Thread David Mertens
extra memory motion (cache thrash). > Your timings indicate that this approach for JIT has promise for > some significant performance improvements. > > --Chris > > > > On Tue, Aug 4, 2015 at 1:35 PM, David Mertens > wrote: > >> Hello everyone, >> >> While th

[Pdl-general] Introducing C::Blocks, a new way to interface C and Perl

2015-08-04 Thread David Mertens
Hello everyone, While this is not strictly a PDL announcement, it is something that will undoubtedly be of interest to PDL users, and may even be of interest to PDL developers. Yesterday I pushed the first "alpha" release of C::Blocks , a module designed to mak

Re: [Pdl-general] strings or words instead of numbers in PDL arrays/lists

2015-07-24 Thread David Mertens
Hello Kostas, To follow up on what Bryan said, I wonder what sort of PDL functionality you hope to use with a piddle of words, as opposed to a normal Perl array. I have a hard time imagining you'll need the multidimensional handling PDL provides. Even if you want a list of lists, PDL will only wor

Re: [Pdl-general] PDL::IO::HDF::SD housekeeping 'Too many open files'

2015-05-11 Thread David Mertens
In more digging (again, I'm not an HDF expert, but this problem piques my curiosity), it looks like the HDF library imposes its own file-open limitation. The number of open files was limited to 32 prior to HDF v4.2r2, but can now be set to any arbitrary number. Perhaps the most interesting factoid,

Re: [Pdl-general] PDL::IO::HDF::SD housekeeping 'Too many open files'

2015-05-11 Thread David Mertens
tty much a dead end for PDL. I > think—someone who knows what they are doing should have a look to confirm. > > > > Is there some magic I can use to call ‘eval{}’ that will force it to do > the cleanup it’s not currently doing? Any ideas? > > > > Thanks again, >

Re: [Pdl-general] PDL::IO::HDF::SD housekeeping 'Too many open files'

2015-05-11 Thread David Mertens
Hello Edward, I'm not an expert with this module, but I can sniff out the problem. The SD file handle gets closed using the close method, which is usually called by DESTROY

Re: [Pdl-general] Lomb Periodogram on github

2015-05-05 Thread David Mertens
Sorry, forgot to include a link: https://github.com/run4flat/PDL-Periodogram On Tue, May 5, 2015 at 10:29 AM, David Mertens wrote: > Hey everyone, > > I have a need for an implementation of the Lomb Periodogram. It's like a > fourier transform, but your input data doesn

[Pdl-general] Lomb Periodogram on github

2015-05-05 Thread David Mertens
Hey everyone, I have a need for an implementation of the Lomb Periodogram. It's like a fourier transform, but your input data doesn't need to have equal time spacing, and you don't need to have evenly spaced output frequencies. You're like to have encountered it if you've read Numerical Recipes.

[Pdl-general] NSF Grant Solicitation in Computational Physics due Dec 3

2015-04-29 Thread David Mertens
Hey everyone, The National Science Foundation (United States) just put out a solicitation for Computational Physics. I will be moving in the middle of 2016 and am considering another postdoc, so I wouldn't be eligible as a PI (i.e. I would not be eligible to take a grant with me if I happened to w

Re: [Pdl-general] multielement piddle in conditional expression

2015-04-20 Thread David Mertens
Hello Juan, $PDL::BIGPDL is evaluated in boolean context, and is meant to only be true or false. It's truthiness is checked in the PDL internals. By assigning a piddle to it (in your line 38), you set a ticking bomb that goes off somewhere in PDL's internals. If you just assign non-piddle true or