Page 1 of 1

MODIS Data processing with OCSSW tag V2024.0 seems to be broken

Posted: Sun Jul 14, 2024 7:31 pm America/New_York
by woodbri
I've been using OCSSW V2024.0 software to process VIIRS files and now I need to get MODIS Aqua processing to work with this also but I get an error running:

Code: Select all

modis_L1A MOD00.P2024196.1720_1.PDS -o MOD00.P2024196.1720_1.PDS.L1A_LAC

Traceback (most recent call last):
  File "/u/ocssw//bin/modis_L1A", line 75, in <module>
    m.l0()
  File "/data/u/ocssw/bin/modis/modis_L1A_utils.py", line 159, in l0
    status = self.get_constructor()
  File "/data/u/ocssw/bin/modis/modis_L1A_utils.py", line 107, in get_constructor
    line = line.replace('LOGDIR', self.dirs['run'].resolve().as_posix())
AttributeError: 'str' object has no attribute 'resolve'

I assume I have done something wrong, but not sure how to fix it. I had this working in branch v7.5.

Running on Ubuntu 22.04
modis_L1A 1.1 from Tag V2024.0

Re: MODIS Data processing with OCSSW tag V2024.0 seems to be broken

Posted: Tue Jul 16, 2024 1:00 pm America/New_York
by woodbri
OK, after researching this issue, I think I have a working patch that fixes this:

Code: Select all

woodbri@389F910:/u/ocssw/bin/modis$ diff -Naur modis_L1A_utils.py-orig modis_L1A_utils.py
--- modis_L1A_utils.py-orig     2024-07-16 11:23:51.123134916 -0500
+++ modis_L1A_utils.py  2024-07-16 11:25:18.410090115 -0500
@@ -10,6 +10,7 @@
 import mlp.obpg_data_file
 import mlp.get_output_name_utils
 import seadasutils.ProcUtils as ProcUtils
+from pathlib import Path


 class modis_l1a:
@@ -104,7 +105,7 @@
         pcf = [line for line in open(self.pcf_template, 'r')]
         sed = open(self.pcf_file, 'w')
         for line in pcf:
-            line = line.replace('LOGDIR', self.dirs['run'].resolve().as_posix())
+            line = line.replace('LOGDIR', Path(self.dirs['run']).resolve().as_posix())
             line = line.replace('L1AFILE', os.path.basename(self.filename))
             line = line.replace('VARDIR', os.path.join(self.dirs['var'], 'modis'))
             sed.write(line)

Re: MODIS Data processing with OCSSW tag V2024.0 seems to be broken

Posted: Tue Jul 30, 2024 10:30 am America/New_York
by OB SeaDAS - xuanyang02
Thanks for sharing your fix! Our fix will be in the next tag.