How to mosaic sentinal 1 grd data and ploting using satpy

232 views
Skip to first unread message

Koti Chowdary

unread,
Jul 11, 2020, 3:37:19 AM7/11/20
to pytroll
Hi all

I downloaded  sentinal1  level1 grd data  *.SAFE formate. I am not able plot using satpy. Please help me how to mosaic and plot in python give yours valuable suggestions .


Thanks for advance

Sateesh M

unread,
Jul 11, 2020, 5:36:19 AM7/11/20
to pyt...@googlegroups.com
Dear Koti,

  Here is my code to Sentinel1 data processing. It may useful for you.
#############################
import os, sys, glob
from satpy import Scene, find_files_and_readers
from satpy.resample import get_area_def
from satpy.utils import debug_on
from datetime import datetime
import aggdraw
debug_on()
os.environ['PPP_CONFIG_DIR'] = '/home/satviz/.local/satpy/etc/'

BASEDIR="/home/satviz/Work/scripts/junk/sentinel1/"
files = find_files_and_readers(base_dir=BASEDIR,reader='sar-c_safe')
scn = Scene(filenames=files)
print(scn.all_dataset_names())
channels = ['sar-ice', 'sar-ice-iw', 'sar-ice-legacy', 'sar-land', 'sar-quick', 'sar-rgb']
scn.load(channels)
indImg = scn.resample('India_SC')
indImg.save_datasets()
#########################

Thank you for showing interest in pytroll.

Good luck.
regards,
M. Sateesh


--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/022f92a8-0b30-4f4e-b303-aad033e49442o%40googlegroups.com.


--
Dr. M. SATEESH, (Project Scientist-C)
M.Tech(Atmospheric Science), Ph.D.
NATIONAL CENTRE FOR MEDIUM RANGE WEATHER FORECASTING (Noida, U. P.), INDIA-201309. 
mobile no: 09394591170.(+91-120-2419462).

David Hoese

unread,
Jul 12, 2020, 5:16:26 PM7/12/20
to pyt...@googlegroups.com
Koti,

Hopefully Sateesh's message helps. Regardless, it is hard to provide any
help when you haven't described what exactly you are trying to do, what
you have tried, what your code looks like so far, or listed any error
messages that you are getting. If you can provide more information like
this we may be able to help.

Dave
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> <https://groups.google.com/d/msgid/pytroll/022f92a8-0b30-4f4e-b303-aad033e49442o%40googlegroups.com?utm_medium=email&utm_source=footer>.

Koti Chowdary

unread,
Jul 13, 2020, 2:01:56 AM7/13/20
to pyt...@googlegroups.com
Dear sir

I apologize for the late reply. Thanks, Sateesh sir  for your help. Actually I have tiles data from sentinel 1 L1 SAR data. How to mosaic all tiles data and how to generate plot with basemap using satpy. Regarding sateesh script, I tried but it shows an error, I'm not able to read *.ZIP formate file. Please see the following errors


>>> import os, sys, glob
>>> from satpy import Scene, find_files_and_readers
>>> from satpy.resample import get_area_def
>>> from satpy.utils import debug_on
>>> from datetime import datetime
>>> import aggdraw
>>> debug_on()
>>>
>>>
>>> BASEDIR="/home/vankayk/Downloads/SENTI/S1B_IW_GRDH_1SDV_20191013T032140_20191013T032209_018451_022C28_AA13.zip/"

>>>
>>>
>>> files = find_files_and_readers(base_dir=BASEDIR,reader='sar-c_safe')
[DEBUG: 2020-07-13 08:49:26 : satpy.readers] Reading ['/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/etc/readers/sar-c_safe.yaml']
[INFO: 2020-07-13 08:49:26 : satpy.readers] Cannot use ['/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/etc/readers/sar-c_safe.yaml']
[DEBUG: 2020-07-13 08:49:26 : satpy.readers] while constructing a Python object
cannot find module 'satpy.readers.sar_c_safe' (libzstd.so.1: cannot open shared object file: No such file or directory)
  in "<unicode string>", line 10, column 22:
            file_reader: !!python/name:satpy.readers.sar_ ...
                         ^
Traceback (most recent call last):
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 532, in find_python_name
    __import__(module_name)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/sar_c_safe.py", line 43, in <module>
    import rasterio
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/rasterio/__init__.py", line 22, in <module>
    from rasterio._base import gdal_version
ImportError: libzstd.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/__init__.py", line 637, in find_files_and_readers
    reader_instance = load_reader(reader_configs, **reader_kwargs)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/__init__.py", line 506, in load_reader
    reader_info = read_reader_config(reader_configs)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/__init__.py", line 492, in read_reader_config
    conf.update(yaml.load(fd.read(), Loader=loader))
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 43, in get_single_data
    return self.construct_document(node)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 52, in construct_document
    for dummy in generator:
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 210, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 135, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 94, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 551, in construct_python_name
    return self.find_python_name(suffix, node.start_mark)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 707, in find_python_name
    return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 535, in find_python_name
    "cannot find module %r (%s)" % (module_name, exc), mark)
yaml.constructor.ConstructorError: while constructing a Python object
cannot find module 'satpy.readers.sar_c_safe' (libzstd.so.1: cannot open shared object file: No such file or directory)
  in "<unicode string>", line 10, column 22:
            file_reader: !!python/name:satpy.readers.sar_ ...


Thanks for advance



V.Koteswara Rao

Martin Raspaud

unread,
Jul 13, 2020, 6:08:20 AM7/13/20
to pyt...@googlegroups.com
Dear Koti,

First you need to unzip the zip file, and work on the extracted directory.

After that, satpy should work better, and allow you to access the data
as an array so that you can plot it with any library you like.

Best regards,
Martin
> */V.Koteswara Rao/*
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9%2Bsz%3Dsm3PSBKDq7z6nfprc%2BTtPZjcNdUmnj%3DoPcLP0jA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9%2Bsz%3Dsm3PSBKDq7z6nfprc%2BTtPZjcNdUmnj%3DoPcLP0jA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Koti Chowdary

unread,
Jul 13, 2020, 6:51:44 AM7/13/20
to pyt...@googlegroups.com
Thanks for your response, sir. I did zip to unzip files and created a separated folder but still the same problem repeating. Please see the following error

 >>> import os, sys, glob
>>> from satpy import Scene, find_files_and_readers
>>> from satpy.resample import get_area_def
>>> from satpy.utils import debug_on
>>> from datetime import datetime
>>> import aggdraw
>>> debug_on()
>>>
>>>
>>> BASEDIR="/home/vankayk/Downloads/SENTI/SATPY/S1B_IW_GRDH_1SDV_20191013T032209_20191013T032234_018451_022C28_9E30.SAFE/"
>>>
>>>  
... files = find_files_and_readers(base_dir=BASEDIR,reader='sar-c_safe')
[DEBUG: 2020-07-13 13:49:55 : satpy.readers] Reading ['/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/etc/readers/sar-c_safe.yaml']
[INFO: 2020-07-13 13:49:55 : satpy.readers] Cannot use ['/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/etc/readers/sar-c_safe.yaml']
[DEBUG: 2020-07-13 13:49:55 : satpy.readers] while constructing a Python object

cannot find module 'satpy.readers.sar_c_safe' (libzstd.so.1: cannot open shared object file: No such file or directory)
  in "<unicode string>", line 10, column 22:
            file_reader: !!python/name:satpy.readers.sar_ ...
                         ^
Traceback (most recent call last):
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/yaml/constructor.py", line 532, in find_python_name
    __import__(module_name)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/sar_c_safe.py", line 43, in <module>
    import rasterio
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/rasterio/__init__.py", line 22, in <module>
    from rasterio._base import gdal_version
ImportError: libzstd.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
                         ^
>>>
>>> scn = Scene(filenames=files)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'files' is not defined


Thanks for advance

Martin Raspaud

unread,
Jul 13, 2020, 7:48:10 AM7/13/20
to pyt...@googlegroups.com
Hi,

You appear to have a problem with you gdal installation.
I can recommend miniconda to create a contained environment if your gdal
gives you problems.

Best regards,
Martin
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS97mg_Xk9KRTZykpab50jXYTCsy92Da3Ne-%3DRVCfSHtBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS97mg_Xk9KRTZykpab50jXYTCsy92Da3Ne-%3DRVCfSHtBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Koti Chowdary

unread,
Jul 13, 2020, 9:38:43 AM7/13/20
to pyt...@googlegroups.com
Actually I install gdal  module using  conda sir when importing gdal  module it shows the following error :

 
vankayk@kw60636:~/Downloads/SENTI/SATPY$ python -c 'import gdal'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
  File "/home/vankayk/anaconda3/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/home/vankayk/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)

ImportError: libzstd.so.1: cannot open shared object file: No such file or directory

vankayk@kw60636:~/Downloads/SENTI/SATPY$


To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/7a68a847-f146-0b9d-400f-7acb088297e8%40smhi.se.


--
V.Koteswara Rao
Senior research fellow  (SRF)
Satellite Meteorology Division
India Meteorological Department
New Delhi - 110003
           koti.ocean...@gmail.com

David Hoese

unread,
Jul 13, 2020, 10:11:24 AM7/13/20
to pyt...@googlegroups.com
Hi Koti,

This is likely caused by a mix of packages from conda-forge and the
default anaconda package channel. There could be other issues causing
this. You may want to create a *new* conda environment ("conda create -n
satpy_env python=3.8 satpy") and follow the tips and tricks on the
conda-forge page:

https://conda-forge.org/docs/user/tipsandtricks.html#why-does-that-happen

Dave

On 7/13/20 8:38 AM, Koti Chowdary wrote:
> Actually I install gdal  module using  conda sir when importing gdal
> module it shows the following error :
>
> *
> vankayk@kw60636:~/Downloads/SENTI/SATPY$ python -c 'import gdal'
> *Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "/home/vankayk/anaconda3/lib/python3.6/site-packages/gdal.py",
> line 2, in <module>
>     from osgeo.gdal import deprecation_warn
>   File
> "/home/vankayk/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py",
> line 21, in <module>
>     _gdal = swig_import_helper()
>   File
> "/home/vankayk/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py",
> line 17, in swig_import_helper
>     _mod = imp.load_module('_gdal', fp, pathname, description)
>   File "/home/vankayk/anaconda3/lib/python3.6/imp.py", line 243, in
> load_module
>     return load_dynamic(name, filename, file)
>   File "/home/vankayk/anaconda3/lib/python3.6/imp.py", line 343, in
> load_dynamic
>     return _load(spec)
> ImportError: libzstd.so.1: cannot open shared object file: No such file
> or directory*
> vankayk@kw60636:~/Downloads/SENTI/SATPY$ *
> <mailto:pytroll%2Bunsu...@googlegroups.com>
> > <mailto:pytroll+u...@googlegroups.com
> <mailto:pytroll%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS97mg_Xk9KRTZykpab50jXYTCsy92Da3Ne-%3DRVCfSHtBQ%40mail.gmail.com
>
> >
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS97mg_Xk9KRTZykpab50jXYTCsy92Da3Ne-%3DRVCfSHtBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to pytroll+u...@googlegroups.com
> <mailto:pytroll%2Bunsu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/7a68a847-f146-0b9d-400f-7acb088297e8%40smhi.se.
>
>
>
> --
> */V.Koteswara Rao/*
> /*Senior research fellow  (SRF)*/
> /*Satellite Meteorology Division*/
> /*India Meteorological Department*/
> /*New Delhi - 110003*/
> */Ph:+91 9703730330/
> *
> *gmail:_kotich...@gmail.com <mailto:koticho...@gmail.com>_*
> *_koti.ocean...@gmail.com <mailto:koti.ocean...@gmail.com>_*
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9Y9H3_9NR4Yg9NX3tbMcBb-rG6WK2LUyR6%2Bx_dreWJnQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9Y9H3_9NR4Yg9NX3tbMcBb-rG6WK2LUyR6%2Bx_dreWJnQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Koti Chowdary

unread,
Jul 13, 2020, 11:10:11 AM7/13/20
to pyt...@googlegroups.com
Hi David sir,

I got one more problem earlier it was running perfectly  EUMETSAT  MSG 2 data. Now I'm not able to generate plot due to some errors showing when I am running eumetsat data also. Please find the following errors

export XRIT_DECOMPRESS_PATH=/usr/bin/PublicDecompWT-master/xRITDecompress/xRITDecompress
python
#!/usr/bin/env python3

import datetime
import platform
import warnings
import netCDF4
import os
import conda
conda_file_dir = conda.__file__
conda_dir = conda_file_dir.split('lib')[0]
proj_lib = os.path.join(os.path.join(conda_dir, 'share'), 'proj')
os.environ["PROJ_LIB"] = proj_lib
import OpenSSL.SSL
os.environ['QT_QPA_PLATFORM']='offscreen'
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot
matplotlib.use('Agg')
import imp
import pyart
import scipy.ndimage as spyi
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from netCDF4 import num2date, date2num, Dataset
from time import time
import mpl_toolkits
import calendar
import pandas as pd
from datetime import datetime
import csv
from mpl_toolkits.basemap import Basemap
import matplotlib.dates as mdates
import glob
from matplotlib import animation
import shapefile
import matplotlib.cm
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from netCDF4 import Dataset
from io import StringIO
import pandas
import pylab
import cartopy.crs as ccrs
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
import cartopy.crs as ccrs
from PIL import Image
from matplotlib.cbook import get_sample_data
import cartopy.io.shapereader as shpreader
import cartopy.feature as cf
import cartopy.crs as ccrs
from contextlib import suppress
import sys
from shutil import ignore_patterns
from shutil import copytree, ignore_patterns
import logging
import optparse
import array
import array as arr
import cartopy
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.pyplot as plt
from siphon.catalog import TDSCatalog, get_latest_access_url
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from netCDF4 import Dataset
import numpy as np
from datetime import datetime, timedelta
import cartopy.crs as ccrs
import cartopy.feature as cfeature
LOGGING_LEVELS = {'critical': logging.CRITICAL,
                  'error': logging.ERROR,
                  'warning': logging.WARNING,
                  'info': logging.INFO,
                  'debug': logging.DEBUG}

import numpy as np
from pyresample import load_area, save_quicklook, SwathDefinition
from pyresample.kd_tree import resample_nearest
from satpy import Scene, MultiScene
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pyresample import geometry
from satpy import Scene
from glob import glob
from satpy import DatasetID
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
import cartopy.crs as ccrs
from PIL import Image
from matplotlib.cbook import get_sample_data
import cartopy.io.shapereader as shpreader
import cartopy.feature as cf
import cartopy.crs as ccrs
from contextlib import suppress
from mpl_toolkits.basemap import Basemap
from pyresample.geometry import AreaDefinition
from satpy.config import check_satpy
from satpy.writers import to_image
from satpy.composites import PaletteCompositor
import numpy as np
from satpy.composites import BWCompositor
from satpy.enhancements import colorize
from satpy.writers import to_image
from satpy import Scene, MultiScene
from satpy.multiscene import timeseries
from glob import glob
from pyresample.geometry import AreaDefinition
 
from satpy import Scene, MultiScene
from glob import glob

fig = plt.figure(figsize=[10,8])

filenames = glob("*20070113*")
global_scene = Scene(reader="seviri_l1b_hrit", filenames=filenames)
/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/seviri_l1b_hrit.py:291: DeprecationWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1
  lon, lat, alt = pyproj.transform(geocent, latlong, x, y, z)
>>> global_scene.load(["IR_108"])
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
/home/vankayk/anaconda3/lib/python3.6/site-packages/pyproj/crs/crs.py:543: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()
ERROR:satpy.readers.yaml_reader:Could not load dataset 'DatasetID(name='IR_108', wavelength=(9.8, 10.8, 11.8), resolution=3000.403165817, polarization=None, calibration='brightness_temperature', level=None, modifiers=())': operands could not be broadcast together with shapes (82671,) (82670,)

Traceback (most recent call last):
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/yaml_reader.py", line 750, in _load_dataset_with_area
    ds = self._load_dataset_data(file_handlers, dsid, **kwargs)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/yaml_reader.py", line 635, in _load_dataset_data
    proj = self._load_dataset(dsid, ds_info, file_handlers, **kwargs)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/yaml_reader.py", line 901, in _load_dataset
    _find_missing_segments(file_handlers, ds_info, dsid)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/yaml_reader.py", line 1031, in _find_missing_segments
    projectable = fh.get_dataset(dsid, ds_info)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/seviri_l1b_hrit.py", line 674, in get_dataset
    res = super(HRITMSGFileHandler, self).get_dataset(key, info)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/hrit_base.py", line 241, in get_dataset
    data = self.read_band(key, info)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/hrit_base.py", line 330, in read_band
    data = dec10216(data)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/satpy/readers/seviri_base.py", line 251, in dec10216
    arr16_2 = ((arr10_2 & 15) << 6) + (arr10_3 >> 2)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/dask/array/core.py", line 1792, in __add__
    return elemwise(operator.add, self, other)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/dask/array/core.py", line 3824, in elemwise
    broadcast_shapes(*shapes)
  File "/home/vankayk/anaconda3/lib/python3.6/site-packages/dask/array/core.py", line 3785, in broadcast_shapes
    "shapes {0}".format(" ".join(map(str, shapes)))
ValueError: operands could not be broadcast together with shapes (82671,) (82670,)

 Thanks for your help
V.Koteswara Rao
 

David Hoese

unread,
Jul 13, 2020, 12:48:39 PM7/13/20
to pyt...@googlegroups.com
Sorry, I don't have a lot of experience with that reader. Seems like the
files are corrupt in some way (inconsistent number of records). Let's
see if one of the other pytroll developers has an idea what's going on.
We can wait for them to reply here.

Dave
> import matplotlib.cm <http://matplotlib.cm>
> */V.Koteswara Rao/*
> _**_
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS8c07d2p2jsvhuYmhkGgqccko1OD94i2z%3DMVW_GDouX-A%40mail.gmail.com
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS8c07d2p2jsvhuYmhkGgqccko1OD94i2z%3DMVW_GDouX-A%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Simon Proud

unread,
Jul 13, 2020, 3:32:07 PM7/13/20
to pytroll
Hello,
Could you provide the output of: print(filenames)
That might help us trace where this error is coming from.
Thanks,
Simon
Message has been deleted

Koti Chowdary

unread,
Jul 13, 2020, 3:38:35 PM7/13/20
to pyt...@googlegroups.com
Thank you for your response. Please see the following output filenames

print(filenames)
['H-000-MSG2__-MSG2________-VIS008___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000012___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000014___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000019___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000022___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000010___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000011___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000021___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000017___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000016___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000015___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-_________-EPI______-200701130830-__', 'H-000-MSG2__-MSG2________-IR_134___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_134___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000024___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000018___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000020___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000013___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_120___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-_________-PRO______-200701130830-__', 'H-000-MSG2__-MSG2________-WV_073___-000007___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000001___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000009___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_108___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000004___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_016___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000002___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000023___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_087___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_062___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS006___-000005___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_097___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-HRV______-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-WV_073___-000006___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000008___-200701130830-C_', 'H-000-MSG2__-MSG2________-VIS008___-000003___-200701130830-C_', 'H-000-MSG2__-MSG2________-IR_039___-000004___-200701130830-C_']



To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/a2ab7cf0-659a-4c20-a61a-e7657c00f5ceo%40googlegroups.com.

Koti Chowdary

unread,
Jul 13, 2020, 5:55:39 PM7/13/20
to pyt...@googlegroups.com
Respected sir,

Thanks for your help David and Simon sir. I did a mistake actually xRITDecompress file path i give a  wrong place that is way showing error now its working fine from EUMETSAT data.I apolozis for my mistake. Regarding senttinal data im not able to generate if dont mind please share me example scripts for mosaic and generating plot.

Thanks a lot for spending yours valuable time & Have a nice day



David Hoese

unread,
Jul 14, 2020, 10:01:57 AM7/14/20
to pyt...@googlegroups.com
Could you provide more information for what you're trying to do? What do
you want your final output to look like? A plot with axes and a colorbar
or just the "raw" data with no axes, no colorbar. I'm not sure we have
an exact example using Sentinel data, but maybe you could show us what
code you have so far and we can advise you how to move forward. You can
load a single swath with the Scene object. If you need to load multiple
swaths and stack them on top of each other you could look at the
MultiScene: https://satpy.readthedocs.io/en/latest/multiscene.html

Otherwise, we have various examples and tutorials in the Satpy
documentation that may be able to help you.

Dave
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/a2ab7cf0-659a-4c20-a61a-e7657c00f5ceo%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/a2ab7cf0-659a-4c20-a61a-e7657c00f5ceo%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> */V.Koteswara Rao/*
> /*Senior research fellow  (SRF)*/
> /*Satellite Meteorology Division*/
> /*India Meteorological Department*/
> /*New Delhi - 110003*/
> */Ph:+91 9703730330/
> *
> *gmail:_kotich...@gmail.com <mailto:koticho...@gmail.com>_*
> *_koti.ocean...@gmail.com
> <mailto:koti.ocean...@gmail.com>_*
>
>
>
> --
> */V.Koteswara Rao/*
> /*Senior research fellow  (SRF)*/
> /*Satellite Meteorology Division*/
> /*India Meteorological Department*/
> /*New Delhi - 110003*/
> */Ph:+91 9703730330/
> *
> *gmail:_kotich...@gmail.com <mailto:koticho...@gmail.com>_*
> *_koti.ocean...@gmail.com <mailto:koti.ocean...@gmail.com>_*
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9fhsYp-KnkO4L%2BQa04-km5-cRz%3D6uEFBSvefH1n0ZEnQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pytroll/CAEH%3DfS9fhsYp-KnkO4L%2BQa04-km5-cRz%3D6uEFBSvefH1n0ZEnQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages