Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/astroumd/lmtoy
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Nov 10, 2024
2 parents 78346ad + 54c355e commit 5c94d3d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,13 @@ bench1:
@echo "================================================================================================================="
@echo xdg-open $(WORK_LMT)/2014ARSRCommissioning/33551/README.html

## bench1a: RSR benchmark with identical combination
## bench1a: RSR benchmark with a combination
bench1a:
$(TIME) SLpipeline.sh obsnums=33551,33551 restart=1 admit=$(ADMIT) meta=$(META)
$(TIME) SLpipeline.sh obsnum=33552 restart=1 linecheck=1 public=2020-12-31 qagrade=3 admit=$(ADMIT) meta=$(META)
$(TIME) SLpipeline.sh obsnums=33551,33552 restart=1 admit=$(ADMIT) meta=$(META)
@bash -c 'source lmtoy_functions.sh ; printf_green_file etc/bench1a.txt'
@echo "================================================================================================================="
@echo xdg-open $(WORK_LMT)/2014ARSRCommissioning/33551_33552/README.html

## bench1b: RSR dryrun archive submission using dvpipe (needs bench1)
bench1b:
Expand Down
10 changes: 7 additions & 3 deletions bin/lmtoy_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# some functions to share for lmtoy pipeline operations
# beware, in bash shell variables are common variables between this and the caller

lmtoy_version="4-nov-2024"
lmtoy_version="7-nov-2024"

echo "LMTOY>> lmtoy_functions $lmtoy_version via $0"

Expand Down Expand Up @@ -484,10 +484,14 @@ function lmtoy_rsr1 {
echo "regress=\"$regress\"" >> $rc
if [ $obsgoal = "LineCheck" ]; then
echo "LMTOY>> LineCheck $xlines"
echo "LMTOY>> LineCheck $linecheck $xlines"
rm -f spec1.tab spec2.tab
# good for I17208, I12112, I10565
xrange=106:111
if [ $linecheck == 1 ]; then
xrange=106:111
else
xrange=$linecheck-2:$linecheck+2
fi
echo "# tabnllsqfit $spec1 fit=gauss1d xrange=$xrange" > linecheck.log
tabnllsqfit $spec1 fit=gauss1d xrange=$xrange out=spec1.tab >> linecheck.log 2>&1
echo "# tabnllsqfit $spec2 fit=gauss1d xrange=$xrange" >> linecheck.log
Expand Down
26 changes: 15 additions & 11 deletions bin/mk_metadata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env python
#

_version = "4-nov-2024"
_version = "6-nov-2024"

_doc = """Usage: mk_metadata.py [options] [OBSNUM]
Expand Down Expand Up @@ -47,7 +47,7 @@



def header(rc, key, debug=False):
def header(rc, key, multi=False, debug=False):
"""
input:
rc dictionary from the rc file
Expand All @@ -62,11 +62,14 @@ def header(rc, key, debug=False):
if rc[key].find(",") < 0:
return rc[key]
else:
print(
"# PJT: header %s not single valued: %s, using first" % (key, rc[key])
)
# return first
return rc[key].split(",")[0]
if multi:
return rc[key]
else:
print(
"# PJT: header %s not single valued: %s, using first" % (key, rc[key])
)
# return first
return rc[key].split(",")[0]
else:
if debug:
print("# PJT: unknown key ", key)
Expand Down Expand Up @@ -282,7 +285,7 @@ def get_qagrade(rc, debug=False):
obsnum = header(rc, "obsnum")
if obsnum.find("_") > 0:
isCombined = True
obsnums = header(rc, "obsnum_list")
obsnums = header(rc, "obsnum_list", multi=True)
else:
isCombined = False
obsnums = ""
Expand All @@ -298,6 +301,7 @@ def get_qagrade(rc, debug=False):
# opacity225 - opacity at 225 GHz (can be 0)

if isCombined:
# print("PJT combined",obsnums)
# assemble all obsinfo's for all obsnum's in the combo
p = header(rc, "ProjectId")
for o in obsnums.split(","):
Expand All @@ -313,12 +317,12 @@ def get_qagrade(rc, debug=False):
if True:
# native yaml
y = yaml.safe_load(fp)
o = y["obsInfo"][0]
o1 = y["obsInfo"][0]
else:
# directly using out dvpipe @todo this doesn't work
y = MetadataBlock(yamlfile=fn, load_data=True)
o = y.metadata["obsInfo"][0]
lmtdata.add_metadata("obsInfo", o)
o1 = y.metadata["obsInfo"][0]
lmtdata.add_metadata("obsInfo", o1)
ref_id = data_prod_id.make_lmtoy_data_prod_id(obsnums.split(","))
else:
obsinfo = dict()
Expand Down
5 changes: 2 additions & 3 deletions bin/rsr_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
#
#

_version="rsr_pipeline: 9-aug-2023"
_version="rsr_pipeline: 7-nov-2024"

echo "LMTOY>> $_version"

#--HELP
# input parameters (only obsnum is required)
# - start or restart
obsnum=0 # this is a single obsnum pipeline (obsnums=0)
obsid="" # not used yet
pdir="" # where to do the work

# - PI parameters
Expand All @@ -30,7 +29,7 @@ badlags="" # set to a badlags file if to use this instead of dynamically gene
shortlags="" # set to a short_min and short_hi to avoid flagged strong continuum source lags, e.g. shortlags=32,10.0
spike=3 # spikyness of bad lags that need to be flagged

linecheck=0 # set to 1, to use the source name to grab the correct xlines=
linecheck=0 # set to 1, to use the source name to grab the correct xlines= (or a freq to check for a nearby peak)
bandzoom=5 # the band for the zoomed window (0..5)
speczoom="" # override bandzoom with a manual speczoom=CENTER,HALF_WIDTH pair
rthr=0.01 # -r option for rsr_driver Threshold sigma value when averaging single observations repeats
Expand Down

0 comments on commit 5c94d3d

Please sign in to comment.