Putting many coordinates number inside codes


#1

Hi everyone,
I have a coordinate list. This starts from (0,0) to (10,10). Each x and y coordinate increases by 1, this is like

(0,0) (0,1) (0,2) (0,3) … (0,10)
(1,0) (1,1) (1,2) (1,3) … (1,10)
.
.
.
(10,0) (10,1) (10,2) (10,3) … (10,10).

I need to put all these coordinates inside my codes respectively without entering the numbers manually.

My code is supposed to be like that:

“inpNETCDF =‘abc.nc’
dataset = Dataset(inpNETCDF, mode=‘r’)
lat_site, lon_site = 0, 0”

“inpNETCDF =‘abc.nc’”
dataset = Dataset(inpNETCDF, mode=‘r’)
lat_site, lon_site = 0, 1"

Could you help me do that?
Thank you.


#2

Dataset class python

It looks like you are reading data from the file, ‘abc.nc’. As such, the lat/lon line could be written inside a loop, and take one line from the data file each iteration.

data_line_1\n
data_line_2\n
data_line_3\n
.
.
.

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.