File: man_com.html

package info (click to toggle)
munipack 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,104 kB
  • sloc: cpp: 29,677; sh: 4,909; f90: 2,872; makefile: 278; python: 140; xml: 72; awk: 12
file content (345 lines) | stat: -rw-r--r-- 9,267 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- meta -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A general astronomical image processing software">
<meta name="author" content="Filip Hroch">
<link href="news_feed.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed" />
<link rel="stylesheet" href="munipack.css">
<link rel="shortcut icon" href="favicon.ico">
<title>Munipack ‒ Common options</title>
</head>
<body>
<header>
  <a href="munipack.html"><img src="big_logo.png" alt="Munipack's logo" class="head"></a>
  <div class="headtitles">
    <p class="head">
      <a class="headtitle" href="munipack.html">Munipack</a>
    </p>
    <p class="head">
      <a class="headsubtitle" href="munipack.html">The astronomical image processing software</a>
    </p>
  </div>
  <div class="buttons">
    <a href="guide.html" class="button">
      <div class="bicon">
	📘
      </div>
      <div class="hide">
	Guide
      </div>
    </a>
    <a href="docs.html" class="button">
      <div class="bicon">
	📁
      </div>
      <div class="hide">
	Documents
      </div>
    </a>
  </div>
</header>
<section>

<h1>Common options</h1>


<p class="abstract">
Commonly used options and switches.
</p>


<h2>Verbose output</h2>

<code>
$ munipack --verbose ... action and so on ...
</code>

<p>
  This switch enables detailed reports.
  The additional information can be useful for exploring
  of processing or in doubts.
</p>

<p>
  Without this switch,
Munipack respects standard UNIX philosophy:
<b>Only errors are reported. A silent run means no errors.</b>
It is very usefully for processing of large datasets because
only important errors should be delivered to users.
</p>

<h2>Simple Output Filenames</h2>

<pre>
-o name
--output name
</pre>
<p>
Specify an output file name for a single file. If the option is not
presented, the output name
is derived from the particular action name.
<!--
Use dash '-' for  redirection  to
the  standard  output.  Precede  the  filename  with exclamation
point (!) to overwrite of an existing FITS file.
In case that the name
is a directory, newly created file(s) are stored here.
-->
</p>

<h2>Target Directory</h2>

<pre>
-t directory
--target-directory=directory
</pre>

<p>
It would be useful to store output files in a specified directory.
The most typical use is storing modified files in a working directory
when original files are untouched.
</p>


<h2>Input filenames</h2>

<p>
  All actions for files expects a list of FITS files on
  input. The list can be specified on a command-line or given by
  a file.
</p>

<h3>Filenames as arguments</h3>

<p>
  The list of files to process. Usually as a names with wildcards (* or ?)
  equivalent to standard shell synatax.
  Example:
</p>
<pre>
  $ munipack fits one.fits more.fits red.fits nightmare.fits
  $ munipack fits -K DATE-OBS *.fits
  $ munipack bias bias*.fits
  $ munipack fits `find dir/ -name '*.fits'`
</pre>

<p>
  The first example shows the FITS structre of the files gived by hand.
  The second one show sthe structure for all files macthing the mask.
  The third line prepares bias from all frames by mask <samp>bias*.fits</samp>
  The last one illustrates scaning of FITS files troughout sub-directories.
</p>

<h3>An input file with filenames</h3>

<p>
  The input filename is powerfull alterantive to the argument lists
  in case of huge lists, the batch processing or arbitrary modification
  of output filenames.
</p>

<p>
  The input filename can be given by specifing <samp>@[input]</samp>
  or <samp>- [&lt; input]</samp> options:
</p>

<pre>
@[input]
- &lt; [input]
</pre>

<p>
  The @ (at) or - (dash) indicates to read from a standard input. (@ character
  has the same meaning like in classical softwares Iraf and Midas.)
</p>

<p>
The input from file is initiated with @ character followed a file-name (file.lst).
The file is a plain text file with single file per line. As example,
the content of the file.lst equivalent to the previous example:
</p>
<pre>
one.fits
more.fits
red.fits
nightmare.fits
</pre>
<p>
The file can be prepared by hand or prepared by the command with using
of <a href="https://en.wikipedia.org/wiki/Redirection_(computing)">shell redirection</a>
and <a href="https://en.wikipedia.org/wiki/Find">find</a> utility:
</p>
<pre>
$ ls *.fits > file.lst                  # files in current directory
$ find dir/ -name '*.fits' > file.lst   # all files in dir/, recursive
$ ls *.fits | munipack dark -           # filenames are piped from ls
</pre>

<p>
  An alternative form represents the input file in the form of
  two items per line. The items are separated by spaces,
  which means that spaces are not allowed in filenames.
</p>
<pre>
  input1.fits output1.fits
  input2.fits output2.fits
  input3.fits output3.fits
  ...
</pre>
<p>
  This form can be usefull in case when a complex renaming is required.
  It can be very usefull for cases like
</p>
<pre>
  ls 0716_*[VR].fits | awk '{a=$1; gsub(/0716/,"pks0716+71"); print a,$1;}' > input
  munipack phcorr @input
</pre>

<p>
  The use of two items is also allowed on command line. The items
  are stil separated by spaces so enclosing in apostrophes is
  necessory.
</p>
<pre>
  munipack fits --cat 'first.fits second.fits'
</pre>

<p>
There are also another a powerful way as
describes <a href="#advanced">Advanced Output Filenames</a> section.
</p>




<h2 id="advanced">Advanced Output Filenames</h2>

<pre>
-O
--pattern pattern (default: (.+)\.(.+))
--mask mask (default: empty)
--format format (default: empty)
</pre>
<p>
Specify a regular expression or a format to describe of an output file name(s).
The <samp>-O</samp> switch-on the advanced functionality (else the simple backup
with suffix is used). The pattern is a regular expression used to matching and
on will usually include bracket expression for back-references. The back-references
can be used in mask with \number. To test a regular expression, use sed:
<samp>sed s/pattern/mask/</samp>. <samp>--mask</samp> is used for newly created
files whilst <samp>--backup</samp> for specify of backup files.
</p>

<p>
The default pattern splits filenames onto two parts name and extension separated
by a dot (\.). The pattern recognizing algorithm uses
<a href="https://en.wikipedia.org/wiki/Regular_expression">Regular Expression</a>
rules syntax.
The parts are accessible via \number operator. The \0 means original
filename, \1 name and \2 extension.
</p>

<p>
The format is a standard format for output of
sequence images. To test a format, use <samp>printf "out%d.fits",666</samp>.
</p>

<p>
When just only <samp>-O</samp> is specified, backups are disabled.
</p>

<p>
When the advanced filename processing is set, the options <samp>-t,-S,-b</samp>
are ignored, because their functionality can be simply simulated.
</p>

<!--
<p>
When <samp>-O</samp> is specified but no other specificators (like masks, format)
are set, backups are disabled and the original file is modified in place.
</p>
-->


<p>Examples:</p>
<pre>
# store outputs in /tmp directory : -O --mask '/tmp/\0'
 barnard_0011R.fits -> /tmp/barnard_0011R.fits

# modify suffix: -O --pattern '(.+)\.fits' --mask '\1.fit'
 barnard_0011R.fits -> barnard_0011R.fit

# modify filename: -O --pattern '(.+)\.(.+)' --mask '\1_D.\2'
 barnard_0011R.fits -> barnard_0011R_D.fits

# alternate backups: -O --mask '\0.bak'
 barnard_0011R.fits -> barnard_0011R.fits.bak

# overwrite output: -O --mask '!\0'
 barnard_0011R.fits -> !barnard_0011R.fits

# list of numbered files: -O --format 'out_%02d.fits'
 barnard_0001R.fits -> out_01.fits

# disable backups: -O
 barnard_0001R.fits -> barnard_0001R.fits
</pre>


<p>See also: <a href="http://docs.wxwidgets.org/3.0/classwx_reg_ex.html">wxRegEx</a>,
<a href="http://docs.wxwidgets.org/3.0/classwx_string.html">wxString</a></p>




<h2>Numerical Data Types</h2>

<pre>
-B [8|16|32|-32]
--bitpix[=8|16|32|-32]
</pre>
<p>
Select bits per pixel of output images. Possible values are: 8
(0-255),  16  (0-65535),  32  (0-4294967296) for integer non-negative numbers
of ℕ set
and -32 (-10<sup>-38</sup> .. 10<sup>38</sup>, 6 decimal digits) for real numbers
of ℝ set, (values in braces indicates numerical ranges).
</p>

<p>
The parameter is set according to BITPIX in original frames for photometric
pre-corrections or set to -32 for derived images.
Defaults are usually satisfactory.
</p>

<p>
General guidelines: An optimal
bitpix  for raw (instrumental) data is 16 (default) which covers
a full range of digital  cameras.  The  representation  occupies
2 × width × height bytes.  Some  out  of  range  (rare) values will
be cut-off.
</p>

<p>
The representing by real numbers (eg. -32)
is  recommended value for images intended for further processing
because saves numerical precision and their numerical range (but
occupies of twice more space with respect to 16).
</p>

<p>
8-bits reduces range (eg. suppress dynamical range) and  32  wastes
a  lot  of storage place only.
</p>

</section>
<footer>
  © 1997 – 2025
  <a href="https://integral.physics.muni.cz/" title="author's homepage"
   class="foot">Filip Hroch</a>
</footer>
</body>
</html>