zanmar/loader_fits
12 years agoAdded benchmarking code and updated TODO master
Ricardo Zanmar [Tue, 28 Jun 2011 08:12:58 +0000 (10:12 +0200)] 
Added benchmarking code and updated TODO

I thought of a way to improve the performance on flat images where the
maximum bin is towards the end of the histogram. Bi-search. Images where
the minimum is towards the end of the minum take less than a second to
load. Flat images take one second more (100%) worst.

12 years agoYet another bug fix on zscalemax
Ricardo Zanmar [Mon, 27 Jun 2011 16:35:47 +0000 (18:35 +0200)] 
Yet another bug fix on zscalemax

I was wrongly adding zscalemin to the calculation of zscalemax. I had to
add datamin instead which is independent of the histogram.

12 years agoFixed bug on the histogram calculation.
Ricardo Zanmar [Mon, 27 Jun 2011 14:37:24 +0000 (16:37 +0200)] 
Fixed bug on the histogram calculation.

I was forgetting to add datamin to the datamin and datamax values drawn
from the histogram. This was evident on images with a very small range
of values (bias images).

12 years agoFixed a bug in datamin calculation.
Ricardo Zanmar [Mon, 27 Jun 2011 12:49:26 +0000 (14:49 +0200)] 
Fixed a bug in datamin calculation.

I expected k == 0 when the mostfreq value ends abruptly (single peak).
Instead it got to k = -1 at the end of the loop. This was only visible
in some images with strange histograms.

12 years agofits file is read one time less
Ricardo Zanmar [Mon, 27 Jun 2011 08:55:31 +0000 (10:55 +0200)] 
fits file is read one time less

In my continuos quest for speed, I read the fits file one time less. I
save a subsample of the data ~500x500 pixels to find the histogram etc.
One could read the whole image once and save everything to ram.

12 years agoThe script I used to format ds9's SLS color table
Ricardo Zanmar [Wed, 22 Jun 2011 15:57:42 +0000 (17:57 +0200)] 
The script I used to format ds9's SLS color table

12 years agoAdded color support and negative
Ricardo Zanmar [Wed, 22 Jun 2011 15:55:00 +0000 (17:55 +0200)] 
Added color support and negative

I copied the ds9 SLS color table and it looks very similar without
interpolation. I can perhaps convert the color table to integers to save
space since it is not critical to have it identical. I get segmentation
faults in tonatiuh but not in tlaloc.

12 years agoPrevent the log of 0 value. 0.97 value is constant
Ricardo Zanmar [Mon, 13 Jun 2011 21:01:17 +0000 (23:01 +0200)] 
Prevent the log of 0 value. 0.97 value is constant

In an image with one peak surrounded by 0 in the histogram I might try
to find the log of 0. This is now prevented. Also, the threshold of
0.977 was computed every time. Now its done only once.

12 years agohistogram based min max values. environment vals
Ricardo Zanmar [Sun, 5 Jun 2011 20:00:25 +0000 (22:00 +0200)] 
histogram based min max values. environment vals

The y axis was inverted becase the way the fits files are saved. This
has been fixed. I now use DATAMIN DATAMAX environmental variables to
pass values to the loader. At the moment this only works if both are
defined but it might be useful to split this. If these variables don't
exist the we do histogram and base the min and max on this, very similar
to ds9's 99.5 scaling.

12 years agoA fits loader for the imlib2 library.
Ricardo Zanmar [Sat, 4 Jun 2011 08:16:37 +0000 (10:16 +0200)] 
A fits loader for the imlib2 library.

The hardest part was compiling it. I'm using gbilo make file but the
commands on doit.sh also work. This last was what I was able to figure
out from the makefile of the GIF loader. In this first commit, I'm able
to see somekind of image but the rescaling hasn't been done yet. The
fits writer needs to written also (.argb). This loader was started by
editing the loader_argb.c. TODO: make it more robust, better handling of
data types, check if there are datamin datamax values in the header.