modis_l1b and modis_l2 readers not available

153 views
Skip to first unread message

nevermind

unread,
May 25, 2022, 7:59:23 AM5/25/22
to pytroll
Hello everyone,

For my thesis, I am trying to load MODIS level 2 data using the modis_l2 reader, but somehow satpy seems unable to use both this reader as well as the modis_l1b reader. 
The code I am working with (in PyCharm with Python 3.10) looks like this:

----------------------------------------------------------
modis_file = ["E:/BA_Thesis/MODIS_data
/MOD06_L2.A2021299.1620.061.2021300211624.hdf"]

modis = {"modis_l2" : modis_file}

mod02_scn = Scene(filenames=modis, reader='modis_l2')
-----------------------------------------------------------

Then the following error shows up:

-----------------------------------------------------------
INFO:satpy.readers:Cannot use ['E:\\BA_Thesis\\\\venv\\Lib\\site-packages\\satpy\\etc\\readers\\modis_l2.yaml']

WARNING:satpy.readers:Don't know how to open the following files: {'E:/BA_Thesis/MODIS_data/MOD06_L2.A2021299.1620.061.2021300211624.hdf'}

ValueError: No supported files found
-----------------------------------------------------------

When I check the available readers using available_readers() neither the modis_l2 nor the modis_l1b readers show up. Does anyone know, why satpy might be unable to use the corresponding .yaml files? Do I have to add the readers manually?

Any help is greatly appreciated!
  Jasper

David Hoese

unread,
May 25, 2022, 8:05:49 AM5/25/22
to pyt...@googlegroups.com
Hi Jasper,

Try this:

https://satpy.readthedocs.io/en/stable/quickstart.html#troubleshooting

Most likely you need to install the "pyhdf" package.

Dave

On 5/25/22 06:59, nevermind wrote:
> Hello everyone,
>
> For my thesis, I am trying to load MODIS level 2 data using the modis_l2
> reader, but somehow satpy seems unable to use both this reader as well
> as the modis_l1b reader.
> The code I am working with (in PyCharm with Python 3.10) looks like this:
>
> ----------------------------------------------------------
> modis_file = ["E:/BA_Thesis/MODIS_data
> /MOD06_L2.A2021299.1620.061.2021300211624.hdf"]
>
> modis = {"modis_l2" : modis_file}
>
> mod02_scn = Scene(filenames=modis,reader='modis_l2')
> -----------------------------------------------------------
>
> Then the following error shows up:
>
> -----------------------------------------------------------
> INFO:satpy.readers:Cannot use
> ['E:\\BA_Thesis\\\\venv\\Lib\\site-packages\\satpy\\etc\\readers\\modis_l2.yaml']
>
> WARNING:satpy.readers:Don't know how to open the following files:
> {'E:/BA_Thesis/MODIS_data/MOD06_L2.A2021299.1620.061.2021300211624.hdf'}
>
> ValueError: No supported files found
> -----------------------------------------------------------
>
> When I check the available readers using available_readers() neither the
> modis_l2 nor the modis_l1b readers show up. Does anyone know, why satpy
> might be unable to use the corresponding .yaml files? Do I have to add
> the readers manually?
>
> Any help is greatly appreciated!
>   Jasper
>
> --
> 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/440f4863-c91a-4b4a-bc69-54ea24fe5a38n%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/440f4863-c91a-4b4a-bc69-54ea24fe5a38n%40googlegroups.com?utm_medium=email&utm_source=footer>.

nevermind

unread,
May 26, 2022, 9:27:39 AM5/26/22
to pytroll
Hi Dave,

Thanks a lot for your advice! I installed the pyhdf package and got a new error (No module named ‘_hdfext’) which I have not been able to fix yet. I did, however, create a new conda environment (worked in venv before) and installed satpy and pyhdf there which seems to have fixed the issue. I have successfully read MOD02 and MOD06 data (got a RuntimeWarning, but everything seemed to work).

Thanks again!
  Jasper

David Hoese

unread,
May 26, 2022, 9:37:18 AM5/26/22
to pyt...@googlegroups.com
Glad you got it working. The `_hdfext` error sounds like the package
wasn't built/installed properly or that your system may be missing the
HDF4 C library. I don't quite remember what pyhdf's installation
instructions are so I'm not sure if it has to be manually installed. But
if you got conda to work then great.

Dave
> <https://groups.google.com/d/msgid/pytroll/440f4863-c91a-4b4a-bc69-54ea24fe5a38n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pytroll/440f4863-c91a-4b4a-bc69-54ea24fe5a38n%40googlegroups.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+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/ee3d0591-a8ab-43db-b499-2566686d91cbn%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/ee3d0591-a8ab-43db-b499-2566686d91cbn%40googlegroups.com?utm_medium=email&utm_source=footer>.

nevermind

unread,
May 30, 2022, 11:41:14 AM5/30/22
to pytroll
Hi Dave,

Alright, thanks! I will try to fix that some other time.

- Jasper
Reply all
Reply to author
Forward
0 new messages