User Stuff

Installation

To use the viewer you need a file called showsky.zip.showsky.jar. This is an executable jar (runs like a binary on windows/solaris). You need JRE or JDK 1.2 to execute the jar. JAI(Java Advanced Imaging) must also be installed on the machine.

 

Files

The CD includes JDK and JAI  for Windows.

 

In the folder showskyinstall there are the following files which were downloaded.

j2sdk1_3_0-win.exe

 jai1_0_2-lib-win.exe

 

The java fits pacakges have been jared together into

 nomfits.jar

 

The HTM code in a jar file

htmIndex.jar

 

The entire source for show sky is in

showsky.zipshowsky.jar

All java documentation is in

showskyjdoc.zipshowskyjdoc.jar

 

Step by Step installation

Step1. Install JDK

Double click on jdk...

Modify the PATH Variable in ControlPanel::System::Environment

to include the jdk1.3\bin\ directory.

 

Step2. Install JAI

Double click on jai...

 

Accept that this goes in the same folder as jdk...

 

Step3. Install fits

Copy nomfits.jar to the jdk1.3\jre\lib\ext folder

 

If you have to download the fits files again you may need to  pack the 3 jar files into 1 jar file by doing the following...

make a temp directory.

 

D:\showskyInstall\temp>jar -xvf ..\fits.jar

D:\showskyInstall\temp>jar -xvf ..\image.jar

D:\showskyInstall\temp>jar -xvf ..\util.jar

D:\showskyInstall\temp>jar -cvf ..\nomfits.jar nom

 

Then delete temp directory

 

Step4: Install htmIndex.jar  (for triangle indentification).

Copy htmIndex.jar to the jdk1.3\jre\lib\ext folder

 

Step5: Install showsky.zipshowsky.zip  (ShowSky visualization tool)

Copy ShowSky folder into desired location for using ShowSky tool.

Ensure the property file is set up correctly.

 

Step6: Check the JRE. The JDK and JRE can confuse intallations such as JAI on WINDOWS. Check that

jdk1.3jre\lib\ext folder

and Program Files\javasoft\jdk1.3\jre\lib\ext folder have the same contents.

They should both contain several jar files for fits and JAI.

 

Execution (CLASSPATH)

There a several methods of execution

Invoke

java –jar showsky.zipshowsky.zip

Remember the JAI classes need to be in your ext folder of JDK1.2  Copy *.jar from the jai\lib directory to the JDK\jre\lib\ext directory

 

Alternatively you may set your classpath - it should look something like:

c:\ShowSky\showsky.zipc:\ShowSky\showsky.jar

Then the Application may be excuted by:

java stsci.sky.ShowSky

 

An alternative location for the property file may be specifed  using –DtoolProps e.g

java –DtoolProps=c:\users\wil\stsci.properties –jar showsky.zipshowsky.zip

 

To deal with large areas of the sky you may need to specify more memory for java. In this case you must run from the command line and use the -mx and -ms options e.g.

java -ms100m -mx100m -jar showsky.zipshowsky.jar

 

Property File (stsci.properties)

The property file is used for specify many things to the tool. Each property is on one line as in

A # represents a comment line - here is a listing of a property file.

#Where to get the list of Archive from

#The file containg the archive descriptions

SERVER_FILE=servers.lst

#Pick up the Archives from an RMI Server ?

REMOTE=no

#If getting from an RMI server then the server name must be specified

RMI_HOST=jazzy

#The name of the RMI server on the HOST

ARC_SERV_NAME=ArchiveServer

#Port on server to look at.

port=1099

 

#Put this catalog in the catalog list on startup

CAT=GSC2,TYC,DSS2

#Print out info - higher number means more is printed out.

verbose=2

#Start the tool with these values in the entry fields

RA=93.73

DEC=70.6

#Directory in which to store temp images

TEMP=c:\\temp\\

# Colour map for the image you can say INVERT here to inverth the images

# or you can use a file name here with your map int it.

COLOURMAP=INVERT

# Magnification factor you like for the magnification window.

MagFactor=3.0

BRIGHTNESS=10

ROTATE=YES

  #Interpolation for image Scaleing

  INTERPOLATION=INTERP_BILINEAR

  #Plate=true

  PlateSize=420

  Plate1=390

  Plate2=300

  # Colour for backgournd of main plotting area

  BGCOLOUR=white

#Plate=true

  PlateSize=420

  Plate1=390

  Plate2=300

  # Colour for backgournd of main plotting area

  BGCOLOUR=white

Usage

 Once the tool is running you are faced with a blank viewing area as shown below.

 

The panel near the bottom right of the screen provides coordinates for the mouse position in the selected field. This panel only becomes active after View has been pressed.

Near the top right is a panel of details for the last source clicked on the screen.

 

This is based on a tool originally developed for Hipparcos for which the source code is freely available (see http://astro.estec.esa.nl/Hipparcos/hipparcos_java.html).

 

Selecting Catalogues

Clicking on the word "Catalogues" in the middle of the right hand panel will provide a pop-up menu of available catalogues these are either image or source catalogues and you can have as many as you wish. The same list is available from the “Catalogues” pull down menu.

When a catalogue is selected from the pop-up it appears in the box under the word "Catalogues". It also

has a check box allowing it to be switched on or off. Each catalogue is given a colour which is also used when plotting sources from that catalogue.

The property CAT in stsci.properties may also be set to a comma separated list of catalogues. These will appear in the catalogue panel when the tool starts up.

 

Viewing

At the bottom of the screen is a panel for defining the area of interest and retrieving the data from the selected catalogues.

Enter an Right Ascension and Declination in degrees or sexagesmal (space or ':' delimited – all 3 values must be provided) in the provided boxes. Select the width of the field in arcminutes from the selection menu.

Click on View to load the sources and images form the selected catalogues and have them plotted.

The “Outer Query” check box when checked will mean the Cone search on point source will be done so the image fits inside the circle hence all sources on the image should be retrieved.

 

The images tend to take longer to load but since the tool is multi-threaded you can perform other operations while the catalogues are loading. Below is a screen shot showing an Image from DSS2 overlaid with sources from GSC2, ESA's Tycho catalog and the GSC1 database - artifacts have been suppressed using the filter.

 


 

 


Clicking on a source will cause its ID to be displayed - click on it again to clear the id from the screen. Also when the source is clicked on the Panel to the right of the screen is filled with data from that source. If the Star list (see below) is open the selected source will be highlighted in the list.

 

Listing the sources in a Table – Star List

Clicking on List (alt +l or under the “Tools Menu”  will provide a list of sources from each selected catalogue which are in the current field and match the selected filter options. This list is displayed in a separate window with scroll bars as shown below.


 


This list may be saved to an ASCII file by clicking on Save the usual file dialog will pop up to allow selection of a file and directory for saving. A default file name is provided "stars.lst".

Clicking on an entry in the list will cause the id of the star to appear on the screen.

 

Source Analysis

Filtering

Clicking on  "Filter" (Alt+F or under the Source Analysis Menu)  allows filtering of the displayed sources. The filter allows selection of  Magnitude,  Star Classification, band code and Propermotion. After changing any of the values hit apply to refresh the screen (and the Star  List screen if it is open).

The COMPASS filter applies only to objects coming from the COMPASS database. More fields will be added to this in due course.

 

Seperation and Position Angle

Simply right click  and drag anywhere on the screen. A pop-up shows you the Seperation and Position angle from the first point of clicking to the current position. This is not a path it is a straight line from the first click point to the current position.

Animation

Proper motions are available for some GSCII stars and all ESA'S Hipparcos and Tycho Catalogue entries. This tool uses the proper motion information to plot star motions into the future. The Proper Motion Window (Alt+P or uner “Source Analysis”)  allows the user to select a step (how fast the animation goes) in years and checkbox for tails. When "tails" are selected a line is drawn back to the origin of the Object.

Hit the "Animate" button to start the animaiton. Just under the button the current year is displayed. The button changes to a "Stop" button to allow halting of the animation.

The "Reset" button sets the date back to 2000 and resets the source positions. Below is a screen dump of an animation.


 

 


Note that proper motions have not been properly calculated from all GSC2 stars.

 

Working With Images

 

Scaleing and Interpolation

When an image is scaled to fit the screen an interpolation is performed on it to smooth it. This may be turned off by specifying INTERPOLATION=INTERP_NEAREST in the stsci.properties file.

Colour Map

Basic manipulation of the image colour map is allowed  using the Colour Map Window (Alt+O or under the Image Analysis menu).  In the stsci.properties file COLOURMAP=INVERT causes the image maps to be inverted – comment this out if you want to see the white on black image. In the Colour Map window clicking on Reset will also return the tool to this setting.  You can put a start brightness into the property file also with BRIGHTNESS=10 (or some value) max is 255 min  is –255. The brighter and darker buttons increase/decrease brightnes by 20. “Normal Brightness” returns this to zero – as does reset.

 


 

Magnifier

The Magnifier window (Alt+M or under Image Analysis) allows magnification of part of the image clicked on.. You can also drag the mouse to Pan over the image. The level of magnification may be set by clicking on the Magnification button.  Again this may be set in the properties file with MagFactor=”your value”.


 


Clicking on Inset puts a small magnification window on top of the image which you may drag around the image  as a magnifiying glass (usefull if you are short of Screen space !).

Multiple Images

It is possible to select several image catalogues (although at present only DSS1 and DSS2(R&B) are available).

As with source Catalogues a small check box appears beside the Catalogue name. This effectively allows switching between images. When the images are switched the sources are re-ploted to match the active image. To switch efficiently between images switch off the current image and then switch on the alternative image.

In addition the Catalogue panel a small slider is seen to the right of the Catalogue name when two or more images are selected (checkbox checked) the images are alpha blended into one image. The slider defines how much precedence the image gets in the blending - moving the slider fully to the left is similar to checking the checkbox off (Switching the image off is much more efficient). The lowest image in the list is used for positioning the sources.

Similarly the lowest checked image on the list is used as a basis for rotating the other images. To switch off the rotation uncheck the “R” radio button beside the catalogue name.

 

The two screen shots below show the application of the Rotation to blended DSS1 and DSS2 images (left) and  on the right the blended images without rotation of the DSS2 image. In the property file ROTATE=YES cause rotation by default ROTATE=NO has rotation off.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Working with Hierarchical Triangular Mesh(HTM)

ShowSky has some HTM related features. To Enable these fully change the property HTM=true in the stsci.properties file.

 

Plate Button

The Plate Button will put up a 6 degree box  around the coordinates in the coordinate entry boxes and fill it with the HTM triangles. The PlateSize proerty allows this to be specified in arcmins. Two further squares are ploted denoting plate boundaries – these are configureable with Plate1 and Plate2 properties again in arcmins. Optionally names may be plotted in the HTMs. Fully contained triangles are green partially contained are yellow.Cyan. Clicknig a triangle selects it in the HTM Window. The exact coordinates of the mouse click are also recorded. This is shown below.

 

HTM Window

The HTM Window lists all triangles to the desired depth in the current field. The recenter button will recenter the field on the selected coordinated (last clicked coordinates). Access the HTM window at any time by using Tools->HTM. The depth of HTM may also be changed here.

The “Plates” button only appears if “Plate=true” is in the stsci.properties file. It will list the plates for the selected region – this requires compass software to be accessible on the system running ShowSky. The “All Plates Button will list all plates for all regions in the current FOV – this can be slow.

 

If the “All Plates” checkbox is checked then all the actual plates are plotted from their coordinate information – plates for regions beginning with N, XE or XO are plotted in Green while others are plotted in Red. This is because there are two grids for the regions. The region number is ploted in the top left corner of the plate and moved on to the screen if the left corner is off screen.  For this you need to be able to run  GetPlatesOnRegions .  You can set the location with a property GETPLATES in stsci.properties the default is X:\\base\\bin\\GetPlatesOnRegions.

Below is a screen grapb of some plates plotted in ShowSky.

 The “Plates” button only appears if “Plate=true” is in the stsci.properties file. It will list the plates for the selected region – this requires compass software to be accessable on the system running ShowSky

 

 

Full Sky Maps using HTM

Now in the showsky.zip is a new application ShowFullSky invoke this with

Java –classpath showsky.zip stsci.sky.ShowFullSky

Optionally a file name may be passed on the command line. The screen below is of the tool with a  file loaded and the HTM grid turned on. The file and grid are both set to level 3.

The red gridlines (for RA and Dec )  may be switched on and off using a button on the right panel. In the screen shot below they are off.

The orientation panel on the right allows selection of galactic projection of the data as well as changing the plot from 0-360 to –180 to 180 by selecting radio buttons.

 

 

FullSky Files

As previously stated a file name may be passed on the command line when starting the tool. Also a file may be loaded by choosing “Load” from the tools menu. This provides a file selector dialog box.

The file should be a  list of HTM region names (any depth – max 15) and intensities (a double precision number) per line separated by a tab or a space i.e.

N21012 67.9

N21013 80.4

The tool will plot the region intensities using an adjusted colour scale. Any missing triangles will be given a NaN value and will not be ploted (hence white).

The scale including the minimum and maximum values from the file are shown at the bottom of the tool screen.

HTM Features in ShowFullSky

The HTM Window  is available under the tool menu (or Alth+H) – this allow the plotting of the HTM triangles over the entire image. This may also be used without an image.

Draging over the Sphere with the mouse will cause a list of the touched triangles to appear in the HTM windw. From the HTM window these may be saved.

Putting up the HTM window also enables the HTM Label in the coordinate box on the right of the tool, this tells which HTM is currently under the mouse (as well as coordinates).

 

ShowFullSky also allows pulling up ShowSky via the HTM window. If you click anywhere on the FullSky Window the HTM number is locked in the HTM Window, beside it there is a recenter button, hitting that will cause ShowSky to come up centered on that coordinate. The catalogs specified in the CAT property will be queried immediately. Note that ShowSky has its own HTM window which may be used to have it Plot HTM names etc. on ShowSky not interfering with ShowFullSky. The Two windows look identical but control HTM features on the separate applications.

 

Triangle Naming is switched off for FullSky mode regardless of the setting in this Window.

Creating a JPG image

Under the tools Menu you may choose dump to create a jpg of the resulting image which will give a plot like below - a GSC2  plot using the number of objects per region for GSC.

 

Lines with no value should specify NaN (Not A Number) or should be omitted from the file these regions will not be plotted.

 

Developer Stuff

 

Code location

The entire source code and jbuilber project are in Source Safe under java/showsky.

 

Executable Jars

Jar files, when correctly made, are executable on Windows and Solaris.

This means the file can simply be put on a windows machine and double clicked like an application.

The correct creation of an executable jar requires a manifest file stating which class is to be executed.

The file java\stsci\client.text is used as the manifest to create showsky.zip.showsky.jar.

The file java\stsci\scripts\makejar.bat contiains the command to create the jar files. Run this in

the script directory. It creates the jar files in the showskyinstall and showskyinstall\ShowSky directories.

 

Additionally there is a jbuilderproject directory which contains a jbuilder project . this will also buila all the jars to the correct locations.

 

 

Archive Descriptions (servers.lst) ArchiveServer

The list of available archives needs to be provided for the tool. The format of this file is quite simple. Each line describes one archive with comma's seperating each part of the description e.g.

GSC2,http://compass.stsci.edu/cgi-bin/gsc2query2.exe,http,source

This says GSC2 is served via http from the given URL and that it is a source archive.

A class called stsci.factory.GSC2factory must exist in this case.

We may also have RMI archives then the line would look like

GSC2,jazzy,RMI,source

Which says GSC2 is served by jazzy via RMI and it is a source archive.

 

Exactly the same is tru for Image archives except the last word is image e.g.

DSS2,http://stdatu.stsci.edu/cgi-bin/dss_search,http,image

 

Running the server

The file can be made available to each client or it may be served via an RMI server this is packed in the arcserv.jar executable jar file. This is the nicest way to do things in house since then the server list can be changed in one place and changes will be picked up by all clients. It also means a servers.lst file does not need to be distributed with the client.

Before ruinning the server you need to ensure the property SERVER_FILE points to a server.lst file as described above. If the default port 1099 is not available or if you wish to use a different port you may also specify this using the "port" property. Makesure the port property is the same in property files on client amchines. To run the server you need to execute tyhe following command.

 

java stsci.server.ArchiveServerImp

 

For this to be sucessfull you must have showsky.zipshowsky.jar in your classpath as described above.

 

If any change is made to the server code then RMIC must be used after javac for compilation. this is done in the make.bat file - you must use make.bat or else the RMI server will not work.

 

Java Docs

The full javadoc documentation  can be generated by running makedocs.bat in docs directory.

The documentation is put in the docs/showskyjdoc directory.

This may be viewed with any browser by opening

docs/showskyjdoc/index.html

This looks like ..

 

A jar file is also made of this directory and it is put in showskyinstall for the installation.

 

Rose Web Docs

All of the classes are in the rose model (designs/stsci.mdl). From this a very nice set of Rose web pages can be produced which include all the class diagrams. To generate the web pages load the model but do not load the sub units (you will be prompted).

From the tools menu select web publisher. In the entry box at the bottom of the dialog fill in docs/rose/stsci.html. We require only the logical view. It is not necessary to generate the component documentation as this is superflous for java (in java one compnent is one class) the use case and deployment views are not filled in.. Click on publish this takes several minutes.

 

This looks like..

 

Using the Export Catalogue (SourceFileArchive)

Although this will still work the baseline now is to use the JINI version which is documented below.

At present the to make use of the export catalog you need access to an executable for searching the catalogue and a Factory for calling and parsing the output of the executable. Given these two things the class stsci.server.FileArchive provides an RMI(Remote Method Invocation) server for the files on any machine. This server becomes available not only to the machine it is running on but to any machine on the network. FileArchive has a main and expects 3 arguments

                1. The name of the Factory class to use.

                2. The full path to the executable that performs the query.

                3. The name to give this server in RMI - this is the name clients will look for.

For example the following command makes an RMI server available for GSC2 called GSC2:

java stsci.server.SourceFileArchive stsci.factory.GSC2factory I:\\ooDev\\app\\GSC2Query\\GSC2Query2\\Release\\GSC2QUERY2.exe GSC2

(the command should all be on one line).

Notice that double '\' need to be used when specifying paths to java on windows.

 

Supposing this was run on jazzy the line in the servers.lst file to allow clients to use it would be

GSC2,jazzy,RMI,source

Which says GSC2 is served by jazzy via RMI and it is a source archive.

 

In fact this technique can be used for serving any data for which an executable exits which performs area searches provided a factory is available to parse the output.

As for the ArchiveServer if any change is made to the FilerServer code then RMIC must be used after javac for compilation. this is done in the make.bat file - you must use make.bat or else the RMI server will not work.

 

JINI

 

The scripts mentioned bellow are insourcesafe under ShowSky/jiniscripts

 The Jini classes are not well testes but are in the normal showsky.zip and source code zip.d:\users\wil\jinni on runrig.

Environment

Define %JINI% in the environment to point to the jini directory  e.g. c:\jini1_1.

Add %JINIPATH% to the environment and define it to be

JINIPATH=c:\jini1_1\lib\jini-core.jar;c:\jini1_1\lib\jini-ext.jar;c:\jini1_1\lib\sun-util.jar;

Assuming c:\jini1_1 is where the files were unpacked. Note you can not use %JINI% when definie the above JINIPATH.

Now modify the CLASSPATH to include JINIPATH.

Servers

Many servers and services may be made available via JINI. Any machine may be used to host the JINI services. The main service we will require is the lookup service called reggie.

Reggie requires rmid (The RMI Activation daemon) .  This should be run on any server by putting it in the startup. Create a new shortcut in the startup folder and put

c:\jdk1.3\bin\rmid

as the command line. Assuming jdk is installed in c:\jdk1.3.

 

Reggie also requires a http server to serv up its serverside code. A script has been provided to start the simple http server provided by sun.  It sis only one line:

java -jar %JINI%/lib/tools.jar -port 8080 -dir %jini%/lib -trees –verbose

 

Finally reggie may be started again there is a script for this but it is only one line:

java -jar -Djava.security.policy=%JINI%\example\lookup\policy.all %JINI%\lib\reggie.jar http://runrig:8080/reggie-dl.jar %JINI%\example\lookup\policy.all c:\temp\reggie_log public

 

The port numbers etc ay be changed but must match.

Theses two should also be put in the start up of a server machine.

 

Checking using Lookup

A very simple JINI client is provided to find registrars on the net. Again a one line script is provided called lookup.bat:

java -cp %JINI%/lib/jini-examples.jar -Djava.security.policy=%JINI%/example/browser/policy -Djava.rmi.server.codebase=http://runrig:8080/jini-examples-dl.jar com.sun.jini.example.browser.Browser

 

Activatable servers

The class stsci.server.LaunchService has been provided to launch Activatable servers and register them with the rmi activation registry. For this to work rmid must be running on the machine.

RMID keeps a log of activated services and restarts them then next time rmid  itself restarts. Hence RMID should be placed in the startup of the machine. This was done on RUNRIG by creating a directory c:\rmidlogs and creating a shortcut in the startupfolder to rmid with startup location c:\rmidlogs. There may be a better way of doing this on NT ?

 

Since services are reactivated their state must be preserved or must be refound when they restart. At this point we have only simple services. All configuration can be kept in the propertyfile to allow correct restarting of the process. Usually we use stsci.properties but now there will be a property file for each of the services with specific configuration information for that service in the file. For example the arcserv.properties must conatin the NAME to give the service and the SERVER_FILE attribute. For the Archives the FACTORYNAME and COMMAND must be specified.

 

Code for the servers should be served from the HTTP server. A script makejinijar.bat makes this on runrig and puts it in the JINI/lib directory. It is called arcserv_dl.jar. this contains all code necessary for running the activatable servers.

 

For all things JINI/RMI related we need policy files for controlling access. These are fairly complex and only the simplest one has been used everywhere. It is commonly called policy.all because it allows everything. It contains a single grant as follows:

grant {

    permission java.security.AllPermission;

};

 

Broadcast

JINI discovery works on broadcasts and as such will not work over  WAN. There is however also the possibility to provide one or more hostnames which should be checked as well as doing a broadcast. This provides the best of both wolds. The JINI servers and the JINI client have been written to take advantage of this. A host name may be specified in the property LOOKUPURL in the propertyfile. Then this host will be searched/used for registration. Should this host not be running reggie the boadcast will still find another host on the network running reggie if possible. It never hurts to specify this hostname and it means distant clients will be able to find reggie. The syntax of the property is

LOOKUPURL=jini://runrig.stsci.edu/

JiniArcServ

This performs the same duties as the ArchiveServer above but it is a JINI service. It is activatable so once run once rmid will always restart it. It requires a properties file such as arcserv.properties:

#Print out info - higher number means more is printed out.

verbose=2

NAME=Archive Wrap Service

LOOKUPURL=jini://runrig/

#Where to get the list of Archive from

#The file containg the archive descriptions

SERVER_FILE=d:\\users\\wil\\jini\\servers.lst

#Register with JINI

REMOTE=JINI

 

In the d:\users\wil\jinni directory there is an arcserv.bat file to launch the JiniArcServ. It is as follows:

java -cp %JINI%\lib\arcserv_dl.jar -Djava.security.policy=%JINI%\policy.all -DtoolProps=d:\users\wil\jini\arcserv.properties -Djava.rmi.server.codebase=http://runrig:8080/arcserv_dl.jar stsci.server.LaunchService "stsci.server.JiniArcServ" http://runrig:8080/arcserv_dl.jar %JINI%\policy.all d:\\users\\wil\\jini\\arcserv.properties

Notice that the property file name is passed as one of the arguments to launch. The launcher parcels the file name into the properties of the activatable object so it will use the same porerties when rmid reactivates it after a restart.

 

JiniImageFileArchive

Similar to the JiniArcServ an activable version fo the ImageArchive has been made. It also use LaunchService. In its poreties the factory ect must be specified. For example dss2.properties looks like this:

#Print out info - higher number means more is printed out.

verbose=9

NAME=DSS2 Proxy

COMMAND=http://stdatu.stsci.edu/cgi-bin/dss_search

FACTORYNAME=stsci.factory.DSS2factory

LOOKUPURL=jini://runrig/

 

#Register with JINI

REMOTE=JINI

# Loctaion for temp image files

TEMP=c:\\temp\\

 

The launch script dss2.bat is like this

java -cp %JINI%\lib\arcserv_dl.jar -Djava.security.policy=%JINI%\policy.all -DtoolProps=d:\users\wil\jini\dss2.properties -Djava.rmi.server.codebase=http://runrig:8080/arcserv_dl.jar stsci.server.LaunchService "stsci.server.JiniImageFileArchive" http://runrig:8080/arcserv_dl.jar %JINI%\policy.all d:\\users\\wil\\jini\\dss2.properties

 

Another image archive would simply require another property file and factory dss1 is also provided but not listed here.

 

JiniSourceFileArchive

This is precisely the same as the image archive but allows registration of e.g. compass with JINI. This can also be used to serv up the export catalogue again the NAME FACTORYNAME and COMMAND need to be specified in a property file which is passed in to LaunchService.

 

Java  Security Policy files

Java uses jdk1.3\jre\lib\security\java.policy by default.

Adding another Archive

You may also wish to read Appendix1 Development  Setup.

The ShowSky tool works with archives that implement stsci.arci.SourceArchiveServer or stsci.arci.ImageArchiveServer interface. Point source objects returned from a SourceArchiveServer of a given catalogue must implement the stcsi.arci.ArchiveObject interface – which allows the ploting and precession code to work with the object. Image objects must be returned as a PlanarImage and must also provide ImageInfo regarding coordinate transforms.

 

Adding a SourceArchiveServer

As with any flexible system there a several ways of making a catalogue available to the ShowSky client. You may choose to use an RMI server or wrap an existing HTTP server. Both approaches are fairly straight forward and the decision rests on which access is already available for the catalogue in question.

If there is already a HTTP interface which returns tabulated data and which can fulfill the simple area requests of  ShowSky e.g.  return all objects within a given radius of given coordinates then wrapping this up is probably the simplest approach.

If there is only a binary which allows access to the catalogue but returns tabulated data then wrapping this in an RMI server is the approach to follow.

If neither web tool nor command line tool exist you need to write a command line tool which access the catalogue and returns a table of objects (as a text stream one per line) for givien input parameters of RA, Dec and radius (or diameter).

 

Wrapping a HTTP server to make a SourceArchive.

There is already a class in the system which wraps up a  HTTP URL and passes  arguments to it and process the resulting page into Archive objects. This is the stcsi.archive.HTTPArchive.java. This class takes all the networking out of the task for the programmer – the programmer however must provide a factory class which performs the mapping between the columns in the table and the attributes of  some object which implements the ArchiveObject interface.

Wrapping a command line as an RMI server to make a SourceArchive.

Again there is a class to do this: stsci.server.SourceFileArchive.java. This uses the same factory class as the HTTPArchive above but requires the getCmd() method to be implemented as detailed below.

 

Making a factory class

The Factory class must be created in the stsci.factory package for use with the HTTPArchive class. The Factory must be named according the the archive name as it appears in the servers.lst file  follwed by the word factory.  Hence in ths package you will see a GSC2factory a HIPfactory etc.

Factories are created when a query is made in the ShowSky tool – the factory is passesd in the information in the archive description as well as the alpha, delta and radius of the query – this is all stored in the ArchiveObjectFatcory class.

All of the factories extend ArchiveObjectFactory which has many features in it which means these classes have only to do the work specific to the archive in hand. This work includes four  things – one or two of which are optional.

1.                    Formulate the specific URL for the query to the web Server

2.                    Provide a Skip to data method (unless it is encased in <PRE> HTML tag.

3.                    Provide a parser for one line of data which constructs an object which implements  the AchiveObject interface.

4.                    Provide a correct command line for calling out to a binary to get the table of data- this is only necessary if you wish to run an RMI server instead of a HTTP wrapper..

 

 

These things take the form of abstract methods on the ArchiveObject Factory. For example if we wanted to create a factory for a Catalogue we call CatX we would construct a java class along the following lines in a file called CatX.java in the directory stsci\factory:

 

 

package stsci.factory;

 

import stsci.tools.*;

import stsci.arcobj.ArchiveObject;

 

public class CatXfactory extends ArcObjFactory {

     

      /**

         The ArcObjFactory will call this and create a connection to

         It and and set our dstream to the output of the connection.

       */

      public String getURL() {

            String theUrl=name; // we got the url passed to us

            Position p = new Position(alpha,delta);

            // we have been passed decimal RA and DEC but we want HMS               theUrl+="?ra=";

            theUrl+=p.HMS();

            theUrl+="&dec=";

            theUrl+=p.DMS();

            theUrl+="&r2=";

            theUrl+=new Double(r*60).toString();

            if (Constants.verbose > 2)

System.out.println("CatXfactory Made "+theUrl+".");

            return theUrl;

      }

     

      /**

         Grab the next line from the dstream and create an object

         We should be nice and check that the stream is opened and

         Not finished and if we finish we should set that too.

           

       */

      public Object nextObj() throws Exception {

            if (!opened) open();

            if (finished) throw new Exception("No more data");

            String skip;

            String str = null;

            try {

                  str=dstream.readLine();// grab next line

            } catch (Exception e) {

                  finished=true;

                  // use this if you want to print out messages

                  // verbose is set in the stsci.properties file.

                  if (Constants.verbose >7 )

                        e.printStackTrace();

                  throw(e);

            }

            if (str == “”) { // blank line

                  return nextObj();            

            }    

     

            CatXObj theObj = new CatXObj();

            // asume tab delimted lines with an id followed by alpha

            // delta mualph mudelta and magnitude.

            DelimitedLine l = new DelimitedLine(str,'\t');

            theObj.id = l.getNextString();

            theObj.alpha = l.getNextDouble();

            theObj.delta = l.getNextDouble();

            theObj.muAlpha = l.getNextDouble();

            theObj.muDelta = l.getNextDouble();

            theObj.mag = l.getNextDouble();

 

           

            return theObj;

      }

     

      /**

            just inlcuded for comleteness – assume <PRE> tag in data

       */

      protected void skipToData() {

            super.skipToData();

      }

     

      /**

         A possible command line assuming a binary exists as well

       */

      public String getCmd() {

            if (name==null) name="CatXQuery";

            Position p = new Position(alpha,delta);

            return name+" -ra "+p.HMS()+" -dec "+p.DMS()+" -r2 "+(r*60);

      }

}

 

We also need to create a specific object to hold our data from the catalogue – if we have no special data then this can be very simple – for example above for  Objects from CatX we assumed there was a CatXObject this would be as follows in the directory stsci\arcobj:

package stsci.arcobj;

public class CatXobj extends ArcObj {

    public String bandcode() { return "V";}

   

    public String classification() {return "Star";}

   

    // precession calculation

public double muAlpha(int year) {

          return ((year-1990)*(muAlpha/3600000));

    }

   

    public double muDelta(int year) {

          return ((year-1990)*(muDelta/3600000));

    }

 

}

 

 

Generally there may be a more complex classification and bancode to be done for an object (see stcsi.arcobj.GSC2obj for example).

 

 

Creating a descriptor line.

With a factory and an Object created we are done – now the tool has to be told these are available. This simply means adding a line to the servers.lst file (outlined above). There are two possible lines – if we use HTTP the line for CatX would look like …

CatX,http:/someserver/cgi-bin/catxquery,http,source

The RMI line is even simpler

CatX,someserver,RMI,source

But then for that to work the RMI server must be running.

Running an RMI server

This would require running the following command on “someserver”

java stsci.server.FileArchive stsci.factory.CatXfactory /fullpath/catxquery CatX

(the command should all be on one line)

Where CatXFatcory is the Factory class we made above catxquery is an executable which the factory calls using command line parameters to specify positon and radius and CatX is the name used by the remote client to lookup this service.

Appendix 1 Development Setup

Firstly you need a JDK intalled on you system and running properly.  Everything which is needed is on the showsky CD or is readily downloadable.

Java Development Kit (JDK)

This may be downloaded from java.sun.com – JDK1.3 works fine.

Verify this works by typing

java –version

Java Advanced Imaging (JAI)

Again available from java.sun.com.

 

JINI  is required for som eof the Jini demonstration classes but basically these  can be ignored.

To make any change to the ShowSky tool or servers you should get two jar files

Showskysrc.zipShowskysrc.jar  - which contains all the source code of  showsky.

Showskydoc.zipShowskydoc.jar  - which contains the java docs.

 

You need to unpack these in a suitable place using jar (which is just like tar  and comes with the jdk). Create for example a showskydev directory and in it do

 

jar –xvf showskysrc.zipshowskysrc.jar

jar –xvf showskydoc.zipshowskydoc.jar

You need to ensure that this directory appears in the CLASSPATH environment variable..

There is no real make system as java has built in dependancy checks but one can simply go to

The stsci directory and type for example 

javac */*.java

 This does not cover the RMI servers for which there is a make.bat file in stsci\server.

In stsci\scripts there is  a makejar.bat  which reacreates showsky.zipshowsky.jar – this would proabably need modifiaction on any other system. This would need to be run if any changes or additons were made to the code.

 

FUTURE FEATURE LIST

 

Pick list of positions and field widths – possible from a file.

 

Popup panel showing the inageinformation on request. It  is included it in the List window for now like the other catalogues.

 

Hourglass or clock beside the image catalogue name to show it is working stlll.

 

Have an option to use colour coding for classification instead of catalogue.

 

Use FITS codec from JSKY to load image instead of naf way its done now.

 

DLL error on Vicky’s machine … only on her machine though.