You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(12) |
2
(13) |
3
(14) |
4
(9) |
|
5
(9) |
6
(22) |
7
(17) |
8
(16) |
9
(19) |
10
(17) |
11
(6) |
|
12
|
13
(20) |
14
(21) |
15
(20) |
16
(10) |
17
(14) |
18
(3) |
|
19
(3) |
20
(12) |
21
(22) |
22
(26) |
23
(31) |
24
(26) |
25
(9) |
|
26
(4) |
27
(33) |
28
(15) |
29
(37) |
30
(26) |
|
|
|
From: Thomas R. <tho...@gm...> - 2009-04-04 23:35:50
|
Hi, I've found that the match_original=True option in PatchCollection causes matplotlib to crash. I have submitted two bug reports: https://sourceforge.net/tracker/?func=detail&aid=2732455&group_id=80706&atid=560720 https://sourceforge.net/tracker/?func=detail&aid=2723527&group_id=80706&atid=560720 I was wondering whether these are problems that other people have encountered too? (description in the bug reports) Thanks, Thomas |
|
From: Cohen-Tanugi J. <co...@lp...> - 2009-04-04 23:31:08
|
hi Eric, then I misunderstood what the code does.... I thought it was transforming the data. In any case, my second figure in my previous post is wrong because the code should read: plt.errorbar(cE,corrE*fluxes, yerr=corrE*unc_fluxes) instead of plt.errorbar(cE,corrE*fluxes, yerr=unc_fluxes) and indeed this seems to behave correctly, so I guess I got completely confused while trying to understand what was happening. I will check out your patch and start from the beginning. thanks a lot and sorry, Johann Eric Firing wrote: > Cohen-Tanugi Johann wrote: >> ok, maybe it is in scale.py :) >> And what I see there confirms my initial fears : the log scale >> transform applies a log to the argument, which is incorrect for an >> error..... So first of all, another transform needs to be created so >> that erry is transformed into erry/y/log(base) where base was 10 in >> my example. > > Johann, > > I don't understand your objection here. It seems to me that an > errorbar should always be in the same units, and on the same scale, > as the point to which it applies. Therefore when switching from > linear to log scales, one simply plots the same data and error ranges > on a log scale instead of a linear scale. This is what mpl does. If > what you want is for the error to be proportional to the value of the > point, then you need to specify the error bounds so that they have > that property. For estimation of a power spectrum, for example, this > is often the case; the error bars are some fraction (depending on the > equivalent number of degrees of freedom) of the spectral level at each > frequency, so on a log plot they will have equal length. It is not > the job of the errorbar function to figure that out, however. > > If I am misunderstanding, then please provide a very simple concrete > example that will make your point clear. > >> >> past midnight here.... I will see tomorrow if I find time to try out >> a patch (not the easiest entry point for starting developer's >> activities in MPL I am afraid....) > > I have just committed a change (trunk r7023) that allows non-positive > numbers to be clipped to a small positive value. To illustrate its > use with an errorbar, I added the example provided by Matthias to > examples/pylab_examples/log_demo.py, as a 4th subplot. > > Eric >> >> Johann |
|
From: Eric F. <ef...@ha...> - 2009-04-04 23:11:49
|
Cohen-Tanugi Johann wrote: > ok, maybe it is in scale.py :) > And what I see there confirms my initial fears : the log scale transform > applies a log to the argument, which is incorrect for an error..... So > first of all, another transform needs to be created so that erry is > transformed into erry/y/log(base) where base was 10 in my example. Johann, I don't understand your objection here. It seems to me that an errorbar should always be in the same units, and on the same scale, as the point to which it applies. Therefore when switching from linear to log scales, one simply plots the same data and error ranges on a log scale instead of a linear scale. This is what mpl does. If what you want is for the error to be proportional to the value of the point, then you need to specify the error bounds so that they have that property. For estimation of a power spectrum, for example, this is often the case; the error bars are some fraction (depending on the equivalent number of degrees of freedom) of the spectral level at each frequency, so on a log plot they will have equal length. It is not the job of the errorbar function to figure that out, however. If I am misunderstanding, then please provide a very simple concrete example that will make your point clear. > > past midnight here.... I will see tomorrow if I find time to try out a > patch (not the easiest entry point for starting developer's activities > in MPL I am afraid....) I have just committed a change (trunk r7023) that allows non-positive numbers to be clipped to a small positive value. To illustrate its use with an errorbar, I added the example provided by Matthias to examples/pylab_examples/log_demo.py, as a 4th subplot. Eric > > Johann |
|
From: Cohen-Tanugi J. <co...@lp...> - 2009-04-04 22:20:24
|
ok, maybe it is in scale.py :) And what I see there confirms my initial fears : the log scale transform applies a log to the argument, which is incorrect for an error..... So first of all, another transform needs to be created so that erry is transformed into erry/y/log(base) where base was 10 in my example. past midnight here.... I will see tomorrow if I find time to try out a patch (not the easiest entry point for starting developer's activities in MPL I am afraid....) Johann Cohen-Tanugi Johann wrote: > hello, > for the sake of concreteness, here is an example without any limit > issues : the python script is attached and the 2 resulting figures as > well. The dirst one is drawn using log directly in the arguments, and > correctly transforming the y-errors into y-errors/y-values/log(10). > In the second figure, I use the log scaling in x and y. Clearly > something goes wrong with plotting the error bars, and the y-scale > limits also seem ill chosen.... > > HTH debugging this. I looked again at the code, but I am decidedly > lost as to where the error bar plotting occurs, and where it gets > modified by the log scale request. > > Johann > > > Cohen-Tanugi Johann wrote: >> hello..... Anyone? I would very much love to see this fixed, and I am >> ready to help out, but I do not know how to browse through the code. >> Despite the fact that log(errors) should of course not be used, but >> rathter errors/values/log(10), Michael's point still remains : >> values- errors in log scale can be negative, so that the artist >> should just draw a bar until the lower limit of the vertical bar. I >> would say that this is the standard practice. >> Sorry for my previous email beside the point. >> Johann >> >> Cohen-Tanugi Johann wrote: >>> I tried to look at the code (axes.py I presume) in order to attempt >>> a patch, but it defeated me, I do not have the instructions to >>> navigate through this code :) >>> Where is the actual transform of the error bars occurring? >>> thanks, >>> Johann >>> >>> Michael Droettboom wrote: >>> >>>> I have to say I don't really have a lot of experience with error >>>> bars on log plots -- but the root cause here is that the lower >>>> bound of the error bar goes negative, and as we all know, the log >>>> of a negative number is undefined. If you can suggest where the >>>> lower bound should be drawn or provide third-party examples, I'm >>>> happy to look into this further and resolve this "surprise". >>>> >>>> Mike >>>> >>>> Cohen-Tanugi Johann wrote: >>>> >>>>> yes exactly.... >>>>> I should have provided a test case, thanks for following up! >>>>> Johann >>>>> >>>>> Matthias Michler wrote: >>>>> >>>>> >>>>>> Hello Johann, >>>>>> >>>>>> is the problem you are reporting the one I observe in the >>>>>> attached picture? Namely some vertical and horizontal lines are >>>>>> missing when using yscale="log". More precisely everything below >>>>>> y=1 seems to be missing. >>>>>> >>>>>> The picture was generated with the code below and >>>>>> matplotlib.__version__ = '0.98.6svn' >>>>>> matplotlib.__revision__ = '$Revision: 6887 $' >>>>>> >>>>>> best regards Matthias >>>>>> >>>>>> ############################### >>>>>> import numpy as np >>>>>> import matplotlib.pyplot as plt >>>>>> >>>>>> plt.subplot(111, xscale="log", yscale="log") >>>>>> x = 10.0**np.linspace(0.0, 2.0, 20) >>>>>> y = x**2.0 >>>>>> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y) >>>>>> plt.show() >>>>>> ################################ >>>>>> On Friday 27 March 2009 16:12:12 Cohen-Tanugi Johann wrote: >>>>>> >>>>>>> Hello, what is the best way to get log log plots with error bars? I >>>>>>> tried putting log10() everywhere but as I was afraid results >>>>>>> look ugly.... >>>>>>> thanks, >>>>>>> johann >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Matplotlib-users mailing list >>>>>>> Mat...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Mat...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Cohen-Tanugi J. <co...@lp...> - 2009-04-04 22:05:38
|
hello, for the sake of concreteness, here is an example without any limit issues : the python script is attached and the 2 resulting figures as well. The dirst one is drawn using log directly in the arguments, and correctly transforming the y-errors into y-errors/y-values/log(10). In the second figure, I use the log scaling in x and y. Clearly something goes wrong with plotting the error bars, and the y-scale limits also seem ill chosen.... HTH debugging this. I looked again at the code, but I am decidedly lost as to where the error bar plotting occurs, and where it gets modified by the log scale request. Johann Cohen-Tanugi Johann wrote: > hello..... Anyone? I would very much love to see this fixed, and I am > ready to help out, but I do not know how to browse through the code. > Despite the fact that log(errors) should of course not be used, but > rathter errors/values/log(10), Michael's point still remains : values- > errors in log scale can be negative, so that the artist should just > draw a bar until the lower limit of the vertical bar. I would say that > this is the standard practice. > Sorry for my previous email beside the point. > Johann > > Cohen-Tanugi Johann wrote: >> I tried to look at the code (axes.py I presume) in order to attempt a >> patch, but it defeated me, I do not have the instructions to >> navigate through this code :) >> Where is the actual transform of the error bars occurring? >> thanks, >> Johann >> >> Michael Droettboom wrote: >> >>> I have to say I don't really have a lot of experience with error >>> bars on log plots -- but the root cause here is that the lower bound >>> of the error bar goes negative, and as we all know, the log of a >>> negative number is undefined. If you can suggest where the lower >>> bound should be drawn or provide third-party examples, I'm happy to >>> look into this further and resolve this "surprise". >>> >>> Mike >>> >>> Cohen-Tanugi Johann wrote: >>> >>>> yes exactly.... >>>> I should have provided a test case, thanks for following up! >>>> Johann >>>> >>>> Matthias Michler wrote: >>>> >>>> >>>>> Hello Johann, >>>>> >>>>> is the problem you are reporting the one I observe in the attached >>>>> picture? Namely some vertical and horizontal lines are missing >>>>> when using yscale="log". More precisely everything below y=1 seems >>>>> to be missing. >>>>> >>>>> The picture was generated with the code below and >>>>> matplotlib.__version__ = '0.98.6svn' >>>>> matplotlib.__revision__ = '$Revision: 6887 $' >>>>> >>>>> best regards Matthias >>>>> >>>>> ############################### >>>>> import numpy as np >>>>> import matplotlib.pyplot as plt >>>>> >>>>> plt.subplot(111, xscale="log", yscale="log") >>>>> x = 10.0**np.linspace(0.0, 2.0, 20) >>>>> y = x**2.0 >>>>> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y) >>>>> plt.show() >>>>> ################################ >>>>> On Friday 27 March 2009 16:12:12 Cohen-Tanugi Johann wrote: >>>>> >>>>>> Hello, what is the best way to get log log plots with error bars? I >>>>>> tried putting log10() everywhere but as I was afraid results look >>>>>> ugly.... >>>>>> thanks, >>>>>> johann >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Mat...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> |
|
From: Andrew S. <str...@as...> - 2009-04-04 19:15:31
|
Eric Firing wrote: > Tobias Wood wrote: >> Hi everyone, >> After getting fed severely fed up with Matlab in recent months I >> downloaded Python, Numpy and Matplotlib to try out as an alternative. So >> far I'm pleasantly impressed, even if building from source on Mac OS X >> is an experience ;) However, I have discovered a couple of problems with >> Matplotlib's imread() function and, shall we say, 'esoteric' PNG files. >> My research group uses a 12-bit CCD controlled through Labview to >> capture high dynamic range image stacks. Often there are ~30 images in a >> single data set. These get read into Matlab in one go for processing as >> a stack. I tried converting my code over to Python but, after digging >> through the _png.cpp source file found the following that are problems >> from my point of view: >> >> 1) All .png files in imread() are converted to 4-plane RGBA files >> regardless of original format. I would prefer greyscale images to return >> a single plane. >> 2) 16-bit PNGs are stripped to 8 bit, losing any extra precision. >> 3) The significant bits option in the PNG header was not being checked. >> Our camera software will automatically save the PNGs at the maximum >> bit-depth required to cover the dynamic range in the image, and can sum >> images before saving, so pixels can be anywhere from 6- to 16-bits (at >> least those are the values I have observed whilst using the camera). >> >> I have attached the results of an svn diff after I made an attempt at >> correcting these issues. This is the first time I have contributed to an >> open source project, so am not sure of the etiquette here. Also, I have >> only had Python and Matplotlib for a fortnight so am still unfamiliar >> with them and haven't programmed with libpng before so I apologise in >> advance if there any stupid mistakes in my code. I am aware that >> imread() is a pretty important function in Matplotlib and hence any >> changes I suggest would need comprehensive testing. In brief, I made the >> following changes: > > Tobias, > > Thank you very much for the patch and the careful explanation. I'm not > the right person to review it, but I expect someone familiar with libpng > use in mpl will do so soon. Mike D. would be a candidate, but I think > he will be unavailable for several days. If you have not gotten any > feedback within a week, *please* ping us with a reminder. If it comes > to that, you could do it by forwarding your original message to > matplotlib-devel. Tobias, I would like to apply your patch, but the test in examples/tests/pngsuite fails. If you can submit a new patch where this test passes, and, even better, if a small example 12-bit PNG of yours is added to the test, I will apply it. Apart from that, I would echo Eric's thanks for the patch and explanation. -Andrew |
|
From: Eric F. <ef...@ha...> - 2009-04-04 19:01:44
|
Tobias Wood wrote: > Hi everyone, > After getting fed severely fed up with Matlab in recent months I > downloaded Python, Numpy and Matplotlib to try out as an alternative. So > far I'm pleasantly impressed, even if building from source on Mac OS X > is an experience ;) However, I have discovered a couple of problems with > Matplotlib's imread() function and, shall we say, 'esoteric' PNG files. > My research group uses a 12-bit CCD controlled through Labview to > capture high dynamic range image stacks. Often there are ~30 images in a > single data set. These get read into Matlab in one go for processing as > a stack. I tried converting my code over to Python but, after digging > through the _png.cpp source file found the following that are problems > from my point of view: > > 1) All .png files in imread() are converted to 4-plane RGBA files > regardless of original format. I would prefer greyscale images to return > a single plane. > 2) 16-bit PNGs are stripped to 8 bit, losing any extra precision. > 3) The significant bits option in the PNG header was not being checked. > Our camera software will automatically save the PNGs at the maximum > bit-depth required to cover the dynamic range in the image, and can sum > images before saving, so pixels can be anywhere from 6- to 16-bits (at > least those are the values I have observed whilst using the camera). > > I have attached the results of an svn diff after I made an attempt at > correcting these issues. This is the first time I have contributed to an > open source project, so am not sure of the etiquette here. Also, I have > only had Python and Matplotlib for a fortnight so am still unfamiliar > with them and haven't programmed with libpng before so I apologise in > advance if there any stupid mistakes in my code. I am aware that > imread() is a pretty important function in Matplotlib and hence any > changes I suggest would need comprehensive testing. In brief, I made the > following changes: Tobias, Thank you very much for the patch and the careful explanation. I'm not the right person to review it, but I expect someone familiar with libpng use in mpl will do so soon. Mike D. would be a candidate, but I think he will be unavailable for several days. If you have not gotten any feedback within a week, *please* ping us with a reminder. If it comes to that, you could do it by forwarding your original message to matplotlib-devel. Eric > > 1) Removed the libpng 16- to 8-bit strip command > 2) Added in the libpng calls to cope with variable bit-depth and > converting 16-bit pngs from big-endian to little-endian > 3) Added a large if/else if stucture at the end to return different > PyArrays depending on the input data. RGBA images are 4 plane, RGB 3 > plane and greyscale 1 plane. Numbers within these are still floats > scaled between 0 and 1, except 16-bit images which are doubles (Are > floats preferable to doubles?). The scaling factor is worked out from > the significant bits struct. > > There are still a couple of issues with this code, mainly that I have > only tested it with PNGs I have lying to hand, all of which display > correctly with imshow() and I have not made much attempt at supporting > 1,2 and 4 bit pngs. I'm personally not a big fan of large if/else ifs > but in this case thought it was the clearest way to return the different > types. > > I would finally like to point out that no software I have used so far > has been able to read the images produced by this camera completely > correctly. PIL interprets the variable bit-depth images as binary (?!), > and we had to write a wrapper round the Matlab imread() function using > iminfo() as Matlab ignores the significant bits setting as well. > > Oh, almost forgot, I'm compiling on Mac OS X 10.5, Python 2.6.1 > (r261:67515) and the latest Numpy and Matplotlib SVN checkouts. > > Kind regards, > Tobias Wood |
|
From: Tobias W. <tw...@do...> - 2009-04-04 11:32:02
|
Hi everyone, After getting fed severely fed up with Matlab in recent months I downloaded Python, Numpy and Matplotlib to try out as an alternative. So far I'm pleasantly impressed, even if building from source on Mac OS X is an experience ;) However, I have discovered a couple of problems with Matplotlib's imread() function and, shall we say, 'esoteric' PNG files. My research group uses a 12-bit CCD controlled through Labview to capture high dynamic range image stacks. Often there are ~30 images in a single data set. These get read into Matlab in one go for processing as a stack. I tried converting my code over to Python but, after digging through the _png.cpp source file found the following that are problems from my point of view: 1) All .png files in imread() are converted to 4-plane RGBA files regardless of original format. I would prefer greyscale images to return a single plane. 2) 16-bit PNGs are stripped to 8 bit, losing any extra precision. 3) The significant bits option in the PNG header was not being checked. Our camera software will automatically save the PNGs at the maximum bit-depth required to cover the dynamic range in the image, and can sum images before saving, so pixels can be anywhere from 6- to 16-bits (at least those are the values I have observed whilst using the camera). I have attached the results of an svn diff after I made an attempt at correcting these issues. This is the first time I have contributed to an open source project, so am not sure of the etiquette here. Also, I have only had Python and Matplotlib for a fortnight so am still unfamiliar with them and haven't programmed with libpng before so I apologise in advance if there any stupid mistakes in my code. I am aware that imread() is a pretty important function in Matplotlib and hence any changes I suggest would need comprehensive testing. In brief, I made the following changes: 1) Removed the libpng 16- to 8-bit strip command 2) Added in the libpng calls to cope with variable bit-depth and converting 16-bit pngs from big-endian to little-endian 3) Added a large if/else if stucture at the end to return different PyArrays depending on the input data. RGBA images are 4 plane, RGB 3 plane and greyscale 1 plane. Numbers within these are still floats scaled between 0 and 1, except 16-bit images which are doubles (Are floats preferable to doubles?). The scaling factor is worked out from the significant bits struct. There are still a couple of issues with this code, mainly that I have only tested it with PNGs I have lying to hand, all of which display correctly with imshow() and I have not made much attempt at supporting 1,2 and 4 bit pngs. I'm personally not a big fan of large if/else ifs but in this case thought it was the clearest way to return the different types. I would finally like to point out that no software I have used so far has been able to read the images produced by this camera completely correctly. PIL interprets the variable bit-depth images as binary (?!), and we had to write a wrapper round the Matlab imread() function using iminfo() as Matlab ignores the significant bits setting as well. Oh, almost forgot, I'm compiling on Mac OS X 10.5, Python 2.6.1 (r261:67515) and the latest Numpy and Matplotlib SVN checkouts. Kind regards, Tobias Wood |
|
From: C M <cmp...@gm...> - 2009-04-04 04:37:15
|
I am pretty happy with the default for how dates ticks are updated with zooming the plot with the navigation toolbar...until it gets down to the level of hours. Hours are by default displayed in a format like: "23:00:00 UTC". How can I get it to display it in a more common way, such as "11:00 pm", or better, "11 pm, 3/15"? Everything else should stay the same. Thanks, Che |