Commit c3513cb3 authored by Marco Kurzynski's avatar Marco Kurzynski
Browse files

moved NBBtemp and IBBtemp to env variables

parent b1298078
......@@ -11,6 +11,7 @@ def set_env():
os.environ.setdefault('WTIB', '0.811 0.0945 0.0945')
os.environ.setdefault('TOSIB', '0.0 0.0 0.0')
os.environ.setdefault('NRNGS', '1')
os.environ.setdefault('IBBTEMP', '273.182')
os.environ.setdefault('C1_WN', '900 1100')
os.environ.setdefault('C2_WN', '2100 2200')
......
......@@ -48,7 +48,15 @@ def interpolate(xin, yin, xout):
return val
def process(c1_file, c2_file, records, NBBtemp=None, IBBtemp=None, abb_breakout=None, output_path=''):
def process(c1_file, c2_file, records, abb_breakout=None, output_path=''):
try:
NBBtemp = float(str.strip(os.environ.get('NBBTEMP')))
except TypeError:
NBBtemp = None
try:
IBBtemp = float(str.strip(os.environ.get('IBBTEMP')))
except TypeError:
IBBtemp = None
return process_helper(1, c1_file, records, NBBtemp, IBBtemp, abb_breakout, output_path), process_helper(2, c2_file, records, NBBtemp, IBBtemp, abb_breakout, output_path)
def process_helper(channel_number, channel_file, records, NBBtemp=None, IBBtemp=None, abb_breakout=None, output_path=''):
......
......@@ -20,12 +20,6 @@ matplotlib_logger.setLevel(logging.WARNING)
logger = logging.getLogger(__name__)
# Metadata override or another bbcal.in1 & bbcal.in2 files
# If the data is in another file set to 0 & create a
# bbcal.in3 & bbcal.in4 files
# NBBtemp=317.925
IBBtemp = 273.182
def to_int(arg):
try:
......@@ -589,7 +583,7 @@ def main(directory, output_dir=None, record_range=None, excluded_records=None, s
logger.info('Record {0} scene mirror position = {1}'.format(record, sceneMirrorPositions[record - 1]))
# Returns wavenumbers, obs_ice, pred_ice, obs_3body, pred_3body
logger.debug('Running bbcal')
lw,sw = bbcal.process(str(c1_file), str(c2_file), record, IBBtemp=IBBtemp, output_path=output_path)
lw,sw = bbcal.process(str(c1_file), str(c2_file), record, output_path=output_path)
if sceneMirrorPositions[record - 1] == 83:
NBB.append((record, times[record - 1], lw[5], sw[5]))
......@@ -618,7 +612,7 @@ def main(directory, output_dir=None, record_range=None, excluded_records=None, s
logger.info('Record {0} scene mirror position = {1}'.format(records[-1],
sceneMirrorPositions[records[-1] - 1]))
# Returns wavenumbers, obs_ice, pred_ice, obs_3body, pred_3body
lw,sw = bbcal.process(str(c1_file), str(c2_file), records, IBBtemp=IBBtemp, output_path=output_path)
lw,sw = bbcal.process(str(c1_file), str(c2_file), records, output_path=output_path)
make_NBB_plot(str(c1_file), lw, sw, records, output_path)
make_IBB_plot(str(c1_file), lw, sw, records, output_path)
......@@ -644,6 +638,8 @@ if __name__ == '__main__':
f"{' WTIB' : <24}IBB Apex, Bottom and Top weightings (defaults to '0.811 0.0945 0.0945')\n" \
f"{' TOSIB' : <24}IBB Apex, Bottom and Top offsets (defaults to '0.0 0.0 0.0')\n" \
f"{' NRNGS' : <24}Read number of ranges (defaults to '1')\n\n" \
f"{' IBBTEMP' : <24}IBB temperature (defaults to '317.925')\n\n" \
f"{' NBBTEMP' : <24}NBB temperature (no default)\n\n" \
f"{' C1_MLTFILE' : <24}MLT output filename for channel 1 (defaults to 'bbcal_YYMMDD.mlt1')\n" \
f"{' C1_LOGFILE' : <24}Log output filename for channel 1 (defaults to 'bbcal_YYMMDD.lo1')\n" \
f"{' C1_SUMFILE' : <24}Sum output filename for channel 1 (defaults to 'bbcal_YYMMDD.sum1')\n" \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment