failed in getanc for modis data

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
zhigang
Posts: 74
Joined: Tue Nov 10, 2020 8:03 pm America/New_York
Answers: 0

failed in getanc for modis data

by zhigang » Fri Feb 02, 2024 12:04 pm America/New_York

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

Tags:

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1470
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 5 times

Re: failed in getanc for modis data

by OB.DAAC - SeanBailey » Sat Feb 03, 2024 11:08 am America/New_York

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

zhigang
Posts: 74
Joined: Tue Nov 10, 2020 8:03 pm America/New_York
Answers: 0

Re: failed in getanc for modis data

by zhigang » Sun Feb 04, 2024 12:50 am America/New_York

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

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1470
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 5 times

Re: failed in getanc for modis data

by OB.DAAC - SeanBailey » Mon Feb 05, 2024 1:45 pm America/New_York

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

Post Reply