[matplotlib-devel] Bug in julian2num()/num2julian()?

2010-03-04 Thread Günter Lichtenberg
Hi 

I think there is a bug in the conversion routines jul2num() and num2jul(). I 
tried to define a date axis for satellite data. The time is measured in a 
modified Julian Date (JD). So reading in the data and then doing

mp = julian2num(jd)
dates = num2date(mp)

resulted in an error "year out of range" (or so). I looked at the values and 
they were way to high. Inspection of the source date.py showed for the 
conversion routines

julian2num: j + 1721425.5
num2julian: j - 1721425.5

Since the JD measures days from 4713 BC - earlier than the matplotlib 
zeropoint -  the conversion should be the other way round, i.e. for julian2num 
we should subtract. 

After correcting this, I could still not reconcile my measurement dates with 
the result of num2date(). In the source it is stated that counting starts at   
0001-01-01 00:00:00 UTC (JD 1721423.5), which BTW does not match the number 
used in the routines. The only way to correct this was to use an offset of JD 
1721424.5 (January 2nd, 0001, 00:00:00). 

So the correct formulae should be

julian2num: j - 1721424.5
num2julian: j + 1721424.5

or am I missing something?

VERSION INFO: matplotlib V. 0.99.1.1/python 2.6.2

on opensuse 11.2/x86_64


Cheers
gl

-- 
Günter Lichtenberg


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Bug in julian2num()/num2julian()?

2010-03-04 Thread John Hunter
2010/3/4 Günter Lichtenberg :
> Hi
>
> I think there is a bug in the conversion routines jul2num() and num2jul(). I
> tried to define a date axis for satellite data. The time is measured in a
> modified Julian Date (JD). So reading in the data and then doing

Hi Günter,

Thanks for digging into this.  Could you file a report on the bug tracker

http://sourceforge.net/tracker/?group_id=80706&atid=560720

Thanks,
JDH

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Bug in julian2num()/num2julian()?

2010-03-04 Thread Günter Lichtenberg
On Thursday 04 March 2010 14:20:41 you wrote:
> 2010/3/4 Günter Lichtenberg :
> > Hi
> > 
> > I think there is a bug in the conversion routines jul2num() and
> > num2jul(). I tried to define a date axis for satellite data. The time is
> > measured in a modified Julian Date (JD). So reading in the data and then
> > doing
> 
> Hi Günter,
> 
> Thanks for digging into this.  Could you file a report on the bug tracker
> 

Done under

2963391   Wrong conversion in julian2num/num2julian

gl

-- 
Dr. Günter Lichtenberg
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
Institut für Methodik der Fernerkundung (MF-AP)
82234 Weßling
Tel. +49-8153-28-1331
Fax +49-8153-28-1446
guenter.lichtenb...@dlr.de


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] FontProperties being ignored...

2010-03-04 Thread James Evans
All,

 

I just submitted bug #2963827 detailing this, but thought that I would echo the 
problem here.

 

When plotting annotations and specifying the FontProperties to use, the 
specified values are completely ignored.  See the attached
script and image for an example.  Am I doing something inherently wrong, or is 
this really a bug?

 

Thanks,

--James Evans



textFormat.png
Description: Binary data
#!/usr/bin/env python

import pylab
from matplotlib.font_manager import FontProperties

fig = pylab.figure()
ax = pylab.subplot( 1, 1, 1 )

normalFont = FontProperties( family = "Sans Serif",
 style = "normal",
 variant = "normal",
 weight = 500,
 stretch = 500,
 size = 14,
)
ax.annotate( "Normal Font", (0.1, 0.1), xycoords='axes fraction',
  fontproperties = normalFont )

boldFont = FontProperties( family = "Sans Serif",
   style = "normal",
   variant = "normal",
   weight = 750,
   stretch = 500,
   size = 14,
  )
ax.annotate( "Bold Font", (0.1, 0.2), xycoords='axes fraction',
  fontproperties = boldFont )

boldItemFont = FontProperties( family = "Sans Serif",
   style = "italic",
   variant = "normal",
   weight = 750,
   stretch = 500,
   size = 14,
  )
ax.annotate( "Bold Italic Font", (0.1, 0.3), xycoords='axes fraction',
  fontproperties = boldItemFont )

lightFont = FontProperties( family = "Sans Serif",
style = "normal",
variant = "normal",
weight = 200,
stretch = 500,
size = 14,
   )
ax.annotate( "Light Font", (0.1, 0.4), xycoords='axes fraction',
  fontproperties = lightFont )

condensedFont = FontProperties( family = "Sans Serif",
style = "normal",
variant = "normal",
weight = 500,
stretch = 100,
size = 14,
   )
ax.annotate( "Condensed Font", (0.1, 0.5), xycoords='axes fraction',
  fontproperties = condensedFont )

pylab.show()
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] FontProperties being ignored...

2010-03-04 Thread Jae-Joon Lee
Do you have fonts whose family name is "sans serif"?
Maybe you meant "sans-serif"?

"sans-serif" searches for fonts whose family name is in
rcParams["font.sans-serif"], but "sans serif" only search for "sans
serif".

I don't think it has anything to do with annotation.
Check if findfont gives you a correct font.
Please report back with matplotlib version etc., if findfont finds a
correct font but annotation still shows with a wrong font.

Regards,

-JJ


import matplotlib.font_manager
fm = matplotlib.font_manager.fontManager
print matplotlib.font_manager.findfont(normalFont)



On Thu, Mar 4, 2010 at 7:07 PM, James Evans  wrote:
> All,
>
>
>
> I just submitted bug #2963827 detailing this, but thought that I would echo
> the problem here…
>
>
>
> When plotting annotations and specifying the FontProperties to use, the
> specified values are completely ignored.  See the attached script and image
> for an example.  Am I doing something inherently wrong, or is this really a
> bug?
>
>
>
> Thanks,
>
> --James Evans
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel