modis_atteph.py is downloading the wrong ATT/EPH pair

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
user_gis
Posts: 21
Joined: Thu Jul 28, 2016 11:19 am America/New_York
Answers: 0

modis_atteph.py is downloading the wrong ATT/EPH pair

by user_gis » Wed Apr 27, 2022 2:20 am America/New_York

Dear Staff,

After the restoration of work AQUA in orbit, I noticed a strange behavior of the module modis_atteph.py
5-min ATT/EPH data is already available in a few hours, but the module still tries to download it is not clear what.

For example:
./modis_atteph.py -v -r -d /var/rki/processing/aqua/modis/processing/MYD01.A2022116.1038.061.2022116104947.hdf
Aqua
Searching database: /opt/rki/OCSSW/var/ancillary_data.db
Determining pass start and end times...
Aqua
()
Input file: /var/rki/processing/aqua/modis/processing/MYD01.A2022116.1038.061.2022116104947.hdf
Sensor : aqua
Start time: 2022116103803
End time : 2022116104401
()
OBPG session started
Downloads disabled. The following missing file(s) will not be downloaded:
PM1EPHND.P2022115.1200.003
PM1ATTNR_NRT.A2022116.1045.061
PM1ATTNR_NRT.A2022116.1040.061
PM1ATTNR_NRT.A2022116.1035.061
All required attitude and ephemeris files successfully determined and downloaded.
att1=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1035.061
att2=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1040.061
att3=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1045.061
eph1=/opt/rki/OCSSW/var/anc/2022/115/PM1EPHND.P2022115.1200.003

()
- All optimal ancillary data files were determined. -

Tell me what's wrong?

Regards,
Dmitry

Tags:

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 644
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by OB SeaDAS - xuanyang02 » Wed Apr 27, 2022 12:45 pm America/New_York

When you use the -d option (Disable download of ancillary files not found on hard disk), it is correct to get the message

"Downloads disabled. The following missing file(s) will not be downloaded:
PM1EPHND.P2022115.1200.003
PM1ATTNR_NRT.A2022116.1045.061
PM1ATTNR_NRT.A2022116.1040.061
PM1ATTNR_NRT.A2022116.1035.061.

- All optimal ancillary data files were determined. -"

If you check /opt/rki/OCSSW/var/anc/2022/116/ and /opt/rki/OCSSW/var/anc/2022/115/, you probably will find these 4 files were not downloaded
PM1EPHND.P2022115.1200.003
PM1ATTNR_NRT.A2022116.1045.061
PM1ATTNR_NRT.A2022116.1040.061
PM1ATTNR_NRT.A2022116.1035.061

However, I think there is a a bug in the code that the following messages were incorrectly printed out:
"All required attitude and ephemeris files successfully determined and downloaded.
att1=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1035.061
att2=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1040.061
att3=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1045.061
eph1=/opt/rki/OCSSW/var/anc/2022/115/PM1EPHND.P2022115.1200.003"

user_gis
Posts: 21
Joined: Thu Jul 28, 2016 11:19 am America/New_York
Answers: 0

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by user_gis » Thu Apr 28, 2022 1:59 am America/New_York

I'll clarify my question.

My operational processing script internally uses modis_atteph.py to get the ATT/EPH.
modis_atteph.py is called in a loop and runs until it gets exit status 0.

0 - all is well in the world
1 - predicted attitude selected
2 - predicted ephemeris selected
4 - no attitude found
8 - no ephemeris found
16 - invalid mission

At some point, the following data set becomes available to me:
att1=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1035.061
att2=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1040.061
att3=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1045.061
eph1=/opt/rki/OCSSW/var/anc/2022/115/PM1EPHND.P2022115.1200.003

In this case, the exit status of modis_atteph.py = 1.
With this status, the script cannot proceed with further processing and continues to run modis_atteph.py.

Interestingly, at the same time, I see that 5-min EPH data is already available:
eph1=/opt/rki/OCSSW/var/anc/2022/116/PM1EPHND_NRT.A2022116.1035.061
eph2=/opt/rki/OCSSW/var/anc/2022/116/PM1EPHND_NRT.A2022116.1040.061
eph3=/opt/rki/OCSSW/var/anc/2022/116/PM1EPHND_NRT.A2022116.1045.061

modis_atteph.py still continues to ignore the 5-min EPH data, giving the correct set like:
att1=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1035.061
att2=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1040.061
att3=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR_NRT.A2022116.1045.061
eph1=/opt/rki/OCSSW/var/anc/2022/115/PM1EPHND.P2022115.1200.003

modis_atteph.py gets an exit status of 0 when the following dataset becomes available:
att1=/opt/rki/OCSSW/var/anc/2022/116/PM1ATTNR.P2022116.1000.003
eph1=/opt/rki/OCSSW/var/anc/2022/115/PM1EPHND.P2022115.1200.003

But this data set can be expected for a long time, which is not good for me.

Q:How can I get a set of 5-min ATT and 5-min EPH data using modis_atteph.py and still get exit status 0?

Regards,
Dmitry

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 644
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by OB SeaDAS - xuanyang02 » Fri Apr 29, 2022 12:48 pm America/New_York

When the PM1ATTNR_NRT and PM1EPHND files are available, the api called by modis_attteph.py returns status 1, because the PM1ATTNR_NRT files are classified as non-optimal. https://oceandata.sci.gsfc.nasa.gov/api/atteph/A/2022118111000/2022118111500
{"files":[["ATT1","PM1ATTNR_NRT.A2022118.1105.061"],
["ATT2","PM1ATTNR_NRT.A2022118.1110.061"],
["ATT3","PM1ATTNR_NRT.A2022118.1115.061"],
["EPH1","PM1EPHND.P2022117.1200.003"]],"status":1}

You can decide if you want to edit the code so modis_atteph.py returns 0 when the PM1EPHND file is available.
/opt/rki/OCSSW/scripts/modis_atteph.py
/opt/rki/OCSSW/scripts/modules/anc_utils.py line 441

user_gis
Posts: 21
Joined: Thu Jul 28, 2016 11:19 am America/New_York
Answers: 0

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by user_gis » Wed May 04, 2022 8:30 am America/New_York

Ok,
Can I just wait until modis_atteph.py returns an exit status < 4?
If I understand correctly, an exit status < 4 indicates the presence of some kind of ATT/EPH data.

Regards,
Dmitry

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 644
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by OB SeaDAS - xuanyang02 » Wed May 04, 2022 4:31 pm America/New_York

Yes, an exit status < 4 indicates the presence of some kind of ATT/EPH data, sometimes NRT, less than optimal.

user_gis
Posts: 21
Joined: Thu Jul 28, 2016 11:19 am America/New_York
Answers: 0

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by user_gis » Thu May 05, 2022 1:32 am America/New_York

Hello,

Many thanks for your advices.

Regards,
Dmitry

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 644
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by OB SeaDAS - xuanyang02 » Thu May 05, 2022 1:15 pm America/New_York

Dmitry,

I have to clarify that ocssw/scripts/modis_atteph.py (V2019.3) calls an old api that returns 1 when ATT files are non optimal.

The new ocssw/bin/modis_attpeh (V2022.0) calls a new api that returns 0 even when ATT/EPH files are non optimal.

Bing

user_gis
Posts: 21
Joined: Thu Jul 28, 2016 11:19 am America/New_York
Answers: 0

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by user_gis » Tue May 24, 2022 2:27 am America/New_York

And if ATT/EPF data is not available, 0 is also returned.
It seems to me that this is wrong.

Then I will not understand in any way that I have data or not.

Regards,
Dmitry

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 644
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: modis_atteph.py is downloading the wrong ATT/EPH pair

by OB SeaDAS - xuanyang02 » Tue May 24, 2022 12:22 pm America/New_York

Sorry for the inconvenience. We are working on the new API and the script that uses the new API so modis_atteph will return the status as follows:

0 - all is well in the world
1 - predicted attitude selected
2 - predicted ephemeris selected
4 - no attitude found
8 - no ephemeris found

Bing

Post Reply