import modules.ProcUtils as ProcUtils

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
cliffordoo
Posts: 17
Joined: Mon Jul 17, 2017 8:36 am America/New_York
Answers: 0

import modules.ProcUtils as ProcUtils

by cliffordoo » Thu Feb 03, 2022 10:36 pm America/New_York

Hello OBPG

Sorry to post this. I feel like it is an easy one but am having trouble getting past this error. Currently running

Seadas 8.1
Ubuntu 18.04

Tryin to batch process files from a bash script by calling the various processors. The first step is modis_geo.py, but there is an error, "ImportError: No module named requests". See output below.

Traceback (most recent call last):
File "/home/andy/ocssw/ocssw_src/scripts/modis_GEO.py", line 7, in <module>
import modules.anc_utils as anc_utils
File "/home/andy/ocssw/ocssw_src/scripts/modules/anc_utils.py", line 9, in <module>
import modules.ProcUtils as ProcUtils
File "/home/andy/ocssw/ocssw_src/scripts/modules/ProcUtils.py", line 16, in <module>
import requests
ImportError: No module named requests
A2020004205000.L1A_LAC.x.hdf, A2020004205000.L1A__L1Asub.hdf, A2020004205000.GEO, A2020004205000_sub.GEO, A2020004205000.L1B_QKM, A2020004205000.GEOsmall.ppm
Traceback (most recent call last):
File "/home/andy/ocssw/ocssw_src/scripts/modis_L1A_extract.py", line 3, in <module>
import anc_utils
ImportError: No module named anc_utils

I am able to get modis_GEO to run through the GUI, but not from the bash script. I am guessing that I installed something the wrong way or am not modifying my scripts correctly. It have been a while (7.4) since I have worked with Seadas.

Any guidance would be appreciated.

Andy

Tags:

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

Re: import modules.ProcUtils as ProcUtils

by OB SeaDAS - xuanyang02 » Fri Feb 04, 2022 4:29 pm America/New_York

In SeaDAS 7, modis_GEO.py and getanc.py are in $OCSSWROOT/scripts, and anc_utils.py is in $OCSSWROOT/scripts/modules.

In SeaDAS 8, modis_GEO and getanc are in $OCSSWROOT/bin, anc_utils.py is in $OCSSWROOT/bin/seadasutils.

You need to call $OCSSWROOT/bin/modis_GEO rather than modis_GEO.py

What was the command you used to install OCSSW? What tag of OCSSW did you install for SeaDAS 8? https://seadas.gsfc.nasa.gov/downloads/

Could you please do SeaDAS-OCCSW -> SeaDAS/System Info and paste your results here.

You might find this post helpful -- viewtopic.php?p=9893&hilit=modis_geo&si ... 5808#p9893

cliffordoo
Posts: 17
Joined: Mon Jul 17, 2017 8:36 am America/New_York
Answers: 0

Re: import modules.ProcUtils as ProcUtils

by cliffordoo » Wed Feb 09, 2022 8:07 pm America/New_York

Thanks for the reply.

The OCSSW processors were installed through the GUI with the tag V2021.2

The system info is below. I have changed the script to call /bin/modis_GEO, but get the following error now.

TypeError: expected str, bytes or os.PathLike object, not NoneType

Thanks for your help.

Andy

Main Application Platform:
Application Version: SeaDAS 8.1.0
Installation Directory: /home/andy
Data Directory: /home/andy/.seadas8
Configuration: /home/andy/etc/snap.properties
WARNING!! File '/home/andy/etc/snap.properties' does not exist
Configuration2: /home/andy/.seadas8/etc/snap.properties
VM Configuration: /home/andy/bin/pconvert.vmoptions
WARNING!! File '/home/andy/bin/pconvert.vmoptions' does not exist
VM Configuration (gpt): /home/andy/bin/gpt.vmoptions
WARNING!! File '/home/andy/bin/gpt.vmoptions' does not exist
Desktop Specification Version: 8.0.3
Engine Specification Version: 8.0.3
JRE: Java(TM) SE Runtime Environment 1.8.0_201-b09
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
Memory: 3641 MiB

OCSSWROOT (Java Env): null

Python3 Directory:
/usr/bin/python3

SeaDAS Toolbox:
SeaDAS Toolbox Specification Version: 1.1.0
Configuration: /home/andy/.seadas8/etc/seadas.properties
OCSSW Root Directory: /home/andy/ocssw
OCSSW Log Directory: /home/andy/modis/test
OCSSW Location: local
Environment {$OCSSWROOT} (external): null

-----------------------------------------------

NASA Science Processing (OCSSW):
Environment {$OCSSWROOT}: /home/andy/ocssw
Environment {$OCDATAROOT}: /home/andy/ocssw/share
l2gen version: msl12 9.5.1-V2021.2 (Jun 18 2021 11:22:53)
l2bin version: 7.0.1
l3bin version: 5.13
l3mapgen version: l3mapgen 2.3.0-V2021.2 (Jun 18 2021 11:24:42)
Installed Missions: ['aquarius', 'avhrr', 'czcs', 'goci', 'hawkeye', 'hico', 'meris', 'aqua', 'terra', 'mos', 'ocm1', 'ocm2', 'octs', 'oli', 'osmi', 'seawifs', 'sgli', 'viirsn', 'viirsj1']

General System and Software:
Operating system: Ubuntu 18.04.1 LTS
Java version: 1.8.0_312
Python3 version: 3.6.9
Python3 Path: /usr/bin/python3
Env: ASAP_PARMS=/home/andy/ocssw/share/common/nav
CC=gcc
CLUTTER_IM_MODULE=xim
COLORTERM=truecolor
CXX=g++
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=ubuntu
DISPLAY=:1
ELEMENTS=/home/andy/ocssw/var/seawifs
EOS_LIB_PREFIX=linux64
FC=gfortran
GCC_TUNE=
GDMSESSION=ubuntu
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/80290c7e_16ea_45ed_a50c_ef03f191ffe8
GNOME_TERMINAL_SERVICE=:1.192
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_IM_MODULE=ibus
GTK_MODULES=
HDFEOS_LIB=/home/andy/ocssw/opt/EOS/lib/linux64
_=/home/andy/ocssw/bin/seadas_info
HOME=/home/andy
HRPT_STATION_IDENTIFICATION_FILE=/home/andy/ocssw/share/seawifs/station/station_id.dat
IM_CONFIG_PHASE=2
J2D_PIXMAPS=shared
L2GEN_ANC=/home/andy/ocssw/var/anc
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/home/andy/jre1.8.0_201/jre/lib/amd64:/home/andy/jre1.8.0_201/jre/lib/i386:
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
LIB3_BIN=/home/andy/ocssw/opt/bin
LIB3_CHECK=0
LIB3_DIR=/home/andy/ocssw/opt
LIB3_INC=/home/andy/ocssw/opt/include
LIB3_LIB=/home/andy/ocssw/opt/lib
LOGNAME=andy
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
NAVCTL=/home/andy/ocssw/share/seawifs/nav
NAVQC=/home/andy/ocssw/share/seawifs/nav
OCDATAROOT=/home/andy/ocssw/share
OCSSW_ARCH=linux_64
OCSSW_BIN=/home/andy/ocssw/bin
OCSSW_DEBUG=0
OCSSWROOT=/home/andy/ocssw
OCSSW_SVN=localhost
OCTS_REGISTRATION_TABLES=/home/andy/ocssw/share/octs/nav
OCVARROOT=/home/andy/ocssw/var
ORBCTL=/home/andy/ocssw/share/seawifs/nav
PATH=/home/andy/ocssw/opt/bin:/home/andy/ocssw/bin:/home/andy/bin:/home/andy/.local/bin:/home/andy/bin:/home/andy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PGSINC=/home/andy/ocssw/opt/EOS/include
PGSLIB=/home/andy/ocssw/opt/EOS/lib/linux64
PROJ_LIB=/home/andy/ocssw/opt/share/proj
PWD=/home/andy/modis/test
QT4_IM_MODULE=xim
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=appmenu-qt5
SESSION_MANAGER=local/Fischer:@/tmp/.ICE-unix/2462,unix/Fischer:/tmp/.ICE-unix/2462
SHELL=/bin/bash
SHLVL=3
SSH_AGENT_PID=2570
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SWFTBL=/home/andy/ocssw/share/seawifs/qc
SWTBL=/home/andy/ocssw/share/seawifs
TERM=xterm-256color
TEXTDOMAINDIR=/usr/share/locale/
TEXTDOMAIN=im-config
USER=andy
USERNAME=andy
VTE_VERSION=5201
WINDOWPATH=2
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_ID=3
XDG_SESSION_TYPE=x11
XDG_VTNR=2
XMODIFIERS=@im=ibus

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

Re: import modules.ProcUtils as ProcUtils

by OB SeaDAS - xuanyang02 » Thu Feb 10, 2022 10:19 am America/New_York

Please change your script to call /home/andy/ocssw/bin/modis_GEO

You can also do

Code: Select all

export OCSSWROOT=/home/andy/ocssw
source $OCSSWROOT/OCSSW_bash.env
and then call $OCSSWROOT/bin/modis_GEO in your script

You need to add the following lines to your .bashrc file to configure your command line environment. See https://seadas.gsfc.nasa.gov/downloads/

export OCSSWROOT=/home/andy/ocssw
source $OCSSWROOT/OCSSW_bash.env

Post Reply