Appending an extra column in

Thanks Maximillian for your help.

Could you please tell me how to surface plot with those data files using Matplotlib?..i.e both reading the data files and then surface plotting in matplotlib?

Sayan

···

On 11 April 2013 02:25, Maximilian Trescher <faucon@…3667…> wrote:

Hi,

np.savetxt(fname, np.array([pp_za,pv_za]).T, ‘%f’)

does maybe

np.savetxt(fname, np.array([pp_za,pv_za, np.ones(1000)*t]).T, ‘%f’)

does what you want? (replace 1000 with approppriate length)

and a comment about:

 if pp_za[i] < 0:
  pp_za[i] = 2 - abs(pp_za[i])
if pp_za[i] > 2:
  pp_za[i] = pp_za[i] % 2

in general

pp_za[pp_za < 0] = 2 - abs(pp_za[pp_za < 0])

pp_za[pp_za > 2] = pp_za[pp_za > 2] % 2

is shorter and much faster.

Max


Sayan Chatterjee
Dept. of Physics and Meteorology

IIT Kharagpur
Lal Bahadur Shastry Hall of Residence
Room AB 205
Mob: +91 9874513565
blog: www.blissprofound.blogspot.com

Volunteer , Padakshep
www.padakshep.org

Hi,

for reading the data files you could user np.loadtxt("filename").

I'm not sure what kind of plot you want to create from this data, but
probably you can find an appropriate plotting method on this page:
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html

Max

PS: Sorry for not sending my first mail to the list, but you can see it
below

···

Am 11/04/2013 04:54, schrieb Sayan Chatterjee:

Thanks Maximillian for your help.

Could you please tell me how to surface plot with those data files using
Matplotlib?...i.e both reading the data files and then surface plotting
in matplotlib?

Sayan

On 11 April 2013 02:25, Maximilian Trescher <faucon@...3667... > <mailto:faucon@…3667…>> wrote:

    Hi,
    >
    > *np.savetxt(fname, np.array([pp_za,pv_za]).T, '%f')*

    does maybe

    np.savetxt(fname, np.array([pp_za,pv_za, np.ones(1000)*t]).T, '%f')
    does what you want? (replace 1000 with approppriate length)

    and a comment about:
    > if pp_za[i] < 0:
    > pp_za[i] = 2 - abs(pp_za[i])
    > if pp_za[i] > 2:
    > pp_za[i] = pp_za[i] % 2

    in general

    pp_za[pp_za < 0] = 2 - abs(pp_za[pp_za < 0])
    pp_za[pp_za > 2] = pp_za[pp_za > 2] % 2

    is shorter and much faster.

    Max

--

--------------------------------------------------------------------------
*Sayan Chatterjee*
Dept. of Physics and Meteorology
IIT Kharagpur
Lal Bahadur Shastry Hall of Residence
Room AB 205
Mob: +91 9874513565
blog: www.blissprofound.blogspot.com <http://www.blissprofound.blogspot.com>

Volunteer , Padakshep
www.padakshep.org <http://www.padakshep.org>