| 1 | package CXC::Astro::Regions::CFITSIO::Types; | ||
| 2 | |||
| 3 | # ABSTRACT: Types for CFITSIO Regions | ||
| 4 | |||
| 5 | 3 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 3 | our $VERSION = '0.04'; | |
| 9 | |||
| 10 | 3 | ▶ | use Types::Standard qw( Enum Bool Num Str StrMatch ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 3 | ▶ | use Types::Common::Numeric qw( PositiveNum ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 3 | ▶ | use Types::Common::String qw( NonEmptyStr ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 3 | ▶ | use Type::Utils -all; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 3 | ▶ | use Regexp::Common qw( number ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | use Type::Library | ||
| 17 | 3 | -base, | |
| 18 | -extends => [ 'Types::Common::Numeric', 'Types::Common::String', 'Types::Standard' ], | ||
| 19 | -declare => qw( | ||
| 20 | Angle | ||
| 21 | Length | ||
| 22 | PositionAsNum | ||
| 23 | Vertex | ||
| 24 | XPosition | ||
| 25 | YPosition | ||
| 26 | ColumnName | ||
| 27 | 3 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | |||
| 29 | 3 | ▶ | use CXC::Types::Astro::Coords 'Sexagesimal'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | |||
| 31 | 3 | declare PositionAsNum, | |
| 32 | as StrMatch [qr{\A (?: $RE{num}{real} [d]?) \z}x]; | ||
| 33 | |||
| 34 | |||
| 35 | 3 | declare XPosition, as PositionAsNum | Sexagesimal [ -ra, -sep ]; | |
| 36 | 3 | declare YPosition, as PositionAsNum | Sexagesimal [ -dec, -sep ]; | |
| 37 | 3 | declare Vertex, as Tuple [ XPosition, YPosition ]; | |
| 38 | |||
| 39 | 3 | declare Length, as StrMatch [qr/\A$RE{num}{real} (['"dp])?\z/x]; | |
| 40 | |||
| 41 | 3 | declare Angle, as Num; | |
| 42 | |||
| 43 | 3 | declare ColumnName, as StrMatch [qr/^[[:alpha:]]\w*$/a]; # does FITS support unicode column names? | |
| 44 | |||
| 45 | 3 | 1; | |
| 46 | |||
| 47 | # | ||
| 48 | # This file is part of CXC-Astro-Regions | ||
| 49 | # | ||
| 50 | # This software is Copyright (c) 2023 by Smithsonian Astrophysical Observatory. | ||
| 51 | # | ||
| 52 | # This is free software, licensed under: | ||
| 53 | # | ||
| 54 | # The GNU General Public License, Version 3, June 2007 | ||
| 55 | # | ||
| 56 | |||
| 57 | __END__ | ||