Menu |
Prof /
IlluminaGuide2014This document is obsolete ILLUMINA USER'S GUIDEMartin Aubé, Ph.D. copyright 2014 General informationIn that document, the red text means that you have to adapt that part to your specific case. Operating systemIllumina should be used with a computer running under linux with a fortran and gcc compilers installed (e.g. gfortran) and mercurial. Other software dependanciesThe following software are needed by the system
Installing the codeILLUMINA model is available from bitbucket: https://bitbucket.org/aubema/illumina All sources codes are released under GNU public licence. To install the model from bitbucket, please follow these steps: If you are a non developer user: cd mkdir hg cd hg hg clone https://bitbucket.org/aubema/illumina If you are graphycs1 developer: cd mkdir hg cd hg hg clone https://graphycs1@bitbucket.org/aubema/illumina Then you must compile the code: cd illumina bash makeILLUMINA Then edit the $HOME/.bashrc file. This will render the executables accessible from anywere on the file system. echo "PATH=$PATH:$HOME/hg/illumina/:$HOME/hg/illumina/bin" >>$HOME/.bashrc cd source .bashrc Making light inventory for each spectral lineWe have to create zones files. In ILLUMINA, zone files allow the user to define different geographical zones with different type of lamp (different by their relative contribution to the VIIRS-DNB satellite imagery, photometry function or light output pattern (LOP), lamp height). Two or more zones may be in the same geographical region or partly overimposed. Since each zone defines the lamp photometry, the user have to combine both lamp type LOP in an average LOP to define some kind of new combined lamp type. By default, as a first step, all the geographical domain will be defined by 2 zones (urban and contryside). These two cases are discriminated on the basis of a threshold value to the VIIRS-DNB relative radiance. Then additional zones are defined as circle shaped zones with center position and radius. Each new zone overwrite the previous. To create zone you have to edit a .zon file with a simple text editor like kwrite or gedit following the format shown below: Sample .zon file for a Hg spectral line5 14 95Cobra_5Sentinel.dat ! Number_circular_zones [City:86%Na 14%Hg] photometry-file-name-city 0.98 34 66Cobra_34Sentinel.dat ! city-threshold [Countryside:66%Na 34%Hg] photometry-file-name-countryside 241 50 8 10 93Cobra_7Helios.dat ! x-pos_1 y-pos_1 r_1 [Sherbrooke(zone1):90%Na 10%Hg] photometry_file_zone1 306 58 25 11 67Helios_22Cobra_11Sentinel.dat ! x-pos_2 y-pos_2 r_2 [IDSR(zone2):89%Na 11%Hg] photometry_file_zone2 305 55 2 0 A210.2.dat ! x-pos_3 y-pos_3 r_3 [Astrolab's parking(zone3):LPS 0%Na 0%Hg] photometry_file_zone3 264 52 4 20 40Helios_40Cobra_20Sentinel.dat ! x-pos_4 y-pos_4 r_4 [Cookshire(zone4):80%Na 20%Hg] photometry_file_zone4 321 73 3 20 40Helios_40Cobra_20Sentinel.dat ! x-pos_5 y-pos_5 r_5 [Lac-Megantic(zone5):80%Na 20%Hg] photometry_file_zone5 First line contentThis line contain 3 elements:
Second line
Following lines
Find a VIIRS-DNB image in ILLUMINA's standard pgm formatSample file for southern part of Quebec province Create a reflectance image in ILLUMINA's standard pgm formatWe are using MODIS reflectance product for summer (~mid August) and winter (~mid February) at the nearest neighbourg wavelength according to the following table:
You must choose the MODIS date to fit the VIIRS-DNB date. Example of MODIS band 4 reflectance for year 2009: Run viirs2lum programRun program viirs2lum with files created at steps 5.1, 5.2, 5.3 as summarized below:
Quick file checkOpen all the _lumlp_NN.pgm files to confirm that they are realistics according to the specific experiment. lumlp files are giving the light luminosity for each zone at the given wavelength. Examples with 546 Hg line but contrast boosted
Zone 5, wich is the Astrolab parking lot, have not been shown here because there is no Hg lamps. This image was consequently completely black. Preparation of the batch fileThis file is a bash program that will generate a lot of running experiment according to the number of desired cases for each variable. We must define the following variables in the makeBATCH program:
We must also define the following arrays in makeBATCH program:
Preparing a different directory for each period of the year and for each relative humidityCreate a directory for each air moisture analyzed in which two sub-directory will be included, e.g. for summer and winter. In our case, we create three directories or RH50, RH80 and RH70. Then, we must put in each directory all the files required for the computation. Submitting the calculations to a linux clusterTo perform the calculations, we now connect to a 'Cluster'. In our case, we connected to 'Galileo' or 'Mammouth serial II' respectively at Cégep de Sherbrooke and at Université de Sherbrooke. Then it is necessary to recompile the ILLUMINA model using 'makeILLUMINA' or through the following command: bash makeILLUMINA The required directories created in step 7 should now be transferred to the cluster interactive node via the scp protocol. Preparing the batch executionNow we need to adapt the program that will run the multiple calculations (i.e. makeBATCH of makeBATCH-territory) for each experiment directory on the cluster. Copy the original file from $HOME/svn/illumina/trunk to the directories and then edit the makeBATCH file in each directory to reflect the particular situation (season or period, relative humidity). Then execute the script: nohup bash makeBATCH %blue%output_batch_file & Notes:
list=`qstat @ms -u maube`;for i in $list; do if [ `echo $i | grep ms ` ] ; then echo $i;qdel $i;sleep 0.01; fi;done To execute the calculations, perform the following command: bash output_batch_file This step should be repeated for each season or period and each relative humidity value. Extracting resultsILLUMINA generates two image files by calculation, a file showing the contribution (PCL) and the other illustrating the sensitivity to light pollution (PCW). It also produces the radiance value in the calculated direction. Now it's time to extract the data and rename files obtained since the names assigned by % blue% output_batch_file do not indicate all the required values for the files to be indexed correctly on the portal. Currently this information is listed in the directory names containing the results. To extract the data, you have to go to each execution directory (each one must contain a gridmap directory) create a list of files to extract. To do so go to the $HOME directory and type: cat ''word'' ''exp_name'' > ''exp_name''.list here word is a string contained in all the execution experiment. Cop the .list file in the execution diretory and extract the data: extract-output-data.bash exp_name exp_name.list At the end of the execution of extract-output-data.bash a Results directory has been created and it will contain all PCL files (ex .: PCL-x302y58-2005-ta0 .05-wl436-el15-az0.pgm), all PCW files (ex.L PCW-x302y58-2005-ta0.05-wl436-el15-az0.pgm) and .out files (the log of each execution). Add some color to your lifeIl peut être plus facile d'analyser une carte lorsque celle-ci est en couleur. Pour ce faire, il faut d'abord savoir quel est la résolution numérique de l'image (8bit ou 16 bit) à l'aide de la commande suivante: more ete_...*pgm
Selon la résolution de l'image, on utilisera le programme pgm8bit2color.bash ou le programme pgm16bit2color.bash. Donc, on entre le programme approprié suivi du nom du fichier à mettre en couleur. Par exemple: pgm16bit2color.bash PCL-x302y58-2005-ta0.05-wl436-el15-az0.pgm Renommage des fichiers pour le portailPour être bien indexés par le portail les fichiers doivent être nommés comme suit: PCL-Astrolab_b_midnight_summer_2005-ta0.05-wl436-el15-az0.pgm Signification: PCL = type de données Astrolab = nom du site d'observation b_midnight_summer_2005 = période (b_midnight est pour before midnight, période par défaut des données VIIRS-DNB) ta0.05 = épaisseur optique des aérosols de 0.05 wl436 = longueur d'onde de 436nm el15 = 15 deg d'angle d'élévation az0 = 0 deg d'angle d'azimuth Exemple de commande pour renommer les fichiers ci-haut correctement: list=`ls -1 *x302y58-2005*`;for i in $list; do o=`echo $i |sed 's/x302y58-2005/Astrolab-b_midnight_summer_2005/g'`;mv $i $o; done Essentiellement cette commande changera x302y58-2005 pour Astrolab-b_midnight_summer_2005. I.e. avant le tiret, c'est le nom du site d'observation qui remplace la position et après on met la période de la nuit suivie de la saison et de l'année. Les tirets séparent les champs utilisés par le portail alors que les underscore servent à séparer les mots d'un champs donné. Par ex., le champ période contient 4 mots (b, midnight, summer, 2005). Notez que si la modélisation a été faite pour après minuit on utilisera les mots a et midnight (a_midnight) et si la modélisation correspond à l'hiver on utilisera le mot winter. Le nom du site est à la discrétion de l'utilisateur du présent guide mais devra ne pas porter à confusion pour les futurs usagers du portail. Quick using guide for mercurialTo publish your locally modified codes on the serverhg commit -u graphycs1 -m "nouveau printout" hg push To update your local version of the codeshg pull hg update |