Skip to content

handofkwll/fisica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

446 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fisica

###The FISICA Project

FISICA stands for 'Far Infra-red Space Interferometer Critical Assessment': Scientific Definition and Technology Development for the Next Generation THz Space Interferometer

The project received funding from the European Union’s Seventh Programme for research, technological development and demonstration under Grant agreement No 312818 - FISICA.

The project was funded for three years, running from January 2013 until end 2015.

###pyfiins

As part of the FISICA project a python program was written to simulate the data taken by a 'strawman design' double Fourier interferometer in space. This program is called pyfiins.

It has been successfully run under python 2.7 on a Mac and on a machine running Windows.

###Installation

To run the simulator you will need a Python installation with the following modules available for import (version numbers of a working installation in square brackets, though these are not known to be important):

  • astropy (.io.pyfits used for FITS file access) [1.0.3]
  • matplotlib (for plotting) [1.4.3]
  • numpy (for fast array processing) [1.9.2]
  • parallelpython (for parallel processing) [1.6.4]
  • psutil (system utilities) [ 2.2.1]
  • scipy (scientific functions and constants) [0.15.1]
  • xlrd (for access to Excel files) [0.9.3]

Your python installation is suitable if you can start it up and type:

  • In [1]: import astropy.io.fits
  • In [2]: import matplotlib
  • In [3]: import numpy
  • In [4]: import pp
  • In [5]: import psutil
  • In [6]: import scipy
  • In [7]: import xlrd

with no errors.

If you have a Mac with no pre-existing python then follow ipython.org/install instructions to install Anaconda and then use it to install IPython and all the necessary modules that it can.

'pp' or parallelpython may not be known to Anaconda so you should install it following the installation instructions here.

Once you have a working Python installation you should follow the following procedure to install the simulator (instructions with emphasis tell how to write visibilities in FITS IDI):

  1. Check out the code from GitHub, install it in a fresh directory.

  2. If you want the simulator to export the simulated visibilities in FITS IDI format (Interferometry Data Interchange), for later import to CASA or AIPS then you will also need to install pyfitsidi. How to do this is described in a later section.

  3. Create a different 'working' directory to run the simulator from and copy the .xlsx files from fisica/excel into it - that is where the code will look for them. In addition, 'gunzip' fisica/data/ringcube.fits.gz and copy that into the working directory. Copy fisica/data/firi.xml into the working directory. This file describes the structure of the FITS IDI file.

  4. Start up python then:

tell python where to look for the code and 'import' it

  • In [1]: import sys

  • In [2]: sys.path.append('*your code directory*/fisica')

  • In [3]: sys.path.append('*your code directory*/pyfitsidi')

  • In [4]: import pyfiins

construct the simulator specifying a file with the sky model to use, and indicating where the beam models can be found (relative to the working directory)

  • In [4]: f=pyfiins.PyFIInS(instrument_spreadsheet='strawman.xlsx', sky_file='ringcube-25-50.fits', beam_model_dir='../fisica/beam_models/Smooth_Walled_Horn/Band 4 GRASP')
  • In [5]: f.simulate()

It should run for 150 minutes or so, eventually finishing with:

  • .....
  • rendering observe
  • rendering writefits

Note that at the rendering stage there is often a warning of 'tight_layout: falling back to Agg renderer'. It is harmless.

All being well you should see a new directory in your working directory with name of form 'fisica-sim-yyyymmddThhmmss', which contains the browsable weblog for the run just made, and a file with name of form 'yyyymmddThhmmss.fits' that contains the simulated interferograms in a FITS table.

Point your browser to the weblog, scroll down to the bottom and click on 'uvmapgenerator.html' whereupon the navigable weblog display should appear.

To reduce the interferograms go into python once again and repeat the above commands until the point where you import pyfiins where you should instead do:

  • In [4]: import pydataprocessing
  • In [5]: d=pydataprocessing.PyDataProcessing('20150519T131215.fits')

giving the name of the FITS file generated by the simulator.

  • In [6]: d.reduce(data_quality='noisy', write_idi=False, make_dirty=True)
  • In [6]: d.reduce(data_quality='noisy', write_idi=True, make_dirty=False)

After a further 30 minutes or so (less if make_dirty is False), the program will finish with:

  • ...
  • rendering reduceinterferogram
  • rendering dirtyimage

A weblog describing the reduction results will appear in 'fisica-dp-yyyymmddThhmmss'.

###Installation of pyfitsidi

You will need to install pyfitsidi if you want the simulator to be able to export the visibilities in FITS IDI format.

For this you will need the following additional python module:

  • ephem (used by pfitsidi) [3.7.6.0]

Your python installation is suitable if you can start it up and type:

  • In [1]: import ephem

If you need to install 'ephem', you can download the source code from here and build it on Mac OSX or Linux by typing 'python setup.py install'. Windows installers for it are available at the same place.

Once you have a working Python installation you should follow the following procedure to install pyfitsidi:

  1. Download the code from the [github repository] (https://github.com/handofkwll/pyfitsidi) and install it in a fresh directory, different to pyfiins.

About

pyfiins - a Python tool for simulating a Double Fourier Interferometer in space.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors