Commit 2961bc4c0f9812adeb48a58a877b79cc76dff960
1 parent
ca5c9a36
Adapt to handling of North IRFs
Showing
1 changed file
with
14 additions
and
4 deletions
cscripts/csadd2caldb.py
| ... | ... | @@ -114,6 +114,10 @@ class csadd2caldb(ctools.cscript): |
| 114 | 114 | # Loop over all members in tarfile |
| 115 | 115 | for member in tar.getmembers(): |
| 116 | 116 | |
| 117 | + # Skip member names starting with a dot | |
| 118 | + if member.name[0] == '.': | |
| 119 | + continue | |
| 120 | + | |
| 117 | 121 | # Get subarray |
| 118 | 122 | subarrays = '' |
| 119 | 123 | nsubarrays = 0 |
| ... | ... | @@ -129,7 +133,7 @@ class csadd2caldb(ctools.cscript): |
| 129 | 133 | if nsubarrays > 1: |
| 130 | 134 | subarrays = '' |
| 131 | 135 | |
| 132 | - # Extract Instrument | |
| 136 | + # Extract attributes | |
| 133 | 137 | if 'South-' in member.name: |
| 134 | 138 | site = 'South' |
| 135 | 139 | else: |
| ... | ... | @@ -149,10 +153,16 @@ class csadd2caldb(ctools.cscript): |
| 149 | 153 | else: |
| 150 | 154 | orientation = '' |
| 151 | 155 | azimuth = 90.0 |
| 152 | - | |
| 156 | + if 'D25' in member.name: | |
| 157 | + suffix = '_D25' | |
| 158 | + elif 'D27' in member.name: | |
| 159 | + suffix = '_D27' | |
| 160 | + else: | |
| 161 | + suffix = '' | |
| 162 | + | |
| 153 | 163 | elements = member.name.split('-') |
| 154 | 164 | zenith = [e for e in elements if 'deg' in e][0].strip('deg') |
| 155 | - instrument = '%s_z%s%s_%s%s' % (site, zenith, orientation, duration, subarrays) | |
| 165 | + instrument = '%s%s_z%s%s_%s%s' % (site, suffix, zenith, orientation, duration, subarrays) | |
| 156 | 166 | |
| 157 | 167 | # Build output directory |
| 158 | 168 | path = '%s/%s' % (outdir, instrument) |
| ... | ... | @@ -268,7 +278,7 @@ class csadd2caldb(ctools.cscript): |
| 268 | 278 | table.append(gammalib.GFitsTableStringCol('FILTER', 0, 10)) |
| 269 | 279 | table.append(gammalib.GFitsTableStringCol('CAL_DEV', 0, 20)) |
| 270 | 280 | table.append(gammalib.GFitsTableStringCol('CAL_DIR', 0, 70)) |
| 271 | - table.append(gammalib.GFitsTableStringCol('CAL_FILE', 0, 70)) # Extend beyond standard | |
| 281 | + table.append(gammalib.GFitsTableStringCol('CAL_FILE', 0, 128)) # Extend beyond standard | |
| 272 | 282 | table.append(gammalib.GFitsTableStringCol('CAL_CLAS', 0, 3)) |
| 273 | 283 | table.append(gammalib.GFitsTableStringCol('CAL_DTYP', 0, 4)) |
| 274 | 284 | table.append(gammalib.GFitsTableStringCol('CAL_CNAM', 0, 20)) | ... | ... |