mercredi 16 novembre 2016

RCE 2016: Rencontres du Ciel et de l'Espace

Every two years, the french astronomical association (AFA: Association Française d'Astronomie), who is also publishing the major french astronomical magazine "Ciel & Espace", organize a big astronomy fair in Paris: RCE. It takes place at La Villette, a science center in Paris.


RCE is THE major meeting place for amateur astronomers from all the country (and more). There are more than an hundred conferences. Some talks are from key professional astronomers, several are from amateurs presenting their work. This year, I presented an introduction to spectroscopy with some historical background as well as key laxs such as Kirchhoff"s laws and Doppler-Fizeau effect.



Link to the talk slides (french):
http://thizy.free.fr/spectro/slides/20161111_Initiation-a-la-spectroscopie_OThizy.pdf


At the end, I had the opportunity to see the conference of Hubert Reeves on atoms and their creation (and their abundances in the universe with iron Fe peak and Li-Be-B gap)... It reminded me of a talk he gave 30 years ago at my engineering school (with more equations at that time!), and the ratio He/H just after the big bang... Anyway, it was very nice to see him again! Here are couple of pictures from Stéphane Neveu (my smartphone battery was dead by then!):


Hubert Reeves talk


This show, which attracted around 7500 people, is also a great opportunity to see some new products. This year we had a lot and I can't cover them all. I noticed a new Sharck-Hartmann from Alcor Prism company and an autonomous/automatic visual assisted scope designed by the french startup company Vuonis. This last one has a very nice design and seems a great "toy" for those who just want to see some nice objects, show them to their family/friends & share the images through social networks. A new astronomy in my opinion - anxious to see it in real conditions under clear skies! Here is a picture from Pierre Barroy:


A special note on a low consumption, simple to use but powerful & evolutive AstroPIBox designed by Sébastien Vauclaire & Philippe Deverchère:

 Philippe showing the AstroPiBox to Christian Buil & Valérie Desnoux

Sébastien Vauclair, David Nagler (Televue) & myself
talking about AstroPiBox and other things [Trump! :-)]

 Sébastien was surprised and happy to receive... an asteroid named after him!
I know the feeling... :-)



But RCE is a major place to meet all the friends in the astronomy world! So I was of course in several meal/discussion/groups through the week-end... A very happy moment!!!

a new astronomy tool? no... just France-Sweden soccer match
watched by Christian Buil & ALain Klotz! :-)





One of the (many) dinner group...



Looking forward (already!) for the 2018 edition!!!

mercredi 12 octobre 2016

V711 Tau - a RS CVn star

V711 Tauri is a RS CVn star. It is a binary system with a late evolved chromospherically active star and a main-sequence or sub-giant companion. With a magnitude V=5.64, it is fairly bright and within reach of 0.28m telescope with the echelle instrument. The binary period is 2.8 days.

A key article on this system and why to observe it is there:
https://arxiv.org/abs/astro-ph/0303154


telescope inside the dome with optical fibers


On the night of october 9th, I woke up around 1am to check the sky and it cleared up from cloudy evening. I started acquisition of 10 min exposures, signal seemed ok.

 first spectrum of the serie, quickly reduced in ISIS


The signal went up at the beginning as the star was rsing high in the sky but after few hours I noticed the signal was getting poor - a quick check outisde confirmed that clouds were coming back. Oh well, I got 20 spectra covering around 4 hours of time.

observatory control computer screen shot at the end of the acquisitions


I reduced the 20 spectra together to obtain a high signal-to-noise spectrum but I also looked at the individual spectra over time around Halpha, no significant change nor shift seems to appear (maybe a small shift, to be confirmed).

merged spectrum (over the visual domain)

Halpha (order 34) 

spectrogram over 4 hours (Y axis is time, X axis is wavelength); bright line is H alpha


Olivier Garde observed it on october 3rd and I was able to observe it again night of october 11th.

PRISM control screen at the end of the observing run on V711 Tau on october 11th
with Gemini hand controler & telescope camera also visible


Here is a comparison of those three observations, there are some radial velocities involved due to the binarity of this system (Doppler effect):


and the code in MAtLab using my scripts to obtain this graph (modified for the Y legend & title full text):
otz_plot -600 800 0 1 '_v711tau_20161003_966_34.fit' -f '_v711tau_20161009_987_34.fits' -f '_v711tau_20161011_950_34.fits' -y p 1 2451142.943 2.83774 -w Ha -s 6549 6550 -x RVH -t s 'V711 Tauri (RS CVn star) - Halpha - Olivier Garde & Olivier Thizy' -l Doi -p png

Here is the spectrogram obtained in ISIS with the one from october 9th (on top) as a comparison:


On can see that Halpha emission (but not only) is actually shifting toward the blue during the approximatly 5 hours total exposure. A graph showing the first and last exposure show a shift of about 40km/s in about 5 hours:


This is promising for the future and more observations are required!...

dimanche 9 octobre 2016

Jour de la Nuit - Le Versoud with GAG

October 8th, 2016 was a national day to switch back the stars. Around 700 event were organized in France. One occured in Grenoble and one in a small city close by - Le Versoud. It was organized by the GAG - Groupement Astronomique du Grésivaudan: https://groupeastronomiegresivaudan.fr/

I went to help them and after a talk done by the president of the association, wer were lucky enough to see the Moon between clouds. Around 30 people were there, with lof ot small children.

mercredi 5 octobre 2016

441 days later...

Hello,


I have my observatory up and running for 441 days now. I looked at my notes and I have observed 60 nights - so around 14% of the nights or an average of more than 4 nights per month.

Total observing hours is around 300h (so 5h in average per night... but winter nights are coming back!). I also have a strong increase after I left Shelyak with 32 nights and 179 hours observing since that time - I am wondering why... :-)

I recorded 230 spectra/targets (around 4 per night) for a total exposure time of 153h (6.4 days!) so an average of 40min total exposure time per target.

My exposure/observing ratio is 51% (in other word, I have around 49% 'overhead' time). This could be just time to start & open the observatory, visual observation with other people (they are included in), time to point a target, maintenance time, etc... There is room for improvement there as 49% is too high. Several issue with guiding and GoTo accuracy due to motor stalled or motor lag is the primary root cause and I'm working to improve it.


I have put my spectra in a personal database, similar to what I use for ARAS spectra I am responsible for. The list of spectra with a thumbnail:
http://www.astrosurf.com/thizy/obe/db/index.htm

And the last one only with some details for each spectra:
http://www.astrosurf.com/thizy/obe/db/last_index.htm


lundi 3 octobre 2016

Titan mount adjustments & Number of exposures calculation using SNR

OK, I made some finetuning of the mount few days ago and acquisition are much easier now. I still have few "motor stalled" so I need to work on this again but now the pointing model is great and I can point my targets within the field of the guiding camera. If I resync on a target and go to another one close by, usually it points very close to the fiber hole!

Tonight's session is done remotely from the house. It works great and I can watch Star Trek Into Darkness on TV tonight! :-)


I have also improved my procedure by measuring the SNR of the first spectrum (or using the first two spectra, dividing them and calculating single exposure SNR = measured SNR / 1.4). I then use the single exposure SNR to calculate the number of exposure to reach 100 of signal to noise ratio:
Nb Exp = (100/[single exposure SNR])^2

My first exposure time is set so I reach maximum ADU around 40000. This means that once I know the number of exposure, I can reuse the same number for all my acquisition of the same target no matter what sky conditions are, I just adjust the exposure time to reach 40000 max ADU...



dimanche 2 octobre 2016

Constellation 738 - Savoie/Isère meeting with clubs

Some time ago, I initiated some public outreach observing evening in Revel with several people and clubs from the area. Some people - specially from the GAD (Groupe d'Astronomie du Dauphiné) club - have picked up from there and organized some discussions between clubs & isolated astronomers to group together and organise combined events.



On october 1/2, in chamrousse, an 'Inter Club' was organised and a name (Constellation 738: 73 for Savoie area & 38 for Isère area) was proposed. Goal is to help in communicating events, work together if/when the Planetarium of Grenoble/Claix is build, organize big event together...

Here are some pictures from GAD during this event where I did a talk on introduction to spectroscopy...






GAD web site is: http://www.astrosurf.com/gad/



vendredi 2 septembre 2016

ARAS dataBase

Hello,


ARAS is the Astronomical Ring for Access to Spectroscopy. It is an informal group of people set in 2003 after the pro/am astrophysics school of Oléron organized by CNRS and AUDE association

ARAS aims to promote cooperation between professional and amateur astronomers in the field of spectroscopy.

To this end, ARAS has prepared the following roadmap:
• Identify  centers  of  interest  for  spectroscopic  observation  which  could  lead  to  useful,  effective  and  motivating  cooperation  between  professional  and  amateur  astronomers.
• Help developping the tools required to transform this cooperation into action  (i.e.  by  publishing  spectrograph  building  plans,  organizing group  purchasing  to  reduce  costs,  developing  and  validating  observation  protocols,  managing  a  data  base,  identifying  available  resources  in  professional  observatories  (hardware,  observation  time),  etc.
• Develop  an  awareness  and  education  policy  for  amateur  astronomers  through  training  sessions,  the  organization  of  pro/am  seminars,  by  publishing  documents  (web  pages),  managing  a  forum,  etc.
• Encourage observers to use the spectrographs available in mission observatories and promote collaboration between experts, particularly variable star experts.
• Create a global observation network.


ARAS is first a front web page:
http://www.astrosurf.com/aras/

You will find there lot of ideas of projects to run with your astronomical spectrograph.
I would like to highlight two newsletters published on regular basis:
Be stars: http://www.astrosurf.com/aras/surveys/beactu/index.htm
Eruptive stars: http://www.astrosurf.com/aras/novae/InformationLetter/InformationLetter.html
(whose content is broader than simply eruptive stars!)


ARAS is also a discussion group on Yahoo group:
https://groups.yahoo.com/neo/groups/spectro-l/info

Alerts and request for observations are usually published on this discussion group.


For more permanent archive and more structured information, ARAS has also a forum:
http://www.spectro-aras.com/forum/

This is THE place for spectroscopy, to get ideas, latest campaign information, exchange with others... Well, not THE only one as Thomas Eversberg mentionned on the Spectro-L discussion group:

I take the liberty to mention the two most active other groups who do the same as ARAS including my personal impression about their activities.

SASER - the Southern Astro Spectroscopy Email Ring (http://saser.wholemeal.co.nz/)  is the only amateur-professional group in the south. The perform extremely well organized campaigns on a number of objects (e.g., O, Be and WR stars – pro-level). Neglecting the advantage to obtain data from the galactic center I experience an extremely well organized and coordinated team from (presently) New Zealand, Australia and Brazil. That means that these fellows can start COORDINATED observations within some hours over the (almost) entire southern hemisphere. The main SASER focus is on campaigns but technical issues are also discussed.

VdS Spectroscopy (http://spektroskopie.fg-vds.de/) is the German and from my knowledge the oldest amateur-professional group in the world. VdS organized a number of amateur-professional campaigns (e.g., O, Be and WR stars) plus observations of galaxies and nebulae. However, its main focus is on technical issues (pro-level) considering the respective discussions in its bilingual (German/English) forum and the weather conditions in Germany (that is why the group organized two extremely long amateur-professional campaigns on Tenerife). Twice a year  the group also publishes its (almost 25 year old) free online Journal SPEKTRUM as pdf which reflects ongoing work within the group. And every year there is a conference to discuss with others in person (2017 in Switzerland)

Some colleagues are active in ARAS, SASER and VdS, some in two of them but all groups are all working on a very high (partly professional) level.


For stars for which an observation campaign is clearly identified - ie: one or more amateur(s) is (are) willing to help validating the spectra and coordinating the observation AND one or more professional(s) astronomer(s) show(s) some interest - a database exists to collect and archive the spectra. This is the ARAS spectra dataBase:
http://www.astrosurf.com/aras/Aras_DataBase/DataBase.htm


François Teyssier has done a tremendous job (really tremendous!) in setting up the dataBase using Excel spreadsheets and maintaining it - alone - since the beginning.

I have volunteered long time ago to be of some assistance and be responsible for:
-VV Cep (or zeta Aurigae) type of stars; Ernst Pollman is very active to monitor VV Cep and
-LBV Luminous Blue Variable (mainly P Cygni) stars for which Ernst Pollman is very active in monitoring Halpha and HeI 6678 lines for exemple
-Micro Quasars (SS433, Cygnus X-1); Kathrine Blundell from Oxford is interested in such spectra and it is any fun to see such changes and so high velocities such as in the case of SS 433!

Truth is that I have not been very confortable in using Excel macros and prefered to write my own MatLab code to do the dataBase web pages. They don't look exactly the same as Excel's one but are close enough.

Process is now in place (finally, I can hear François sigh of relief!) to receive spectra, check them and update the web page/dataBase.

There are three web pages, one for each campaign/group:
VV Cep: http://www.astrosurf.com/aras/Aras_DataBase/VVCepStars.htm
LBV: http://www.astrosurf.com/aras/Aras_DataBase/LBV.htm
Micro Quasars: http://www.astrosurf.com/aras/Aras_DataBase/MicrosQuasars.htm


From a technical point of view, I use two scripts; they are given at the end of this blog for reference/archive.

Here is my process: fFirst I updated my local dataBase with the FITS file I receive. The FITS file should be compliant with BeSS format and the filename should follow some convention: asdb_NomObjet_aaaammdd_hhh

See for more details:
http://www.astrosurf.com/aras/Aras_DataBase/Usage.htm

If the spectrum is flux calibrated, I add 'flux' in the filename.
If the echelle spectrum if provided in a ZIP archive, I use the same file root name for both files. The ZIP can also contain a time serie for exemple.

I check them by comparing with the most recent spectrum (or the one closest to it) with a simple graph (I still need to write a third script to help me there but this task is fairly straight forward for the moment).
If I see something strange in the wavelength calibration, overall shape, etc... I put the spectrum aside and contact the observer.

I go in my local dataBase in the proper directory (LBV, VVCepStars, or microquasars) where I have added latest spectra and run dbFitsTable.m script after having changed the campaign by a group code (LBV, VVCep, SS433).

Then I can upload the new spectra, the associated graphs and the updated webpages on ARAS server.


You find the same pages as for the other campaigns with the list of targets with number of spectra, the first and last ones:


You also have for each target a table of all spectra with some information in a structured way:



If you left clic on the spectrum ID you will have a graph. If you right clic on the filename or the ZIP, you can save the spectrum on your hard drive:



But there is also a new feature with the last 10 spectra including a graph of the full specrum and a graph around Halpha/HeI6678 which allow a quick comparison with other spectra:



Olivier Thizy


Annexe 1: dbFitsTable.m
Code for dbFitsTable.m, release 1.0, my first version of the database for those stars:

% dbFitsTable.m
%
% Read spectra from the given directory and create thumbnails and HTML web pages for ARAS database
%
% v1.0 / 20160902 - used for the first release this format on ARAS server
%
% Olivier Thizy
%

clear;
clear all;

Group = 'VVCep'; % 'VVCep', 'LBV', 'SS433' (MicroQuasars) - CHOOSE THE GROUP BEFORE RUNNING dbFitsTable.m !!!
ARAS = true; % true if ARAS database, false if personal one
DisplayGraphs = false; % true to add graphs on web page, false otherwise (ARAS standard)
ReDoGraphs = false; % true to redo the graphs, false otherwise
NbLastSpectra = 10; % number of spectra to display in the last spectra HTML file
SearchSubDirectories = true;
Xlimit1 = 6500; % Wavelength limit for main graph, or -inf
Xlimit2 = 6700; % Wavelength limit for main graph, or -inf




if ARAS
    switch Group
        case 'VVCep'
            %%% IMPORTANT - CHANGE DIRECTORY & FILENAME HERE %%%
            BaseFilePath = 'D:\Aras_DataBase\VVCepStars\'; % Change depending on what campaign we work on !!!
            BaseFilePath2 = '.\VVCepStars\'; % Change depending on what campaign we work on !!!
            MainWebPage = '..\VVCepStars.htm'; % Change depending on what campaign we work on !!!
            CampaignTitle = 'VV Cep stars';
        case 'LBV'
            BaseFilePath = 'D:\Aras_DataBase\LBV\'; % Change depending on what campaign we work on !!!
            BaseFilePath2 = '.\LBV\'; % Change depending on what campaign we work on !!!
            MainWebPage = '..\LBV.htm'; % Change depending on what campaign we work on !!!
            CampaignTitle = 'Luminous Blue Variable stars';
        case 'SS433'
            BaseFilePath = 'D:\Aras_DataBase\Microquasars\'; % Change depending on what campaign we work on !!!
            BaseFilePath2 = '.\Microquasars\'; % Change depending on what campaign we work on !!!
            MainWebPage = '..\MicrosQuasars.htm'; % Change depending on what campaign we work on !!!
            CampaignTitle = 'Micro Quasars';
    end
    MainTitle = 'A.R.A.S. Spectral dataBase';
    MainURL = '..\DataBase.htm';
    MainURL2 = '.\DataBase.htm';
    ObjectName{1} = 'VV Cep';
    webFileName{1} = 'VVCep.htm';
    PreviousURL{1} = '..\VVCepStars.htm';
    webTitle{1} = 'VV Cep stars: VV Cep';
    ObjectRA{1} = '21 56 39.1';
    ObjectDec{1} = '+63 37 32';
    ObjectRem{1} = 'Mag V = 4.9';
    ObjectName{2} = '31 Cyg';
    webFileName{2} = '31Cyg.htm';
    PreviousURL{2} = '..\VVCepStars.htm';
    webTitle{2} = 'VV Cep stars: 31 Cyg';
    ObjectRA{2} = '20 13 37.9';
    ObjectDec{2} = '+46 44 28.8';
    ObjectRem{2} = 'Mag V = 3.8';
    ObjectName{3} = '32 Cyg';
    webFileName{3} = '32Cyg.htm';
    PreviousURL{3} = '..\VVCepStars.htm';
    webTitle{3} = 'VV Cep stars: 32 Cyg';
    ObjectRA{3} = '20 15 28.3';
    ObjectDec{3} = '+47 42 51.2';
    ObjectRem{3} = 'Mag V = 4.0';
    ObjectName{4} = 'zet Aur';
    webFileName{4} = 'zetAur.htm';
    PreviousURL{4} = '..\VVCepStars.htm';
    webTitle{4} = 'VV Cep stars: zet Aur';
    ObjectRA{4} = '';
    ObjectDec{4} = '';
    ObjectRem{4} = '';
    ObjectName{5} = 'P Cyg';
    PreviousURL{5} = '..\LBV.htm';
    webFileName{5} = 'PCyg.htm';
    webTitle{5} = 'Luminous Blue Variables: P Cygni';
    ObjectRA{5} = '20 17 47.2';
    ObjectDec{5} = '+38 01 58';
    ObjectRem{5} = '';
    ObjectName{6} = 'SS 433';
    webFileName{6} = 'ss433.htm';
    PreviousURL{6} = '..\MicrosQuasars.htm';
    webTitle{6} = 'Micro Quasars: SS 433';
    ObjectRA{6} = '';
    ObjectDec{6} = '';
    ObjectRem{6} = '';
    ObjectName{7} = 'Cygnus X-1';
    webFileName{7} = 'cygnusx-1.htm';
    PreviousURL{7} = '..\MicrosQuasars.htm';
    webTitle{7} = 'Micro Quasars: Cygnus X-1';
    ObjectRA{7} = '';
    ObjectDec{7} = '';
    ObjectRem{7} = '';
    NbObjects = 7;
    ObjectName{NbObjects+1} = 'Unknown';
    PreviousURL{NbObjects+1} = '../unknown.htm';
    webFileName{NbObjects+1} = 'unknown.htm';
    webTitle{NbObjects+1} = 'Unknown objects/campaign ???';
    for jj = 1:(NbObjects+1)
        CountObject{jj} = 0;
    end
else
    MainURL = 'index.html';
    MainTitle = 'Personal astronomical spectroscopical dataBase';
    BaseFilePath = 'D:\Acquisitions\00_MySpectroDataBase\DATABASE\THIZY\Observatoire Belle Etoile';
end

location = '.\';


% TO DO:
% ======
%
% ==> Create FITS header only with updated/coherent data (used for faster
% processing after)
%
% ==> Separate web page with latest spectra (same as ARASBeAm (monitoring)
%
% ==> Separate web page with last spectrum and ID for the star + info on
% the campaign (comments).
%
% ==> Split pages per objects + sort data by date
%
% ==> add to the data structure (based on standardised object name):
% --> ARASGroup: Eruptive stars, miscellaneous...
% --> ARASGroupDir for ARAS database directory
% --> ARASSubGroup: MicroQuasars, HMBX, AGN, B[e] stars, VV CEp stars...
% --> ARASSubGroupDir for ARAS database directory
%

% Create list of FITS files in the directpry & subdirectories
ds = datastore(location,'Type','image','IncludeSubfolders',SearchSubDirectories,'FileExtensions',{'.fit','.fits','.FIT','.FITS'});
% if multiple directories, can use {location1,location2,location3} syntax


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Read and process all FITS files headers (without changing them)
% Then print all details in a single HTML web page/table
% TO DO: !!! SORT LINES BY CATEGORY (to be created) / OBJECT / DATE !!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NbFiles = 0;
for i = 1:length(ds.Files)
    fName = char(ds.Files(i));
    [filepath,filename,fileext] = fileparts(fName);

    % Manage when filename includes unvalid characters for fitsio routine
    if (max(size(strfind(fName,'('))) ~= 0) || (max(size(strfind(fName,')'))) ~= 0)
        fNameValid = 0;
        copyfile(fName,'otz_tmp.fit');
        fName = 'otz_tmp.fit';
    else fNameValid = 1;
    end
    data = rfitsinfo(fName);     % Read the ith image & get FITS details

    if data.Valid == 1
        NbFiles = NbFiles + 1;
        UnsortedKey(NbFiles,1) = NbFiles;
        UnsortedKey(NbFiles,2) = data.CalcJD;
        dataBase{NbFiles} = data;
        dataBase{NbFiles}.fname = char(ds.Files(i));
        dataBase{NbFiles}.filepath = filepath;
        dataBase{NbFiles}.filename = filename;
        dataBase{NbFiles}.fileext = fileext;
        dataBase{NbFiles}.fNameValid = fNameValid;
        if strcmp(filepath, BaseFilePath)
            dataBase{NbFiles}.shortfilepath = '.\';
        else
            dataBase{NbFiles}.shortfilepath = strcat('.\',filepath(size(BaseFilePath,2)+1:size(filepath,2)));
        end
        GraphfName = strcat(dataBase{NbFiles}.shortfilepath,'\',filename,'.png');
        dataBase{NbFiles}.GraphfName = GraphfName;
        FullGraphfName = strcat(dataBase{NbFiles}.shortfilepath,'\',filename,'_FULL.png');
        dataBase{NbFiles}.FullGraphfName = FullGraphfName;

        if ARAS
            Tmp = true;
            for jj = 1:NbObjects
                if strcmp(data.Object,ObjectName{jj})
                    data.NoObject = jj;
                    CountObject{jj} = CountObject{jj} + 1;
                    Tmp = false;
                end
            end
            if Tmp
                    data.NoObject = NbObjects+1;               
                    CountObject{NbObjects+1} = CountObject{NbObjects+1} + 1;
            end
        end
        UnsortedKey(NbFiles,3) = data.NoObject;
    end
end


SortedKey = sortrows(UnsortedKey,[3 2]); % Sort by Object ID then date

if ARAS
    Nbend = NbFiles;
    for jj = NbObjects+1:-1:1
        if CountObject{jj} ~= 0
            FullwebFileName{jj} = [location webFileName{jj}];
           
            Nend{jj} = Nbend; % Id # of last spectrum of this Object (=most recent date)
            Nstart{jj} = Nbend - CountObject{jj} + 1; % Id # of first spectrum of this Object (=oldest date)
            Nbend = Nstart{jj} - 1; % for next Object...

            NLastSpectra{jj} = min(CountObject{jj}, NbLastSpectra);
            LastStart{jj} = Nend{jj}-NLastSpectra{jj} + 1;
            FullLastFileName{jj} = [location 'last_' webFileName{jj}];
           
            % Open text file for HTML web page
            fileID{jj} = fopen(FullwebFileName{jj},'w');
           
            %%% HTML header %%%  / all spectra list
            fprintf(fileID{jj},'<!DOCTYPE html>\r\n');
            fprintf(fileID{jj},'<HTML>\r\n');
            fprintf(fileID{jj},'<HEAD><TITLE>%s</TITLE></HEAD>\r\n',webTitle{jj});
            fprintf(fileID{jj},'<BODY bgcolor="#ffffff" text="#000099" link="#660066" vlink="#cc99cc" alink="#33ff99">');
           
            % Table style / all spectra list
            fprintf(fileID{jj},'<style>\r\n');
            fprintf(fileID{jj},'table, th, td {\r\n');
            fprintf(fileID{jj},'    border: 1px solid black;\r\n');
            fprintf(fileID{jj},'    border-collapse: collapse;\r\n');
            fprintf(fileID{jj},'}\r\n');
            fprintf(fileID{jj},'th, td {\r\n');
            fprintf(fileID{jj},'    padding: 5px;\r\n');
            fprintf(fileID{jj},'}\r\n');
            fprintf(fileID{jj},'</style>\r\n');
           
            % TITLE & top of the page / all spectra list
            fprintf(fileID{jj},'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',MainTitle);
            fprintf(fileID{jj},'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',webTitle{jj});
            fprintf(fileID{jj},'<CENTER><B><I>Send spectra to: <A HREF="mailto:thizy@free.fr">Olivier THIZY</A></I></B></CENTER>');
            fprintf(fileID{jj},'<P>\r\n');
            fprintf(fileID{jj},'Nb of spectra: %d\r\n', CountObject{jj});
            fprintf(fileID{jj},'<BR>\r\n');
            fprintf(fileID{jj},'First date: %sT%s (JD: %0.5f) by %s (%s)\r\n', datestr(dataBase{SortedKey(Nstart{jj},1)}.Date,'yyyy/mm/dd'), datestr(dataBase{SortedKey(Nstart{jj},1)}.Date,'HH:MM:SS.FFF'), dataBase{SortedKey(Nstart{jj},1)}.CalcJD, dataBase{SortedKey(Nstart{jj},1)}.ObserverCode, dataBase{SortedKey(Nstart{jj},1)}.Observer);
            fprintf(fileID{jj},'<BR>\r\n');
            fprintf(fileID{jj},'Last date: %sT%s (JD: %0.5f) by %s (%s)\r\n', datestr(dataBase{SortedKey(Nend{jj},1)}.Date,'yyyy/mm/dd'), datestr(dataBase{SortedKey(Nend{jj},1)}.Date,'HH:MM:SS.FFF'), dataBase{SortedKey(Nend{jj},1)}.CalcJD, dataBase{SortedKey(Nend{jj},1)}.ObserverCode, dataBase{SortedKey(Nend{jj},1)}.Observer);
            fprintf(fileID{jj},'<P>\r\n');
            fprintf(fileID{jj},'Last spectra details: <A HREF="%s">%s</A>\r\n', FullLastFileName{jj}, FullLastFileName{jj});
            fprintf(fileID{jj},'<BR>\r\n');
            fprintf(fileID{jj},'Campaign: <A HREF="%s">%s</A>\r\n', PreviousURL{jj}, PreviousURL{jj});
            fprintf(fileID{jj},'<BR>\r\n');
            fprintf(fileID{jj},'ARAS dataBase: <A HREF="%s">%s</A>\r\n', MainURL, MainURL);
            fprintf(fileID{jj},'<BR><BR><P><P>\r\n');
           
            % Beginning of the spectra TABLE
            fprintf(fileID{jj},'<CENTER><TABLE>\r\n');
           
           
            %%% FIRST ROW: title %%%
            fprintf(fileID{jj},'<TR>\r\n');
           
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            if DisplayGraphs == 0;
                fprintf(fileID{jj},'#');
            else
                fprintf(fileID{jj},'Preview');
            end
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Date');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Time(UT)');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'J.D. mid');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            %fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            %fprintf(fileID{jj},'Exposure(s)');
            %fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Obs.');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Site');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Instrument');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'R');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'L_min');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'L_max');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Exp.(s)');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'File');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'Flux');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileID{jj},'ZIP?');
            fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            %fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
            %fprintf(fileID{jj},'Directory');
            %fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
           
            if jj == (NbObjects+1)
                fprintf(fileID{jj},'<TD><B><CENTER>\r\n');
                fprintf(fileID{jj},'Object');
                fprintf(fileID{jj},'</CENTER></B></TD>\r\n');
            end
           
            fprintf(fileID{jj},'</TR>\r\n');
            % end of ROW above
           
           
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            % Main web page with all spectra but no graphics displayed
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            for index = Nend{jj}:-1:Nstart{jj}
                i = SortedKey(index,1);
               
                % Plot thumbnail of the spectrum graph (TO BE IMPROVED)
                if isempty (dir(dataBase{i}.GraphfName)) || isempty (dir(dataBase{i}.FullGraphfName)) || ReDoGraphs
                    % Graph using full spectral domain
                    plot(dataBase{i}.Wavelength, dataBase{i}.Intensity, 'r');
                    Titre1 = ['\fontsize{10}', dataBase{i}.Object, ' / ',dataBase{i}.ObserverCode, ' @ ', dataBase{i}.SiteCode];
                    SubTitle = sprintf('JD: %0.5f [%0.0fs]', dataBase{i}.CalcJD, dataBase{i}.ExpTimeTotal);
                    Titre2 = ['\fontsize{8}', SubTitle];
                    title({Titre1 ; Titre2});
                    xlabel('Wavelenght in Â');
                    x_limit = [Xlimit1 Xlimit2];
                    xlim(x_limit)
                    ylabel('Relative flux');
                    saveas(gca, dataBase{i}.GraphfName, 'png');
                   
                    % Zoom on Halpha and around...
                    plot(dataBase{i}.Wavelength, dataBase{i}.Intensity, 'r');
                    Titre1 = ['\fontsize{10}', dataBase{i}.Object, ' / ',dataBase{i}.ObserverCode, ' @ ', dataBase{i}.SiteCode];
                    SubTitle = sprintf('JD: %0.5f [%0.0fs]', dataBase{i}.CalcJD, dataBase{i}.ExpTimeTotal);
                    Titre2 = ['\fontsize{8}', SubTitle];
                    title({Titre1 ; Titre2});
                    xlabel('Wavelenght in Â');
                    x_limit = [-inf inf];
                    xlim(x_limit)
                    ylabel('Relative flux');
                    saveas(gca, dataBase{i}.FullGraphfName, 'png');
                end
               
                %%% One row per spectrum... %%%
                fprintf(fileID{jj},'<TR>\r\n');
               
                % Thumbnails (FULL spectrum)if DisplayGraphs is set as true
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                if DisplayGraphs
                    fprintf(fileID{jj},'<A HREF=\"%s\\%s%s\"><IMG SRC=\"%s\" NAME=\"%s\" ALIGN=BOTTOM WIDTH=400 HEIGHT=280 BORDER=0></A>', dataBase{i}.shortfilepath, dataBase{i}.filename, dataBase{i}.fileext, dataBase{i}.GraphfName, dataBase{i}.filename);
                else
                    fprintf(fileID{jj},'<A HREF=\"%s\">%d</A>', dataBase{i}.FullGraphfName, index);
                end
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%s', datestr(dataBase{i}.Date,'yyyy/mm/dd'));
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%s', datestr(dataBase{i}.Date,'HH:MM:SS.FFF'));
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                %fprintf(fileID{jj},'<TD><CENTER>\r\n');
                %fprintf(fileID{jj},'%s', datestr(dataBase{i}.DateEnd,'HH:MM:SS.FFF'));
                %fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%0.5f', dataBase{i}.CalcJD);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%s', dataBase{i}.ObserverCode);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%s', dataBase{i}.SiteCode);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%s', dataBase{i}.Instrument);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%6.0f', dataBase{i}.Resolution);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%4.0f', dataBase{i}.WaveOrigin);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%4.0f', dataBase{i}.WaveMax);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'%0.0f', dataBase{i}.ExpTimeTotal);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                fprintf(fileID{jj},'<A HREF=\"%s\\%s%s\">%s%s</A>', dataBase{i}.shortfilepath, dataBase{i}.filename, dataBase{i}.fileext, dataBase{i}.filename, dataBase{i}.fileext);
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                if strfind(dataBase{i}.filename,'flux') >= 0
                    fprintf(fileID{jj},'yes');
                end
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileID{jj},'<TD><CENTER>\r\n');
                ZIPfName = strcat(dataBase{i}.filepath,'\\',dataBase{i}.filename,'.zip');
                if ~isempty (dir(ZIPfName))
                    fprintf(fileID{jj},'<A HREF=\"%s\\%s.zip\">ZIP</A>', dataBase{i}.shortfilepath, dataBase{i}.filename);
                end
                fprintf(fileID{jj},'</CENTER></TD>\r\n');
               
                %    fprintf(fileID{jj},'<TD><CENTER>\r\n');
                %    fprintf(fileID{jj},'%s\\', dataBase{i}.filepath);
                %    fprintf(fileID{jj},'</CENTER></TD>\r\n');

                if jj == (NbObjects+1)
                    fprintf(fileID{jj},'<TD><CENTER>\r\n');
                    fprintf(fileID{jj},'%s', dataBase{i}.Object);
                    fprintf(fileID{jj},'</CENTER></TD>\r\n');
                end
               
                fprintf(fileID{jj},'</TR>\r\n');
               
                % end of ROW above
               
            end
           
            %%% HTML end of file %%%
            fprintf(fileID{jj},'</CENTER></TABLE>\r\n');
            fprintf(fileID{jj},'</BODY>\r\n');
            fprintf(fileID{jj},'</HTML>\r\n');
           
            % and close the main file...
            fclose(fileID{jj});
           
           
           
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            % Last spectra web page
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
           
            % Open text file for HTML web page
            fileIDLast{jj} = fopen(FullLastFileName{jj},'w');
           
            %%% HTML header %%% / Last X spectra displayed
            fprintf(fileIDLast{jj},'<!DOCTYPE html>\r\n');
            fprintf(fileIDLast{jj},'<HTML>\r\n');
            fprintf(fileIDLast{jj},'<HEAD><TITLE>%s</TITLE></HEAD>\r\n',webTitle{jj});
            fprintf(fileIDLast{jj},'<BODY bgcolor="#ffffff" text="#000099" link="#660066" vlink="#cc99cc" alink="#33ff99">');
           
            % Table style / Last X spectra displayed
            fprintf(fileIDLast{jj},'<style>\r\n');
            fprintf(fileIDLast{jj},'table, th, td {\r\n');
            fprintf(fileIDLast{jj},'    border: 1px solid black;\r\n');
            fprintf(fileIDLast{jj},'    border-collapse: collapse;\r\n');
            fprintf(fileIDLast{jj},'}\r\n');
            fprintf(fileIDLast{jj},'th, td {\r\n');
            fprintf(fileIDLast{jj},'    padding: 5px;\r\n');
            fprintf(fileIDLast{jj},'}\r\n');
            fprintf(fileIDLast{jj},'</style>\r\n');
           
            % TITLE & top of the page / Last X spectra displayed
            fprintf(fileIDLast{jj},'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',MainTitle);
            fprintf(fileIDLast{jj},'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',webTitle{jj});
            fprintf(fileIDLast{jj},'<CENTER><H1><B>Last %d Spectra (by acquisition date)</B></H1></CENTER>\r\n', NLastSpectra{jj});
            fprintf(fileIDLast{jj},'<CENTER><B><I>Contact: <A HREF="mailto:thizy@free.fr">Olivier THIZY</A></I></B></CENTER>');
            fprintf(fileIDLast{jj},'<P>\r\n');
            fprintf(fileIDLast{jj},'Nb of spectra: %d / %d\r\n', NLastSpectra{jj}, CountObject{jj});
            fprintf(fileIDLast{jj},'<P>\r\n');
            fprintf(fileIDLast{jj},'Back to spectra database: <A HREF="%s">%s</A>\r\n', FullwebFileName{jj}, FullwebFileName{jj});
            fprintf(fileIDLast{jj},'<BR><BR><P><P>\r\n');
           
            % Beginning of the spectra TABLE
            fprintf(fileIDLast{jj},'<CENTER><TABLE>\r\n');
           
            %%% FIRST ROW: title %%%
            fprintf(fileIDLast{jj},'<TR>\r\n');
            fprintf(fileIDLast{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileIDLast{jj},'full spectrum preview');
            fprintf(fileIDLast{jj},'</CENTER></B></TD>\r\n');
            fprintf(fileIDLast{jj},'<TD><B><CENTER>\r\n');
            fprintf(fileIDLast{jj},'preview around Halpha');
            fprintf(fileIDLast{jj},'</CENTER></B></TD>\r\n');
            fprintf(fileIDLast{jj},'<TD><B>\r\n');
            fprintf(fileIDLast{jj},'Spectrum details');
            fprintf(fileIDLast{jj},'</B></TD>\r\n');
           
            fprintf(fileIDLast{jj},'</TR>\r\n');
           
            for index = Nend{jj}:-1:LastStart{jj}
                i = SortedKey(index,1);
               
                %%% One row per spectrum... %%%
                fprintf(fileIDLast{jj},'<TR>\r\n');
               
                % Thumbnails of FULL spectrum & zoom on Halpha
                fprintf(fileIDLast{jj},'<TD><CENTER>\r\n');
                fprintf(fileIDLast{jj},'<A HREF=\"%s\\%s%s\"><IMG SRC=\"%s\" NAME=\"%s\" ALIGN=BOTTOM WIDTH=600 HEIGHT=400 BORDER=0></A>', dataBase{i}.shortfilepath, dataBase{i}.filename, dataBase{i}.fileext, dataBase{i}.FullGraphfName, dataBase{i}.filename);
                fprintf(fileIDLast{jj},'</CENTER></TD>\r\n');
                fprintf(fileIDLast{jj},'<TD><CENTER>\r\n');
                fprintf(fileIDLast{jj},'<A HREF=\"%s\\%s%s\"><IMG SRC=\"%s\" NAME=\"%s\" ALIGN=BOTTOM WIDTH=600 HEIGHT=400 BORDER=0></A>', dataBase{i}.shortfilepath, dataBase{i}.filename, dataBase{i}.fileext, dataBase{i}.GraphfName, dataBase{i}.filename);
                fprintf(fileIDLast{jj},'</CENTER></TD>\r\n');
               
                fprintf(fileIDLast{jj},'<TD>\r\n');
               
               
                fprintf(fileIDLast{jj},'Object: <B><I>%s</I></B><BR>\r\n', dataBase{i}.Object);
                fprintf(fileIDLast{jj},'Date: %s, from ', datestr(dataBase{i}.Date,'yyyy/mm/dd'));
                fprintf(fileIDLast{jj},'%s to ', datestr(dataBase{i}.Date,'HH:MM:SS.FFF'));
                fprintf(fileIDLast{jj},'%s<BR>\r\n', datestr(dataBase{i}.DateEnd,'HH:MM:SS.FFF'));
                fprintf(fileIDLast{jj},'Julian Date (calc.): %0.5f<BR>\r\n', dataBase{i}.CalcJD);
                fprintf(fileIDLast{jj},'Exposure: %0.0f<BR>\r\n', dataBase{i}.ExpTimeTotal);
                fprintf(fileIDLast{jj},'Taken by: <B>%s</B> (%s)<BR>\r\n', dataBase{i}.ObserverCode, dataBase{i}.Observer);
                fprintf(fileIDLast{jj},'Location: <B>%s</B> (%s)<BR>\r\n', dataBase{i}.SiteCode, dataBase{i}.SiteObs);
                fprintf(fileIDLast{jj},'Instrument: %s (R=%6.0f)<BR>\r\n', dataBase{i}.Instrument, dataBase{i}.Resolution);
                fprintf(fileIDLast{jj},'Spectral domain: %4.0f - %4.0f<BR>\r\n', dataBase{i}.WaveOrigin, dataBase{i}.WaveMax);
                fprintf(fileIDLast{jj},'<P>Spectrum file: <A HREF=\"%s\\%s%s\">%s%s</A>\r\n', dataBase{i}.shortfilepath, dataBase{i}.filename, dataBase{i}.fileext, dataBase{i}.filename, dataBase{i}.fileext);
                ZIPfName = strcat(dataBase{i}.filepath,'\\',dataBase{i}.filename,'.zip');
                if ~isempty (dir(ZIPfName))
                    fprintf(fileIDLast{jj},' (<A HREF=\"%s\\%s.zip\">ZIP file</A>)<P>\r\n', dataBase{i}.shortfilepath, dataBase{i}.filename);
                end
               
                fprintf(fileIDLast{jj},'</CENTER></TD>\r\n');
                fprintf(fileIDLast{jj},'</TR>\r\n');
                % end of ROW above
               
            end
           
            fprintf(fileIDLast{jj},'</CENTER></TABLE>\r\n');
            fprintf(fileIDLast{jj},'</BODY>\r\n');
            fprintf(fileIDLast{jj},'</HTML>\r\n');
           
            % and close the files
            fclose(fileIDLast{jj});
        end
    end
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Campaign web page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Open text file for HTML web page
fileIDCampaign = fopen(MainWebPage,'w');

%%% HTML header %%% / Last X spectra displayed
fprintf(fileIDCampaign,'<!DOCTYPE html>\r\n');
fprintf(fileIDCampaign,'<HTML>\r\n');
fprintf(fileIDCampaign,'<HEAD><TITLE>%s</TITLE></HEAD>\r\n',MainTitle);
fprintf(fileIDCampaign,'<BODY bgcolor="#ffffff" text="#000099" link="#660066" vlink="#cc99cc" alink="#33ff99">');

% Table style / Last X spectra displayed
fprintf(fileIDCampaign,'<style>\r\n');
fprintf(fileIDCampaign,'table, th, td {\r\n');
fprintf(fileIDCampaign,'    border: 1px solid black;\r\n');
fprintf(fileIDCampaign,'    border-collapse: collapse;\r\n');
fprintf(fileIDCampaign,'}\r\n');
fprintf(fileIDCampaign,'th, td {\r\n');
fprintf(fileIDCampaign,'    padding: 5px;\r\n');
fprintf(fileIDCampaign,'}\r\n');
fprintf(fileIDCampaign,'</style>\r\n');

% TITLE & top of the page / Last X spectra displayed
fprintf(fileIDCampaign,'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',MainTitle);
fprintf(fileIDCampaign,'<CENTER><H1><B>%s</B></H1></CENTER>\r\n',CampaignTitle);
fprintf(fileIDCampaign,'<CENTER><B><I>Contact: <A HREF="mailto:thizy@free.fr">Olivier THIZY</A></I></B></CENTER>');
fprintf(fileIDCampaign,'<P>\r\n');
NbStars = 0;
for jj=1:(NbObjects+1)
    if CountObject{jj} ~= 0
        NbStars = NbStars + 1;
    end
end
fprintf(fileIDCampaign,'Nb of stars: %d<BR>\r\n', NbStars);
fprintf(fileIDCampaign,'Nb of spectra: %d\r\n', NbFiles);
fprintf(fileIDCampaign,'<P>\r\n');
fprintf(fileIDCampaign,'Back to spectra database: <A HREF="%s">%s</A>\r\n', MainURL2, MainURL2);
fprintf(fileIDCampaign,'<BR><BR><P><P>\r\n');

% Beginning of the spectra TABLE
fprintf(fileIDCampaign,'<CENTER><TABLE>\r\n');

%%% FIRST ROW: title %%%
fprintf(fileIDCampaign,'<TR>\r\n');
fprintf(fileIDCampaign,'<TD><B><CENTER>\r\n');
fprintf(fileIDCampaign,'ID');
fprintf(fileIDCampaign,'</CENTER></B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B><CENTER>\r\n');
fprintf(fileIDCampaign,'Name');
fprintf(fileIDCampaign,'</CENTER></B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'AD');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'Dec');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'Nb Spectra');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'First');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'Last');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'Days since last');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'<TD><B>\r\n');
fprintf(fileIDCampaign,'Comment');
fprintf(fileIDCampaign,'</B></TD>\r\n');
fprintf(fileIDCampaign,'</TR>\r\n');


NbStars = 0;
for jj=1:NbObjects
    if CountObject{jj} ~= 0
        NbStars = NbStars + 1;
        fprintf(fileIDCampaign,'<TR>\r\n');
        fprintf(fileIDCampaign,'<TD><B><CENTER>\r\n');
        fprintf(fileIDCampaign,'%d', NbStars);
        fprintf(fileIDCampaign,'</CENTER></B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B><CENTER>\r\n');
        fprintf(fileIDCampaign,'<A HREF="%s%s">%s</A>', BaseFilePath2, webFileName{jj}, ObjectName{jj});
        fprintf(fileIDCampaign,'</CENTER></B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%s', ObjectRA{jj});
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%s', ObjectDec{jj});
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%d', CountObject{jj});
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%sT%s (JD: %0.5f) by %s (%s)\r\n', datestr(dataBase{SortedKey(Nstart{jj},1)}.Date,'yyyy/mm/dd'), datestr(dataBase{SortedKey(Nstart{jj},1)}.Date,'HH:MM:SS'), dataBase{SortedKey(Nstart{jj},1)}.CalcJD, dataBase{SortedKey(Nstart{jj},1)}.ObserverCode, dataBase{SortedKey(Nstart{jj},1)}.Observer);
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%sT%s (JD: %0.5f) by %s (%s)\r\n', datestr(dataBase{SortedKey(Nend{jj},1)}.Date,'yyyy/mm/dd'), datestr(dataBase{SortedKey(Nend{jj},1)}.Date,'HH:MM:SS'), dataBase{SortedKey(Nend{jj},1)}.CalcJD, dataBase{SortedKey(Nend{jj},1)}.ObserverCode, dataBase{SortedKey(Nend{jj},1)}.Observer);
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'...');
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'<TD><B>\r\n');
        fprintf(fileIDCampaign,'%s', ObjectRem{jj});
        fprintf(fileIDCampaign,'</B></TD>\r\n');
        fprintf(fileIDCampaign,'</TR>\r\n');
    end
end

fprintf(fileIDCampaign,'</CENTER></TABLE>\r\n');
fprintf(fileIDCampaign,'</BODY>\r\n');
fprintf(fileIDCampaign,'</HTML>\r\n');

fclose(fileIDCampaign);

display('That''s all folks !');
%%% That's all folks !



Annexe 2: rfitsinfo.m
This code use the rfitsinfo.m routine which is here:

function Header=rfitsinfo(File)

% RFITSINFO    Read FITS file header
%    Specific for astronomical spectra, mainly amateur ones
%  
%
%    RFITSINFO('file') reads a file written in FITS format and returns
%    all the relevant information in the header.
%
% v1.0 / 20160901 (c) Olivier Thizy
% Version used for v1 of ARAS dataBase using MatLab
%

% TO DO:
% ======
%
% ==> Heliocentric JD calculation
% using the astronomy & astrophysics package for Matlab (Ofek 2014)
% Cf: http://adsabs.harvard.edu/abs/2014ascl.soft07005O
%
% Pour VV Cep par exemple:
% ra = (21+(56+39.14385/60)/60)/12*pi
% dec = (63+(37+32.0174/60)/60)/180*pi
% jd = julian date
% [OutJD,ObjVel] = hjd(jd,[ra dec],'hh')
% showresult = sprintf('%0.6f',OutJD)
%
% ==> Calculate Heliocentric RV correction
% (to be done in rfitsinfo ?)
%
% ==> object name conversion & RA/DEC list
% *** ARASstars: table listing stars with key infos:VV Cep, RA, Dec, Vmag,
% SpType, ARASGroup, ARASSubGroup... (ext. TEXT file?)
% *** ARASstarsEQ: table of aliases for stars/objects; ex: VV Cep, VV_Cep,
% vvcep...  (ext. TEXT file?)
% Change the ObsCode conversion using a table structure (ext. TEXT file?)
% Change the ObsSite conversion using a table structure (ext. TEXT file?)
% Add in output data structure:
% --> RA, RA_d, RA_m, RA_s
% --> DEC, DEC_d, DEC_m, DEC_s
% --> Vmag, SpecType
%


H=fitsinfo(File);
Data = fitsread(File);
%Header.filename = File;


% searching for key header values
if max(size(H.Contents)) == 1
    kwd = H.PrimaryData.Keywords ;
elseif max(size(H.Contents)) > 3
    kwd = [H.PrimaryData.Keywords;H.Image(max(size(H.Contents))-2).Keywords];
else
    kwd = H.PrimaryData.Keywords ;
end

HeaderMax = max(size(kwd));

% Set criteria to 0; will be set to 1 when keyword is found...
WaveOrigin = 0;
Dispersion = 0;
Object = 0;
Date = 0;
DateEnd = 0;
JD = 0;
CalcJD = 0;
MidHJD = 0;
Exposure = 0;
ExpTimeTotal = 0;
Observer = 0;
Site = 0;
Instrument = 0;
NAXIS1 = 0;
Resolution = 0;

% Extrait certaines données de l'entèete fit
for l=1:HeaderMax
    k = kwd{l,1};
    kc = kwd{l,2};
    kt = kwd{l,3};
   
    switch k
    % CALIBRATION & REDUCTION data
    case 'NAXIS1'
        Header.NAXIS1 = kwd {l,2};
        NAXIS1= 1;
    case 'CRVAL1'
        Header.WaveOrigin = kwd {l,2};
        WaveOrigin = 1;
    case 'CDELT1'
        Header.Dispersion = kwd {l,2};
        Dispersion = 1;
    case 'BSS-VHEL'
        Header.VHel = kwd {l,2};
       
    % OBJECT data
    case {'OBJNAME', 'OBJECT'}
        Header.Object = kwd {l,2};
        Header.ObjName = kwd {l,2}; % Original name from FITS file
        Object = 1;
        switch Header.Object % Convert Object name to standard name for more consistent display/use
            case {'PCyg', 'p_cygni','P Cyg', 'pcyg', 'p cyg', '34 cyg', '34 Cyg', '34_cyg', '34_Cyg', '               P Cyg', 'P CYG'}
                Header.Object = 'P Cyg';
                Header.Campaign = 'LBV';
            case {'SS443','SS433', 'SS 433', '01_ss433', 'ss433', '__ss433', 'ss-433-', 'ss433-', 'SS433_', 'SS433V1', 'SS433 V2'}
                Header.Object = 'SS 433';
                Header.Campaign = 'Micro Quasars';
            case {'Cygnus X-1', 'cygnus x-1', 'Cygnus x-1', 'V1357Cyg', 'CygnusX-1', 'CygnusX1', '__cygx-1', 'CygX1', 'Cyg X1'}
                Header.Object = 'Cygnus X-1';
                Header.Campaign = 'Micro Quasars';
            case {'VVCep', 'VVcep', 'vvcep', 'VV Cep', 'VV cep', 'vv cep', 'vv_cep', '              VV Cep'}
                Header.Object = 'VV Cep';
                Header.Campaign = 'VV Cep Stars';
            case {'31cyg', '31Cyg', '31 cyg', '31 Cyg', '31_cyg', '31_Cyg'}
                Header.Object = '31 Cyg';
                Header.Campaign = 'VV Cep Stars';
            case {'32cyg', '32Cyg', '32 cyg', '32 Cyg', '32_cyg', '32_Cyg'}
                Header.Object = '32 Cyg';
                Header.Campaign = 'VV Cep Stars';
            case {'zet Aur', 'zetAur', 'zet aur', 'zeta Aur', 'zeta aur', 'zet_Aur', 'zet_aur'}
                Header.Object = 'zet Aur';
                Header.Campaign = 'VV Cep Stars';
%            case {'', '', '', '', ''}
%                Header.Object = '';
        end

    % OBS DATE & EXPOSURE TIME data
    case 'DATE-OBS'
        Date = 1;
        if length(kwd {l,2}) == 17
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuuMMdd''T''HH:mm:ss','TimeZone','UTC');
        elseif length(kwd {l,2}) == 18
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuuMMdd''T:''HH:mm:ss','TimeZone','UTC');
        elseif length(kwd {l,2}) == 19
            if strcmp(kwd{l,2}(14),'-')
                Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH-mm:ss','TimeZone','UTC');
            else
                Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss','TimeZone','UTC');
            end
        elseif  length(kwd {l,2}) == 20
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.','TimeZone','UTC');
        elseif  length(kwd {l,2}) == 21
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.S','TimeZone','UTC');
        elseif  length(kwd {l,2}) == 22
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.SS','TimeZone','UTC');
        elseif  length(kwd {l,2}) >= 23
            Header.Date = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.SSS','TimeZone','UTC');
        elseif  isempty(kwd {l,2})
            Header.Date = kwd {l,2};
            Date = 0;
        end
    case 'DATE-END'
        DateEnd = 1;
        if length(kwd {l,2}) == 17
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuuMMdd''T''HH:mm:ss','TimeZone','UTC');
        elseif length(kwd {l,2}) == 18
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuuMMdd''T:''HH:mm:ss','TimeZone','UTC');
        elseif length(kwd {l,2}) == 19
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss','TimeZone','UTC');
        elseif  length(kwd {l,2}) == 20
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.','TimeZone','UTC');
        elseif  length(kwd {l,2}) == 21
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.S','TimeZone','UTC');
        elseif  length(kwd {l,2}) == 22
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.SS','TimeZone','UTC');
        elseif  length(kwd {l,2}) >= 23
            Header.DateEnd = datetime(kwd {l,2},'InputFormat','uuuu-MM-dd''T''HH:mm:ss.SSS','TimeZone','UTC');
        elseif  isempty(kwd {l,2})
            Header.DateEnd = kwd {l,2};
            DateEnd = 0;
        end
    case {'DATE-JD','JD-OBS'}
        Header.JD = kwd {l,2};
        JD = 1;
    case {'MJD-OBS'}
        Header.JD = 2400000 + kwd {l,2};
        JD = 1;
    case 'MID-HJD'
        Header.MidHJD = kwd {l,2};
        MidHJD = 1;
    case {'EXPTIME','EXPOSURE'} % Exposure to light / TBD: check when EXPTIME ~= EXPOSURE !!!
        if isnumeric(kc) % Some FITS file have EXPOSURE numeric and EXPTIME string
            Header.Exposure = kwd {l,2};
            Exposure = 1;
        end
    case 'EXPTIME2' % Total exposure duration (including in-between read-out time)
        Header.ExpTimeTotal = kwd {l,2};
        ExpTimeTotal = 1;
   
    % OBSERVER data
    case 'OBSERVER'
        Header.Observer = kwd {l,2};
        Observer = 1;
        switch Header.Observer
            case 'Paolo Berardi'
                Header.ObserverCode = 'BER';
            case {'cbuil','cbuil   '}
                Header.ObserverCode = 'CBU'; % To be confirmed !!!
            case {'Christian Kreider','ChK     ','ChK'}
                Header.ObserverCode = 'CHK';
            case 'Ch. REVOL'
                Header.ObserverCode = 'CRE';
            case {'D.Boyd  ','D.Boyd'}
                Header.ObserverCode = 'DBO';
                %Header.SiteCode = 'WCO-UK';
            case {'DongLi  ','DongLi'}
                Header.ObserverCode = 'DLI';
            case 'ETB'
                Header.ObserverCode = 'EBE';
            case 'fboubault'
                Header.ObserverCode = 'FBO';
            case {'fteyssier','Francois Teyssier','FTeyssier'}
                Header.ObserverCode = 'FMT';               
            case 'kgraham '
                Header.ObserverCode = 'GKA';
            case {'A. Garcia  J. Guarro','J. Guarro'}
                Header.ObserverCode = 'JGU'; % To be confirmed !!!
            case 'JJ Broussat'
                Header.ObserverCode = 'JJB'; % To be confirmed !!!
            case 'Jacques Montier'
                Header.ObserverCode = 'JMO';
            case {'JEdlin  ','JEdlin'}
                Header.ObserverCode = 'JPE';
            case {'JP MASVIEL','JP Masviel'}
                Header.ObserverCode = 'JPM'; % To be confirmed !!!
            case {'tlester','tlester '}
                Header.ObserverCode = 'LES';
            case 'Malcolm Locke'
                Header.ObserverCode = 'MLO'; % To be confirmed !!!
            case {'Nico Montigiani, Massimiliano Mannucci','Nico Montigiani, Massimiliano Mannucci, Lapo Ferrini'}
                Header.ObserverCode = 'NMO'; % To be confirmed !!!
            case {'Olivier garde','Olivier Garde'}
                Header.ObserverCode = 'OGA';
                % Header.SiteCode = 'OTO-FR';
            case {'Olivier THIZY','Olivier Thizy','Olivier Thizy, Ribeiro J','Olivier Thizy, MASVIEL','Olivier THIZY, Christian BUIL, Valerie DESNOUX, Michel PUJOL','Olivier Thizy, A Lopez, P Dubreuil, G Kobber'}
                Header.ObserverCode = 'OTH';
            case 'Pollmann'
                Header.ObserverCode = 'POL';
                % Header.SiteCode = 'LEV-DE';
            case {'Pierre DUBREUIL','Pierre Dubreuil'}
                Header.ObserverCode = 'PDU'; % To be confirmed !!!
            case {'PSO','psomogyi'}
                Header.ObserverCode = 'PSO';
            case 'Leadbeater'
                Header.ObserverCode = 'RLE'; % To be confirmed !!!
            case 'S. Charbonnel'
                Header.ObserverCode = 'SCH'; % To be confirmed !!!
            case 'TBohlsen'
                Header.ObserverCode = 'TBO'; % To be confirmed !!!
            case 'Umberto Sollecchia'
                Header.ObserverCode = 'USO'; % To be confirmed !!!
            case ''
                Header.ObserverCode = ''; % To be confirmed !!!
            case ''
                Header.ObserverCode = ''; % To be confirmed !!!
            case ''
                Header.ObserverCode = ''; % To be confirmed !!!
            case ''
                Header.ObserverCode = ''; % To be confirmed !!!
            otherwise
                Header.ObserverCode = '---';
        end
   
    % SITE LOCATION data
    case {'BSS_SITE','ORIGIN','SITENAME'}
        Header.SiteObs = kwd {l,2};
        Site = 1;
        switch Header.SiteObs
            case {'Saint-Veran','AQ-St Veran'}
                Header.SiteCode = 'AAQ-FR'; % To be confirmed !!!
            case 'C.A.L.C'
                Header.SiteCode = 'ALC-FR'; % To be confirmed !!!
            case {'AMPERE LYON(FR)','AMPERE(Lyon)'}
                Header.SiteCode = 'AMP-FR'; % To be confirmed !!!
            case 'Lac Appolinaire'
                Header.SiteCode = 'APP-FR'; % To be confirmed !!!
            case 'LAquila'
                Header.SiteCode = 'AQL-IT'; % To be confirmed !!!
            case 'Arnprior_ON_CA'
                Header.SiteCode = 'ARN-CA'; % To be confirmed !!!
            case 'Aspremont (06)'
                Header.SiteCode = 'ASP-FR'; % To be confirmed !!!
            case 'Bellavista Obs. L'
                Header.SiteCode = 'BEL-IT'; % To be confirmed !!!
            case 'Observatoire du CALA'
                Header.SiteCode = 'CAL-FR'; % To be confirmed !!!
            case 'Castanet'
                Header.SiteCode = 'CAS-FR'; % To be confirmed !!!
            case 'Christchurch-NZ'
                Header.SiteCode = 'CHR-NZ'; % To be confirmed !!!
            case 'Jade Tianjin'
                Header.SiteCode = 'JAD-CN';
            case 'Obs Pollmann Leverkusen'
                Header.SiteCode = 'LEV-DE';
            case 'Mill Ridge_ON_CA'
                Header.SiteCode = 'MIR-CA'; % To be confirmed !!!
            case 'Mirranook Armidale'
                Header.SiteCode = 'MIR-AU'; % To be confirmed !!!
            case 'Molines'
                Header.SiteCode = 'MOL-FR'; % To be confirmed !!!
            case 'Observatoire Astronomique d''Osenbach'
                Header.SiteCode = 'OAO-FR'; % To be confirmed !!!
            case {'OAF-FR','OAF'}
                Header.SiteCode = 'OAF-FR';
            case {'38420 Revel','Observatoire Belle Etoile'}
                Header.SiteCode = 'OBE-FR';
            case {'Observatoire de la Tourbière','Observatoire de la Tourbiere'}
                Header.SiteCode = 'OTO-FR';
            case {'OHP     ','OHP','Haute Provence','Haute Provence'}
                Header.SiteCode = 'OHP-FR';
            case 'Pic du Midi'
                Header.SiteCode = 'PIC-FR'; % To be confirmed !!!
            case {'Rouen','Rouen   '}
                Header.SiteCode = 'ROU-FR';
            case 'Saint-Jean Illac'
                Header.SiteCode = 'SJI-FR'; % To be confirmed !!!
            case {'STA. MARIA DE MONTMAGASTRELL','Sta. Maria M.','Sta. Maria de Montmagastrell'}
                Header.SiteCode = 'SMM-ES'; % To be confirmed !!!
            case 'San Polo a Mosciano AAF'
                Header.SiteCode = 'SPM-??'; % To be confirmed !!!
            case {'TAT-HU','Tata'}
                Header.SiteCode = 'TAT-HU';
            case 'Three Hills Observatory'
                Header.SiteCode = 'THO-UK'; % To be confirmed !!!
            case {'OTSP2014','Okie-Tex Star Party 2015'}
                Header.SiteCode = 'TSP-US'; % To be confirmed !!!
            case 'West Challow UK'
                Header.SiteCode = 'WCO-UK';
            case 'St Sordelin'
                Header.SiteCode = 'SOR-FR'; % To be confirmed !!!
            case ''
                Header.SiteCode = ''; % To be confirmed !!!
            case ''
                Header.SiteCode = ''; % To be confirmed !!!
            case ''
                Header.SiteCode = ''; % To be confirmed !!!
            case ''
                Header.SiteCode = ''; % To be confirmed !!!
            case ''
                Header.SiteCode = ''; % To be confirmed !!!
            otherwise
                Header.SiteCode = '-------';
        end

    % EQUIPMENT data
    case {'BSS_INST','INSTRUME'}
        Header.Instrument = kwd {l,2};
        Instrument = 1;
    case {'BSS_ITRP','SPE_RPOW'}
        Header.Resolution = kwd {l,2};
        Resolution = 1;
    end

end

% Manage missing data/keyword in the header
Header.Valid = 1; % Means data is valid

if Exposure == 0 % Without exposure time, we considere the spectrum not valid (TBD: manage other fields ~= '[]' but Exposure == 0)
    Header.Exposure = 0;
    Header.Valid = 0;
end

if WaveOrigin == 0
    Header.WaveOrigin = 0;
end
if Dispersion == 0
    Header.Dispersion = 0;
    Header.WaveMax = 0;
else
    if NAXIS1 == 0
        Header.WaveMax = 0;
    else   
        Header.WaveMax = Header.WaveOrigin + Header.NAXIS1 * Header.Dispersion;
    end
end


if (Object == 0) || (strcmp(Header.Object,''))
    Header.Object = '???';
    Header.Valid = 0; % Without object name, data is invalid (to be confirmed)
end

% Date & Exposure/Duration Time
if Date == 0
    Header.Date = 0;
    Valid = 0; % Without date, data is invalid (to be confirmed)
end

if Header.Valid == 1
    if DateEnd == 0
        if Date == 0
            Header.DateEnd = 0;
        else
            if Exposure == 0
                Header.DateEnd = 0;
            else
                Header.DateEnd = Header.Date + seconds(Header.Exposure);
            end
        end
    end
end

%if ExpTimeTotal == 0
    if Header.Valid == 0
        Header.ExpTimeTotal = 0;
    else
        Header.ExpTimeTotal = seconds(Header.DateEnd - Header.Date);
    end
%end

% Calculated mid JD - TEMPORARY
if (Date == 0) || (Header.Valid == 0)
    Header.CalcJD = 0;
else
    Header.CalcJD = juliandate(Header.Date + seconds(Header.ExpTimeTotal / 2));
end

if JD == 0
    Header.JD = 0;
end

if MidHJD == 0
    Header.MidHJD = 0;
end

% Other fields...
if Observer == 0
    Header.Observer = '???';
    Header.ObserverCode = '???';   
end

if Site == 0
    if strcmp(Header.ObserverCode,'OTH')
        Header.Site = 'Observatoire Belle Etoile';
        Header.SiteCode = 'OBE-FR';
    else
        Header.Site = '???';
        Header.SiteCode = '??????';
    end
end

if Instrument == 0
    Header.Instrument = '????';
end
if strcmp(Header.Instrument,'eshel_6H-101')
    Header.Observer = 'OTH-FR';
end

if Header.Dispersion == 0
    Header.Dispersion = double((Header.WaveMax - Header.WaveOrigin))/double(Header.NAXIS1);
end
if Resolution == 0 % Resolution is actually the Power of Resolution (R)
    % If power of resolution is not provided, assume dispersion is resolution/2.5
    % (Nyquist criteria)
    Header.Resolution = ((Header.WaveMax - Header.WaveOrigin)/2)/(2.5*double(Header.Dispersion));
end

for a = 1 : Header.NAXIS1
    Header.Wavelength (a) = Header.WaveOrigin + (a-1) * Header.Dispersion;
     Header.Intensity (a) = Data (1,a);
end

return