Skip to content

Commit

Permalink
atools: Add astsphmap
Browse files Browse the repository at this point in the history
  • Loading branch information
David Berry committed Feb 5, 2013
1 parent 48a7833 commit 3ca315c
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 5 deletions.
8 changes: 5 additions & 3 deletions applications/atools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ atools_mon_TASKS = astcopy astaddframe astclear astget astset asttest \
astselectormap astinterval astbox astshowmesh astzoommap astdistance \
astcircle astlinearapprox astnegate astremoveregion astdownsize \
astoutline astrate astoverlap astmask asttrangrid astquadapprox \
astratemap astwcsmap astpolytran astangle asttohds astfromhds
astratemap astwcsmap astpolytran astangle asttohds astfromhds astsphmap

FSRC = \
atl1_gtfrm.f \
Expand Down Expand Up @@ -105,7 +105,8 @@ astselectormap.ifc astmapregion.ifc astcmpregion.ifc astgetregbounds.ifc \
astgetregframe.ifc astshowmesh.ifc astzoommap.ifc astdistance.ifc astcircle.ifc \
astlinearapprox.ifc astnegate.ifc astremoveregion.ifc astdownsize.ifc \
astoutline.ifc astrate.ifc astoverlap.ifc astmask.ifc asttrangrid.ifc \
astquadapprox.ifc astwcsmap.ifc astangle.ifc asttohds.ifc astfromhds.ifc
astquadapprox.ifc astwcsmap.ifc astangle.ifc asttohds.ifc astfromhds.ifc \
astsphmap.ifc

IFL_FILES = astaddframe.ifl astclear.ifl astcmpframe.ifl astcmpmap.ifl \
astratemap.ifl astconvert.ifl astcopy.ifl astdsbframe.ifl astellipse.ifl \
Expand All @@ -123,7 +124,8 @@ astselectormap.ifl astmapregion.ifl astcmpregion.ifl astgetregbounds.ifl \
astgetregframe.ifl astshowmesh.ifl astzoommap.ifl astdistance.ifl astcircle.ifl \
astlinearapprox.ifl astnegate.ifl astremoveregion.ifl astdownsize.ifl \
astoutline.ifl astrate.ifl astoverlap.ifl astmask.ifl asttrangrid.ifl \
astquadapprox.ifl astwcsmap.ifl astangle.ifl asttohds.ifl astfromhds.ifl
astquadapprox.ifl astwcsmap.ifl astangle.ifl asttohds.ifl astfromhds.ifl \
astsphmap.ifl


CLEANFILES = $(MISC_FILES) $(IFC_FILES) $(IFL_FILES)
121 changes: 121 additions & 0 deletions applications/atools/astsphmap.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
SUBROUTINE ASTSPHMAP( STATUS )
*+
* Name:
* ASTSPHMAP

* Purpose:
* Create a SphMap.

* Language:
* Starlink Fortran 77

* Type of Module:
* ADAM A-task

* Invocation:
* CALL ASTSPHMAP( STATUS )

* Arguments:
* STATUS = INTEGER (Given and Returned)
* The global status.

* Description:
* This application creates a new SphMap and optionally initialises
* its attributes. A SphMap is a Mapping which transforms points from
* a 3-dimensional Cartesian coordinate system into a 2-dimensional
* spherical coordinate system (longitude and latitude on a unit
* sphere centred at the origin). It works by regarding the input
* coordinates as position vectors and finding their intersection
* with the sphere surface. The inverse transformation always
* produces points which are a unit distance from the origin
* (i.e. unit vectors).

* Usage:
* astunitmap options result

* ADAM Parameters:
* FMT = LITERAL (Read)
* The format in which to store output objects. Can be "AST", "XML",
* "STCS", or any FitsChan encoding such as FITS-WCS. Only used
* if the output object is written to a text file. An error is
* reported if the output object cannot be written using the
* requested format. ["AST"]
* OPTIONS = LITERAL (Read)
* A string containing an optional comma-separated list of attribute
* assignments to be used for initialising the new SphMap.
* RESULT = LITERAL (Read)
* A text file to receive the new SphMap.

* Copyright:
* Copyright (C) 2013 Science & Technology Facilities Council.
* All Rights Reserved.

* Licence:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA
* 02110-1301, USA

* Authors:
* DSB: David Berry (STARLINK)
* {enter_new_authors_here}

* History:
* 5-FEB-2013 (DSB):
* Original version.
* {enter_further_changes_here}

* Bugs:
* {note_any_bugs_here}

*-
* Type Definitions:
IMPLICIT NONE ! no default typing allowed

* Global Constants:
INCLUDE 'SAE_PAR' ! Standard SAE constants
INCLUDE 'NDF_PAR' ! NDF constants
INCLUDE 'AST_PAR' ! AST constants and function declarations

* Status:
INTEGER STATUS

* Local Variables:
INTEGER RESULT
*.

* Check inherited status.
IF( STATUS .NE. SAI__OK ) RETURN

* Begin an AST context.
CALL AST_BEGIN( STATUS )

* Create the required SphMap.
RESULT = AST_SPHMAP( ' ', STATUS )

* Store the required attribute values.
CALL ATL1_SETOP( 'OPTIONS', RESULT, STATUS )

* Write the results out to a text file.
CALL ATL1_PTOBJ( 'RESULT', ' ', RESULT, STATUS )

* End the AST context.
CALL AST_END( STATUS )

* Give a context message if anything went wrong.
IF( STATUS .NE. SAI__OK ) THEN
CALL ERR_REP( 'ASTSPHMAP_ERR', 'Error creating a new '//
: 'SphMap.', STATUS )
END IF

END
32 changes: 32 additions & 0 deletions applications/atools/atools.ifd.in
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,38 @@ iraf! {
helpkey *
}

}

action astsphmap {
helplib {$ATOOLS_HELP}

parameter fmt {
type LITERAL
prompt {Format for output text file}
ppath DEFAULT
vpath DEFAULT
default AST
helpkey *
}

parameter options {
position 1
type LITERAL
prompt {Options for the SphMap}
ppath CURRENT DEFAULT
default !
helpkey *
}

parameter result {
position 2
type LITERAL
prompt {Name of file in which to store the SphMap}
ppath DYNAMIC CURRENT
association ->GLOBAL.AST_OBJECT
helpkey *
}

}
action astlutmap {
helplib {$ATOOLS_HELP}
Expand Down
4 changes: 4 additions & 0 deletions applications/atools/atools.news
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
high-level interface to the AST library.


Changes in V1.9-11

- New command astsphmap

Changes in V1.9-10

- New command astangle
Expand Down
3 changes: 3 additions & 0 deletions applications/atools/atools_mon.f
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ SUBROUTINE ATOOLS_MON( STATUS )
ELSE IF ( NAME .EQ. 'ASTFROMHDS' ) THEN
CALL ASTFROMHDS( STATUS )

ELSE IF ( NAME .EQ. 'ASTSPHMAP' ) THEN
CALL ASTSPHMAP( STATUS )

* If the action name is not recognised, then report an error.
ELSE
STATUS = SAI__ERROR
Expand Down
2 changes: 1 addition & 1 deletion applications/atools/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- component.xml. Generated from component.xml.in by configure. -->

<component id="atools" support="S">
<version>1.9-10</version>
<version>1.9-11</version>
<path>applications/atools</path>
<description>ATOOLS - AST applications</description>
<abstract><p>
Expand Down
2 changes: 1 addition & 1 deletion applications/atools/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script
AC_REVISION($Revision$)

dnl Initialisation: package name and version number
AC_INIT(atools, 1.9-10, starlink@jiscmail.ac.uk)
AC_INIT(atools, 1.9-11, starlink@jiscmail.ac.uk)

dnl Require autoconf-2.50 at least
AC_PREREQ(2.50)
Expand Down

0 comments on commit 3ca315c

Please sign in to comment.