Extracting the value from Netcdf file with longitude and lattitude

2014-05-16 Thread Isaac Won
Hi, My question may be confusing. Now I would like to extract temperature values from model output with python. My model output have separate temperature, longitude and latitude variables. So, I overlap these three grid variables on one figure to show temperature with longitude and latitude thr

Drawing shaded area depending on distance with latitude and altitude coordinate

2014-01-06 Thread Isaac Won
I have tried to make a plot of points with longitude and latitude coordinate, and draw shaded area with distance from one point. So, I thought that I could uae contourf function from matplotlibrary. My code is: import haversine import numpy as np import matplotlib.pyplot as plt wi

Using MFDataset to combine netcdf files in python

2013-12-02 Thread Isaac Won
I am trying to combine netcdf files, but it contifuously shows " File "CBL_plot.py", line 11, in f = MFDataset(fili) File "utils.pyx", line 274, in netCDF4.MFDataset.init (netCDF4.c:3822) IOError: master dataset THref_11:00.nc does not have a aggregation dimension." So, I checked only one netcd

Re: Plot a contour inside a contour

2013-11-14 Thread Isaac Won
On Thursday, November 14, 2013 2:01:39 PM UTC-8, John Ladasky wrote: > On Thursday, November 14, 2013 11:39:37 AM UTC-8, Isaac Won wrote: > > > I tried to plot one smaller contour inside of the other larger contour. > > > > Using what software? A plotting package i

Plot a contour inside a contour

2013-11-14 Thread Isaac Won
I tried to plot one smaller contour inside of the other larger contour. I have two different 2D-arrays. One is with smaller grid spacing and smaller domain size and the other is with larger spacing and larger domain size. So, I tried to use fig.add_axes function as follows: fig = plt.figure() ax

Putting the loop inside of loop properly

2013-03-01 Thread Isaac Won
I just would like to make my previous question simpler and I bit adjusted my code with help with Ulich and Chris. The basic structure of my code is: for c in range(5,25): for columns in ( raw.strip().split() for raw in f ): a.append(columns[c]) x = np.arra

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
UTC-6, Ulrich Eckhardt wrote: > Am 01.03.2013 09:59, schrieb Isaac Won: > > > try to make my triple nested loop working. My code would be: > > > c = 4 > > [...] > > > while c <24: > > > c = c + 1 > > > > This is bad

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > > for columns in ( raw.strip().split() for raw in f ): > > > while d <335: > > > > Note

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
Thank you, Chris. I just want to acculate value from y repeatedly. If y = 1,2,3...10, just have a [1,2,3...10] at onece. On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > >

Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
try to make my triple nested loop working. My code would be: c = 4 y1 = [] m1 = [] std1 = [] while c <24: c = c + 1 a = [] f.seek(0,0) for columns in ( raw.strip().split() for raw in f ): a.append(columns[c])

About a value error called 'ValueError: A value in x_new is below the interpolation range'

2013-02-05 Thread Isaac Won
Dear all, I am trying to calculate correlation coefficients between one time series data and other time series. However,there are some missing values. So, I interploated each time series with 1d interpolation in scipy and got correlation coefficients between them. This code works well for some

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 10:51:43 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 14:57, Isaac Won wrote: > > > On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: > > >> On 23 January 2013 14:28, Isaac Won wrote: > > >> &g

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 8:40:54 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 14:28, Isaac Won wrote: > > > On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > > > > > > To Oscar > > > My actual error message is: >

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 2:55:14 AM UTC-6, Ulrich Eckhardt wrote: > Am 23.01.2013 05:06, schrieb Isaac Won: > > > I have tried to use different interpolation methods with Scipy. My > > > code seems just fine with linear interpolation, but shows memory > > >

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 08:55, Ulrich Eckhardt > > > > > Am 23.01.2013 05:06, schrieb Isaac Won: > > > > > >> I have tried to use different interpolation methods with Scipy. My &

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Wednesday, January 23, 2013 4:08:13 AM UTC-6, Oscar Benjamin wrote: > On 23 January 2013 08:55, Ulrich Eckhardt > > wrote: > > > Am 23.01.2013 05:06, schrieb Isaac Won: > > > > > >> I have tried to use different interpolation methods with Scipy. My &

Re: Memory error with quadratic interpolation

2013-01-23 Thread Isaac Won
On Tuesday, January 22, 2013 10:06:41 PM UTC-6, Isaac Won wrote: > Hi all, > > > > I have tried to use different interpolation methods with Scipy. My code seems > just fine with linear interpolation, but shows memory error with quadratic. I > am a novice for python. I wil

Memory error with quadratic interpolation

2013-01-22 Thread Isaac Won
Hi all, I have tried to use different interpolation methods with Scipy. My code seems just fine with linear interpolation, but shows memory error with quadratic. I am a novice for python. I will appreciate any help. #code f = open(filin, "r") for columns in ( raw.strip().split() for raw in f ):

Re: avoding the accumulation of array when using loop.

2013-01-02 Thread Isaac Won
On Wednesday, January 2, 2013 5:54:18 PM UTC-6, Dave Angel wrote: > On 01/02/2013 05:21 PM, Isaac Won wrote: > > > Hi all, > > > > > > Thanks to Hans, I have had a good progress on my problem. > > > > > > Followings are Hans's Id

avoding the accumulation of array when using loop.

2013-01-02 Thread Isaac Won
Hi all, Thanks to Hans, I have had a good progress on my problem. Followings are Hans's Idea: import numpy as np b = [] c = 4 f = open("text.file", "r") while c < 10: c = c + 1 f.seek(0,0) for columns in ( raw.strip().split() for raw in f ):

Re: Question about nested loop

2012-12-31 Thread Isaac Won
On Monday, December 31, 2012 6:59:34 AM UTC-6, Hans Mulder wrote: > On 31/12/12 11:02:56, Isaac Won wrote: > > > Hi all, > > > I am a very novice for Python. Currently, I am trying to read continuous > > > columns repeatedly in the form of array.

Re: Question about nested loop

2012-12-31 Thread Isaac Won
On Monday, December 31, 2012 5:25:16 AM UTC-6, Gisle Vanem wrote: > "Isaac Won" wrote: > > > > > while c < 10: > > >c = c + 1 > > > > > >for columns in ( raw.strip().split() for raw in f ): > > > > &

Question about nested loop

2012-12-31 Thread Isaac Won
Hi all, I am a very novice for Python. Currently, I am trying to read continuous columns repeatedly in the form of array. my code is like below: import numpy as np b = [] c = 4 f = open("text.file", "r") while c < 10: c = c + 1 for columns in ( raw.strip().split() for raw