Re: xarry netcdf message

2022-08-23 Thread Dioumacor FAYE
Hello, I think you can try this.
I use Python 3.7.11 in jupyter Notebook
import xarray as xr
path = '/media/lpaosf/LPAOSF_DATA/maman/r1mm_r20mm_sdii/
chirps-v2.0.days_p05_r1mm_WA1981-2018.nc'
# Open the NetCDF files in xr.DataSet
r1mm = xr.open_dataset(path)
time=r1mm['time'].data
lon =r1mm['longitude'].data
lat =r1mm['latitude'].data
data_r1mm=r1mm['r1mm'].data

Le mar. 23 août 2022 à 15:38, Jorge Conrado Conforte Conforte <
jorgconfo...@gmail.com> a écrit :

> Hi,
>
> I'm reading my netcdf data air.2m.mon.ltm.nc.
> I used the netcdf4 and I didn't have message when i read my data. But if I
> use the xarray I had this message:
>
>
> /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/backends/plugins.py:61:
> RuntimeWarning: Engine 'cfgrib' loading failed:
> module 'cfgrib.messages' has no attribute 'DEFAULT_INDEXPATH'
>   warnings.warn(f"Engine {name!r} loading failed:\n{ex}", RuntimeWarning)
>
> /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/coding/times.py:673:
> SerializationWarning: Unable to decode time axis into full numpy.datetime64
> objects, continuing using cftime.datetime objects instead, reason: dates
> out of range
>   dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
>
> /home/conrado/.conda/envs/meuambi/lib/python3.8/site-packages/xarray/core/indexing.py:423:
> SerializationWarning: Unable to decode time axis into full numpy.datetime64
> objects, continuing using cftime.datetime objects instead, reason: dates
> out of range
>   return np.asarray(array[self.key], dtype=None)
>
> What can I do to solve this message.
>
> Thanks,
>
> Conrado
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Bien à vous,
---  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list


How to create forecast lead time with python?

2022-10-07 Thread Dioumacor FAYE
Hello,
I wanted to create on different days the deadline forecast files (2, 3, 4,
and 5 deadlines). The file is in NetCDF format. The objective is to see
later on these different forecast deadlines which one gives the best score.
If anyone can help me to do?

-- 
Bien à vous,
---  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Gdal

2022-10-07 Thread Dioumacor FAYE
If you are working on ubuntu, you can use this command.
conda create --name pygdal
conda activate pygdal
conda install -c conda-forge gdal
If installation completes import it from:
from osgeo import gdal

Le ven. 7 oct. 2022 à 12:01, "Jorge Conrado Conforte" <
jorge.confo...@inpe.br> a écrit :

>
>
> Hi,
>
>
>
>
> I installed GDAL using the pip command and conda. But, I did:
>
> import gdal and I had:
>
> Traceback (most recent call last):
> File "", line 1, in 
> ModuleNotFoundError: No module named 'gdal'
>
>
>
>
>
> I need gdal to remap some data.
>
> Please, help me
>
>
>
>
> Conrado
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Bien à vous,
---  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list


How to turn this Matlab code into python

2022-11-07 Thread Dioumacor FAYE
hi everyone
I wanted to transform this matlab code into python. If anyone can help me
please let me know.
load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat
prcp = reshape(precip,[140*100,13879]);
dates = datenum(1981,1,1):datenum(2018,12,31);
date = datevec(dates);
ind_mjja=find(date(:,2)>=5 & date(:,2)<=8);% May to Aug (May(31)+ June(30)+
July(31)+ August(31)= 123 days)
data_mjja=precp(:,ind_mjja);
data_mjja_res=reshape(data_mjja,14000,123,38);
-- 
Bien à vous,
---  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to turn this Matlab code into python

2022-11-08 Thread Dioumacor FAYE
From datenum to data_mjja=precp(:,ind_mjja);

Le lun. 7 nov. 2022 à 21:42, Christian Gollwitzer  a
écrit :

> Am 07.11.22 um 18:12 schrieb Dioumacor FAYE:
> > hi everyone
> > I wanted to transform this matlab code into python. If anyone can help me
> > please let me know.
> > load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat
> > prcp = reshape(precip,[140*100,13879]);
> > dates = datenum(1981,1,1):datenum(2018,12,31);
> > date = datevec(dates);
> > ind_mjja=find(date(:,2)>=5 & date(:,2)<=8);% May to Aug (May(31)+
> June(30)+
> > July(31)+ August(31)= 123 days)
> > data_mjja=precp(:,ind_mjja);
> > data_mjja_res=reshape(data_mjja,14000,123,38);
>
> which part do you have trouble with?
>
>
> Christian
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Bien à vous,
-------  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to turn this Matlab code into python

2022-11-08 Thread Dioumacor FAYE
Merci beaucoup Christian pour le lien.

Le mar. 8 nov. 2022 à 17:08, Christian Gollwitzer  a
écrit :

> Am 08.11.22 um 09:01 schrieb Dioumacor FAYE:
> >>From datenum to data_mjja=precp(:,ind_mjja);
>
> I think the code filters data based on calendar dates. I'd guess that
> you can do that most easily with pandas.
>
> https://pandas.pydata.org/docs/user_guide/timeseries.html
>
> Christian
> >
> > Le lun. 7 nov. 2022 à 21:42, Christian Gollwitzer  a
> > écrit :
> >
> >> Am 07.11.22 um 18:12 schrieb Dioumacor FAYE:
> >>> hi everyone
> >>> I wanted to transform this matlab code into python. If anyone can help
> me
> >>> please let me know.
> >>> load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat
> >>> prcp = reshape(precip,[140*100,13879]);
> >>> dates = datenum(1981,1,1):datenum(2018,12,31);
> >>> date = datevec(dates);
> >>> ind_mjja=find(date(:,2)>=5 & date(:,2)<=8);% May to Aug (May(31)+
> >> June(30)+
> >>> July(31)+ August(31)= 123 days)
> >>> data_mjja=precp(:,ind_mjja);
> >>> data_mjja_res=reshape(data_mjja,14000,123,38);
> >>
> >> which part do you have trouble with?
> >>
> >>
> >>  Christian
> >> --
> >> https://mail.python.org/mailman/listinfo/python-list
> >>
> >
> >
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Bien à vous,
---  -
  -
Dioumacor FAYE doctorant au  LPAOSF/ESP/UCAD/BP 5085 Dakar-Fann, Sénégal.
Tel labo: (00221) 33 825 93 64
Email: d.faye20171...@zig.univ.snTel:
+221773475098   +221783484308
Physicien en herbe
Pseudo Skype:   dioumacorfaye
-- 
https://mail.python.org/mailman/listinfo/python-list