#!/usr/bin/perl -w # # NAME # higi-fits.cgi # # DESCRIPTION # CGI script to convert HI spectrum in HiGi format (ASCII) into FITS. # # USAGE # http://hostname/cgi-bin-path/higi-fits.cgi?pgc=REFXXX/pgcYYY.(H|B) # # SETUP # $DATA_PATH : full path of the REFXXX directories # $PRG : full path of the C program which converts ASCII into FITS # # AUTHOR # 2006-06-17 - Jonathan Normand # use strict; use CGI; my $DATA_PATH = "/share/web/voparis-srv/higi/data/"; my $PRG = "/share/web/voparis-srv/higi/fits/higi-fits"; my $query = new CGI; my $pgc = $query->param('pgc'); my @s = split(/\//, $pgc); my $out = @s[1]; $out =~ s/H/fits/g; my $arg = "$DATA_PATH" . $pgc . " -o stdout"; print $query->header(-type => 'image/fits', -attachment => $out); my $cmd = "$PRG $arg"; print qx($cmd);