- Subject Matter Expert
- Posts: 225
- Joined: Thu Mar 05, 2009 10:25 am America/New_York
What is worse is I am only using the workflow I am using (L2 OC files > l2bin > L3b files > l3mapgen) because I can't figure out how to use gpt.command to reproject many files and save to files with all bands that I can use in R to calculate chlor_a with a Great Lakes-specific algorithm (R workflow uses raster package). Would prefer, I think, to use L2 data anyway.
Maybe I need a new workflow. Too bad as the existing R code works nicely.
Have you seen Upgrade to bash 4 in macOS? This illustrates a few ways to manage the shell version used in a particular script. On recent versions of MacOS, Apple System Integrity Protection should prevent replacing
/bin/bashwith a symbolic link to
/usr/local/bin/bash. It is, however, possible to disable SIP. The first line of your script reads "
#!/bin/bash", so if you are using bash 4 in a terminal the script could be getting different settings. From the examples in the "Upgrade to bash 4 " link you should be able to devise some scirpts to display key varaibles in
different shell environments.
l2binworks from a shell prompt that points to some difference in the environment between the script and the prompt. You can start from a very simple script and add back the extra parameter passing and checking logic to see if you can figure out where things go wrong.
Not sure how I will get to the point of "things working". And I wish I knew much earlier that issues with installation can have such far reaching impacts. I would have taken greater care.
One thing that is nonstandard about my system is that it is a Mac. That might be standard where you work, but is not where I work (USGS) and the implementation of security and other policies is not, in my opinion, well thought out even for Windows systems. And the support for Macs, so far, has not been good.
This feature of my system, is, in all likelihood, part of the puzzle.
Do you mean that there is something causing ocssw to look for files in the wrong place?
In the meantime, I've modified my R code that uses L2 OC data and the raster and plotKML packages to estimate chlor_a so that it now also maps the estimated chlor_a. While it is likely a different mapping procedure than is employed by OBPG products, it is still based on the principle of resampling and I can provide the code to anyone who wants to use it. As long as the packages I used persist anyway.
I suggest you set up a new "ocssw" account andt install using only the command-line (the default location will be
~/ocssw). In the long run, having such a bare-bones account is often helpful for troubleshooting other issues. If you still having network problems, follow the offline installation instructions (download the git bundles and use the
--local=<bundle_directory>option as well as the appropriate branch and sensor). You will need to use Anaconda python 2.7to run the installer and add lines to set the OCSSW variables to the "
/Users/ocssw/.bashrc". Logout and back in to get the settings in a terminal and run
update_luts.pyto make sure everything is current. It is very likely that will get
l2bingoing, itf not the next step would be a basic install of macOS (e.g., on an external disk).
Once you have a configuration that runs
l2binwithout the segmentation faults, you can proceed with your processing and track down the difference at leisure.
I do have R processing the stuff ok but slowly. Something close to 30 seconds per scene with parallelization using foreach().