{"id":16,"date":"2018-05-07T09:33:52","date_gmt":"2018-05-07T09:33:52","guid":{"rendered":"http:\/\/ross2.oas.inaf.it\/wp\/imprs18\/?page_id=16"},"modified":"2021-12-09T21:03:17","modified_gmt":"2021-12-09T19:03:17","slug":"the-course","status":"publish","type":"page","link":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/the-course\/","title":{"rendered":"The course"},"content":{"rendered":"<p>*** WORK IN PROGRESS ***<\/p>\n<p><strong>Index:<\/strong><\/p>\n<ul>\n<li><a href=\"\/wp\/imprs18\/system-requirements\">Requirements<\/a><\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/data-sources\/\">Data sources<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/installing-sid\/\">Installing SID<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/installing-dif\/\">Installing DIF<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/installing-mcs\/\">Installing MCS<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/installing-mysql-udfs\/\">Installing custom UDFs<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/php-demo-programs\">PHP demo program<\/a> &#8211; <i>importing VOTables<\/i><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/php-demo-programs\">Python demo programs<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/c-demo-programs\">C demo programs<\/a><\/li>\n<li><a href=\"\/wp\/imprs18\/client-software\/julia-demo-programs\/\">Julia demo programs<\/a> &#8211; <i>importing FITS tables<\/i><\/li>\n<li><a href=\"\/imprs-db\/Soft\/C++\">C++ demo programs<\/a> &#8211; TODO<\/li>\n<li><a href=\"\/imprs-db\/Soft\/F77\">Fortran77 demo programs<\/a> &#8211; TODO<\/li>\n<li><a href=\"\/wp\/imprs18\/software\/idl-demo-programs\">IDL demo programs<\/a> &#8211; <i>plotting HEALPix sky maps<\/i><\/li>\n<li><a href=\"\/wp\/imprs18\/software\/web-demo-pages\/\">AMP + JavaScript<\/a> &#8211; <i>DB web interface<\/i><\/li>\n<li><a href=\"\/wp\/imprs18\/troubleshooting\/\">Troubleshooting<\/a> &#8211; TODO<\/li>\n<li><a href=\"\/wp\/imprs18\/db-words\">DB words<\/a><\/li>\n<\/ul>\n<p><strong>Note:<\/strong> We assume that you have created a working directory, e.g. <tt>mpe2018<\/tt>, in your <tt>$HOME<\/tt><\/p>\n<pre>\r\nshell> cd\r\nshell> mkdir mpe2018\r\nshell> cd mpe2018\r\n<\/pre>\n<p>and downloaded (or will download when requested) the course files with a directory structure like this:<br \/>\n<a name=\"mpe2018_dirtree\"><\/a><\/p>\n<pre style=\"font-size: 120%;\">\r\n  <a href=\"\/imprs-db\/\" target=\"_blank\" rel=\"noopener\"><strong>mpe2018<\/strong><\/a>\r\n  |   <a href=\"\/imprs-db\/soft_dirs.tar.gz\">soft_dirs.tar.gz<\/a>\r\n  |-- <a href=\"\/imprs-db\/Data\">Data<\/a>\r\n  |-- <a href=\"\/imprs-db\/Docs\">Docs<\/a>\r\n  |-- <a href=\"\/imprs-db\/Web\">Web<\/a>\r\n  `-- <a href=\"\/imprs-db\/Soft\">Soft<\/a>\r\n      `-- <a href=\"\/imprs-db\/Soft\/C\">C<\/a>\r\n      |   |-- <a href=\"\/imprs-db\/Soft\/C\/UDFs\">UDFs<\/a>\r\n      |   `-- <a href=\"\/imprs-db\/Soft\/C\/dbIO\">dbIO<\/a>\r\n      |\r\n      |-- <a href=\"\/imprs-db\/Soft\/C++\">C++<\/a>\r\n      |-- <a href=\"\/imprs-db\/Soft\/F77\">F77<\/a>\r\n      |   `-- <a href=\"\/imprs-db\/Soft\/F77\/mcs_fdemos\">mcs_fdemos<\/a>\r\n      |\r\n      |-- <a href=\"\/imprs-db\/Soft\/IDL\">IDL<\/a>\r\n      |-- <a href=\"\/imprs-db\/Soft\/Julia\">Julia<\/a>\r\n      |-- <a href=\"\/imprs-db\/Soft\/PHP\">PHP<\/a>\r\n      |-- <a href=\"\/imprs-db\/Soft\/Python\">Python<\/a>\r\n      `-- <a href=\"\/imprs-db\/Soft\/SQL\">SQL<\/a>\r\n<\/pre>\n<p>For convenience, the tar file <tt>soft_dirs.tar.gz<\/tt> contains the whole <tt>Soft<\/tt> tree structure.<br \/>\nDownload it in the <tt>~\/mpe2018<\/tt> directory (or another you prefer) and untar it:<\/p>\n<pre>\r\nshell> cd ~\/mpe2018\r\nshell> wget https:\/\/ross2.oas.inaf.it\/imprs-db\/soft_dirs.tar.gz\r\nshell> tar zxvf soft_dirs.tar.gz\r\n<\/pre>\n<blockquote><p>To download the whole <tt>Data<\/tt> directory, see the instructions in the <a href=\"\/wp\/imprs18\/data-sources\/\">reference page<\/a>.<\/p><\/blockquote>\n<p>Some of these files will be overwritten during the course, so verify your local version matches that on the website.<\/p>\n<p>Commands are to be executed in a terminal either at the shell prompt or the MySQL prompt. When there could be ambiguity, the <tt>shell&gt;<\/tt> or <tt>mysql&gt;<\/tt> prompt is shown explicitly.<\/p>\n<p>Examples:<\/p>\n<pre>\r\ncd ~\/mpe2018\/Data\r\n\r\ncurl -o cx_out.xml --form coordFormat=decimal --form outputFormat=vot --form query='SELECT TOP 50 m.name, m.ra, m.dec, m.significance, m.flux_aper_b, m.alpha FROM master_source m WHERE (m.significance > 10.0 AND m.pileup_flag = 0)' 'https:\/\/cda.cfa.harvard.edu\/csccli\/getProperties'\r\n\r\ncurl -o cx_out.txt --form coordFormat=decimal --form query=@csc_query.sql 'https:\/\/cda.cfa.harvard.edu\/csccli\/getProperties'\r\n<\/pre>\n<p>And this is the content of <strong>csc_query.sql<\/strong>:<\/p>\n<pre>\r\nSELECT DISTINCT m.name, m.ra, m.dec, m.extent_flag, m.err_ellipse_r0, m.err_ellipse_r1, m.conf_flag, m.flux_aper_b, m.flux_aper_w, m.significance FROM master_source m WHERE (m.significance > 10.0 AND m.pileup_flag = 0)\r\n<\/pre>\n<p>You can substitute the previous query for example with this and rerun:<\/p>\n<pre>\r\nSELECT DISTINCT TOP 1000 m.name, m.ra, m.dec, m.err_ellipse_r0, m.conf_flag, m.sat_src_flag, m.significance, m.flux_aper_b, m.flux_aper_w FROM master_source m WHERE (m.significance > 10.0 AND m.pileup_flag = 0) ORDER BY name ASC\r\n<\/pre>\n<p>Note how we used <tt>vot<\/tt> for the output file. This refers to the <strong>VOTable<\/strong> format. It will be used transparently in some examples, but if you want to know about it, have a look to the <a href=\"https:\/\/www.ivoa.net\/documents\/VOTable\/20130315\/PR-VOTable-1.3-20130315.html#ToC7\" rel=\"noopener\" target=\"_blank\">reference document<\/a>. <\/p>\n<h3>Python demo programs<\/h3>\n<p>You need to install the <tt>MySQLdb<\/tt> package (but other options exist). E.g. on Linux Debian\/Ubuntu:<\/p>\n<p><code>sudo apt install python-mysqldb<\/code><\/p>\n<p>See the <a href=\"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/client-software\/python-demo-programs\/\">demo page<\/a>.<\/p>\n<h3>PHP demo programs<\/h3>\n<p>To communicate with the database we use the <tt>MySQLi<\/tt> Extension. Please see the demo programs source code and refer to the <a href=\"https:\/\/php.net\/manual\/book.mysqli.php\" rel=\"noopener\" target=\"_blank\">mysli manual pages<\/a>.<\/p>\n<p>See the <a href=\"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/client-software\/php-demo-programs\/\">demo page<\/a>.<\/p>\n<h3>Julia demo programs<\/h3>\n<p>You need to have Julia installed. Please refer to the <a href=\"https:\/\/julialang.org\/\" rel=\"noopener\" target=\"_blank\">Julia web site<\/a>.<\/p>\n<h3>IDL and Fortran demo programs<\/h3>\n<p>You need to have MCS installed. Please refer to <a href=\"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/software\/mcs-install\/\">this page<\/a>.<\/p>\n<p>See the <a href=\"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/client-software\/idl-demo-programs\/\">demo page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>*** WORK IN PROGRESS *** Index: Requirements Data sources Installing SID Installing DIF Installing MCS Installing custom UDFs PHP demo program &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-16","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/pages\/16"}],"collection":[{"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":0,"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/pages\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/ross2.oas.inaf.it\/wp\/imprs18\/wp-json\/wp\/v2\/media?parent=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}