Monday, October 30, 2017

SER, FITS and Octave

While capturing a series of images in an autocorrelation experiment using a QHY5L-II and Sharpcap, instead of capturing as a series of PNG files, captured as SER files by mistake. From the experience of trying to use that data, found the following.

  1. SER capture is faster than PNG sequence capture - PNG was capturing at 20 fps or so, but dropping frames after 80 frames or so, and was taking the last 20 frames at around 5 fps. SER was not dropping frames at all. All this on the Menlo systems Lenovo laptop. 
  2. Octave and Matlab don't open SER files without conversion, the definitive site for SER files seems to be http://www.grischa-hahn.homepage.t-online.de/astro/ser/
  3. After some back and forth on this thread, found that Siril can export SER to a sequence of FITS images without losing the 16-bit resolution. 
  4. Imagemagick can be used to convert the FITS images to 16-bit TIFF using
    mogrify -format tif *.fits
  5. Alternately, the fits octave package can be used to read the data into Octave from the FITS files. Although Octave uses Imagemagick to implement imread, imread doesn't seem to work with the FITS files from Siril, complaining
    error: Magick++ exception: Magick: Unexpected end-of-file (/media/mac/SAM2TB/Autocorr/2017-10-16/Capture/14_10_49/Capture_00002.fit) reported by coders/fits.c:370 (ReadFITSImage)
  6. In order to install the fits package, had to install its dependency, with
    sudo apt-get install libcfitsio*
    and then run octave as root,
    sudo octave
    and within octave, run
    pkg install -forge fits
  7. Reading using the fits package and imread give different results.
    imread returns uint16 rows x columns
    read_fits_image returns double columns x rows, upside down.
    So, for equivalence with imread, we need to use flipud.
    b=read_fits_image('im.fits')
    b=b';
    b=flipud(b);
    imagesc(b)

    gives the same numbers as
    a=imread('im.tif')
  8. identify Capture_0035.png
    can be used to check whether the png is 8-bit or 16-bit. 
  9. Installing ISIS and SER Player turned out to be dead-ends, since they did not convert SER to PNG without converting to 8-bit.
Edit - more on siril's stackall here

Saturday, October 28, 2017

removing malware/adware from Intex phone - trois

Even after my earlier posts about removing malware from Intex phone, one issue persisted. Occasionally, Rs. 1.50 would be deducted as SMS charges. At first I thought it was some sort of location finding behaviour by some app - as I noted, this deduction was noticed after I installed Uber and PayTM apps. But even after uninstalling those apps, the issue remained - deduction of Rs. 1.50 once in a week or so.

Finally I contacted my carrier Airtel via email - which seems to be the only way to reach their customer service department. They advised that I could Dial *121*51# (Toll Free) or 12181 (Toll Free) to check last 5 deductions which have happened in the last 72 hours. Using this information, I found that the SMS charges were to a number 9582943043. Googling, found that this is an "activation feature" on Intex phones!

https://together.jolla.com/question/139190/intex-aqua-fish-re-activation-sms/

Now I seem to have removed the offending Intex services - using Kingroot and root uninstaller - searched for sms in system apps, found SmsRegister - com.android.smsregister - uninstalled it. This seems to have solved the issue - no sms sent for the last one month. 

Friday, October 27, 2017

a tale of redirects

I added a second domain to Godaddy's deluxe hosting, using My Products -> Web Hosting -> Manage All ->  Manage (under primary domain name)  -> More -> Hosted Domains. The root folder for this was configured like /seconddomain, but when trying to access the second domain, was getting a redirect to
http://firstdomain.org/seconddomain

Godaddy support, over the course of 3 days, told me that this was due to some redirects in the .htaccess file. But they could not fix it for me. Finally when I tried editing the .htaccess file, found that the issues were due to some redirects meant for the CodeIgniter framework, redirecting html files to their php equivalents. The original .htaccess was
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

In order to make it work with the second domain, I added some conditions, and made it

# BEGIN WordPress

RewriteBase /
# END WordPress

RewriteCond %{HTTP_HOST} ^www.seconddomain.org$ [NC]
RewriteRule ^(.*)$ http://seconddomain.org/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^seconddomain.org$ [NC]
rewritecond %{REQUEST_FILENAME} !-f
rewritecond %{REQUEST_FILENAME} !-d
rewriterule ^(.*)$ /index.html [L]

RewriteCond %{HTTP_HOST} ^www.firstdomain.org$ [NC]
RewriteRule ^(.*)$ http://firstdomain.org/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^firstdomain.org$ [NC]
rewritecond %{REQUEST_FILENAME} !-f
rewritecond %{REQUEST_FILENAME} !-d
rewriterule ^(.*)$ /index.php?$1 [L]

Now both sites firstdomain.org and seconddomain.org seem to be working fine. www.firstdomain.org redirects to firstdomain.org and similarly www.seconddomain.org redirects to seconddomain.org.

Sunday, October 08, 2017

removing duplicates

Found some duplicate filename entries in our schedule page remote database. PB found that these were due to some files with filenames beginning with a carriage return - ASCII 13 -

and he found there were 144 such duplicated files.


I found that these had been added in the early days - double digit index numbers - and so could be deleted - did

SELECT * FROM `name_of_table` where LEFT (fileName, 1) = '\r'

and then deleted all those 141 records using the phpmyadmin interface.