Skip to content

Commit

Permalink
Environment variable HIPERCAM_DEFAULT_SOURCE introduced
Browse files Browse the repository at this point in the history
This is to allow the reset value of "source", the data source use by multiple routines to be set by the environment. The idea is that on the drpcs one really wants this to point to the servers, not to a local file. i.e.on the ULTRACAM and ULTRASPEC drpcs, set HIPERCAM_DEFAULT_SOURCE to ot "us", but on the HiPERCAM drpc, set it to "hs". Other users need not set this usually.
  • Loading branch information
trmrsh committed Mar 16, 2021
1 parent 1f710e4 commit 11c4433
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 13 deletions.
9 changes: 7 additions & 2 deletions hipercam/scripts/averun.py
Expand Up @@ -41,7 +41,11 @@ def averun(args=None):
| 'hf' : list of HiPERCAM hcm FITS-format files
'hf' is used to look at sets of frames generated by 'grab' or
converted from foreign data formats.
converted from foreign data formats. The standard start-off
default for ``source'' can be set using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export HIPERCAM_DEFAULT_SOURCE="us"`
would ensure it always started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : string [if source ends 's' or 'l']
run number to access, e.g. 'run034'
Expand Down Expand Up @@ -132,10 +136,11 @@ def averun(args=None):
cl.register("output", Cline.LOCAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul, hf]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul", "hf"),
)

Expand Down
9 changes: 7 additions & 2 deletions hipercam/scripts/ftargets.py
Expand Up @@ -66,7 +66,11 @@ def ftargets(args=None):
| 'hf' : list of HiPERCAM hcm FITS-format files
'hf' is used to look at sets of frames generated by 'grab' or
converted from foreign data formats.
converted from foreign data formats. The standard start-off
default for ``source'' can be set using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export HIPERCAM_DEFAULT_SOURCE="us"`
would ensure it always started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
device : string [hidden]
Plot device. PGPLOT is used so this should be a PGPLOT-style name,
Expand Down Expand Up @@ -248,10 +252,11 @@ def ftargets(args=None):
cl.register("yhi", Cline.GLOBAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul, hf]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul", "hf"),
)

Expand Down
11 changes: 10 additions & 1 deletion hipercam/scripts/grab.py
Expand Up @@ -40,6 +40,13 @@ def grab(args=None):
| 'us' : ULTRACAM server
| 'ul' : local ULTRACAM .xml/.dat files
The standard start-off default for ``source'' can be set
using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export
HIPERCAM_DEFAULT_SOURCE="us"` would ensure it always
started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : string
run name to access
Expand Down Expand Up @@ -101,6 +108,7 @@ def grab(args=None):
|grab| is used by several other scripts such as |averun| so take great
care when changing anything to do with its input parameters.
"""

command, args = utils.script_args(args)
Expand All @@ -124,10 +132,11 @@ def grab(args=None):
cl.register("dtype", Cline.LOCAL, Cline.HIDE)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul"),
)

Expand Down
10 changes: 9 additions & 1 deletion hipercam/scripts/makebias.py
Expand Up @@ -41,6 +41,13 @@ def makebias(args=None):
| 'us' : ULTRACAM server
| 'ul' : local ULTRACAM .xml/.dat files
The standard start-off default for ``source'' can be set
using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export
HIPERCAM_DEFAULT_SOURCE="us"` would ensure it always
started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : string
run name to access
Expand Down Expand Up @@ -97,10 +104,11 @@ def makebias(args=None):
cl.register("output", Cline.GLOBAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul"),
)

Expand Down
10 changes: 9 additions & 1 deletion hipercam/scripts/makedark.py
Expand Up @@ -42,6 +42,13 @@ def makedark(args=None):
| 'us' : ULTRACAM server
| 'ul' : local ULTRACAM .xml/.dat files
The standard start-off default for ``source'' can be set
using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export
HIPERCAM_DEFAULT_SOURCE="us"` would ensure it always
started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : string
run name to access
Expand Down Expand Up @@ -98,10 +105,11 @@ def makedark(args=None):
cl.register("output", Cline.GLOBAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul"),
)

Expand Down
9 changes: 7 additions & 2 deletions hipercam/scripts/makeflat.py
Expand Up @@ -84,7 +84,11 @@ def makeflat(args=None):
| 'hf' : list of HiPERCAM hcm FITS-format files
'hf' is used to look at sets of frames generated by 'grab' or
converted from foreign data formats.
converted from foreign data formats. The standard start-off
default for ``source'' can be set using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export HIPERCAM_DEFAULT_SOURCE="us"`
would ensure it always started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : str [if source ends 's' or 'l']
run number to access, e.g. 'run034'
Expand Down Expand Up @@ -171,10 +175,11 @@ def makeflat(args=None):
cl.register("output", Cline.LOCAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul, hf]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul", "hf"),
)

Expand Down
9 changes: 7 additions & 2 deletions hipercam/scripts/reduce.py
Expand Up @@ -75,7 +75,11 @@ def reduce(args=None):
| 'hf': list of HiPERCAM hcm FITS-format files
'hf' is used to look at sets of frames generated by 'grab' or
converted from foreign data formats.
converted from foreign data formats. The standard start-off
default for ``source'' can be set using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export HIPERCAM_DEFAULT_SOURCE="us"`
would ensure it always started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
run : str [if source ends 's' or 'l']
run number to access, e.g. 'run034' or a file list. If a run,
Expand Down Expand Up @@ -226,10 +230,11 @@ def reduce(args=None):
cl.register("yhi", Cline.GLOBAL, Cline.PROMPT)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul, hf]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul", "hf"),
)

Expand Down
9 changes: 7 additions & 2 deletions hipercam/scripts/rtplot.py
Expand Up @@ -61,7 +61,11 @@ def rtplot(args=None):
| 'hf' : list of HiPERCAM hcm FITS-format files
'hf' is used to look at sets of frames generated by 'grab' or
converted from foreign data formats.
converted from foreign data formats. The standard start-off
default for ``source'' can be set using the environment variable
HIPERCAM_DEFAULT_SOURCE. e.g. in bash :code:`export HIPERCAM_DEFAULT_SOURCE="us"`
would ensure it always started with the ULTRACAM server by default. If
unspecified, it defaults to 'hl'.
device : string [hidden]
Plot device. PGPLOT is used so this should be a PGPLOT-style name,
Expand Down Expand Up @@ -323,10 +327,11 @@ def rtplot(args=None):
cl.register("thresh", Cline.LOCAL, Cline.HIDE)

# get inputs
default_source = os.environ.get('HIPERCAM_DEFAULT_SOURCE','hl')
source = cl.get_value(
"source",
"data source [hs, hl, us, ul, hf]",
"hl",
default_source,
lvals=("hs", "hl", "us", "ul", "hf"),
)

Expand Down

0 comments on commit 11c4433

Please sign in to comment.