capturing standard output from a python script that calls lonlat2pixline

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
monger
Posts: 29
Joined: Wed May 26, 2010 4:19 pm America/New_York
Answers: 0

capturing standard output from a python script that calls lonlat2pixline

by monger » Fri May 25, 2018 9:23 am America/New_York

Hi -- Did you folks change something with lonlat2pixline in seadas 7.5? With seadas 7.4, I used subprocess.Popen and subprocess.communicate() commands to obtain the standard output from the call to lonlat2pixline in my python (2.7) program and now it does not seem to work.

p= subprocess.Popen('lonlat2pixline -v ' + fname_l1a + ' ' + fname_geo + ' ' + west  + ' ' + south  + ' ' + east + ' ' + north, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)   
stdout,stderr = p.communicate()

It captures some of the output, but not the last important bit of lines and pixls before preceding to the rest of the program with this missing [important] information. 

I realize this is more of a python question than a seadas question, but I've been banging my head long enough-- and figured you might have a 2 second answer for me.

Regards
Bruce

Hi--- As follow-up... I figured out "my" problem.  I re-downloaded a new viirs L1A file and things worked just fine with capturing the output of lonlat2pixline.  Sorry if my questions sent you off spending time checking on lonlat2pixline.   --Bruce

Filters:

OB.DAACx - SeanBailey
Posts: 1519
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 9 times

capturing standard output from a python script that calls lonlat2pixline

by OB.DAACx - SeanBailey » Wed May 30, 2018 3:12 pm America/New_York

> Hi--- As follow-up... I figured out "my" problem.  I re-downloaded a new viirs L1A file and things worked just fine with capturing the output of lonlat2pixline.  Sorry if my questions sent you off spending time checking on lonlat2pixline.


No worries :grin:

BTW, lonlat2pixline can read a MODIS GEO file directly (and it's faster than if you give it the L1A/GEO combo since it can skip the L1A load)....and you probably don't need the -v option either.

Regards,
Sean

Post Reply