Page 1 of 1

failed in getanc for modis data

Posted: Fri Feb 02, 2024 12:04 pm America/New_York
by zhigang
Dear all,

I have not used seadas for about one year and re-instailled it to process some modis aqua data with l2gen (ocssw V2023.3). However, the getanc did not work. The detail of error was:

Code: Select all

getanc -cv /home/ubuntu/data/NorthA/tmp/A2002243182000.L1B_LAC
ancillary_data.db
Searching database: /home/ubuntu/ocssw/var/log/ancillary_data.db 
Aqua

Input file: /home/ubuntu/data/NorthA/tmp/A2002243182000.L1B_LAC
Sensor    : Aqua
Start time: 2002-08-31T18:20:00
End time  : 2002-08-31T18:24:59

OBPG session started
Downloading A2002243182000.anc.server (    0.00 MBs)
[==================================================]
...Done
Traceback (most recent call last):
  File "/home/ubuntu/ocssw/bin/getanc", line 149, in <module>
    exit(main())
         ^^^^^^
  File "/home/ubuntu/ocssw/bin/getanc", line 142, in main
    g.findweb()
  File "/home/ubuntu/ocssw/bin/seadasutils/anc_utils.py", line 666, in findweb
    ancdatabase.insert_record(satfile=filekey, starttime=self.start, stoptime=self.stop, anctype=anctype,
  File "/home/ubuntu/ocssw/bin/seadasutils/ancDB.py", line 103, in insert_record
    c.execute('INSERT INTO ancfiles VALUES (NULL,?,?,?)', [ancfile, ancpath, anctype])
sqlite3.ProgrammingError: Error binding parameter 2: type 'PosixPath' is not supported
I remembered that "getanc" was easy to use before. I have not idea how to fix it, could someone provide some suggestions.

Best regards,
Zhigang

Re: failed in getanc for modis data

Posted: Sat Feb 03, 2024 11:08 am America/New_York
by OB.DAACx - SeanBailey
Seems there is a bug with the use of the -c,--curdir option. One I apparently introduced almost 3 years ago :shock: I'm very surprised this is the first report. The good news is the solution is simple.

The first option is a workaround. Don't use -c. Just let the code put the files in the default location.

The second option is to edit this file: $OCSSWROOT/bin/seadasutils/setupenv.py
replace line 55 which looks like this:

Code: Select all

    self.dirs['run'] = Path.cwd()
with this:

Code: Select all

    self.dirs['run'] = str(Path.cwd())
Sean

Re: failed in getanc for modis data

Posted: Sun Feb 04, 2024 12:50 am America/New_York
by zhigang
Hi Sean,

Appreciated! I had reverted ocssw to the older version (V2021.1) and it worked. I will be able to try your solution for V2023.3 later.

Best,
Zhigang

Re: failed in getanc for modis data

Posted: Mon Feb 05, 2024 1:45 pm America/New_York
by OB.DAACx - SeanBailey
I was too quick with that 'fix'. It fixed getanc, but breaks modis_GEO and modis_L1B :o
My "fix" has been fixed ;) The correct fix will be in the next OCSSW tag.

Sean