Menu |
Prof /
SandcontrolopenmandrivaEn(:translatelink style=horizontal :) SAND Light pollution spectrometer/photometer controlIntroductionThe aim of this project is to develop a system capable of remotely controlling a spectrometer or a five filter wheel radiometer for measuring light pollution. SAND-4 spectrometer is the result of several years of development and was preceeded by various version more or less effective. The first version was developed as part of a research project of the Groupe de Recherche et d'applications en physique du CÉGEP de Sherbrooke (GRAPHYCS, http://cegepsherbrooke.qc.ca/~graphycs/site/html) but it is mainly the private society Memo Environnement (http://www.memoenvironnement.com) which supported subsequent developments. In 2008, the society gave back the system to GRAPHYCS and it was under this that SAND-3 and SAND-4 has emerged. That project is led by Martin Aubé, principal researcher at GRAPHYCS. Among other changes from SAND-2 to SAND-3, we decided to replace our spectroscopic head with the SBIG DSS-7 spectrometer but kept the SBIG ST-7MEI CCD camera. In SAND-4, we replaced ST-7MEI by ST-402 camera. LPRad-1 is our first attempt to use a combination of filters to estimate light pollution levels. We choosed a development philosophy based on a complete control from the Linux command line. The system can be controlled simply with a low speed remote connection provided by a SSH client installed on the user workstation. The computer connected to the system act as a server. From internet: ssh -p 2022 sand@routers_public_ip or inside a private network ssh sand@servers_local_ip From the internet, port 2022 is used instead of standard port 22 to reduce risk of attacks by hackers. A password and user name is required. The standard username is sand. The system administrator should be able to provide you the password for sand. In addition to this SSH control, a Web interface was designed to allow remote control with a more user-friendly graphical interface. This interface can be accessed by logging into your favorite web browser: http://routers_public_ip:2080/~sand Once again, a password and username will be required. The username is sand. The system administrator should be able to provide the password. Unfortunately, not all commands and options are available from the web interface. The various web browsers have not been systematically tested, so the user should carry out preliminary tests before using this interface with confidence. Installing and configuring subsystemsHardware profileThe system consists of the following but it would certainly be adapted to a different list of items with minor corrections.
Environmental constraintsThe critical element is the hard disk because it does not support very high nor very low temperatures. To overcome this problem we are studying the possibility of replacing the mechanical hard disk by a solid state (SSD). For now in the case of the installation in the observatory protected by an acrylic dome (OBSAND-2), we integrated bathroom ceiling fan (50 CPM) controlled by a thermodisc that switch on at 43 C and off at 32 deg C. For cold weather, the field test show that thermal equilibrium is reached at a differential of 16 deg C above the outside temperature. The plywood surface is 1.25 m2 while the acrylic dome covers about 0.55 m2 (a total of 1.8 m2). We can assume a mean R value of 1 (Rsi = 0.17) and estimate the heat power dissipation of 170W. A 82 W heating wire is installed in the observatory. The wire automatically starts at a temperature of 3 deg C and switch off at 7 deg C. Under these conditions, we can maintain the critical temperature of 5 deg C when outside temperature if above -18 C. With 210W heating wire, the temperature limit is -31 C. Our test at -18 C gave a stable temperature around 5 C. The heating wire of 82 W is probably working intermittently in that situation. Table 1: Thermal constraints of the hard disk western digital WD800
Basic packages installation and dependancies
NightviewNightview is based on the SBIG driver for linux that allows to operate the CCD camera and the filter wheel. It was developed by Filip Hroch, Institute of Theoretical Physics and Astrophysics, Masaryk University, Brno, Czech Republic
The modification concern the install_sbig_firmware.sh program located in libsbig directory. This program will automatically download the driver (PUBLIC_SOFTWARE_2014.tar.gz) from our website.
cd /home/sand/Downloads gzip -d nightview*.tar.gz tar -xvf nightview*.tar mkdir /lib/udev/devices
echo "usbfs /proc/bus/usb/ usbfs defaults 0 0" >> /etc/fstab cd nightview*/libsbig ./install_sbig_firmware.sh
cd .. ./configure --without-xnightview --without-xmove --without-nighthttpd make make install
nightview-conf /usr/local/etc/nightview.conf SSHSSH server allows any remote SSH client to connect to the server to remotely control system programs from the command line or to download (upstream / downstream) data. Most operations shall be also accessible via the web interface.
Installing SAND applicationsLatest available package release on google code subversion repository
cd mkdir svn cd svn svn checkout http://sand.googlecode.com/svn/trunk/ cd trunk bash makeSAND
cp -f /home/sand/svn/trunk/* /usr/local/bin/ chmod a+x /usr/local/bin/*
cp -f /home/sand/svn/trunk/localconfig /home/sand Fits utility programsOur spectra extraction scripts are using fits utilities developed by HEASARC at NASA. Some other scripts were added, but all rely on LIBFITSIO. These utilities are placed in /home/sand/svn/trunk/fits-utils/ . To install, do as root: cd /usr/include ln -s cfitsio/* . cd /home/sand/svn/trunk/fits-utils ln -s /usr/include/cfitsio/* . ./fits-utility note it was impossible to link to cfitsion normaly so we made local symbolics links. This step may not be necessary for futurs versions of the distribution. Access to serial port ttyS0 and usb port in order to control mounts (Meade LXD-75 or Servo-city PT785-S) and to ports video0 or video1 for the mount webcamIt seems that the serial port is not available by default to a user in the terminal and the remote web control can not access it. A patch to remedy to this is to put the port in the sand group. But we must ensure that the group sand has the writing and reading permissions. All users of the system must be able to access the serial port, so you have to give permissions to read and write to all. As root, create the script «openserial» in /etc/init.d/ with execution permission echo '#!/bin/bash' > /etc/init.d/openserial echo "chgrp sand /dev/ttyS0" >> /etc/init.d/openserial echo "chmod g+rw /dev/ttyS0" >> /etc/init.d/openserial echo "chmod a+rwx /dev/video0" >> /etc/init.d/openserial echo "chmod a+rwx /dev/video1" >> /etc/init.d/openserial echo "chgrp -R sand /dev/bus" >> /etc/init.d/openserial echo "chmod -R g+rwx /dev/bus" >> /etc/init.d/openserial chmod u+x /etc/init.d/openserial N.B. If the computer have its builtin webcam (sometimes the case for laptops), the external mount webcam will be available on the USB device /dev/video1 instead of /dev/video0 . As root do cd /etc/rc5.d ln -s ../init.d/openserial S93openserial Active archive
Learn more about that
SkycalcSkycalc allows ephemeris calculations that provide, among other time of the astronomical twilight ans sunset. These data will be used to manage the launch of observation requests. However a number of additional information will also be archived in the execution log file as the percentage of the lunar disk illuminated.
cd /home/sand/Downloads gzip -d skycalc.c.gz cc skycalc.c -o skycalc -lm cp skycalc /usr/local/bin/ Lear morepyephemNote: il manque des dependances a cette installation. Voir le journal des etudiants 2013-2014 Another ephemeris library using python.
cd /$HOME/Downloads gzip -d pyephem-3.7.5.1.tar.gz tar -xvf pyephem-3.7.5.1.tar
cd pyephem-3.7.5.1 python setup.py install Servo city PT785-S Pan / Tilt mount with pololu Micro Maestro 6-Channel USB Servo ControllerOnly do this step if you have this hardware. The default is the Meade's LXD-75 mount via autostar handpad 497. PT785-S is clearly less accurate (of the order of 1 deg) but it could be enough as light pollution do not varry at high angular frequencies.
cd /home/sand/Downloads gzip -d maestro-linux.tar.gz tar -xvf maestro-linux.tar cd maestro_linux
cd /home/sand/Downloads/maestro_linux cp * /usr/local/bin D-LINK router configurationThe router is useful when SAND is connected to the Internet and that the appropriate ports are open to take control of the instrument remotely. If the system is not connected to the internet, a simple network switch or hub is sufficient.
Apache serverWe are using the Apache web server. This server allow the remote control from a web interface. It allow also browsing the database. To activate the web server, we must:
echo "UserDir public_html" >>/etc/httpd/conf/httpd.conf echo "<Directory /home/*/public_html>" >>/etc/httpd/conf/httpd.conf echo " AllowOverride All " >>/etc/httpd/conf/httpd.conf echo " Options MultiViews -Indexes Includes FollowSymLinks" >>/etc/httpd/conf/httpd.conf echo " <IfModule mod_access.c> " >>/etc/httpd/conf/httpd.conf echo " Order allow,deny " >>/etc/httpd/conf/httpd.conf echo " Allow from all " >>/etc/httpd/conf/httpd.conf echo " </IfModule> " >>/etc/httpd/conf/httpd.conf echo "</Directory> " >>/etc/httpd/conf/httpd.conf echo "<Directory /home/sand/public_html/cgi-bin>" >>/etc/httpd/conf/httpd.conf echo " AllowOverride All " >>/etc/httpd/conf/httpd.conf echo " Options +Indexes FollowSymLinks ExecCGI " >>/etc/httpd/conf/httpd.conf echo " <IfModule mod_access.c> " >>/etc/httpd/conf/httpd.conf echo " Order allow,deny " >>/etc/httpd/conf/httpd.conf echo " Allow from all " >>/etc/httpd/conf/httpd.conf echo " </IfModule> " >>/etc/httpd/conf/httpd.conf echo "</Directory>" >>/etc/httpd/conf/httpd.conf echo "<Directory /home/sand/public_html/data> " >>/etc/httpd/conf/httpd.conf echo " Options +Indexes " >>/etc/httpd/conf/httpd.conf echo "</Directory>" >>/etc/httpd/conf/httpd.conf
service httpd restart
cd /home chmod a+x sand
mkdir /home/sand/public_html cd chmod a+rx /home/sand/public_html
mkdir /home/sand/public_html/cgi-bin mkdir /home/sand/public_html/data cd /home/sand/public_html/cgi-bin ln -s /home/sand/public_html/data data
cd /home/sand/public_html echo "AuthUserFile /home/sand/.htpasswd" > .htaccess echo "AuthGroupFile /dev/null" >> .htaccess echo "AuthName \"Acces securise au site\"" >> .htaccess echo "AuthType Basic" >> .htaccess echo "<LIMIT GET POST>" >> .htaccess echo " Require valid-user" >> .htaccess echo "</LIMIT>" >> .htaccess
cd /home/sand/public_html/data echo "AuthUserFile /home/sand/.htpasswd" > .htaccess echo " AuthGroupFile /dev/null" >> .htaccess echo " AuthName \"Acces securise au site\"" >> .htaccess echo " AuthType Basic" >> .htaccess echo " <LIMIT GET POST>" >> .htaccess echo " Require valid-user" >> .htaccess echo " </LIMIT>" >> .htaccess
cd /home/sand /usr/bin/htpasswd -c /home/sand/.htpasswd sand
cp /home/sand/svn/trunk/cgi-bin/* /home/sand/public_html/cgi-bin/ cp /home/sand/svn/trunk/html/* /home/sand/public_html/
chmod go-w /home/sand/public_html/cgi-bin/*
chmod -R a+r /home/sand/public_html Webcam server LINKSYS WVC54GC ou D-LINK DCS-920 et webcam logitech quickcam notebookWe are using a webcam server to track cloudiness and transparency of the window during day time. The webcam server is also usefull to measure the ambiant luminosity. This is obtained by taking the mean grey level of the image. If the mean grey level is higher that a given treshold (typically 10 or 20) then the observe script will pause for 15 min before make another verification of the mean grey level. Observe can also decide to begin observation if the ambiant luminosity is under the threshold when the starting observation time is more than 12 hours later.
crontabThe crond daemon is scheduling repetitive task on lilux system. Users who have the right to use crond can schedule their own tasks to crond. We are using crond to schedule a webcam acquisition every 15 min and to create an animated gif with the last 6 hours images. Allow sand user to use crondAs root, allow sand to use cron by doing: echo sand >>/etc/cron.allow Add program webcamimg to the crond scheduleAs sand, edit crontab cd crontab -e Add the following content: */15 * * * * /usr/local/bin/webcamimg Add program checkmysystem.bash and restartskycam.bash to the root crond scheduleAs root, edit crontab cd crontab -e Add the following content: 30 10 * * * /usr/local/bin/checkmysystem.bash >> /home/sand/checkmysystem.log 13,28,43,58 * * * * /usr/local/bin/restartskycam.bash 13,28,43,58 * * * * /etc/init.d/openserial USB GPS BU-353 from GlobalSatThe GPS is controlled by the gpsd server. The GPS startup may easily take 45 seconds (time to connect to available satallites). Sometime, the GPS do not succeed to connect to satellites. Most of the time this occur when satellites are masked by obstacles like mountains or buildings. The observe script is able to extract latitude and longitude from the GPS and use them for ephemeris calculations. To be shure that the gpsd server will startup with the system do the following steps. As root create the script gpsstart into /etc/init.d . cd /etc/init.d echo "#!/bin/bash" > gpsstart echo "/usr/sbin/gpsd /dev/ttyUSB0" >> gpsstart As root do: cd /etc/init.d chmod a+x gpsstart As root do: cd /etc/rc5.d ln -s ../init.d/gpsstart S94gpsstart UPS controlThe UPS is a power battery backup. It will protect the system against power fluctuations and will allow the system to continue its ongoing tasks during short power failure.
service apcupsd start
apcaccess Monitoring system sensorsOn a regular pc, we can use thermal sensors to monitor the internal temperature of obsand.
sensors-detect
sensors
System rebootNow all the relevant software are installed, in order to activate all newly added functionalities, restart the computer. Configuring the spectrometerOpto-mechanical alignment and focussingThe spectrometer may be aligned following the procedure described in the document titled Operating instructions for the Santa Brabara Instrument Group Deep Space Spectrograph (DSS-7). In that case, it may be usefull to keep a windows partition since CCDOPS is convenient to make alignment with the focus mode. We suggest here an alternative step by step procedure to make the optical alingment and focussion in linux. The DSS-7 have a set of 4 air slits of various width. We are using the thinnest (the one giving the darkest spectrum and thinnest spectral lines). This slit possess a width of 50 microns of 1.45 mm in length. Table 3: Field of view of the spectrometer:
SAND-4 versionTo get the proper spectral image orientation on the CCd matrix (UV to the left and IR at right), the DSS-7 should be attached to the ST-402 camera according to the image below. Figure 1: Proper orientation of the ST-402 relative to DSS-7
night_exposure -b 1 -t 0.121 -pn display nightview.fits & rm -f nightview.fits Then move the small plate in a given way and take another picture. Repeat this step as long as the image of the slit is not the sharpest you can have. At the end, thighten the 2 screws.
Figure 2
Take note that at this step you should have the camera lens attached even if it is not shown on figure 3.
At the end of the alignment procedure, the image of a white surface lighted by a fluocompact lamp, should be similar to image of table 4. We can clearly see on this image the 4 slits dispersion. These slits allow to cover a large span of sensitivity/spectral resolution. We are normally using the highest resolution that keep the signal to noise ratio at a reasonable level. On the same figure, we can notice that the spectral dispersion is correctly alligned horizontally (relative to the red rectangle). But the most important is to be shure that a given spectral line is precisely vertical on the image. This vertical alignment is crutial to get a maximum signal to noise ratio and an optimal spectral resolution. Sometimes the optical assembly is not perfectly done by SBIG and this may result in non perfect orthogonality between the spectral line and the spectral dispersion. This is not a big problem. Securing moving componentsThe DSS-7 spectrometer contain some moving components (the air slit and the grating). Moreover, the grating is supported on a flexible shaft. These moving parts have the disadvantage that if we move the orientation of the spectrometer, there is some small change in grating orientation and then the spectrum moves on the CCD image. We decided to glue those moving parts. We used melted glue applied with a glue gun. That kind of glue may be remove (not without pain...) if required. Refer to figure 2 above to see where the glued spots should be applied. It should be also a good idea to glue the coupling fo the camera and the spectrometer and the spectrometer plate if you plan to travel with the instrument. This will prevent unwanted spectral calibration shifts. Parameters for spectral calibrationIn order to extract the spectral information of the desired air slit from the CCD image we should specify the line numbers of the beginning and end of the spectrum. As an example, on the image show in table 4, we had measured 136 and 218. This information have to appear in the spectral calibration file. There will be different values for different spectrometers units. More over these values may change if the instrument is violently shocked. It could be a good idea to keep an image of a uniform surface lighted by a fluocompact bulb as a reference. This image may be used later to confirm that the spectral calibration had not changed. The spectral calibration file name should allow to clearly identify the spectrometer unit and should contain the date of the calibration process. Here is an example of a spectral calibration file gain= .54442 oorigin= 400.7 quad= 0. lineup= 91 linedown= 175 The conversion pixel to wavelength is done by doing: {#Wavelength(nm)=quad \times {pixel}^2 + gain \times pixel + oorigin #} Table 4: Spectral alignment and calibration
Note that the wavelengths provided in table above are for the peak of the spectral line as observed with a real fluocompact light bulb. This is why it is equal to the nominal wavelength of the given chemical element To determine the spectral calibration parameters, you will need to identify the pixel position on the CCD image of spectral lines identified in table 4 above. The you can use a fitting application like fityk to fit a second order polynomial on the data assuming that x are the pixel position and y the wavelength in nm. But it is important to note that for us, the first pixel of the image is at position 1 (not 0 as it is in display program). Figure 3: Example of spectral calibration with OpenOffice Calc. For that case we set the curve to linear since OpenOffice is not able to fit 2nd order polynomials Download openoffice calc file. For the case presented in figure 3, gain= 0.54056, oorigin= 397.8097 and quad= 0. . OBSAND-2 automated observatoryThe OBSAND-2 observatory is a protecting structure that keeps the spectrometer safe from the outdoor elements and from the extreme temperature variations. OBSAND-2’s objective is to allow the system to be continually operating with its robotized mounting. OBSAND-2 follows a first version called OBSAND and developed by mechanical engineering students (Université de Sherbrooke) and electrical engineering students (Cégep de Sherbrooke) supervised by Martin Aubé (Cégep/Université de Sherbrooke) and Chloé Legris (AstroLab du Mont-Mégantic). Due to the complexity of the construction and the maintenance of the OBSAND, we decided here to design a simplified observatory called OBSAND-2. Figure 4: OBSAND-2 at Sherbrooke University, Quebec, Canada with SAND-3A inside SAND-3A spectrometerSAND-3A was optimized for a fixed installation but can be easily carried on a plane. It consists in a smaller box than OBSAND-2. It has the dimensions of a hand-luggage and can be carried in the cabin. SAND-3 is provided with a starphire glass that can be washed more times. This version was conceived for its installation in China. It has a power of 45 Watt, and can reach 65 Watt when its heating cable is in operation (less than 5 C). The system is controlled by an Acer Aspire One netbook. OBSAND-3 doesn’t include any mounting, and must be aligned in order to point at the zenith. SAND-3A includes less components than OBSAND-2. Here is a list of the revoved components:
Figure 5: SAND-3A at AIOFM center Hefei, Anhui, China For now, SAND-3 isn’t adapted to the very cold climatic conditions because its provided with a heating cable of 21 Watt only. External size of the box:height=13 po Mass: SAND-3B spectrometerThis SAND version is intended for ponctual measurements but can be installed permanently. The main idea is to localize the computer-router tandem far from the webcam server and the spectrometer. The computer and the router are then safely set indoor, while only the spectrometer and the webcam server are exposed to the outdoor elements. In order to assure the communication between the outdoor unit and the indoor control center, we use a network cable for the webcam server and a USB->CAT5 converter for the spectrometer. The outdoor unit must also be powered by electricity. Here is a list of the non present components :
The box protecting the spectrometer is the 516-0010 HAMMOND MFG model. Its dimensions are 8.5po x 14.38po x 9.25po (height). It has its own natural ventilating slits. A mosquito net has been placed on the interior side in front of those slits in order to repeal as much insects as possible. Figure 6: SAND-3B at Sherbrooke University, Quebec, Canada Development documentationTodo list
User's guide |