Saturday, August 09, 2014

data analysis with ROOT - redux

In my previous post about data analysis with ROOT, I had used the data from a single gamma. Extending it to multiple gammas - 1500 - and calculating the energy weighted position, found a bug in my code.

Apparently the Fill() function does not fill if the indices passed to it are 0. That is,
h2->Fill(i,j,energy2D[i][j])
will not work for i=0 or j=0. Since our energy2D C array has a range 0-7 for i & j, this Fill() had to be re-written as
h2->Fill(i,j,energy2D[i-1][j-1])
with the i & j range 1-8.

I also changed my definition of the histogram to
TH2I *h2 = new TH2I("h2","energy distribution",8,1,9, 8,1,9);
instead of
TH2I *h2 = new TH2I("h2","energy distribution",8,0,8, 8,0,8);

With the resulting root file, energy-weighted position analysis could be done quite quickly, almost instantaneously, with

// loading the data in root file
    TFile f("multifile.root");
    f.ls();
    TH2I* h = (TH2I*)f.Get("h2"); 

for (int i=1;i<9;i++)
    {     
    for (int j=1;j<9;j++)
      {
      bincontent=h->GetBinContent(i,j);
      ewposx += posx[i-1][j-1] * bincontent ;
      ewposy += posy[i-1][j-1] * bincontent ;
      totalcount +=  bincontent ;      
      }
    }
    ewposx /= totalcount;
    ewposy /= totalcount;
    printf("ewposx & y   = %f, %f\n", ewposx  , ewposy  );

Changing the position of the gamma was fairly straightforward in LXePrimaryGeneratorAction.cc

The calculation of energy weighted position in the LXe example seems to have broken somewhere in development - people have reported non-zero positions in 2010 and so on, but when it is run now, it returns only zero, since the GetPos() for the pmt hit collection class returns zero. This seems to have causes in the class definitions and so on - LXePMTHit.cc doesn't mention fPos private variable in the over-ride function for = operator and so on. Instead of trying to fix that, I just re-entered the position data in root, as

for (int i=0;i<8;i++)
    {
    y = -22.75;
    for (int j=0;j<8;j++)
      {
      posx[i][j]= x ;
      posy[i][j]= y ;

      //printf("pos2D[%d,%d]=%f,%f\n",i,j,posx[i][j] , posy[i][j] ); 
      y+=6.5;
      }
    x+=6.5;
    }



Friday, August 08, 2014

blogger limitations

Blogger is still raw around the edges! Surprising, even after so many years.
  • A post I did with email - the one just before this one - became mangled somehow, and made any page containing that post to break the browser so that links were disabled. Deleted it and reposted it from blogger compose window in order to fix it. Not sure what exactly was the issue, perhaps links are the issue in emailed posts.
  • Any < or > anywhere in the post has to be manually escaped, written as & lt ; and & gt ; respectively (without the spaces, of course). Otherwise blogger creates all sorts of problems, misrecognising them as html tags.

Thursday, August 07, 2014

Tuesday, August 05, 2014

opening multiple files in ROOT

If the filenames (or pathnames in this case) are sequential, this method in the ROOT forums would work.

while (i1<50) {
   
 sprintf(filename1,"pathnameTemplete_%d.txt",i1);
    f1 = new TFile(filename1,"READONLY");


and so on.

Otherwise this glob based solution might be useful.

Monday, August 04, 2014

ROOT canvas save problem

At first I could not save the ROOT plots, error mesg
Error in <tunixsystem::dynamicpathname>: Postscript[.so | .dll | .dylib | .sl | .dl | .a] does not exist in <tunixsystem::dynamicpathname> ...

Then found this discussion about this very same issue.

sudo apt-get install libroot-graf2d-postscript5.34

Solved.

Now I can save as png or pdf / ps etc. But not gif. Error,
Error in <tasimage::writeimage>: error writing file

But pdf and png are fine for now :)

data analysis with ROOT

Got similar results to my previous post with Octave, using ROOT.

Had some hiccups. Initial testing of ROOT C macro failed due to that particular sample data file being empty! The file input was based on this basic.C example. After getting the samples into the ntuple,
while (1) {
      in >> runID >> sID >> energy >> pixelID;
      if (!in.good()) break;
      ntuple->Fill(runID,sID,energy,pixelID);
      nlines++;
   }

I could do a simple linear plot just to check,
ntuple->Draw("pixelID","energy");

Then I created the same sort of 2D matrix as in octave - perhaps this is not necessary, but this is the way I did it :)

 for (int i=0;i<8;i++)
    for (int j=0;j
<8;j++)
     {
     energy2D[i][j]=0;    // initializing to zero, since 

                          // some i,j are not mentioned in the next loop
     }


for (int i=0;i<nlines;i++)     {
     ntuple->GetEntry(i);
    //pmtNumber pmtx is an 8x8 array,
    // assumed numbered rowwise.
    //for i=0:7, j=0:7,
    //i*8+j=pmtx. So
    jj= int(pmtx) % 8; //here we need to cast the float pmtx as an int
    ii= (pmtx -jj) / 8;
    energy2D[ii][jj]=enx   
     }


for (int i=0;i<8;i++)
 for (int j=0;j<8;j++)      {
     h2->Fill(i,j,energy2D[i][j]);
     }

h2->Draw("lego2");





Thursday, July 31, 2014

vGate 3.0 ROOT issues

First there were some issues with not being to type quotes inside vGate. Fixed that by going to Ubuntu's System Settings -- Keyboard -- Layout Settings, adding English US there and removing the English US extended international layout.

But ROOT on vGate 3.0 seems to be broken. Screenshot below. libjpeg.so.62 is not found in this case. Trying TBrowser b; also causes "segmentation violation" with some xpm files not found and so on.


Wednesday, July 30, 2014

ROOT font issue

On a fresh install of ROOT with Ubuntu Software Center on Ubuntu 14.04, this error on starting root

Couldn't find font "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1",
trying "fixed". Please fix your system so helvetica can be found,
this font typically is in the rpm (or pkg equivalent) package
XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi.


ROOT continues to run without problems. This issue is mentioned in this discussion, but xfs is not an available package for Ubuntu 14.04. Ignoring for now.

root -l doesn't bring up this error, nor the splash screen. Perhaps this font is used in the splash screen.

rough draft of output with Octave

Imported the ascii file output by the modified GEANT4 example I'm working with into a google spreadsheet. Manually sorted it by PMTNumber, manually added 0 photon counts for the missing PMTNumbers, exported the resulting photon counts into Octave as:

data = load ("Run-PMTHitOrder-PhotonCount-PMTNumber.csv")
for i = 1:8
  for j = 1:8
  matrixed_data(i,j)=data((i-1)*8+j,3);
  endfor

endfor
  my_bar3(matrixed_data)


plotted it using this octave version of bar3:


Tuesday, July 29, 2014

G4BestUnit

In order to check if the GetPMTPos() is working in the modified GEANT4 example I'm working with but returning 0,0,0 due to some units problem, tried to include G4BestUnit in the cout. As an example, LXeSteppingVerbose.cc has
std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")

For this to work, the include file needed is
#include "G4UnitsTable.hh"

But even with this, GetPMTPos() returns zeros - units set to femto-metres! So, we have to work with GetPMTNumber() instead, since that is working fine. 

Sunday, July 27, 2014

using vGATE 3.0 - a virtual machine with GATE, GEANT4, ROOT

vGATE is a virtualbox virtual machine image of Ubuntu 64 bit running GATE and associated tools. Tried it out. Running it on an Ubuntu 13.10 host, would not boot with the default virtualbox settings. On Windows XP, virtualbox was very flakey. The virtualbox control panel would come up only right after an install if "Run virtualbox" was ticked in the last step of the Install wizard. At other times, it would silently fail to start - the process would be seen in task manager for a few seconds before it vanished. Running the virtualbox image directly after a first run, by double-clicking (on Windows XP)

C:\Documents and Settings\Username\VirtualBox VMs\VGATE3VM\VGATE3VM.vbox

would work sometimes, and not work sometimes. Flakey. Also to be noted, the various issues of running Ubuntu with a non-3D-accelerated VM display - becomes very slow.

So I converted the virtualbox image to a VMWare image using the tool supplied with virtualbox,
C:\Full-path-to\VBoxManage clonehd --format VMDK vGATE_v3.0.vdi vGATE_v3.0.vmdk
The process took around half an hour for the 7 GB file on an external USB hard disk.

Running on VMWare Player was much more stable - at least for me on a WinXP host. Enabled 3D acceleration before starting the VM, of course.

Speeds - using a VM with 1.2 G ram, 1 processor,

SPECT benchmark - each acquisition of 37.5 sec was taking around 2 minutes to run.

Running the LXe example of GEANT4, from command-line the virtual machine was not too much slower than the bare-metal Ubuntu install. But with graphical display, was 3x slower.

VM - ./LXe LXe.in

Run Summary
  Number of events processed : 3
  User=0.92s Real=1.17s Sys=0.09s

Ubuntu 13.10 bare metal - ./LXe LXe.in

Run Summary
  Number of events processed : 3
  User=1.05s Real=1.06s Sys=0s

Using GUI, running .LXe and then running the macro with /control/execute LXe.in inside the LXe application, 
VM on VMWarePlayer, WinXP Host - 

Run Summary
Number of events processed : 3
User=1s Real=6.7s Sys=1.57s

Ubuntu 13.10 bare metal - 

Run Summary
Number of events processed : 3
User=1.44s Real=2.11s Sys=0.07s


Some notes on the modified version of Geant4 LXe example

Some graduate students have worked on modifying the LXe example supplied with the geant4 package, here are my notes on understanding and troubleshooting the modifications.


  • cout needs << endl ; at the end, for flushing the buffer, especially when called inside a loop
  • "Find in Files" from commandline -
      grep "string to search for" /path/to/directory -R -n
  • the G4cout statements in the LXe example have an if statement before them, so the macro statement /LXe/eventVerbose 1 should be called if those are to be executed. 
  • the supplied macros in LXe example also have errors -
    COMMAND NOT FOUND
-  this is due to the modification noted in the Changes file, in 2013, November 22, 2013 P. Gumplinger (LXe-V09-06-12) - replace Update method and commands with ReinitializeGeometry. So we should just comment out the update lines in the macros. Four cc files have been modified in src - LXeMainVolume.cc, LXeDetectorConstruction.cc,  LXeEventAction.cc and LXePrimaryGeneratorAction.cc.

  • LXePrimaryGeneratorAction.cc sets the gamma energy to be 140 keV.
  • pmt positioning is done originally in LXeMainVolume.cc inside G4PVPlacement function -

    There, the PlacePMTs function calls have been commented out except in the xy plane.
  • G4double lxe_Energy[lxenum]    = { 3.001*eV , 3.000*eV, 2.999*eV, 2.998*eV };
  • is defined in LXeDetectorConstruction.cc - also

    fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",63000./MeV);

    G4double vacuum_RIND[lxenum]={1.,1.,1.,1.};
    (changed from 3 values in orig to 4 values here. seems to be a mistake. - refractive index should be a 3D vector, not 4D.

    In SetDefaults, sizes and numbers defined as

    fScint_x = 5.2*cm;
    fScint_y = 5.2*cm;
    fScint_z = 1*cm;
    fNx = 8;
    fNy = 8;
    fNz = 0;
  • LXeEventAction.cc has the added opfile <<  statements.
    Most of the G4couts in the original are after an if(fVerbose>0)
    that is, LXe/eventVerbose 1 must be set while running LXe for them to execute.
  • vis.mac the default visualization macro has
    /run/verbose 2
    /control/verbose 2

    setting these to 0 reduces some clutter.
  • Somewhere the process verbose is being set to 1, can't seem to override. So all hadron processes etc are listed.
  • 140 keV being deposited in modified version as against 511 in orig.
  • Energy weighted position of hits in LXe is being shown as non-zero in new and old, but in both cases, reconstructed position is 0,0,0

Thursday, July 24, 2014

some Ubuntu tweaks for general working

To add Open in Terminal to the right-click context menu for folders displayed in Ubuntu, followed this page
http://askubuntu.com/questions/207442/how-to-add-open-terminal-here-to-nautilus-context-menu
and installed with
sudo apt-get install nautilus-open-terminal

To install Adoble Flash Plugin, Software Center had Adobe Flash Plugin installer. But even after that, radiosai streams did not work - apparently that was due to absence of mp3 codec. Installing GStreamer plugins for mp3 and so on from Software Center solved that issue.

To avoid having to adjust the brightness every time on reboot, followed this workaround.
cat /sys/class/backlight/acpi_video0/max_brightness
to get the value for max brightness, and then put that or a corresponding value - I used 8 - at the end of /etc/rc.local as
echo 8 > /sys/class/backlight/acpi_video0/brightness

Apparently the correct solution is to fix it in grub, as given here

working with Geant4 on Ubuntu 13.10

Started some preliminary work with the Geant4 C++ toolkit for Monte Carlo simulations. The name comes from GEANT-3, GEometry ANd Tracking.

Also looking at GATE - Geant4 Application for Tomographic Emission as mentioned in this pdf.

Installing Geant4 ran into QT related errors. The solution was here, editing
/usr/include/qt4/QtOpenGL/qgl.h

to have at the end of the if defined includes

#if defined(Q_WS_MAC)
# include
#else
# ifndef QT_LINUXBASE
#   include
# endif
#endif

It turned out that installing in a user directory was more convenient, as that was the method in the install guide. Installed versions 9.6 and 10.0, since the GATE was supposed to work with 9.6. My make string was
cmake -DCMAKE_INSTALL_PREFIX=~/geant4 ../geant4_9_6_p03 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_EXAMPLES=ON 

make -j2 (using two cores for building) ran for 50 minutes to build geant4 v9.6.
make by itself (only one core) took 80 minutes for 10.0.

With this installation, the make string for applications using Geant4 was
cmake -DGeant4_DIR=/home/hari/geant4/lib/Geant4-9.6.3 ../LXe
and so on.

The LXe example needed the path to low energy data to be defined as an environment variable, like
export G4LEDATA=/home/hari/geant4_10/share/Geant4-10.0.2/data/G4EMLOW6.35

In Ubuntu, one method to set environment variables without reboot seems to be to edit /etc/environment to add at the bottom
G4LEDATA=/home/hari/geant4_10/share/Geant4-10.0.2/data/G4EMLOW6.35
Geant4_DIR=/home/hari/geant4_10/lib/Geant4-10.0.2
and then call
source /etc/environment
at the bottom of .bashrc - but that did not seem to work - have to put export statements in .profile, as mentioned in the ubuntu help file. And that will work only after logging in again.

Once these environment variables are set, then the make string does not need the path to Geant4 and so on.




Thursday, July 17, 2014

call forwarding from BSNL landline

According to this BSNL page,
http://www.bsnl.co.in/opencms/bsnl/BSNL/services/landline/plus.html
we can activate call forwarding using the code 114 followed by number to which call is to be forwarded. Did not work in my case. The CLI announcement service at 164 also did not work, so perhaps all these services are not available at our location. 

Wednesday, July 16, 2014

Sunday, July 06, 2014

Avidemux issue

Found that my installation of Avidemux, version 2.6 32 bit, doesn't load files when the VGA cable for 2nd monitor is connected and monitor 2 is enabled with "Extend my Windows desktop onto this monitor". With single display, loads fine. 

Friday, June 20, 2014

mysql database table crash and recovery

There was a power outage yesterday at the studio, and the UPS also tripped. PB reports:
The phplist mailist list server gave the error message

> Message:
> Database error 144 while doing query Table './path/to/tablename' is marked as crashed and last (automatic?) repair failed
>
>
> Currently running the repair on the table tablename​ as suggested here:
>
http://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed
>
> cd /var/lib/mysql/path/to/relevant/db
> myisamchk -r tablename.MYI
>
> ​looks like its going to take a long time.....​


and later,

Recovery successful.

​This was done by stopping mysql database:


service mysql stop
myisamchk -r tablename.MYI

- recovering (with sort) MyISAM-table 'tablename.MYI'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
Data records: 119477877


service mysql start


testing schedule page and audio search page accessibility with screen reader software

We got a report that the audio search results were not accessible with JAWS 14.137 screen reader software. The google chrome accessibility page lists JAWS and NVDA. Downloaded and tested both. Found JAWS 14.0 working perfectly fine with our audio search page, with Firefox and Chrome. Also with IE8 (on my machine which has Win XP, highest version of Internet Explorer is IE8). Also fine on NVDA, which is free, as against JAWS which is $1000. Probably reasons, some of which I also faced:

1. Opening the page in a new tab instead of a new window causes problems. Open all pages in new windows instead.
2. Using old version of browser may cause issues on radiosai.org - upgrade to latest version of browser.
 

Tuesday, June 17, 2014

Google Apps Education edition

I had a query asked of me, whether the Google apps for a domain was the "Free edition" or the "Education Edition". Also about the number of users allowed for Edu edition. Here was my reply.

Google apps Education edition allows unlimited users for educational institutions, and 3000 users for other non-profit institutions.
https://productforums.google.com/forum/#!topic/apps/fptTBRXfGPM

You can check which edition you have - Education edition or not - by seeing how much space each user gets. According to this page,
https://support.google.com/a/answer/175121?hl=en
Education edition users get 30 GB, Free edition users get 15 GB.

This is seen at the bottom of your inbox, "Using 4.13 GB of your 15 GB" or "Using 4.13 GB of your 30 GB" or something like that.

Friday, June 13, 2014

source timeout on icecast

On May 21, we had changed the source timeout property on icecast from 10 to 40 seconds hoping to reduce the number of times the server dropped connection. This strategy suggested by PB seems to have worked, since then the connection has not dropped even once when I was operating the live broadcast. Edited  icecast_all.xml  and  icecast_tel_live.xml  and made the source timeout 40 sec. The original suggestion was as below.







changing default browser font for other languages

Using this post as a guide, changed the default font for Malayalam on Firefox to Rachana, which is more readable.

Tools -> Options -> Content tab -> Advanced button in default fonts -> Fonts for: chose Malayalam in the drop-down list, and changed the options other than Proportional to Rachana.


Thursday, June 12, 2014

recordings with M-Audio MobilePre

As noted in an earlier post, the M-Audio MobilePre is an el-cheapo USB preamp interface. But I had to rely on that for some trial recordings.

Using a Maxim mic, laptop sound card noise floor is around -50 dB

M-Audio MobilePre with Maxim mic noise floor is around -60 dB

Using dynamic mic - Ahuja ASM-780XLR - results were similar.

Nose floor rises to -40 dB when capture slider increased to 80%.

The XLR input on the MobilePre seems to be defective - S/N almost unity! -18 dB of noise

Monday, June 09, 2014

"NEW" label on schedule page

As requested, PB has added the "NEW" label on our schedule page for "Concert" category also. He had to modify the csv generation local code as well as the schedule page code for this.

Wednesday, June 04, 2014

brief outage

There was a brief outage of radiosai services. The issue was with Cloudflare dns returning SERVFAIL for our domains. Conversation with Cloudflare:


Thursday, May 29, 2014

avfs - Avisynth filesystem

The simpleslug pages mentioned AVFS. Tried it out. A 10 minute 2K planetarium show - Solar Quest - is seen as a 250 GB file after mounting. After Effects 4.1 complains error retrieving frame - not enough storage is available. But GL_warp2Avi works, even though it has the 2 GB file size limit for actual files, it seems to handle larger virtual avi files. Tested with 18 GB credits virtual avi file. 

Wednesday, May 28, 2014

replacing an acrilconvex mirror with a vialux mirror

From 2011, our fulldome projection has used an Acril Convex first surface spherical mirror. Last year, I'd purchased a used Vialux mirror. Today, we tried out the Vialux mirror, and decided to leave it installed for one show as a trial.

The Vialux mirror mini-review from Paul Bourke is here. As he notes, the extraneous reflections are more for the vialux mirror. The overall effect in the theatre is to reduce contrast and increase the brightness of the black levels. So we'll use the vialux only as a backup. Also did some back-of-the-envelope calculations of their radii of curvature.

After putting back the Acrilconvex mirror, I wonder if the perception of higher black levels was just an illusion. Maybe I'll try a light meter test next time, with a suitable frame on both mirrors. 

radius of curvature of spherical mirror

Did some back of the envelope calculations for the radius of curvature of our spherical mirrors, and with the help of the alternate segment theorem at this page, measuring x and y with a ruler got me r, the radius of curvature.


For the Acrilconvex mirror, 2x = 56 cm, y = 14.5 cm, so r = ( (28)^2 / 14.5 + 14.5 ) / 2 = 34.3 cm

For the Vialux mirror, 2x = 56 cm again, but y = 12 cm, so r = ( (28)^2 / 12 + 12 ) / 2 = 38.7 cm

Tuesday, May 27, 2014

simpleslug upscale

Checked out simpleslug upscale. Not directly useful for me, since the output is set to presets like 1080p 720p etc. Internally, it uses Blackman Resize, which is similar to, but better than Lanczos with higher number of taps. From this discussion linked on that page, it looks like sinc resize with avisynth might yield the best results for upscaling. But in our case, the loss of clarity seems to be more due to the codec used for the lo-res videos.

Update (2 June): As mentioned by the SimpleSlug author in the comments, was able to use simpleslug upscale with SimpleSlugUpscale(prog=true,outwidth=2048, outheight=2048)


As compared to doing Lanczos resize + Sharpen in Virtualdub below.





Monday, May 26, 2014

Software Bisque Seeker - docked windows, IMAGE

Found that starting Seeker with only one monitor leads to a docked visuals window. Starting Seeker with two monitors makes it un-docked.

Also, found that <IMAGE> does not render at all in fisheye mode. Directly changing <IMAGE> to <DOMEIMAGE> did not put the images in suitable positions.

Rendering of flat movie Explorers of Mars,


Rendering of dome movie of Explorers of Mars, with <IMAGE> changed to <DOMEIMAGE>



Sunday, May 25, 2014

Image Sequence Scanner

One of the many tools to check a sequence of images for corrupt or missing files - ISS or Image Sequence Scanner. But it does not detect errors in files like this bad frame,



why I removed ads

When I first started this blog, I had clicked through and added Adsense as Google recommended. But then, months of zero earnings later, I removed it, but did not post about it. According to this page, it's advisable not to put ads on your site if your traffic is below 10,000 page-views a month. Mine is only 1,400, so it really did not make sense to put ads on this blog. 

Thursday, May 22, 2014

resources from newtonscannon

Checking out the www.newtonscannon.com blog, found these useful resources:

cgskies.com  has free samples.
compiz lighttwist plugin for blended large desktop. Could possibly be useful for blended two-projector dome setup?

Wednesday, May 21, 2014

some links for miscellaneous jobs

Hypercube Time Stretcher for stretching wav files to sync to video.

Stackoverflow discussion about how to map an ffmpeg frame to an opengl texture.

Webpagetest.org for analyzing web page load speeds - and an old link to a test run in 2011.

Online tool for Hex color-code generation.

Frame-rate up-conversion virtualdub filter. Increase frame-rate by integer values - 2x, 3x and so on, interpolating frames.

The frame interpolation above could be used along with slow-motion for virtualdub ideas in this thread

Tuesday, May 20, 2014

more experiments with Software Bisque Seeker Theater Edition

More trials with Software Bisque Seeker Theater Edition:


  1. The About Seeker menu item and Solar System Map feature work when not in "Fulldome" mode, and when the flat screen version of "None" is selected in Settings -> Dome Projection.
  2. When writing scripts, leaving a space after the command tag and the first argument is a must. Wasted a lot of time wondering why <WAIT>20 was not working - it should be <WAIT>  20
  3.  <DOMEIMAGE> doesn't work with jpg files. Targa files as given in the example are fine.
  4.  <DOMEIMAGE> works best for small images - distorts panoramas etc.
  5. <QUIET> 0 makes not only sound effects, but also a counter of time elapsed while running scripts in flat screen mode - not in fulldome mode. 
  6. The spaceship movement seems to be auto-linked to the nearest object. 
As an example for the last point, after doing <WARP> "Earth" , using spaceship thrusters to move towards the moon and creating a waypoint there, when time is advanced, the camera and ship movement sync to make the moon centred. This is sometimes a problem, like when we want to make the moon move across the ecliptic. The moon as seen from earth is displayed too small to be visible in fulldome mode. But if we move close enough to the moon as to make it visible, camera and ship are no longer locked to earth, but are locked to the moon!

Also, access to the Software Bisque support forums are linked to the subscription. After one year subscription elapses, "Access Denied" to the support forums. In my case, "Access Denied" even 12 days before expiry of subscription. Can't even reply to my own bug-report post!

Thursday, May 15, 2014

Winebottler and Winamp on Mac

The Telugu team wanted to continue making playlists by dragging and dropping to Winamp, but move to Mac from Windows. I sent them the following options.

There is a "Winamp for Mac", but that has an interface similar to iTunes and not like Winamp. So, for a Winamp-like solution on Mac, there are various options:

1. Run virtualbox, run Windows inside virtualbox, run winamp in that window. Free software, but will take time to install windows, and will be slow.

2. Run Wine and Winamp on Wine. Free software, but takes hours to install, complicated installation.

3. Run CrossoverMac and Winamp using crossover. Software costs $16, we can download a 14 day trial, see if it works, and then pay if needed.

4. Installing WineBottler - http://wine-review.blogspot.in/2010/01/winebottler-for-os-x.html and installing winamp inside it.

Apparently Winebottler 1.4 was already installed. Installing Winamp 5.5 inside it worked, but unfortunately drag and drop files into playlist was not working. Then they uninstalled Winebottler by simply dragging the app to trash, installed the latest version which was 1.7, installed Winamp 5.5 inside it, then it worked fine. 

Wednesday, May 14, 2014

cleanly removing applications from OS X

Looking for Winebottler drag and drop support (dragging and dropping from Finder to Winamp does not work), found this macrumors forum post about cleanly removing applications.

The steps include searching for the software by name in the default (Macintosh HD) volume, and expanding the search to include system files and hidden files. And then deleting them. 

Monday, May 12, 2014

transcoding older mov files

The Art Science Wonder mov file from cosmoquest.org was encoded with RLE codec. Directshow and Avidemux could not play it back, though it played back in VLC. To cleanly convert it to AVI with controlled bitrate, codec and resolution, finally used After Effects. My AE 4.1 was able to render it out as Xvid avi. 

Friday, May 09, 2014

mini-review of super-resolution filter

Tried out the Virtualdub filter for Super-Resolution from Infognition. The results did not seem to be very encouraging. Probably because the videos I tried had lots of motion in them, had compression artifacts and also lots of detail. 5x resize with Lanczos3 followed by Sharpen filter set to maximum sharpness seemed to have similar results to the Super-Resolution filter. And final result was quite inferior to the actual higher resolution image. All the sample images below were warped using GL_warp2Avi and are from the Citizen Sky - Epsilon Aurigae planetarium show.

Warped from a 2K domemaster:


Warped from a 640x640 video using Super-Resolution filter to resize 3x to 1920x1920:


Warped from the 640x640 video using Lanczos3 resize 3x followed by sharpen filter set to 25%:


Unfortunately the frames are not exactly the same. Also, blogger might be re-encoding the images. So the differences are not clearly seen. If you click on the images and see the original size, the comparison is a bit easier. 

The results using directly warping from the 640x640 video are clearly inferior to the results got from warping the lanczos3+sharpened frames. 

Warped directly from 640x640 video:


Warped after resizing 5x with Lanczos3 and then Sharpen 100%:


And finally, warped after 5x resized using the Super-Resolution filter.










Wednesday, April 30, 2014

slow loading of website via cloudflare

From a few weeks back, our website at media.radiosai.org started loading slowly, even though we had enabled Cloudflare CDN. There were also some times when the site was reported as down, though the server did not show any outage. Checking with Internap, our hosting providers, found no issues at their end. Used MTR - "My TraceRoute" tool to check packet losses. Apparently 1% packet loss at their main router for UDP packets was acceptable.

Then checked with CloudFlare support. After traceroute checks, one of their recommendations was to set the expiresby attribute to one month. Checking that in our apache2.conf, found that it was set to just 1 second after access! Changed it to one hour, and site became fast again :)

Saturday, April 26, 2014

making bhajanstream playlists

PB shares his method of creating bhajanstream playlists from supplied 30 minute m3u files.

1. The received m3u file is in extened m3u file format. Collect all of
them into a folder

2. Run the script extm3u_to_m3u_batch.sh  This script converts the
extened m3u files to simple m3u files with the required path.
(currently the path is /local/audio24)

3. Add these files to BhajanPlaylist_files folder (in scripts dir)
with the proper filename sequence

4. Run the script make_bhajan_playlist.sh to make the required 31 days
random playlist using the m3u files in the  BhajanPlaylist_files
folder. The output of these files are in /home/sgh/bhajan_m3u

5. Open them in xmms to set to the correctly to 24 hrs + few mins duration files

6. To replace to the correct path use the following code

sed -e 's/\/local\/audio24\//\/home\/sgh\/audio\//' -i /home/sgh/bhajan_m3u/*

Sometime later the above steps can be combined to one script.

Monday, April 21, 2014

some still image After Effects techniques

There are a few ways in which I have used low resolution still images (and videos) on the dome. One way was detailed in an earlier post. Another way was to use a starfield image as a background in a fisheye dome-master, move the small rectangular image to the bottom of the fisheye so that it suffers least distortion on the dome, move the anchor point to the centre of the background image, and rotate the rectangular image so that it appears at a different place on the dome rather than front centre. To move the anchor point, the tool is the "Pan behind" tool, which looks like a circle.

Another technique was to exploit the fact that after mirror warping, the bottom centre 640x480 pixels can be used almost un-distorted. So, using a warped 1920x1080 starfield as background, animating stills (or videos) across the bottom, fading them in and out within the 640 pixel boundary. For doing this with a large number of images, copy-pasting attributes like position and opacity is useful. Just move the time marker to the first of the keyframes, click on Position, Ctrl-C to copy, click on Position on the layer where you want to paste, and Ctrl-V. 
  

Friday, April 18, 2014

file limit workaround on Ubuntu 10.04 Lucid

We'd been seeing graphs like this:

for listener number statistics (using Shoutstats) on our Icecast streaming server at radiosai.org. PB correctly diagnosed this as being due to the server not accepting new connections after 1000 connections were reached. The server limits in the icecast xml file were set to 2048. PB correctly pointed out that this was due to a user limit issue.

Checked the error log and found lot messages like:

WARN connection/_accept_connection
 
accept() failed with error 24: Too many open files

We have to set ulimt (user limits) as suggested here

Currently it is set to 1024 on our server.

But after setting the limit to 4096 and restarting the server, still the problem persisted:

Checked the icecast limit as suggested here

It still shows Max open files as 1024


which says to use ulimit -S 4096 as the relevant user to change per session. But doing that and running the script to start our icecast using nohup still did not solve the issue. Max open files still reported as 1024 when doing cat /proc/pid_of_icecast/limits

Finally PB found the solution: which was, edit /etc/security/limits.conf by adding the lines 
relevant_username         hard    nofile      65536
relevant_username         soft    nofile      65536
and also editing /etc/pam.d/common-session to add the line 
session required pam_limits.so 
at the end. And then, after a reboot, instead of directly logging in as relevant_username, either log in as root and then do su relevant_username, or do an su to become root, and then su relevant_username. After doing that, ulimit -n returns 4096, and starting our icecast now, it can open more than 1024 files. 



Thursday, April 10, 2014

Heartbleed patch

Internap sent us an email with the OpenSSL vulnerability info, link to http://heartbleed.com/  and so on. Actually this does not affect us, since we don't use any https pages. Still, have done this update for krishna and server1 .

apt-get update && apt-get install openssl

Sunday, April 06, 2014

checking out Kolor Eyes

Some of the IMERSA talks mentioned Kolor Eyes as a preview tool. Checking out the "spherical" view on Kolor Eyes, found that it is a bit different from what we get using the polar co-ords tool of Gimp.

Kolor Eyes screenshot below, zoomed in a bit to get more of sky, rotated to make it similar to the Gimp screenshot.


Gimp screenshot below.


This difference is because what we're seeing in Kolor Eyes is a "Little Planet" view and not a Fisheye view. This page has a discussion on the different projections. Kolor Eyes hosting has an option for Fisheye view also. 


Saturday, April 05, 2014

hand pump for bicycles - mini review

N got a hand-pump. But it needed some work before it could be used. The nozzle had to be opened, and the washer had to be turned around to fit our type of cycles.


The pump itself is small and light, but because of its lack of tubing, the ergonomics of hand pumping are a bit awkward. My arms are clearly not strong enough. So this pump is not useful for me. Floor pumps are fine for me, though. 


The usage of the pump also had a gotcha. The nozzle has to be fixed to the cycle tube's valve, and the pump has to be locked as below, for effective pumping. 






applying for a passport in India

Now the procedure for applying for Indian passport applications has been made online, and many Passport Seva Kendras (PSKs) have been opened, so the whole process is more transparent and less of a hassle. The website passportindia.gov.in gives most of the required info, in a user-friendly manner. My own experience was as follows.

Applied online, filling up the form online over the course of a couple of days, and found at the last step that Hyderabad Begumpet office, where I wanted to go, was giving out appointments the very next day. Since I had to book Tatkal railway tickets to go to Hyderabad, chose to wait for a Thursday morning before making payment and booking an appointment, so that I could go to Hyd on Thu evening, reach there on Fri morning for a morning appointment.

The Begumpet PSK was near the American consulate, so there was a big rush of US Visa applicants also nearby! The passport office entrance was to the side, the security guard was allowing only those who had appointments within 15 minutes to come and stand in line, was asking the others to move away. One potential issue is that only the person who has the appointment is allowed inside (except for invalids etc) - so, in general, it would be a good idea to meet up with someone else and apply together, because when one is alone, waiting for the tokens to be displayed on the screens can be a chore. The queue was only around 10 minutes, then after a brief security check, we have to hand over initial documents like School Leaving Certificate photocopy for getting a token number and a temporary file.

As the passport portal shows, the process is in three counters, A, B, and C. Counter A for entry of details, documents scanning, checking spelling, finger print scanning, taking of picture etc. Counter B - another check of the documents. Counter C - final approval. for After getting the token, we proceeded to counter A almost immediately, with our token numbers being displayed on the video screen there. But after that, our wait for counter B was almost two hours! The waiting area is air-conditioned, but one has to be alert for the token numbers to be displayed on the screen. There's a coffee/snack bar, and washroom facilities in the waiting area, but once in, we can't go out. At Begumpet, the A and B sections have lots of counters - 20+, C section has comparatively fewer - 10 or so.

Counter B to Counter C waiting time was only 15 minutes or so, and the whole process was finished in around a couple of hours. A's father finished his passport renewal at Calicut in just an hour, so it depends on the centre and how busy it is on a given day. The initial counters are manned by TCS folks, professional and quick. Counter C is the Govt. of India official who gives final approval, checking the docs for a final time. Then we just have to collect a receipt at the exit - a short 2 minute queue for this - and then leave after another security check.

The police verification was the main cause of delay - had to call the policeman, a friend's acquaintance - several times, since he was busy with the elections coming up. Once he came and checked the documents, had to give him another set of photocopies and two photographs, a week later the passport portal status showed that the passport has been sent for printing. Another week later, the passport was in my hands. The postman also needs a photocopy of address proof before handing over the passport. The whole process took 5 weeks. 

Friday, April 04, 2014

emulating home button press on Android with ssh

On the HTC Wildfire which I'm using as a demo piece, installed SSHDroid and was successful with implementing the act of pressing the Home button, though the button does not work, by running
am start -a android.intent.action.MAIN -c android.intent.category.HOME
as given at this stackexchange post. And as mentioned in the comments here, the
input keyevent 3
command does not work in ssh shell, probably due to some path or permission issues.

2:1 equirectangular to angular fisheye

Checking out the IMERSA live action photography talk at fddb, the speakers talk about VideoStitch - trying out their demo videos, found that it renders output to 2:1 equirectangular format. The IMERSA speakers mention using the NAVEGAR Fulldome plugin for AE for converting this video to fulldome domemasters.

Checking Andrew Hazelden's Photoshop actions pack demo images, found that I can get the same result using Gimp's Filters -> Distorts -> Polar Co-ordinates


Since this view is supposed to be closer to a sphere than a hemi-sphere as we need on the dome, we would probably need to cut out some of the grass in the picture. Original 1600 x 800, probably close to 360 degrees by 360 degrees field of view,


Leaving in a little bit of grass, cropping to 1600 x 450 or so, (also rotated to get the mountains to foreground)


Cropping to 1600 x 400, technically should be close to 360 x 180 degrees FOV,





Wednesday, April 02, 2014

exposing the wireless key on XP

I got hold of an HTC Wildfire mobile phone with a cracked screen and non-functional home-menu-back buttons, for use as a demo piece for radiosai. Usable, since the touchscreen works. When trying to make it connect to Wifi, it showed connected for whatever password I entered, if I used a static ip. But actually it was not connecting. Finally used WirelessKeyView from Nirsoft and entered the correct wireless key. Then it connected with DHCP with no issues.