[SciPy-dev] Default data type of mtrand distributions

Paul Barrett pebarrett@gmail....
Wed Sep 24 20:02:49 CDT 2008


Robert,

I'm prepared to submit a patch, if I can find the time.  What is the
easiest way to go about this?  It would appear that some of this code
is generated.  If yes, then what should I look out for.  Any tips
would help speed this patch along.

 -- Paul

On Wed, Sep 24, 2008 at 5:06 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On Wed, Sep 24, 2008 at 15:34, Paul Barrett <pebarrett@gmail.com> wrote:
>> I'm using numpy to simulate - and then analyze - large scale (8k x 8k)
>> astronomical images. The counts per pixel are not expected to be much
>> greater that 100k for the brightest stars, so an int32 data type is
>> completely adequate for my needs.  In some cases, an int16 data type
>> will do, when the brightest object has <65k counts.  In fact, most
>> pixels are of the background sky with typical counts of <20.  When I
>> add Poisson noise to the simulated image, the output array has a data
>> type of int64 on my 64 bit workstation.  This results in an array size
>> of 512 MB, when a 256 MB array (i.e. int32 data type) will do.
>>
>> So the question is: Is it possible to add a dtype keyword to the
>> distribution functions that will specify the output data type as
>> opposed to the current situation of defaulting to the largest possible
>> data type?  How difficult is it to make such changes?
>
> Probably more annoying than difficult but sufficiently annoying that
> I'm not going to do it any time soon. Present me with a complete
> patch, though ...
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>


More information about the Scipy-dev mailing list