Basemap shiftgrid

Hi All,

I am having problems plotting data in Basemap. I have tried some of the
different projections such as Robinson and Equidistant Cylindrical, however
kept running into the error

WARNING: x coordinate not monotonically increasing - contour plot
may not be what you expect. If it looks odd, your can either
adjust the map projection region to be consistent with your data, or
(if your data is on a global lat/lon grid) use the shiftgrid
function to adjust the data to be consistent with the map projection
region (see examples/contour_demo.py).

Having read some other forums, I see that it is due to the fact that the
longitude is based on 0-360 rather that -180 to 180. I have been trying to
rectify this with shiftgrid.

I have used shiftgrid and have moved my longitudes to -180 to 180 however I
keep running up with the error:

ValueError: lon0 outside of range of lonsin

I also manage to get one plot out, which has the right projection I want (I
am looking over the Atlantic) however the data isnt shifting in line with
the longitudes. Would anyone know why this is the case?

I have am using shiftgrid as below and the Basemap projection of Equidistant
cylindrical (I have also tried Robinson however end up with similar result
of data not moving in line with the longitude)

MSLP = aso_mslp.data
MSLP_background = np.mean(MSLP, axis = 0)

    # shifting grid to run from -180 to 180 rather than 0-360
    MSLP_background,lon = shiftgrid(180., MSLP_background, lon, start=False)
    
    #setting the map in order to plot the data
    map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90,
llcrnrlon=-180, urcrnrlon=180, resolution='c')

Thanks
Michelle

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi Michelle,

I might not fully understand your problem, could you have a look at this thread and see if it helps?

http://matplotlib.1069221.n5.nabble.com/Fwd-Strange-behaviour-on-plotting-data-on-Ronbinson-projection-using-Basemap-td43222.html#a43233

Cheers,

Chao

···

On Wed, Aug 27, 2014 at 9:58 AM, mmc [via matplotlib] <[hidden email]> wrote:

Hi All,

I am having problems plotting data in Basemap. I have tried some of the different projections such as Robinson and Equidistant Cylindrical, however kept running into the error

WARNING: x coordinate not monotonically increasing - contour plot

may not be what you expect. If it looks odd, your can either

adjust the map projection region to be consistent with your data, or

(if your data is on a global lat/lon grid) use the shiftgrid

function to adjust the data to be consistent with the map projection

region (see examples/contour_demo.py).

Having read some other forums, I see that it is due to the fact that the longitude is based on 0-360 rather that -180 to 180. I have been trying to rectify this with shiftgrid.

I have used shiftgrid and have moved my longitudes to -180 to 180 however I keep running up with the error:

ValueError: lon0 outside of range of lonsin

I also manage to get one plot out, which has the right projection I want (I am looking over the Atlantic) however the data isnt shifting in line with the longitudes. Would anyone know why this is the case?

I have am using shiftgrid as below and the Basemap projection of Equidistant cylindrical (I have also tried Robinson however end up with similar result of data not moving in line with the longitude)

MSLP = aso_mslp.data

MSLP_background = np.mean(MSLP, axis = 0)

# shifting grid to run from -180 to 180 rather than 0-360

MSLP_background,lon = shiftgrid(180., MSLP_background, lon, start=False)


#setting the map in order to plot the data

map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90, llcrnrlon=-180, urcrnrlon=180, resolution='c')

Thanks

Michelle


If you reply to this email, your message will be added to the discussion below:

http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html

To start a new topic under matplotlib - users, email [hidden email]

  To unsubscribe from matplotlib, click here.


  [NAML](http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml)


please visit:
http://www.globalcarbonatlas.org/


Chao YUE
Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex

Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16


Is this related to https://github.com/matplotlib/basemap/issues/163 ?

···

On Wed, Aug 27, 2014 at 5:41 AM, ChaoYue <chaoyuejoy@...287...> wrote:

Hi Michelle,

I might not fully understand your problem, could you have a look at this
thread and see if it helps?

http://matplotlib.1069221.n5.nabble.com/Fwd-Strange-behaviour-on-plotting-data-on-Ronbinson-projection-using-Basemap-td43222.html#a43233

Cheers,

Chao

On Wed, Aug 27, 2014 at 9:58 AM, mmc [via matplotlib] <[hidden email]> > wrote:

Hi All,

I am having problems plotting data in Basemap. I have tried some of the
different projections such as Robinson and Equidistant Cylindrical, however
kept running into the error

WARNING: x coordinate not monotonically increasing - contour plot
may not be what you expect. If it looks odd, your can either
adjust the map projection region to be consistent with your data, or
(if your data is on a global lat/lon grid) use the shiftgrid
function to adjust the data to be consistent with the map projection
region (see examples/contour_demo.py).

Having read some other forums, I see that it is due to the fact that the
longitude is based on 0-360 rather that -180 to 180. I have been trying to
rectify this with shiftgrid.

I have used shiftgrid and have moved my longitudes to -180 to 180 however
I keep running up with the error:

ValueError: lon0 outside of range of lonsin

I also manage to get one plot out, which has the right projection I want
(I am looking over the Atlantic) however the data isnt shifting in line with
the longitudes. Would anyone know why this is the case?

I have am using shiftgrid as below and the Basemap projection of
Equidistant cylindrical (I have also tried Robinson however end up with
similar result of data not moving in line with the longitude)

MSLP = aso_mslp.data
MSLP_background = np.mean(MSLP, axis = 0)

    # shifting grid to run from -180 to 180 rather than 0-360
    MSLP_background,lon = shiftgrid(180., MSLP_background, lon,
start=False)

    #setting the map in order to plot the data
    map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90,
llcrnrlon=-180, urcrnrlon=180, resolution='c')

Thanks
Michelle

________________________________
If you reply to this email, your message will be added to the discussion
below:
http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html
To start a new topic under matplotlib - users, email [hidden email]
To unsubscribe from matplotlib, click here.
NAML

--
please visit:
http://www.globalcarbonatlas.org/
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************

________________________________
View this message in context: Re: Basemap shiftgrid

Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Thomas Caswell
tcaswell@...287...

Hi Thomas

I have managed to get my data to shift in line with my longitude and latitudes, however now I cannot get it to read out more than one plot.

I am running this is a loop as I want to get 34 plots (of 34 separate years of the same variable) however once it runs through the loop once and I get a plot,
it stops and I get an error saying

“lon0 outside of range of lonsin”

Am I able to do this in a loop or are there other things which maybe causing this?

···

From: Thomas Caswell [via matplotlib] [mailto:ml-node+[hidden email]]
Sent: 27 August 2014 13:37
To: McCrystall, Michelle R.
Subject: Re: Basemap shiftgrid

Is this related to
https://github.com/matplotlib/basemap/issues/163
?

On Wed, Aug 27, 2014 at 5:41 AM, ChaoYue <[hidden email]> wrote:

Hi Michelle,

I might not fully understand your problem, could you have a look at this
thread and see if it helps?


http://matplotlib.1069221.n5.nabble.com/Fwd-Strange-behaviour-on-plotting-data-on-Ronbinson-projection-using-Basemap-td43222.html#a43233

Cheers,

Chao

On Wed, Aug 27, 2014 at 9:58 AM, mmc [via matplotlib] <[hidden email]>
wrote:

Hi All,

I am having problems plotting data in Basemap. I have tried some of the
different projections such as Robinson and Equidistant Cylindrical, however
kept running into the error

WARNING: x coordinate not monotonically increasing - contour plot
may not be what you expect. If it looks odd, your can either
adjust the map projection region to be consistent with your data, or
(if your data is on a global lat/lon grid) use the shiftgrid
function to adjust the data to be consistent with the map projection
region (see examples/contour_demo.py).

Having read some other forums, I see that it is due to the fact that the
longitude is based on 0-360 rather that -180 to 180. I have been trying to
rectify this with shiftgrid.

I have used shiftgrid and have moved my longitudes to -180 to 180 however
I keep running up with the error:

ValueError: lon0 outside of range of lonsin

I also manage to get one plot out, which has the right projection I want
(I am looking over the Atlantic) however the data isnt shifting in line with
the longitudes. Would anyone know why this is the case?

I have am using shiftgrid as below and the Basemap projection of
Equidistant cylindrical (I have also tried Robinson however end up with
similar result of data not moving in line with the longitude)

MSLP = aso_mslp.data
MSLP_background = np.mean(MSLP, axis = 0)

# shifting grid to run from -180 to 180 rather than 0-360
MSLP_background,lon = shiftgrid(180., MSLP_background, lon,

start=False)

#setting the map in order to plot the data
map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90,

llcrnrlon=-180, urcrnrlon=180, resolution=‘c’)

Thanks
Michelle


If you reply to this email, your message will be added to the discussion
below:

http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html

To start a new topic under matplotlib - users, email [hidden email]
To unsubscribe from matplotlib, click here.
NAML


please visit:
http://www.globalcarbonatlas.org/


Chao YUE
Laboratoire des Sciences du Climat et de l’Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16



View this message in context: Re: Basemap shiftgrid

Sent from the matplotlib - users mailing list archive at Nabble.com.


Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/


Matplotlib-users mailing list
[hidden email]


https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Thomas Caswell
[hidden email]


Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/


Matplotlib-users mailing list
[hidden email]

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


If you reply to this email, your message will be added to the discussion below:

http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851p43859.html

To unsubscribe from Basemap shiftgrid,

click here.
NAML