Help for Metop-B/C images


samu120497@...
 

Hi all,

This morning, when I was trying the Python script for the Metop B/C passages, I have read an error: No supported files found. Please, how can I resolve this problem? 

In the quote, the log session:

(pytroll) C:\EMCtools\LEOscripts>python Metop-B_DAY.py 20220731
Impossibile trovare C:\EMCdata\tmpdirs\xmetopb\AVHR_HRP_00_M01_*
 1 --> C:/Users/Samuele/Desktop\AVHR_xxx_1B_M01_20220731081603Z_20220731081903Z_N_O_20220731090815Z.bz2
 2 --> C:/Users/Samuele/Desktop\AVHR_xxx_1B_M01_20220731081903Z_20220731082203Z_N_O_20220731090851Z.bz2
 3 --> C:/Users/Samuele/Desktop\AVHR_xxx_1B_M01_20220731082203Z_20220731082503Z_N_O_20220731090926Z.bz2
 4 --> C:/Users/Samuele/Desktop\AVHR_xxx_1B_M01_20220731082503Z_20220731082803Z_N_O_20220731091002Z.bz2
 5 --> C:/Users/Samuele/Desktop\AVHR_xxx_1B_M01_20220731082803Z_20220731083103Z_N_O_20220731091038Z.bz2
Metop-B_DAY.py 20220731 lat=46.9 lon=8.2 ran=40.0 Orbit number with maximum elevation 51197 at telmax=08:20 UTC
No filenames found for reader: avhrr_l1b_eps
Don't know how to open the following files: {'C:/Users/Samuele/Desktop\\AVHR_xxx_1B_M01_20220731082203Z_20220731082503Z_N_O_20220731090926Z.bz2', 'C:/Users/Samuele/Desktop\\AVHR_xxx_1B_M01_20220731081603Z_20220731081903Z_N_O_20220731090815Z.bz2', 'C:/Users/Samuele/Desktop\\AVHR_xxx_1B_M01_20220731081903Z_20220731082203Z_N_O_20220731090851Z.bz2', 'C:/Users/Samuele/Desktop\\AVHR_xxx_1B_M01_20220731082803Z_20220731083103Z_N_O_20220731091038Z.bz2', 'C:/Users/Samuele/Desktop\\AVHR_xxx_1B_M01_20220731082503Z_20220731082803Z_N_O_20220731091002Z.bz2'}
Traceback (most recent call last):
  File "C:\EMCtools\LEOscripts\Metop-B_DAY.py", line 233, in <module>
    scn = Scene(filenames = bestfiles, reader = 'avhrr_l1b_eps')
  File "C:\Users\Samuele\Miniconda3\envs\pytroll\lib\site-packages\satpy\scene.py", line 121, in __init__
    self._readers = self._create_reader_instances(filenames=filenames,
  File "C:\Users\Samuele\Miniconda3\envs\pytroll\lib\site-packages\satpy\scene.py", line 142, in _create_reader_instances
    return load_readers(filenames=filenames,
  File "C:\Users\Samuele\Miniconda3\envs\pytroll\lib\site-packages\satpy\readers\__init__.py", line 578, in load_readers
    _check_reader_instances(reader_instances)
  File "C:\Users\Samuele\Miniconda3\envs\pytroll\lib\site-packages\satpy\readers\__init__.py", line 617, in _check_reader_instances
    raise ValueError("No supported files found")
ValueError: No supported files found


Ernst Lobsiger
 

Samuele,

If you work more or less with my original scripts, then:
...
# Set temporary directory and image directory
tmpdir = datdrp + '/EMCdata/tmpdirs/xmetopb'
imgdir = datdrp + '/EMCdata/images/Metop-B'

# Dir must exist
try:
   os.chdir(tmpdir)
except:
   sys.exit('Cannot change to tmp directory ...')

# Clean out the tmp directory first
os.system('del AVHR_xxx_1B_M01_*')
...

You should be in a tmp directory and your files that end
with *.bz2 must be uncompressed first to this directory:

...
# Decompress all n bestfiles found
for n in range (0, len(bestfiles)):
    filename = bestfiles[n][offset:-4]
    cmdstr = toodrp + '/EMCtools/exefiles/7za x -so ' + bestfiles[n] + ' > ' + filename
    bestfiles[n] = filename
    os.system(cmdstr)
...

After decompression the .bz2 should be gone and the reader
can read the files (in the tmp directory) that have now names like:

AVHR_xxx_1B_M01_20220731081603Z_20220731081903Z_N_O_20220731090815Z


Not sure why you have the line:

Impossibile trovare C:\EMCdata\tmpdirs\xmetopb\AVHR_HRP_00_M01_*

currently these files cannot be treated with Satpy, only the AVHR_xxx_* files.



Regards,
Ernst


samu120497@...
 

Ernst,

Thank You so much! Now it works so good! Today I will edit the Python scripts for all my needs.



Thanks again, have a nice day!

Cheers,
Samuele Giampietro


Ernst Lobsiger
 

Samuele,

good to see your fast progress! When you enter the tmp directory make sure you delete the right files:
...
# Clean out the tmp directory first
os.system('del AVHR_xxx_1B_M01_*')
...
If not deleted these (above Metop-B) files will accumulate in the tmp directory with every image you make.

Your line:

Impossibile trovare C:\EMCdata\tmpdirs\xmetopb\AVHR_HRP_00_M01_*

makes me think you tried to delete the other HRP files in the tmp directory. These should never make it there.


Regards,
Ernst