Page 1 of 1

OCSSW V2024.0 modis_L1A

Posted: Fri Jun 28, 2024 7:29 pm America/New_York
by oo_processing
Dear Support,

I saw this error in T2024.17, but was too busy to post it. Now it still exists in V2024.0. It's the step from L0 to L1A of modis. Please advise.

Code: Select all

 $ modis_L1A /scratch/tmp/S4P_SEADAS.MODISA.ANGOLA.2024.120_version_1.02_zf37urf4/MOD00.P2024120.1255.PDS -o /scratch/tmp/S4P_SEADAS.MODISA.ANGOLA.2024.120_version_1.02_zf37urf4/MOD00.P2024120.1255.ANGOLA_FULL.L1A_LAC --startnudge=0 --stopnudge=10
Traceback (most recent call last):
  File "/shares/cms_optics/apps/seadas/ocssw/V2024.0/bin/modis_L1A", line 75, in <module>
    m.l0()
  File "/shares/cms_optics/apps/seadas/ocssw/V2024.0/bin/modis/modis_L1A_utils.py", line 159, in l0
    status = self.get_constructor()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/shares/cms_optics/apps/seadas/ocssw/V2024.0/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'
Thanks,
Yuyuan

Re: OCSSW V2024.0 modis_L1A

Posted: Tue Jul 16, 2024 11:54 am America/New_York
by woodbri
Is there a work-around for this issue? This is a blocking issue for me.

Re: OCSSW V2024.0 modis_L1A

Posted: Tue Jul 16, 2024 12:57 pm America/New_York
by woodbri
OK, did a little research into this issue and 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: OCSSW V2024.0 modis_L1A

Posted: Tue Jul 16, 2024 1:26 pm America/New_York
by oo_processing
My workaround is

Code: Select all

$ cp V2024.0/bin/modis_L1A V2024.0/bin/modis_L1A.orig
$ vim V2024.0/bin/modis_L1A
 from modis.modis_utils import buildpcf, modis_env
-import modis.modis_L1A_utils as modisL1A
+import modis.modis_L1A_utils_mod as modisL1A
 from seadasutils.setupenv import env

Code: Select all

$ cp V2024.0/bin/modis/modis_L1A_utils.py V2024.0/bin/modis/modis_L1A_utils_mod.py
$ vim V2024.0/bin/modis/modis_L1A_utils_mod.py
 import seadasutils.ProcUtils as ProcUtils
+from pathlib import Path

         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))
Yuyuan

Re: OCSSW V2024.0 modis_L1A

Posted: Thu Aug 08, 2024 6:26 pm America/New_York
by OB SeaDAS - xuanyang02
Thanks for sharing your fix and workaround. Our fix will be in the next tag.