2020-12-29
The Last Post
2015-01-05
Photon Calibration Release
Developing of Astromill contributes tree new important features into Munipack:
Photometry Calibration
- (approximate) calibration of a carefully selected reference frame against to a catalogue (standard field stars) in absolute fluxes.
- And follow up calibration of all other frames against to the reference.
Flat-fields
- averaged flat,
- new scaling against to the flat and new averaging.
Packages Repository
2014-04-01
Nights Without Convergence
With a presumption of Normal (Gaussian) distribution of data, the location parameter (centre of distribution) is independent on its scale and moreover, the estimate of the scale by conventional methods (standard deviation, mean of absolute deviations) is optional and naturally guaranties minimal noise and maximal information. Processing of data with other distributions, which we are supposing when robust algorithms are applied, also requires estimate of its scale (standard deviation) of the distribution together with the location.
From numerical mathematics point of view, this is a standard task. One can use the method of maximum likelihood, the likelihood function will be constructed and its minimum is determined to get parameters. Another standard way is to derive a gradient of the function and use an appropriate numerical library to locate minimum from an initial estimate.
Unfortunately, I revealed during the sleepless nights, that the gradient way can fail when the original function is not quadratic (opposite to the least square method). In this case, the false (artificial) features are appearing and I spend nights by looking for its convergence criterion.
The final result, on figures, is self-describing. When initial estimate of the gradient method falls inside of pit, on the left from the artificial throat, a method converges. When we are starting on the right, the algorithm is non-convergent or with minimum in infinity.
A non-gradient method without derivatives locates the minimum easy and unique (and unfortunately slowly).
As the result of all the sleepless nights, users of Munipack benefits in less scattered estimates of averaged biases, darks, flats, sky backgrounds, photometry calibrations,…
Closing doors
I'm closing Munipack's site on Google Code because separation on development and stable sites was source of confusing for many users. The content of wiki has been merged to main site and Mercurial repositories will be sometimes updated.
Together with the change, I thinking also about closing of mailing lists and Google plus page which are practically abandoned.
2013-07-31
Photon Rain
The developed implementation along with the new matching algorithm are superseding importantly of Classical release.
The implemented features are two extremely difficult tasks:
- transformation between photometric systems
- full photometric calibration
- Removed superfluous loops (speed-up about 100x), matching has additional criterion for similarity of observed counts and expected photons (improve robustness in crowded fields where stars can be easy interchanged, also reduces back-tracking tree and therefore importantly improve the algorithm speed). The computing of angle between stars in normal space is included as an independent quality test. The star sequences are closed paths now to reduce length of sequences and improve robustness.
- UCAC4 is now default astrometry catalogue.
- Proper motion is introduced.
- Just stars with valid aperture photometry are used for matching (all detected sources had been used and the approach may produce a lot of garbage for improperly corrected images).
- Developed a new approach for frame photometry pre-corrections (bias, dark, flat). Renamed (and redesigned) modules for the corrections. A single command for the corrections (replacing darkbat and flatbat) has been introduced. It is implemented possibility of masking of a part of image.
- Basic FITS header modifications are implemented including to update of header's keywords. A FITS file can be dumped to a text file and restored again (useful to create of tables).
- Internal FITS tables has different column naming schema to be more compatible with Virtual Observatory conventions. Also some command-line options has been modified for that reasons.
- For known data sources, the long options (--col-ra, --col-mag ..) has default values and ones can be provided optionally.
- Structure of both FITS tables and extensions has been changed drastically and any older preprocessed data are no more compatible (!) with files produced by this version.
- Building system - Building scripts (in dist/) has been improved to separate the installation to independent bundles (packages) and as the system-wide one. There is also possibility to install Munipack without wxWidgets.
- Developed light-curve (or any quantity) time series FITS-flavor format as a simpler version of SimpleTimeseries.
- GUI updated to match modern desktop conventions (for GNOME 3/ Gtk 3+).
- Huge expansion of documentation.
- using of shell-environment variable containing substring DATE-OBS
- A negative declination is recognised as a number (not as a command-line confusing switch).
- GUI has only minor improvements (=practically none).
- None from New features has no support in GUI (except new photometric quantities box in side panel of View).
- There are problems with non-English locales. Numbers with commas (replacing dots) are still recognised unsatisfactory (the behaviour is perhaps random and very difficult for testing by myself).
2012-12-25
Astronomy HDR still in its infancy
Softening contrast
I've currently experience with using global mapping methods which non-linearly compress high to low ranges. When, we defines contrast as ratio of intensity of a detail against to a local mean, the contrast is compressed together with intensity. As result of the compression, pictures has characteristically softened details.
Perhaps our perceive prefers the contrast over global luminance, the main problem of HDR photography is compress of the global luminance while preserving the local contrast.
Luminance HDR
During last summer, I've spend some time with algorithms for rendering HDR images. The project which I've been studied deeply is Luminance HDR. Advanced algorithms included in the package works well (at least acceptable) on both normal (landscapes, interiors or erotic photographs, etc) and astronomical scenes.
Earthshine
The algorithm for taking photos has been:
- I taken set of exposures with different exposure times to cover full range of intensities. I'm preferring division by two sequence: 16,8,4,.. 1/32,1/64... For long-exposure night scenes and high ISOs, darks are necessary.
- ll images are unified on same exposure time. Images are spatially (angular) arranged and composed by weighting summation. Weights are choose as a function with maximum in half saturation range and zero outside the range (pfscalibration).
- The tone mapping maps HDR to a limited range. The package offers many methods, but for my requirements, the just "A Perceptual Framework for Contrast Processing of High Dynamic Range Images" by Rafał Mantiuk, Karol Myszkowski, Hans-Peter Seidel is acceptable (source).
- Some aureole, worse contrast and lower resolutions are visible. I'm meaning ones are products of too-rough arranging (needs better subpixels). Note that all images are published in two- or tree-times binning.
- I've worry about correct showing of really full range, single exposures shows even more details.
- Also many defect (black areas in clouds, purple in dark exposures) are corrupting visually images.
- I've no ideas about better intensity profile (just gamma is used).
- The best rendering algorithm is Mantinuk's. Acceptable results gives also Fattal (both removes gradients). All others, including Gaussian blurring, practically works on base of global methods and gives poor results in contrast.
- The night exposures are even worse, probably growing noticed defects.
- As the best rendering, I'm supposing images which are visually indistinguishable against to original scene (by my eye). Various strongly-coloring pictures looks cool, but ones are out of my interest.
2012-10-06
New Photo Preprocessing
As the photometric preprocessing I means photometric corrections:
- correction for dark current (dark frame),
- removing of preamplifier offset (bias),
- correct a variable light response of (CCD) detector together with whole optical system (flat-field).
New approach is modeled as following the widely reccomended method in today. A photometrically corrected image Icij is computed for every input image Iij as
Icij = (Iij - t Dij - Bij) / fij,
where i,j is an index of a pixel, Dij is a dark frame t is ratio of exposure times of I and D. Bij is the bias and fij is normalized flat-field frame (to save absolute photometric fluxes):
fij = Fij / 〈Fij〉.
〈Fij〉 means averaged level determined by robust mean.
I think the change does not cause any controversy. More over:
- The older approach is still available when bias is treated as zero.
- From previous point of view, the approach is just primary a new façade for users. More easy user's usage.
- User is not confused. The method is exactly the same as textbooks describes.
- Important parts of algorithms are the same, changes in functional parts are minor.
- Observation time save. A long-exposure dark would be prepared and applied to all shortest exposures (also on longer ones, but the noise can devalue frames).
- Bias exposures are very short, so acquisition of a lot of biases it is not too time consuming.
- Processing tools has improvements in use of previous data products and no temporary reduction of frames are created.
2012-06-28
New Generation Release
I finished modernization of Munipack the engine during this spring. By the way, the incoming release fully replaces of the classic edition 2009. All the functionality is recovered again (and many many other is added).
All the current functionality has origin in all-inclusive representation of FITS (images has added all processed data as the additional HDU). On the base I prepared new versions of:
- astrometry,
- photometry,
- listing of data (star catalogues, light curves),
- composition of images.
The classic edition tagged as 0.4.2 is to be supposed obsolete now and its functionality is fully superseded.
Now, Munipack is prepared as to be suitable for regular data processing since this release. Please be careful, really extensive testing is still necessary!
Many of the implemented features has GUI unfinished (unprepared).
Astrometry
Astrometry part has been improved in many points:
- advanced GUI dialog,
- batch GUI dialog,
- the matching has been theoretically studied and the algorithm is practically developed from scratch,
- the robust fitting part has been improved by more simplifying and fine tuning of the algorithm,
- GUI contains visualization of matching:
Robust Algorithm
Very important improvement is included in the robust algorithm, the core of all robust estimation. Since this release, I used estimate of median by a fast algorithm by Dijskra (see Wirth (1976)) which can get n/2-th element of n sequence. One is excellent for many data (over twenty) but the ignorance of the correct definition of median (which is mean for even) has poor impact on estimate in case of a few points.
The algorithm of median (scatter) estimation is newly modified. For a few points, the median is estimated using of a sorted sequence (with sorting ~n*log(n) complexity) and the definition. For many points, the algorithm is unchanged and by using of the fast algorithm (with ~n complexity).
Results seems more precise and stable.
Localization
There is an unsolved problem with localization. Many my colleagues has installed localized version of a GNU/Linux distribution which is confused by a decimal dash (no decimal point) in real numbers so the underlying software (wxWidgets) must use locale rules to convert numbers to the right format. So I prepared a (untested) code to be locale-friendly.
Unfortunately, there is no complete solution of the problem. There are many examples where the points must be left: VO related and FITS header must contains only ASCII characters.
Other changes:
- HTML documentation updated to HTML5,
- Docs has been restructured and extended for description of completed features and tutorials,
- Helping utilities konve and picko has been removed from main tree and are available as independent applications (but included to binary version),
- backup strategy replaces FITS conventions and implements the standard GNU backup behavior,
- better processing of output filenames in batch,
- improvement and bugfix in displaying of images,
- created a photometry GUI dialog,
- rewrite of munilist (added listing of all objects,..) and kombine (works with spherical coordinates which enable geometrical transformations and mosaicking),
- updated for a new versions of g++/gfortran and wxWidgets,
- patchelf utility needed for binary distribution has been fully replaced by -rpath option,
- clarified verbose/pipelog prints.
Summer Plans:
- update GUI + add GUI for remaining features,
- a library for image/color processing (common to fitspng) (?),
- use slalib.
Acknowledgment
Many thanks for my students which has been first testing persons of new versions. Many errors has been identified and corrected during the testing period.
2012-04-19
Benchmarking of mathematical co-processors
My inspection of glibc sources revealed that numerical functions provided by GNU glibc just only wraps implementation of ones by mathematical co-processor. No own rational approximation is implemented. The hardware support is directly assured by C99 IEEE standard.
Following the track, I created a small test code to test duration of execution various computing functions in GNU system math library. One is practically tests implementation of the functions in mathematical co-processors.
Fortran
program funs
integer, parameter :: double = selected_real_kind(15)
integer, parameter :: nsteps = 10000
integer :: i,j
real(double) :: x,y, s, xsteps = nsteps
s = 0.0
do j = 1,nsteps
do i = 1,nsteps
x = i/xsteps
y = x*(1.0_double/3.0_double)
s = s + y
end do
end do
write(*,*) s
end program funs
C
(note that no-effect summations and return values are added to prevent compiler's over-optimizations)
The function in line /*!*/ have been changed.
Computations has been done on Intel(R) Core Quad and verified on Intel(R) Xeon machines (cca 30% faster). The gcc and gfortran compilers gives the same results, gfortran may give a litte bit faster code).
Results are summarized in following table.
Core Quad
[nsec] [nsec] ratio fortran i686
-O -O4 -O4
pow(x,1.0/3.0) 128.56 123.01 7.2 123.06 287.68
exp(1/3*log(x)) 120.21 116.14 6.8 117.14 269.20
cbtr(x) 90.15 85.79 5.0 - -
sinh(x) 95.15 91.80 5.4 91.99 235.34
log10(x) 95.74 91.14 5.4 91.73 95.35
atan2(x,2.0) 83.94 79.22 4.6 79.09 106.00
log(x) 79.30 74.98 4.4 74.88 95.22
cosh(x) 78.13 74.34 4.4 74.61 198.99
tan(x) 78.89 73.29 4.3 73.50 118.17
atan(x) 64.27 58.02 3.4 57.99 101.92
exp(x) 58.97 54.58 3.2 54.55 143.93
asin(x) 58.52 53.87 3.2 53.44 165.31
acos(x) 58.70 55.30 3.2 54.94 165.32
cos(x) 51.63 45.57 2.7 45.64 93.98
sin(x) 50.03 44.29 2.6 44.77 92.30
sqrt(x) 47.68 37.23 2.2 39.35 34.11
fabs(x) 20.93 16.14 1.0 16.11 17.25
(1.0/3.0)*x 23.02 17.16 1.0 17.22 17.87
(i686 = Intel(R) Pentium(R) 4 CPU 2.66GHz, 0.376 nsec)
(Core Quad = Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 0.4167 ns )
From the table, It is directly visible that pow(x,a) is computed as exp(a*log(x)) because 5.5+7.5 is approximately 13.0. Moreover, the results perhaps shows that computing of pow() by direct use of the identity exp(..log) gives a little bit faster computation.
Also log10 is computed perhaps as log(x)/log(10) because 1.7+7.5 is 9.5.
Computation times divides functions onto groups by duration:
- fast: arithmetical operations, fabs
- medium: sin,cos, tan, atan, cbtr, sqrt, asin, acos, sinh, cosh, log(10), exp, atan2
- slow: pow
Finally, computation times looks horribly but I think that a method which computes a function with precision of 15 decimals just only 7 times slower (!) than basic arithmetical operations is a miracle. The real world miracle.:)
2012-01-15
Konve and picko
I separated utilities konve and picko from main Munipack's source tree. Sources of both converters are unmaintained and I'm expecting just only small interest about its. On the other side, there are probably huge archives of frames in these formats and the existence of the utility may be important.
Both utilities can be easy used by hand (from command line). An integration to munipack/xmunipack is not planed (although one is easy).
Moreover, I prepared also:
- GNU autoconf/automake machinery (but simple compilation by gcc will does the same job).
- creating of DEB based packages (is there somebody who will do it for RPM based?)
- Homepages: konve and picko
- source is maintained under Mercurial vs.
2011-10-22
Astrometry Release
It's right time for an another development snapshot of Munipack. I have no time and no strength to stay in intense developing during our semester period. Before two months of stagnation, I issuing a rolling progress of Munipack.
General notes
The issue is still experimental. The debugging is switched on by default. Don't be confused from a lot of mash prints.
- New matching algorithm on base of back-tracking has been developed.
- Dialog GUI for astrometry. Users can directly change parameters and see results of the modifications.
- Added (unfinished) GUI dialog for aperture photometry and object detection.
- First steps toward to direct editing of FITS files has been implemented as a support of saving WCS to HDU.
- Manual specification of set of full parameters.
- Fitting of predefined of set of parameters.
- Matching against to a known catalogue.
- astrometry directly derived from an image (transfer from image) by fitting of two images by hand (?)
- add object name resolver (coordinates position by name)
- using of WCS-library for support of more projections and more precise algorithms
- solve relative coordinates calibration for wide-field images by digital camera, or precise relative (mutual) positioning of images
- object name resolving
- image, spectra and time series (?) search implementation
- less chaos, additional information are partially hidden for user
- the information are directly accessible for processing
- due to binary representation, there are no formatting complications for very small or huge numbers
2011-06-07
New Format of Color FITS for RAWTRAN, FITSPNG and Munipack
2011-03-15
Photon rain statistics
- start
- generate random X coordinate
- generate random Y coordinate
- add +1 to pixel on X,Y
- back to 0.
- the p_k is probability of capturing of k-photons during time period T when averaged flux is f photons per time unit
- the events are statistically independent (photons doesn't interacts)
- consequence is that the zero, one, or more photons can be captured in a single pixel during T

- the noise in start is relative huge, noise disappear with time
- the mean gray goes from black to (light-)gray
- the distribution histogram is highly non-symmetrical shortly after start
- mean of the distribution increases proportionally to time
- the distribution metamorphosing from Poisson to Gaussian
- the noise is strongly reduced, practically disappear with time
- the noise is not visible at end of simulation (uniform color)
- the width of distribution increases with time,
- but relative uncertainty decreases as sqrt(t)/t suppressing noise
- distribution histogram approaching Gaussian, very nice illustration of the law of large numbers


2011-03-04
Barnard star constantly in motion
2010-10-17
Coloring release
- book-like design
- column width of 80 characters
- column width of 80 characters
- minimized number of used fonts

- All files are placed to /opt/munipack. The hard-coded installation directory is required by EPM.
- The distribution includes libraries out of typical distribution set (wxWidgets and plplot). The libraries also would correctly set compilation options and versions.
- Some binaries (and .so libraries) sets rpath. Usually the rpath is hard-coded during compilation. The path is different from installation path. Therefore, I replace the rpath by patchelf utility (see http://www.eyrie.org/~eagle/notes/rpath.html).
- The distribution script is dist/builder.sh
2010-03-04
Continuous motion of Barnard's star

2010-02-11
A Graphical User Interface for Munipack

- simple complex visual manipulation with FITSes
- processing of astronomical data by my students during migrating from another platforms
- it is really shame that we have not a simple astronomical data manipulation tool in 21. century
- command line utilities needs a lot of experiences to work with
- I want save my skills with data processing (any kind of description is not satisfactory with respect to a dynamic actions, a white paper is not a way).
- More simple and interactive way of operations on images.
- Keep everything simple as possible.
- Don't distract the user from his/her ideas which working on.
- The user is not a programmer. It is expert in astronomy and I is not (not want to be) an expert in programming.
- Gtk+ - With Gtkmm+ may be useful. But relative rapid development and non-platform looks doesn't fit my needs.
- Qt - controversial license. Development depends on one company. Unaesthetic look.
- GnuStep - Very attractive alternative witch offers look, control and behavior like Mac OS X. Moreover it is programmed in Objective-C. Unfortunately, graphical look under Linux is like one from the past.
- Portable (multiplatform). It can be run under many possible environments including Unix, Mac OS X, Windows, smart phones.. The library is as the unified layer between portable code (developed by my) and a native toolkit. Impressive! So it looks as a native application. Many additional features like portable configuration support, filesystem managements and many more helpers are implemented.
- Memory management. wxWidgets has two approaches to memory management. Graphical widgets (like windows, controls, dialog.. elements..) are created as pointers and destroyed by the library itself so memory management is done by library itself. Second way is implementation of reference-counting into library core. Therefore all my data I'm using as reference (not pointers) without risk of memory leaks. Both techniques practically does a kind of automatic garbage collector. The memory is checked via valgrind.
- design and implementation of FITS representation on the top of cFITSIO. I developed a set of C++ classes as representation of a general FITS file. The implementation can be used as a simple library for cFITSIO. CCFits library does not fit my needs.
- I'm using two sets of classes. First represents a original FITS file and the structure is fully used in View window. Second represents a FITS meta object containing only headers and icons without memory consuming bitmaps or tables. The structure is used in Browser window.
- GUI design (see rest of the post).
- Any interaction between different windows controls is implemented by all modern window systems via events. Unfortunately, the implementation is very primitive. Single object sends events to another specified object but it is very difficult to sent the signal to various objects, gets a response and vice versa. The basic idiom used in this context is model view-control. I'm using some ideas of its for displaying of images. But I developed it by little another way and independently.
- Using of threads. One from big problems when I solved. The windowing system runs handlers for prepared actions without interruption. If any action takes longer periods (over 0.7 sec) user can see that the application hangups. This is very confusing behavior. The right way, how to solve, is via independent threads. The application responses very quickly and it pleasure for use when threads are used. It is very nice when more than one CPU (or core) is installed. Than both threads can run on different CPUs to importantly speed up the application.
- The image is fitted on the size during load (like iPhoto's). This speed up loading of large images and also the image is completely and perfectly prepared for a quick inspection.
- The image is automatically scaled in intensity. The user probably will see mostly details on the image.
- The issue tracker under Google code. You must have OpenID account to use it. You can also use the tracker to request of new features.
- When application crashes, the application shows an dialog with a log which can be used to directly report to my ftp server. The log can contain some private information. Please check directly that the info can be read be me and when you will accept to pass a (really) small info about your configuration, please send the report.

- List mode (don't show icons, show table with files) in Browser. It is probably useless, because thumbnails are not visible. I'm hesitating with its support.
- Orthogonal intensity scaling. The well behaving applications has orthogonal controls. That means, that when one tune a quantity, other quantities are not affected. Unfortunately, the intensity scaling in not implemented orthogonally. The image is brighter of darker by using of both sliders. I have no idea how orthogonalise it.
2010-01-15
Astrometry Calibration
- Get center of a picture in pixels as half of both sizes.
- Estimate a center of projection in spherical coordinates by mean.
- Project spherical coordinates to rectangular ones.
- Estimate scale as mean ratio between distances of projected and measured distances of objects.
- Estimate angle of rotation between projected and measured coordinates by using of property of scalar product of vectors.
- Compute the transformation by some minimization method with starting values given by items 3,4 and 5.
- Check offsets between center of projected and measured coordinates. If one is too great, does better estimate of the center of projection and repeat from item 2, else finish.
- Estimate median of absolute deviations (MAD) using of minimization of absolute deviation (Nelder-Mead).
- Use method of maximal likelihood to estimate the proper transformation.









