log

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
bbroman93
Posts: 38
Joined: Fri Feb 01, 2019 11:04 am America/New_York
Answers: 0

log

by bbroman93 » Thu Jun 20, 2019 6:49 pm America/New_York

Is there a function I can use at the command line to apply logarithm to my chlorophyll anomalies once they are calculated?

Tags:

OB WebDev - norman
Subject Matter Expert
Subject Matter Expert
Posts: 142
Joined: Tue Feb 09, 2021 8:19 am America/New_York
Answers: 0

log

by OB WebDev - norman » Fri Jun 21, 2019 9:31 am America/New_York

It's not SeaDAS, but you could use the standard linux program, bc, like this.

cat <<EOF >sample_chl_anomalies.txt
0.02
0.014
2.4
0.26
0.089
0.37
EOF

for c in `cat sample_chl_anomalies.txt`; do
  echo "l($c)" | bc -l >> log_sample_chl_anomalies.txt
done

Or you could use my favorite, reverse-polish, command-line calculator from the
GMT folks that provides a lot more mathematical functionality.

gmt math sample_chl_anomalies.txt LOG = log_sample_chl_anomalies.txt

Regards,
Norman

Post Reply