Debian Codegraph @

planning/pysyn_file_rationalization.txt

raw
1 Requirements:
2 ------------
3
4 1. Pysynphot must support the following scenarios for data file access:
5
6 A. CDBS: All data files are obtained from the CDBS tree.[ETC ops.]
7
8 B1. Customized CDBS, override: All data files are obtained from the
9 CDBS tree *except* for one or more specific directories (e.g., the
10 NICMOS throughput files, or the graph/component tables). [Testing]
11
12 B2. Customized CDBS, augment: All data files are obtained from the
13 CDBS tree, including one or more additional directories provided
14 by the user.
15
16 C. Standalone user: Pysynphot still works for Bessell/Cousins/Johnson
17 photometric calculation without CDBS installed
18
19 D. Customized user: The user provides her/his own preferred set of
20 supported bandpasses.
21
22 2. No hardcoded filenames should be included in the Pysynphot code.
23
24 3. Synphot and Pysynphot must have the same definitions for variables
25 used in the TMC file (component table).
26
27
28 Proposed Solutions:
29 ------------------
30
31 Requirement 1:
32 -------------
33 The PYSYN_CDBS environment variable is already defined and used to point
34 to the directory where pysynphot expects to find its reference
35 files. Its use will be modified to support the various cases as follows:
36
37 A. PYSYN_CDBS points to the top level of an installed CDBS directory.
38
39 B. PYSYN_CDBS points to the top level of an installed CDBS
40 directory. B1: Environment variables are set to override the desired
41 directories (eg crnicmoscomp or mtab). B2: User adds new directories,
42 and edits the CDBS_STRUCT.txt file described below to add shorthand
43 names for them.
44
45 C. PYSYN_CDBS is set to an empty or blank string. Pysynphot will use its
46 locally bundled data, including the Vega spectrum.
47
48 D. PYSYN_CDBS points to a directory containing the file
49 SIMPLE_CDBS.txt. The file should contain keyword-value pairs mapping from
50 bandpass specification to throughput file, eg:
51
52 2mass,j = 2mass_j.fits
53 v = myccd_v.dat
54
55 The files should also be located in the PYSYN_CDBS directory. This
56 mapping will be added to the locally bundled mapping, and may override
57 elements of it. Users may then specify bp=Band('2mass,j') as
58 shorthand for bp=FileBandpass('/full/path/spec/2mass_j.fits').
59
60
61 Requirement 2 (relevant to cases A/B only):
62 ------------------------------------------
63
64 The top level CDBS directory will contain a file named
65 CDBS_STRUCT.txt. It will contain a mapping such as:
66
67 cracscomp ./comp/acs/
68 mtab ./mtab/
69 crgridk93models ./grid/k93models/
70
71 This file itself will be under configuration control by the CDBS
72 group.
73
74 Pysynphot will read this file and construct a dictionary that will
75 then be used to translate the shorthand names
76 (cracscomp$) to full file paths. Environment variables will always be
77 checked first and will override the dictionary value if present.
78
79
80
81 Requirement 3 (relevant to cases A/B only):
82 ------------------------------------------
83
84 STSDAS will be modified so that:
85 - none of the variables presently defined in zzsetenv.def in terms
86 of crrefer will be defined there. (crrefer itself will still be
87 defined in extern.pkg.)
88 - stsdas.cl will run a script that reads the CDBS_STRUCT.txt file
89 and sets the corresponding variables based on this definition,
90 unless a corresponding environment variable has already been defined.
91
92 Note that this change provides more flexibility for user installations
93 of stsdas/cdbs. Definitions of the shorthand variables are visible with
94 the CDBS files instead of buried in the zzsetenv.def. New variables
95 can be easily defined without requiring code changes.