Changeset 39926
- Timestamp:
- Jan 6, 2017, 11:30:10 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 155 edited
- 18 copied
-
. (modified) (1 prop)
-
Nebulous-Server/Build.PL (modified) (1 diff)
-
Nebulous-Server/bin/neb-aliasadd (copied) (copied from branches/czw_branch/20160809/Nebulous-Server/bin/neb-aliasadd )
-
Nebulous-Server/bin/neb-cabadd (modified) (5 diffs)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (7 diffs)
-
Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (8 diffs)
-
Nebulous/bin/neb-repair (modified) (1 diff)
-
Nebulous/lib/Nebulous/Client.pm (modified) (3 diffs)
-
Nebulous/nebclient/src/nebclient.c (modified) (1 diff)
-
Ohana (modified) (1 prop)
-
Ohana/Makefile.in (modified) (1 diff)
-
Ohana/src/addstar/Makefile (modified) (5 diffs)
-
Ohana/src/addstar/include/gaia.h (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/include/gaia.h )
-
Ohana/src/addstar/src/args_loadgaia.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/args_loadgaia.c )
-
Ohana/src/addstar/src/find_matches_gaia.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/find_matches_gaia.c )
-
Ohana/src/addstar/src/loadgaia.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/loadgaia.c )
-
Ohana/src/addstar/src/loadgaia_catalog.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/loadgaia_catalog.c )
-
Ohana/src/addstar/src/loadgaia_make_subset.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/loadgaia_make_subset.c )
-
Ohana/src/addstar/src/loadgaia_readstars.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/loadgaia_readstars.c )
-
Ohana/src/addstar/src/loadgaia_table.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/addstar/src/loadgaia_table.c )
-
Ohana/src/addstar/src/psps_ids.c (modified) (2 diffs)
-
Ohana/src/delstar/include/delstar.h (modified) (3 diffs)
-
Ohana/src/delstar/src/args.c (modified) (7 diffs)
-
Ohana/src/delstar/src/delete_duplicate_measures.c (modified) (2 diffs)
-
Ohana/src/delstar/src/delete_measures_by_match.c (modified) (7 diffs)
-
Ohana/src/dvomerge/include/dvomerge.h (modified) (2 diffs)
-
Ohana/src/dvomerge/src/LoadCatalog.c (modified) (2 diffs)
-
Ohana/src/dvomerge/src/args.c (modified) (2 diffs)
-
Ohana/src/dvomerge/src/build_links.c (modified) (54 diffs)
-
Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/merge_catalogs_old.c (modified) (22 diffs)
-
Ohana/src/fakeastro/Makefile (modified) (1 diff)
-
Ohana/src/fakeastro/include/fakeastro.h (modified) (4 diffs)
-
Ohana/src/fakeastro/src/ConfigInit.c (modified) (3 diffs)
-
Ohana/src/fakeastro/src/args.c (modified) (4 diffs)
-
Ohana/src/fakeastro/src/fakeastro.c (modified) (1 diff)
-
Ohana/src/fakeastro/src/fakeastro_gaia.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/fakeastro/src/fakeastro_gaia.c )
-
Ohana/src/fakeastro/src/initialize.c (modified) (2 diffs)
-
Ohana/src/fakeastro/src/make_fake_stars_catalog.c (modified) (1 diff)
-
Ohana/src/fakeastro/src/make_fakestars.c (modified) (5 diffs)
-
Ohana/src/fakeastro/src/make_gaia_measures.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/fakeastro/src/make_gaia_measures.c )
-
Ohana/src/kapa2/include/prototypes.h (modified) (3 diffs)
-
Ohana/src/kapa2/src/DrawFrame.c (modified) (2 diffs)
-
Ohana/src/kapa2/src/DrawObjects.c (modified) (18 diffs)
-
Ohana/src/kapa2/src/LoadObject.c (modified) (1 diff)
-
Ohana/src/kapa2/src/PSFrame.c (modified) (2 diffs)
-
Ohana/src/kapa2/src/PSObjects.c (modified) (4 diffs)
-
Ohana/src/kapa2/src/bDrawFrame.c (modified) (2 diffs)
-
Ohana/src/kapa2/src/bDrawObjects.c (modified) (2 diffs)
-
Ohana/src/libdvo/include/dvo.h (modified) (2 diffs)
-
Ohana/src/libdvo/src/ImageMetadataSelection.c (modified) (2 diffs)
-
Ohana/src/libdvo/src/coordops.c (modified) (12 diffs)
-
Ohana/src/libdvo/src/dbExtractMeasures.c (modified) (2 diffs)
-
Ohana/src/libdvo/src/galaxy_model.c (modified) (1 diff)
-
Ohana/src/libdvo/test/coords.sh (copied) (copied from branches/czw_branch/20160809/Ohana/src/libdvo/test/coords.sh )
-
Ohana/src/libfits/header/F_H_field.c (modified) (1 diff)
-
Ohana/src/libkapa/Makefile (modified) (1 diff)
-
Ohana/src/libkapa/include/kapa.h (modified) (3 diffs)
-
Ohana/src/libkapa/src/KapaOpen.c (modified) (1 diff)
-
Ohana/src/libkapa/src/KapaStyles.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/libkapa/src/KapaStyles.c )
-
Ohana/src/libkapa/src/KapaWindow.c (modified) (1 diff)
-
Ohana/src/libkapa/src/bDrawFuncs.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.astro/csystem.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.astro/fitplx_irls.c (modified) (2 diffs)
-
Ohana/src/opihi/cmd.astro/spex1dgas.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.astro/spex2dgas.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.astro/spexseq.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/Makefile (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/init.c (modified) (2 diffs)
-
Ohana/src/opihi/cmd.data/match2d.c (modified) (10 diffs)
-
Ohana/src/opihi/cmd.data/rndseed.c (copied) (copied from branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/rndseed.c )
-
Ohana/src/opihi/cmd.data/stats-new.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/test/fit1d_irls.sh (copied) (copied from branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/test/fit1d_irls.sh )
-
Ohana/src/opihi/dvo/imbox.c (modified) (3 diffs)
-
Ohana/src/opihi/dvo/imdense.c (modified) (2 diffs)
-
Ohana/src/opihi/dvo/skycat.c (modified) (1 diff)
-
Ohana/src/opihi/lib.data/style_args.c (modified) (3 diffs)
-
Ohana/src/opihi/lib.shell/startup.c (modified) (1 diff)
-
Ohana/src/photdbc/src/make_subcatalog.c (modified) (5 diffs)
-
Ohana/src/photdbc/src/photdbc_catalogs.c (modified) (2 diffs)
-
Ohana/src/relastro/include/relastro.h (modified) (11 diffs)
-
Ohana/src/relastro/src (modified) (1 prop)
-
Ohana/src/relastro/src/BootstrapOps.c (modified) (1 diff)
-
Ohana/src/relastro/src/BrightCatalog.c (modified) (2 diffs)
-
Ohana/src/relastro/src/ConfigInit.c (modified) (1 diff)
-
Ohana/src/relastro/src/FitAstromOps.c (modified) (1 diff)
-
Ohana/src/relastro/src/FitChip.c (modified) (2 diffs)
-
Ohana/src/relastro/src/FitPM.c (modified) (8 diffs)
-
Ohana/src/relastro/src/FitPM_IRLS.c (deleted)
-
Ohana/src/relastro/src/FitPMandPar.c (modified) (8 diffs)
-
Ohana/src/relastro/src/FitPMandPar_IRLS.c (deleted)
-
Ohana/src/relastro/src/FitPosPMfixed.c (modified) (8 diffs)
-
Ohana/src/relastro/src/FitPosPMfixed_IRLS.c (deleted)
-
Ohana/src/relastro/src/GetAstromError.c (modified) (6 diffs)
-
Ohana/src/relastro/src/ImageOps.c (modified) (5 diffs)
-
Ohana/src/relastro/src/StarMaps.c (modified) (2 diffs)
-
Ohana/src/relastro/src/UpdateChips.c (modified) (4 diffs)
-
Ohana/src/relastro/src/UpdateMeasures.c (modified) (1 diff)
-
Ohana/src/relastro/src/UpdateObjectOffsets.c (modified) (8 diffs)
-
Ohana/src/relastro/src/UpdateObjects.c (modified) (16 diffs)
-
Ohana/src/relastro/src/UpdateStacks.c (modified) (2 diffs)
-
Ohana/src/relastro/src/args.c (modified) (33 diffs)
-
Ohana/src/relastro/src/assign_images.c (modified) (2 diffs)
-
Ohana/src/relastro/src/bcatalog.c (modified) (4 diffs)
-
Ohana/src/relastro/src/extra.c (modified) (1 diff)
-
Ohana/src/relastro/src/initialize.c (modified) (1 diff)
-
Ohana/src/relastro/src/launch_region_hosts.c (modified) (4 diffs)
-
Ohana/src/relastro/src/load_catalogs.c (modified) (5 diffs)
-
Ohana/src/relastro/src/load_images.c (modified) (1 diff)
-
Ohana/src/relastro/src/relastro_images.c (modified) (6 diffs)
-
Ohana/src/relastro/src/relastro_objects.c (modified) (3 diffs)
-
Ohana/src/relastro/src/relastro_parallel_images.c (modified) (2 diffs)
-
Ohana/src/relastro/src/select_images.c (modified) (2 diffs)
-
Ohana/src/relastro/src/syncfile.c (modified) (1 diff)
-
Ohana/src/relphot/include/relphot.h (modified) (2 diffs)
-
Ohana/src/relphot/src/args.c (modified) (2 diffs)
-
Ohana/src/relphot/src/extra.c (modified) (2 diffs)
-
Ohana/src/relphot/src/reload_catalogs.c (modified) (1 diff)
-
Ohana/src/relphot/src/relphot_objects.c (modified) (1 diff)
-
Ohana/src/relphot/src/setMrelCatalog.c (modified) (4 diffs)
-
Ohana/src/uniphot/include/setgalmodel.h (modified) (2 diffs)
-
Ohana/src/uniphot/include/setphot.h (modified) (1 diff)
-
Ohana/src/uniphot/src/initialize_setgalmodel.c (modified) (4 diffs)
-
Ohana/src/uniphot/src/initialize_setphot.c (modified) (1 diff)
-
Ohana/src/uniphot/src/initialize_setphot_client.c (modified) (1 diff)
-
Ohana/src/uniphot/src/update_catalog_setgalmodel.c (modified) (2 diffs)
-
Ohana/src/uniphot/src/update_catalog_setphot.c (modified) (3 diffs)
-
Ohana/src/uniphot/src/update_dvo_setgalmodel.c (modified) (1 diff)
-
Ohana/src/uniphot/src/update_dvo_setphot.c (modified) (1 diff)
-
ippScripts/scripts/camera_exp.pl (modified) (1 diff)
-
ippScripts/scripts/nightly_science.pl (modified) (1 prop)
-
ippTools/src/stacktool.c (modified) (1 diff)
-
ippconfig/dvo.photcodes (modified) (3 diffs)
-
ippconfig/hsc (modified) (1 prop)
-
ippconfig/hsc/Makefile.am (modified) (1 diff)
-
ippconfig/hsc/camera.config (modified) (3 diffs)
-
ippconfig/hsc/dvo.config (copied) (copied from branches/czw_branch/20160809/ippconfig/hsc/dvo.config )
-
ippconfig/hsc/format_cmf.config (copied) (copied from branches/czw_branch/20160809/ippconfig/hsc/format_cmf.config )
-
ippconfig/hsc/format_mef.config (modified) (2 diffs)
-
ippconfig/hsc/format_raw.config (modified) (2 diffs)
-
ippconfig/hsc/ppImage.config (modified) (3 diffs)
-
ippconfig/hsc/ppMerge.config (modified) (2 diffs)
-
ippconfig/hsc/ppStack.config (copied) (copied from branches/czw_branch/20160809/ippconfig/hsc/ppStack.config )
-
ippconfig/hsc/psastro.config (modified) (5 diffs)
-
ippconfig/megacam/dvo.config (modified) (1 diff)
-
ippconfig/megacam/psastro.config (modified) (1 diff)
-
ippconfig/recipes/nightly_science.config (modified) (1 prop)
-
ippconfig/recipes/psastro.config (modified) (2 diffs)
-
ippconfig/recipes/psphot.config (modified) (1 diff)
-
ppMerge/src/ppMergeLoop.c (modified) (1 diff)
-
psLib/src/astro/psCoord.c (modified) (12 diffs)
-
psLib/src/astro/psCoord.h (modified) (2 diffs)
-
psLib/src/fits/psFitsScale.c (modified) (3 diffs)
-
psLib/src/types/psMetadata.c (modified) (1 diff)
-
psModules/src/astrom/pmAstrometryDistortion.c (modified) (1 diff)
-
psModules/src/astrom/pmAstrometryModel.c (modified) (4 diffs)
-
psModules/src/astrom/pmAstrometryObjects.c (modified) (9 diffs)
-
psModules/src/astrom/pmAstrometryObjects.h (modified) (2 diffs)
-
psModules/src/astrom/pmAstrometryWCS.c (modified) (42 diffs)
-
psModules/src/detrend/pmFringeStats.c (modified) (1 diff)
-
psModules/src/objects/pmPCM_MinimizeChisq.c (modified) (5 diffs)
-
psModules/src/objects/pmSourceIO_MatchedRefs.c (modified) (1 diff)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroAstromGuess.c (modified) (3 diffs)
-
psastro/src/psastroChipAstrom.c (modified) (2 diffs)
-
psastro/src/psastroConvert.c (modified) (4 diffs)
-
psastro/src/psastroDemoDump.c (modified) (1 diff)
-
psastro/src/psastroFixChips.c (modified) (1 diff)
-
psastro/src/psastroLoadRefstars.c (modified) (2 diffs)
-
psastro/src/psastroModelAdjust.c (modified) (7 diffs)
-
psastro/src/psastroMosaicAstrom.c (modified) (3 diffs)
-
psastro/src/psastroMosaicCorrectDistortion.c (modified) (1 diff)
-
psastro/src/psastroMosaicGradients.c (modified) (1 diff)
-
psastro/src/psastroMosaicOneChip.c (modified) (1 diff)
-
psastro/src/psastroOneChipFit.c (modified) (1 diff)
-
psphot/src/psphotSourceStats.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/czw_branch/20160809 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Nebulous-Server/Build.PL
r39663 r39926 48 48 bin/neb-voladd 49 49 bin/neb-voladm 50 bin/neb-aliasadd 50 51 bin/neb-insedit 51 52 bin/neb-host -
trunk/Nebulous-Server/bin/neb-cabadd
r26292 r39926 19 19 use Pod::Usage qw( pod2usage ); 20 20 21 my ($db, $dbhost, $dbuser, $dbpass, $cname, $location );21 my ($db, $dbhost, $dbuser, $dbpass, $cname, $location, $site_id, $update, $cab_id); 22 22 23 23 $db = $ENV{'NEB_DB'} unless $db; … … 33 33 'cname|n=s' => \$cname, 34 34 'location|l=s' => \$location, 35 'site_id|s=s' => \$site_id, 36 'cab_id=s' => \$cab_id, 37 'update|u' => \$update, 35 38 ) || pod2usage( 2 ); 36 39 37 40 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 38 pod2usage( -msg => "Required options: --db --user --pass --cname ", -exitval => 2 )39 unless $db && $dbuser && $dbpass && $cname ;41 pod2usage( -msg => "Required options: --db --user --pass --cname --site_id", -exitval => 2 ) 42 unless $db && $dbuser && $dbpass && $cname && $site_id; 40 43 41 44 my $dbh = DBI->connect( … … 52 55 my $sql = Nebulous::Server::SQL->new(); 53 56 54 print "Adding cabinet..."; 55 56 my $query = $dbh->prepare( $sql->new_cabinet ); 57 $query->execute( $cname, $location); 58 59 print " OK\n"; 60 57 if (defined($update)) { 58 unless ($cname && $location && $site_id && $cab_id) { 59 pod2usage( -msg => "Required options for update: --db --user --pass --cname --site_id --location --cab_id", -exitval => 2 ); 60 } 61 print "Updating cabinet..."; 62 my $query = $dbh->prepare( $sql->update_cabinet ); 63 # Check query: 64 # UPDATE cabinet SET 65 # location = ?, 66 # name = ?, 67 # site_id = ? 68 # WHERE cab_id = ? 69 70 $query->execute( $location, $cname, $site_id, $cab_id ); 71 72 print "OK\n"; 73 74 } 75 else { 76 print "Adding cabinet..."; 77 78 my $query = $dbh->prepare( $sql->new_cabinet ); 79 $query->execute( $cname, $location, $site_id); 80 81 print " OK\n"; 82 } 61 83 __END__ 62 84 … … 69 91 =head1 SYNOPSIS 70 92 71 neb-cabadd --cname <cabinet name> --location <cabinet location> 93 neb-cabadd --cname <cabinet name> --location <cabinet location> --site_id <site_id> 72 94 [--db <database>] [--user <username>] [--pass <password>] [--host <hostname] 73 95 … … 89 111 90 112 Description of the location of the cabinet. 113 114 =item * --site_id <site_id> 115 116 Numerical value of the location's site. Default = 0. 91 117 92 118 =item * --db|-d <database> -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r31370 r39926 1753 1753 } 1754 1754 1755 sub find_instances 1755 sub find_instances_old 1756 1756 { 1757 1757 my $self = shift; … … 1820 1820 # ext_id, name, available 1821 1821 my $rows = $query->execute($key->path, $vol_name, 1); 1822 unless ($rows > 0) { 1823 $query->finish; 1824 die("no instances on storage volume or volume is not avaiable for key: $key volume: $vol_name"); 1825 } 1826 } else { 1827 $query = $db->prepare_cached( $sql->get_object_instances ); 1828 my $rows; 1829 # ext_id, available 1830 if (defined($find_invalid)) { 1831 $rows = $query->execute($key->path, 0); 1832 } 1833 else { 1834 $rows = $query->execute($key->path, 1); 1835 } 1836 unless ($rows > 0) { 1837 $query->finish; 1838 die("no instances available for key: $key"); 1839 } 1840 } 1841 1842 while (my $row = $query->fetchrow_hashref) { 1843 my $instance = $row->{ 'uri' }; 1844 push @locations, $instance if $instance; 1845 } 1846 }; 1847 if ($@) { 1848 $db->rollback; 1849 # handle soft volumes 1850 if (defined $vol_name and not defined $key->hard_volume) { 1851 $log->debug("retrying with 'any' volume"); 1852 return $self->find_instances($key->path, 'any'); 1853 } 1854 $log->logdie("database error: $@"); 1855 } 1856 1857 # XXX remove this? 1858 $log->logdie("no instances found") unless (scalar @locations); 1859 1860 $log->debug("found: @locations"); 1861 1862 $log->debug("leaving"); 1863 1864 return \@locations; 1865 } 1866 1867 #sub find_instances_by_proximity 1868 sub find_instances 1869 { 1870 my $self = shift; 1871 1872 my $log = $self->log; 1873 $log->debug("entered - @_"); 1874 1875 my ($key, $vol_name, $find_invalid) = validate_pos(@_, 1876 { 1877 type => SCALAR, 1878 callbacks => { 1879 'is valid object key' => sub { $self->_is_valid_object_key($_[0]) }, 1880 }, 1881 }, 1882 { 1883 type => SCALAR|UNDEF, 1884 # callbacks => { 1885 # # check that the volume name requested is valid 1886 # 'is valid volume name' => sub { 1887 # return 1 if not defined $_[0]; 1888 # $self->_is_valid_volume_name($_[0]) 1889 # }, 1890 # }, 1891 optional => 1, 1892 }, 1893 { 1894 # find_invalid 1895 type => SCALAR|UNDEF, 1896 optional => 1, 1897 }, 1898 ); 1899 1900 my $sql = $self->sql; 1901 1902 # unless ($key) { 1903 # $log->warn("key was undefined after validate_pos(), trying again..."); 1904 # return $self->find_instances(@_); 1905 # } 1906 1907 # vol_name overrides the key implied volume 1908 my ($h_vol_id, $h_cab_id, $h_site_id); 1909 eval { 1910 $key = parse_neb_key($key, $vol_name); 1911 }; 1912 $log->logdie("$@") if $@; 1913 $vol_name = $key->volume; 1914 1915 my $db = $self->db($key); 1916 1917 # Convert possible alias to real volume. 1918 if (defined $vol_name) { 1919 my ($tmp_vol_id, $tmp_name, $tmp_host, $tmp_path); 1920 eval { 1921 my $query = $db->prepare_cached( $sql->get_volume_by_alias ); 1922 $query->execute( $vol_name ); 1923 ($tmp_vol_id, $tmp_name, $tmp_host, $tmp_path) = $query->fetchrow_array; 1924 $query->finish; 1925 }; 1926 $log->logdie("$@") if $@; 1927 # $log->warn("CZW: find_instance: deref alias: $vol_name => $tmp_vol_id $tmp_name $tmp_host $tmp_path (key vol: $key" . $key->volume . ")"); 1928 if (defined $tmp_vol_id and defined $tmp_name and defined $tmp_host and defined $tmp_path) { 1929 if ($tmp_name ne $vol_name) { 1930 $vol_name = $tmp_name; 1931 # $key->volume = $vol_name; 1932 } 1933 } 1934 1935 1936 } 1937 1938 # the key's volume can't be validiated on input for this method so we have 1939 # to check it after parsing the key 1940 if (defined $vol_name 1941 and not $self->_is_valid_volume_name($key, $vol_name)) { 1942 if ($key->hard_volume) { 1943 $log->logdie("$vol_name is not a valid volume name"); 1944 } else { 1945 $log->warn( "$vol_name is not a known volume name" ); 1946 $vol_name = undef; 1947 } 1948 } 1949 1950 # Get the host volume information encoded in the vol_name. 1951 # I am unhappy that we have three different if(defined($vol_name)) entries, but I don't see a better way. 1952 # my ($h_vol_id, $h_cab_id, $h_site_id); 1953 if (defined $vol_name) { 1954 eval { 1955 my $query = $db->prepare_cached( $sql->get_site_info_by_name ); 1956 $query->execute( $vol_name ); 1957 ($h_vol_id, $h_cab_id, $h_site_id) = $query->fetchrow_array; 1958 $query->finish; 1959 }; 1960 $log->logdie("$@") if $@; 1961 1962 unless(defined $h_vol_id and defined $h_cab_id and defined $h_site_id) { 1963 $vol_name = undef; 1964 } 1965 } 1966 1967 my @locations; 1968 eval { 1969 my $query; 1970 if ($vol_name && $h_vol_id && $h_cab_id && $h_site_id) { 1971 $query = $db->prepare_cached( $sql->get_object_instances_by_proximity ); 1972 # ext_id, name, available 1973 # host_vol_id host_cab_id host_site_id ext_id available 1974 my $rows = $query->execute($h_vol_id, $h_cab_id, $h_site_id, $key->path, 1); 1822 1975 unless ($rows > 0) { 1823 1976 $query->finish; … … 2341 2494 my $db = $self->db($key); 2342 2495 2343 my ($vol_id, $vol_host, $vol_path, $xattr, $forbidden_cabinet );2496 my ($vol_id, $vol_host, $vol_path, $xattr, $forbidden_cabinet, $forbidden_site); 2344 2497 eval { 2345 2498 my $rows; … … 2352 2505 } 2353 2506 if ($rows == 1) { 2354 ($forbidden_cabinet ) = $query->fetchrow_array;2507 ($forbidden_cabinet, $forbidden_site) = $query->fetchrow_array; 2355 2508 unless (defined($forbidden_cabinet)) { 2356 2509 $forbidden_cabinet = 0; 2510 } 2511 unless (defined($forbidden_site)) { 2512 $forbidden_site = 0; 2357 2513 } 2358 2514 $query->finish; … … 2360 2516 else { 2361 2517 $forbidden_cabinet = 0; 2518 $forbidden_site = 0; 2362 2519 $query->finish; 2363 2520 } … … 2366 2523 $query = $db->prepare_cached( $sql->get_replication_volume_for_ext_id ); 2367 2524 # ext_id, %free, avaiable, allocate 2368 $rows = $query->execute($key->path, $max_used_space, 1, 1, $forbidden_cabinet, $ topfew_count);2525 $rows = $query->execute($key->path, $max_used_space, 1, 1, $forbidden_cabinet, $forbidden_site, $topfew_count); 2369 2526 # XXX destinguish between non-existant and unaviable 2370 2527 unless ($rows > 0) { 2371 2528 $query->finish; 2372 die("can't find a suitable storage volume to replicate $key to"); 2529 # CZW: 2016-08-23 This wasn't right. If we don't get an entry, we may have been too strict. 2530 # I'm not fully convinced this is complete, as we may want to back out the cabinet criterion as well. 2531 # In any case, I don't think we're generally in the situation where replication can't find a host. 2532 $rows = $query->execute($key->path, $max_used_space, 1, 1, $forbidden_cabinet, 0, $topfew_count); 2533 unless ($rows > 0) { 2534 die("can't find a suitable storage volume to replicate $key to"); 2535 } 2373 2536 } 2374 2537 # when matching by name we shouldn't ever match more than once … … 2490 2653 $log->logdie("database error: $@") if $@; 2491 2654 2655 # $log->warn("CZW: $vol_id $vol_path for >>$vol_name<<"); 2492 2656 if (defined $vol_id and defined $vol_path) { 2493 2657 $log->debug( "found volume name $vol_name" ); 2494 2658 $log->debug( "leaving" ); 2659 # $log->warn("CZW: $vol_id $vol_path for >>$vol_name<<"); 2495 2660 return 1; 2496 2661 } -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r34764 r39926 250 250 AND mountedvol.available = ? 251 251 }, 252 get_object_instances_by_proximity => qq{ 253 SELECT 254 storage_object.so_id, 255 uri, 256 mountedvol.available, 257 vol_id, 258 cab_id, 259 (ABS(vol_id - ?) + 20 * ABS(cab_id - ?) + 100 * ABS(site_id - ?)) AS vol_idx 260 FROM storage_object 261 JOIN instance 262 USING (so_id) 263 JOIN mountedvol 264 USING(vol_id) 265 JOIN volume 266 USING(vol_id) 267 JOIN cabinet 268 USING(cab_id) 269 WHERE ext_id = ? 270 AND mountedvol.available = ? 271 ORDER BY vol_idx ASC 272 }, 252 273 get_object_instances_by_vol_name => qq{ 253 274 SELECT … … 301 322 get_cabinets_for_ext_id => qq{ 302 323 SELECT DISTINCT 303 cab_id324 volume.cab_id, site_id 304 325 FROM instance 305 JOIN volume ON instance.vol_id = volume.vol_id 326 JOIN volume ON (instance.vol_id = volume.vol_id) 327 JOIN cabinet ON (volume.cab_id = cabinet.cab_id) 306 328 JOIN storage_object USING(so_id) 307 329 WHERE ext_id = ? … … 317 339 FROM mountedvol AS m 318 340 JOIN volume AS v USING(vol_id) 341 JOIN cabinet AS c USING(cab_id) 319 342 LEFT JOIN ( 320 343 SELECT … … 336 359 AND m.available = ? 337 360 AND m.allocate = ? 338 AND m.xattr = 0361 -- AND m.xattr = 0 339 362 AND ( (v.cab_id IS NULL) || 340 363 (v.cab_id != ?) ) 364 AND ( (c.site_id IS NULL) || 365 (c.site_id != ?) ) 341 366 ORDER BY free DESC 342 367 LIMIT ?) as topfew … … 366 391 }, 367 392 new_cabinet => qq{ 368 INSERT INTO cabinet (name, location, cab_id) 369 VALUES (?, ?, NULL) 393 INSERT INTO cabinet (name, location, site_id, cab_id) 394 VALUES (?, ?, ?, NULL) 395 }, 396 update_cabinet => qq{ 397 UPDATE cabinet SET 398 location = ?, 399 name = ?, 400 site_id = ? 401 WHERE cab_id = ? 370 402 }, 371 403 new_volume => qq{ 372 404 INSERT INTO volume (name, host, path, allocate, available, xattr, mountpoint, cab_id, note) 373 405 VALUES (?, ?, ?, TRUE, TRUE, FALSE, ?, NULL, ?) 406 }, 407 new_alias => qq{ 408 INSERT INTO aliasvol (alias_id, alias, name, vol_id) 409 VALUES (NULL, ?, ?, ?) 410 }, 411 update_alias => qq{ 412 UPDATE alias SET 413 vol_id = ?, 414 name = ? 415 WHERE alias_id = ? 416 AND alias = ? 374 417 }, 375 418 get_volume_by_name => qq{ … … 377 420 FROM volume 378 421 WHERE name = ? 422 }, 423 get_volume_by_alias => qq{ 424 SELECT vol_id, name, host, path 425 FROM aliasvol 426 JOIN volume USING(vol_id,name) 427 WHERE alias = ? 428 }, 429 get_site_info_by_name => qq{ 430 SELECT vol_id, cab_id, site_id 431 FROM volume 432 JOIN cabinet USING(cab_id) 433 WHERE volume.name = ? 379 434 }, 380 435 get_volumes => qq{ … … 676 731 cab_id INT NOT NULL AUTO_INCREMENT, 677 732 name VARCHAR(255) NOT NULL, 733 site_id INT NOT NULL DEFAULT 0, 678 734 location VARCHAR(255), 679 735 PRIMARY KEY(cab_id), 680 736 UNIQUE KEY(name), 737 KEY (site_id), 681 738 KEY (location) 682 739 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 735 792 ### 736 793 794 CREATE TABLE aliasvol ( 795 alias_id INT NOT NULL AUTO_INCREMENT, 796 alias VARCHAR(255) NOT NULL, 797 name VARCHAR(255) NOT NULL, 798 vol_id INT NOT NULL, 799 PRIMARY KEY(alias_id), 800 KEY(alias), 801 KEY(name), 802 FOREIGN KEY(vol_id) REFERENCES volume(vol_id) 803 ) ENGINE=innodb DEFAULT CHARSET=latin1; 804 805 ### 806 737 807 CREATE TABLE instance ( 738 808 ins_id BIGINT NOT NULL AUTO_INCREMENT, -
trunk/Nebulous/bin/neb-repair
r39506 r39926 167 167 my $name = shift; # Filename for which to get the scheme 168 168 my ($scheme) = $name =~ /^(path|neb|file):/; # The scheme, e.g., file://, path:// 169 if undef $scheme { $scheme = "none"; }169 # if undef $scheme { $scheme = "none"; } 170 170 # $scheme may be undef if the input doesn't contain one of the above recognised schemes 171 171 unless (defined($scheme)) { $scheme = "none"; } -
trunk/Nebulous/lib/Nebulous/Client.pm
r31850 r39926 18 18 use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN ); 19 19 #use SOAP::Lite +trace => [qw( debug )]; 20 use Sys::Hostname; 20 21 use SOAP::Lite; 21 22 use Time::HiRes qw( sleep ); … … 858 859 859 860 $log->debug( "entered - @_" ); 861 862 unless(defined($params[0])) { 863 $params[0] = hostname() . ".0"; 864 # print STDERR "Setting host to $params[0]\n"; 865 } 860 866 861 867 my $response = $self->{ 'server' }->find_instances( $key, @params ); … … 980 986 $log->debug( "entered - @_" ); 981 987 988 my $find_volume = hostname() . ".0"; 989 $params[0] = $find_volume; 982 990 my $locations = $self->find_instances( $key, @params ); 983 991 unless (defined $locations) { -
trunk/Nebulous/nebclient/src/nebclient.c
r25000 r39926 529 529 return NULL; 530 530 } 531 532 // Construct a dummy volume name to allow nebulous to find the 533 // closest instance available. 534 char hostname[256]; 535 char volname[260]; 536 537 int v; 538 539 v = gethostname(hostname,256); 540 // fprintf(stderr, "%s %d\n", hostname, v); 541 /* printf("%s %d\n",hostname,v); */ 542 if (v) { 543 nebSetErr(server, "failed to construct hostname"); 544 return NULL; 545 } 546 snprintf(volname,260, "%s.0", hostname); 531 547 532 nebObjectInstances *locations = nebFindInstances(server, key, NULL);548 nebObjectInstances *locations = nebFindInstances(server, key, volname); 533 549 if (!locations) { 534 550 if (!strstr(nebErr(server), "no instances on storage volume")) { -
trunk/Ohana
-
trunk/Ohana/Makefile.in
r38473 r39926 138 138 139 139 rebuild: 140 @date 140 141 $(MAKE) clean 141 142 $(MAKE) install 143 @date 142 144 143 145 # standard rules: targets are foo, foo.clean, foo.install, foo.dist -
trunk/Ohana/src/addstar/Makefile
r39496 r39926 25 25 load2mass : $(BIN)/load2mass.$(ARCH) 26 26 loadgalphot : $(BIN)/loadgalphot.$(ARCH) 27 loadgaia : $(BIN)/loadgaia.$(ARCH) 27 28 loadstarpar : $(BIN)/loadstarpar.$(ARCH) 28 29 loadstarpar_client : $(BIN)/loadstarpar_client.$(ARCH) … … 42 43 # programs in 'SERVER' use the client-server concept and are out of date 43 44 44 INSTALL = addstar addstar_client sedstar loadgalphot load starpar loadstarpar_client setobjflags setobjflags_client loadICRF loadICRF_client skycells mkcmf dumpskycells findskycell load2mass loadwise loadtycho loadbsc loadsupercos45 INSTALL = addstar addstar_client sedstar loadgalphot loadgaia loadstarpar loadstarpar_client setobjflags setobjflags_client loadICRF loadICRF_client skycells mkcmf dumpskycells findskycell load2mass loadwise loadtycho loadbsc loadsupercos 45 46 SERVER = addstarc addstard addstart 46 47 … … 267 268 $(SRC)/psps_ids.$(ARCH).o 268 269 269 # $(SRC)/SkyRegionUtils.$(ARCH).o 270 # $(SRC)/loadstarpar_io.$(ARCH).o 271 # $(SRC)/loadgalphot_remote_hosts.$(ARCH).o 272 # $(SRC)/loadgalphot_save_remote.$(ARCH).o 270 LOAD-GAIA = \ 271 $(SRC)/loadgaia.$(ARCH).o \ 272 $(SRC)/ConfigInit.$(ARCH).o \ 273 $(SRC)/SetSignals.$(ARCH).o \ 274 $(SRC)/Shutdown.$(ARCH).o \ 275 $(SRC)/args_loadgaia.$(ARCH).o \ 276 $(SRC)/find_matches_gaia.$(ARCH).o \ 277 $(SRC)/loadgaia_catalog.$(ARCH).o \ 278 $(SRC)/loadgaia_make_subset.$(ARCH).o \ 279 $(SRC)/loadgaia_readstars.$(ARCH).o \ 280 $(SRC)/loadgaia_table.$(ARCH).o \ 281 $(SRC)/resort_catalog.$(ARCH).o \ 282 $(SRC)/build_links.$(ARCH).o \ 283 $(SRC)/strhash.$(ARCH).o \ 284 $(SRC)/sortIDs.$(ARCH).o \ 285 $(SRC)/psps_ids.$(ARCH).o 273 286 274 287 LOAD-STARPAR = \ … … 493 506 $(LOAD-2MASS) : $(INC)/addstar.h $(INC)/2mass.h 494 507 $(LOAD-GALPHOT) : $(INC)/addstar.h $(INC)/loadgalphot.h 508 $(LOAD-GAIA) : $(INC)/addstar.h $(INC)/gaia.h 495 509 $(LOAD-STARPAR) : $(INC)/addstar.h $(INC)/loadstarpar.h 496 510 $(LOAD-STARPAR-CLIENT) : $(INC)/addstar.h $(INC)/loadstarpar.h … … 514 528 $(BIN)/loadbsc.$(ARCH) : $(LOAD-BSC) 515 529 $(BIN)/loadgalphot.$(ARCH) : $(LOAD-GALPHOT) 530 $(BIN)/loadgaia.$(ARCH) : $(LOAD-GAIA) 516 531 $(BIN)/loadstarpar.$(ARCH) : $(LOAD-STARPAR) 517 532 $(BIN)/loadstarpar_client.$(ARCH) : $(LOAD-STARPAR-CLIENT) -
trunk/Ohana/src/addstar/src/psps_ids.c
r34701 r39926 42 42 43 43 uint64_t part1, part2, part3; 44 part1 = (uint64_t)( izone * 10000000000000LL) ; 44 part1 = (uint64_t)( izone * 10000000000000LL) ; // 10,000,000,000,000 45 45 part2 = ((uint64_t)(ra * 1000000.)) * 10000 ; // 0 - 360*1e6 = 3.6e8 (< 29 bits) 46 46 part3 = (int) (zresid * 10000.0) ; // 0 - 10000 (1 bit == 30/10000 arcsec) (< 14 bits) … … 48 48 return part1 + part2 + part3; 49 49 } 50 51 // 10 000 000 000 000 -
trunk/Ohana/src/delstar/include/delstar.h
r39692 r39926 95 95 int SAVE_DELETES; 96 96 int SKIP_IMAGES; 97 char *BACKUP_EXTNAME; 97 98 98 99 time_t START; … … 111 112 112 113 // for DELETE_MEASURES_BY_MATCH, these are the ranges to delete: 114 int DELETE_MIN_DET_ID; 115 int DELETE_MAX_DET_ID; 116 int DELETE_MIN_CAT_ID; 117 int DELETE_MAX_CAT_ID; 118 113 119 int DELETE_MIN_IMAGE_ID; 114 120 int DELETE_MAX_IMAGE_ID; … … 118 124 int DELETE_MIN_TIME; 119 125 int DELETE_MAX_TIME; 120 121 126 122 127 /*** delstar prototypes ***/ -
trunk/Ohana/src/delstar/src/args.c
r39692 r39926 202 202 } 203 203 204 DELETE_MIN_DET_ID = 0; 205 DELETE_MAX_DET_ID = 0; 206 DELETE_MIN_CAT_ID = 0; 207 DELETE_MAX_CAT_ID = 0; 204 208 DELETE_MIN_IMAGE_ID = 0; 205 209 DELETE_MAX_IMAGE_ID = 0; … … 209 213 DELETE_MAX_TIME = 0; 210 214 215 if ((N = get_argument (argc, argv, "-delete-min-detID"))) { remove_argument (N, &argc, argv); DELETE_MIN_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 216 if ((N = get_argument (argc, argv, "-delete-max-detID"))) { remove_argument (N, &argc, argv); DELETE_MAX_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 217 if ((N = get_argument (argc, argv, "-delete-min-catID"))) { remove_argument (N, &argc, argv); DELETE_MIN_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 218 if ((N = get_argument (argc, argv, "-delete-max-catID"))) { remove_argument (N, &argc, argv); DELETE_MAX_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 211 219 if ((N = get_argument (argc, argv, "-delete-min-imageID"))) { remove_argument (N, &argc, argv); DELETE_MIN_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 212 220 if ((N = get_argument (argc, argv, "-delete-max-imageID"))) { remove_argument (N, &argc, argv); DELETE_MAX_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } … … 221 229 remove_argument (N, &argc, argv); 222 230 } 231 232 BACKUP_EXTNAME = NULL; 233 if ((N = get_argument (argc, argv, "-backup-extname"))) { 234 remove_argument (N, &argc, argv); 235 BACKUP_EXTNAME = strcreate (argv[N]); 236 remove_argument (N, &argc, argv); 237 } 238 if (!BACKUP_EXTNAME) BACKUP_EXTNAME = strcreate (".bck"); 239 223 240 SAVE_DELETES = FALSE; 224 241 if ((N = get_argument (argc, argv, "-save-deletes"))) { … … 471 488 remove_argument (N, &argc, argv); 472 489 } 490 473 491 if ((N = get_argument (argc, argv, "-delete-measures-by-match"))) { 474 492 if (MODE != MODE_NONE) usage(); … … 477 495 SKIP_IMAGES = TRUE; // we do not need to load the images for -dup-measures 478 496 } 497 498 DELETE_MIN_DET_ID = 0; 499 DELETE_MAX_DET_ID = 0; 500 DELETE_MIN_CAT_ID = 0; 501 DELETE_MAX_CAT_ID = 0; 479 502 DELETE_MIN_IMAGE_ID = 0; 480 503 DELETE_MAX_IMAGE_ID = 0; … … 484 507 DELETE_MAX_TIME = 0; 485 508 509 if ((N = get_argument (argc, argv, "-delete-min-detID"))) { remove_argument (N, &argc, argv); DELETE_MIN_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 510 if ((N = get_argument (argc, argv, "-delete-max-detID"))) { remove_argument (N, &argc, argv); DELETE_MAX_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 511 if ((N = get_argument (argc, argv, "-delete-min-catID"))) { remove_argument (N, &argc, argv); DELETE_MIN_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 512 if ((N = get_argument (argc, argv, "-delete-max-catID"))) { remove_argument (N, &argc, argv); DELETE_MAX_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 486 513 if ((N = get_argument (argc, argv, "-delete-min-imageID"))) { remove_argument (N, &argc, argv); DELETE_MIN_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 487 514 if ((N = get_argument (argc, argv, "-delete-max-imageID"))) { remove_argument (N, &argc, argv); DELETE_MAX_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } … … 496 523 remove_argument (N, &argc, argv); 497 524 } 525 BACKUP_EXTNAME = NULL; 526 if ((N = get_argument (argc, argv, "-backup-extname"))) { 527 remove_argument (N, &argc, argv); 528 BACKUP_EXTNAME = strcreate (argv[N]); 529 remove_argument (N, &argc, argv); 530 } 531 if (!BACKUP_EXTNAME) BACKUP_EXTNAME = strcreate (".bck"); 498 532 499 533 if ((N = get_argument (argc, argv, "-fix-LAP"))) { -
trunk/Ohana/src/delstar/src/delete_duplicate_measures.c
r39692 r39926 111 111 112 112 // save backup of original cpm file 113 if (!dvo_catalog_subset_backup (&catalog, ".dl x")) {113 if (!dvo_catalog_subset_backup (&catalog, ".dlz")) { 114 114 fprintf (stderr, "ERROR: failed to make backup cpt table for catalog %s\n", catalog.filename); 115 115 exit (1); 116 116 } 117 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1 x")) {117 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1z")) { 118 118 fprintf (stderr, "ERROR: failed to make backup cpm table for catalog %s\n", catalog.filename); 119 119 exit (1); 120 120 } 121 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dl x")) {121 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dlz")) { 122 122 fprintf (stderr, "ERROR: failed to make backup cps table for catalog %s\n", catalog.filename); 123 123 exit (1); … … 377 377 if (SAVE_DUPLICATES) { 378 378 char savename[DVO_MAX_PATH]; 379 snprintf (savename, DVO_MAX_PATH, "%s.save.091 2", catalog->filename);379 snprintf (savename, DVO_MAX_PATH, "%s.save.0914", catalog->filename); 380 380 struct stat filestat; 381 381 int myStatus = stat (savename, &filestat); -
trunk/Ohana/src/delstar/src/delete_measures_by_match.c
r39692 r39926 13 13 14 14 int validOptions = FALSE; 15 validOptions |= DELETE_MAX_CAT_ID; 16 validOptions |= DELETE_MIN_CAT_ID; 17 validOptions |= DELETE_MAX_DET_ID; 18 validOptions |= DELETE_MIN_DET_ID; 15 19 validOptions |= DELETE_MAX_IMAGE_ID; 16 20 validOptions |= DELETE_MIN_IMAGE_ID; … … 26 30 fprintf (stderr, "deleting measurements matching the following\n"); 27 31 fprintf (stderr, "image ID range : %d to %d\n", DELETE_MIN_IMAGE_ID, DELETE_MAX_IMAGE_ID); 32 fprintf (stderr, "det ID range : %d to %d\n", DELETE_MIN_DET_ID, DELETE_MAX_DET_ID); 33 fprintf (stderr, "cat ID range : %d to %d\n", DELETE_MIN_CAT_ID, DELETE_MAX_CAT_ID); 28 34 fprintf (stderr, "photcode range : %d to %d\n", DELETE_MIN_PHOTCODE, DELETE_MAX_PHOTCODE); 29 35 fprintf (stderr, "time range (UNIX) : %d to %d\n", DELETE_MIN_TIME, DELETE_MAX_TIME); … … 133 139 134 140 // save backup of original cpm file 135 if (!dvo_catalog_subset_backup (&catalog, ".dlz")) {141 if (!dvo_catalog_subset_backup (&catalog, BACKUP_EXTNAME)) { 136 142 fprintf (stderr, "ERROR: failed to make backup cpt table for catalog %s\n", catalog.filename); 137 143 exit (1); 138 144 } 139 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1z")) {145 if (!dvo_catalog_subset_backup (catalog.measure_catalog, BACKUP_EXTNAME)) { 140 146 fprintf (stderr, "ERROR: failed to make backup cpm table for catalog %s\n", catalog.filename); 141 147 exit (1); 142 148 } 143 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dlz")) {149 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, BACKUP_EXTNAME)) { 144 150 fprintf (stderr, "ERROR: failed to make backup cps table for catalog %s\n", catalog.filename); 145 151 exit (1); … … 214 220 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 215 221 222 if (DELETE_MIN_DET_ID) strextend (&command, "-delete-min-detID %d", DELETE_MIN_DET_ID); 223 if (DELETE_MAX_DET_ID) strextend (&command, "-delete-max-detID %d", DELETE_MAX_DET_ID); 224 if (DELETE_MIN_CAT_ID) strextend (&command, "-delete-min-catID %d", DELETE_MIN_CAT_ID); 225 if (DELETE_MAX_CAT_ID) strextend (&command, "-delete-max-catID %d", DELETE_MAX_CAT_ID); 226 216 227 if (DELETE_MIN_IMAGE_ID) strextend (&command, "-delete-min-imageID %d", DELETE_MIN_IMAGE_ID); 217 228 if (DELETE_MAX_IMAGE_ID) strextend (&command, "-delete-max-imageID %d", DELETE_MAX_IMAGE_ID); … … 234 245 if (UPDATE) { strextend (&command, "-update"); } 235 246 if (SAVE_DELETES) { strextend (&command, "-save-deletes"); } 247 248 if (BACKUP_EXTNAME) { strextend (&command, "-backup-extname %s", BACKUP_EXTNAME); } 236 249 237 250 fprintf (stderr, "command: %s\n", command); … … 356 369 357 370 // does this measure match our selection criteria? 371 if (measure[i].detID > DELETE_MAX_DET_ID) continue; 372 if (measure[i].detID < DELETE_MIN_DET_ID) continue; 373 374 if (measure[i].catID > DELETE_MAX_CAT_ID) continue; 375 if (measure[i].catID < DELETE_MIN_CAT_ID) continue; 376 358 377 if (measure[i].imageID > DELETE_MAX_IMAGE_ID) continue; 359 378 if (measure[i].imageID < DELETE_MIN_IMAGE_ID) continue; … … 367 386 measureDrop[i] = TRUE; 368 387 off_t N = measure[i].averef; 369 if (VERBOSE) fprintf (stderr, "0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, average[N].R, average[N].D, measure[i].photcode);388 if (VERBOSE) fprintf (stderr, "0x%08x 0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, measure[i].catID, average[N].R, average[N].D, measure[i].photcode); 370 389 if (fsave) { 371 fprintf (fsave, "0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, average[N].R, average[N].D, measure[i].photcode);390 fprintf (fsave, "0x%08x 0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, measure[i].catID, average[N].R, average[N].D, measure[i].photcode); 372 391 } 373 392 if (isGPC1chip(measure[i].photcode)) { -
trunk/Ohana/src/dvomerge/include/dvomerge.h
r39536 r39926 61 61 int SKIP_MEASURE; 62 62 int SKIP_LENSING; 63 int SKIP_LENSOBJ; 63 64 int SKIP_STARPAR; 64 65 int SKIP_GALPHOT; … … 171 172 off_t *build_measure_links PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure)); 172 173 off_t *init_measure_links PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure)); 173 int add_meas _linkPROTO((Average *average, off_t *next, off_t Nmeasure, off_t NMEASURE));174 int add_measure_link PROTO((Average *average, off_t *next, off_t Nmeasure, off_t NMEASURE)); 174 175 Measure *sort_measure PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure, off_t *next)); 175 176 176 177 off_t *build_lensing_links PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing)); 177 178 off_t *init_lensing_links PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing)); 178 int add_lens _linkPROTO((Average *average, off_t *next, off_t Nlensing, off_t NLENSING));179 int add_lensing_link PROTO((Average *average, off_t *next, off_t Nlensing, off_t NLENSING)); 179 180 Lensing *sort_lensing PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next)); 181 182 off_t *build_lensobj_links PROTO((Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj)); 183 off_t *init_lensobj_links PROTO((Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj)); 184 int add_lensobj_link PROTO((Average *average, off_t *next, off_t Nlensobj, off_t NLENSOBJ)); 185 Lensobj *sort_lensobj PROTO((Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj, off_t *next)); 180 186 181 187 off_t *build_starpar_links PROTO((Average *average, off_t Naverage, StarPar *starpar, off_t Nstarpar)); 182 188 off_t *init_starpar_links PROTO((Average *average, off_t Naverage, StarPar *starpar, off_t Nstarpar)); 183 int add_star _link PROTO((Average *average, off_t *next, off_t Nstarpar, off_t NSTARPAR));189 int add_starpar_link PROTO((Average *average, off_t *next, off_t Nstarpar, off_t NSTARPAR)); 184 190 StarPar *sort_starpar PROTO((Average *average, off_t Naverage, StarPar *starpar, off_t Nstarpar, off_t *next)); 185 191 186 192 off_t *build_galphot_links PROTO((Average *average, off_t Naverage, GalPhot *galphot, off_t Ngalphot)); 187 193 off_t *init_galphot_links PROTO((Average *average, off_t Naverage, GalPhot *galphot, off_t Ngalphot)); 188 int add_galp _link PROTO((Average *average, off_t *next, off_t Ngalphot, off_t NGALPHOT));194 int add_galphot_link PROTO((Average *average, off_t *next, off_t Ngalphot, off_t NGALPHOT)); 189 195 GalPhot *sort_galphot PROTO((Average *average, off_t Naverage, GalPhot *galphot, off_t Ngalphot, off_t *next)); 190 196 191 197 off_t *init_missing_links PROTO((Average *average, off_t Naverage, Missing *missing, off_t Nmissing)); 192 int add_miss _link PROTO((Average *average, off_t *next, off_t Nmissing));198 int add_missing_link PROTO((Average *average, off_t *next, off_t Nmissing)); 193 199 Missing *sort_missing PROTO((Average *average, off_t Naverage, Missing *missing, off_t Nmissing, off_t *next_miss)); 194 200 -
trunk/Ohana/src/dvomerge/src/LoadCatalog.c
r39536 r39926 9 9 10 10 // always load all of the data (if any exists) 11 // XXXX TEMP HACK : skip GALPHOT12 11 13 catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSOBJ;12 catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 14 13 15 14 if (SKIP_MEASURE) { … … 23 22 } else { 24 23 catalog[0].catflags = catalog[0].catflags | DVO_LOAD_LENSING; 24 } 25 26 if (SKIP_LENSOBJ) { 27 catalog[0].catflags = catalog[0].catflags | DVO_SKIP_LENSOBJ; 28 } else { 29 catalog[0].catflags = catalog[0].catflags | DVO_LOAD_LENSOBJ; 25 30 } 26 31 -
trunk/Ohana/src/dvomerge/src/args.c
r39536 r39926 56 56 if ((N = get_argument (*argc, argv, "-skip-lensing"))) { 57 57 SKIP_LENSING = TRUE; 58 remove_argument (N, argc, argv); 59 } 60 SKIP_LENSOBJ = FALSE; 61 if ((N = get_argument (*argc, argv, "-skip-lensobj"))) { 62 SKIP_LENSOBJ = TRUE; 58 63 remove_argument (N, argc, argv); 59 64 } … … 340 345 remove_argument (N, argc, argv); 341 346 } 347 SKIP_LENSOBJ = FALSE; 348 if ((N = get_argument (*argc, argv, "-skip-lensobj"))) { 349 SKIP_LENSOBJ = TRUE; 350 remove_argument (N, argc, argv); 351 } 342 352 SKIP_STARPAR = FALSE; 343 353 if ((N = get_argument (*argc, argv, "-skip-starpar"))) { -
trunk/Ohana/src/dvomerge/src/build_links.c
r39536 r39926 15 15 data: they refer to the sequence number in the data blocks. 16 16 17 next_meas is a list of the equivalent sequence of the measure block as if it were sorted.17 next_measure is a list of the equivalent sequence of the measure block as if it were sorted. 18 18 19 19 to find the sequence of measurements for a given average: 20 20 n_0 = average->measureOffset 21 n_1 = next_meas [n_0]22 n_i = next_meas [n_i-1]21 n_1 = next_measure[n_0] 22 n_i = next_measure[n_i-1] 23 23 24 24 */ … … 31 31 32 32 off_t i, j, N; 33 off_t *next_meas ;33 off_t *next_measure; 34 34 35 35 if (!measure) return NULL; … … 38 38 N = 0; 39 39 40 ALLOCATE (next_meas , off_t, Nmeasure);40 ALLOCATE (next_measure, off_t, Nmeasure); 41 41 for (i = 0; i < Naverage; i++) { 42 42 if (!average[i].Nmeasure) continue; … … 45 45 for (j = 0; j < average[i].Nmeasure - 1; j++, N++) { 46 46 myAssert (measure[m+j+1].averef == i, "not sorted"); 47 next_meas [N] = N + 1;47 next_measure[N] = N + 1; 48 48 if (N >= Nmeasure) { 49 49 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 50 50 } 51 51 } 52 next_meas [N] = -1;52 next_measure[N] = -1; 53 53 if (N >= Nmeasure) { 54 54 fprintf (stderr, "WARNING: N out of bounds (2)\n"); … … 61 61 N++; 62 62 } 63 return (next_meas );63 return (next_measure); 64 64 } 65 65 … … 74 74 75 75 off_t i, m, k, Nm, averef; 76 off_t *next_meas ;77 78 ALLOCATE (next_meas , off_t, Nmeasure);76 off_t *next_measure; 77 78 ALLOCATE (next_measure, off_t, Nmeasure); 79 79 80 80 /* reset the Nm, offset values for average */ … … 87 87 averef = measure[Nm].averef; 88 88 m = average[averef].measureOffset; 89 next_meas [Nm] = -1;89 next_measure[Nm] = -1; 90 90 91 91 if (m == -1) { /* no links yet for source */ … … 95 95 } 96 96 97 for (k = 0; next_meas [m] != -1; k++) {98 m = next_meas [m];97 for (k = 0; next_measure[m] != -1; k++) { 98 m = next_measure[m]; 99 99 if (m >= Nmeasure) { 100 100 fprintf (stderr, "WARNING: m out of bounds (1)\n"); … … 103 103 104 104 average[averef].Nmeasure = k + 2; 105 next_meas [m] = Nm;105 next_measure[m] = Nm; 106 106 if (m >= Nmeasure) { 107 107 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 108 108 } 109 109 } 110 return (next_meas );110 return (next_measure); 111 111 } 112 112 113 113 /* average[].measureOffset, average[].Nmeasure are valid within an addstar run */ 114 int add_meas _link (Average *average, off_t *next_meas, off_t Nmeasure, off_t NMEASURE) {114 int add_measure_link (Average *average, off_t *next_measure, off_t Nmeasure, off_t NMEASURE) { 115 115 116 116 off_t k, m; 117 117 118 /* if we have trouble, check validity of next_meas [m] : m < Nmeasure */118 /* if we have trouble, check validity of next_measure[m] : m < Nmeasure */ 119 119 m = average[0].measureOffset; 120 120 121 121 for (k = 0; k < average[0].Nmeasure - 1; k++) { 122 m = next_meas [m];122 m = next_measure[m]; 123 123 if (m >= NMEASURE) { 124 124 fprintf (stderr, "WARNING: m out of bounds (3)\n"); … … 127 127 128 128 /* set up references */ 129 next_meas [Nmeasure] = -1;129 next_measure[Nmeasure] = -1; 130 130 if (Nmeasure >= NMEASURE) { 131 131 fprintf (stderr, "WARNING: Nmeasure out of bounds (1)\n"); … … 136 136 average[0].measureOffset = Nmeasure; 137 137 } else { 138 next_meas [m] = Nmeasure;138 next_measure[m] = Nmeasure; 139 139 if (m >= NMEASURE) { 140 140 fprintf (stderr, "WARNING: m out of bounds (4)\n"); … … 145 145 } 146 146 147 Measure *sort_measure (Average *average, off_t Naverage, Measure *measure, off_t Nmeasure, off_t *next_meas ) {147 Measure *sort_measure (Average *average, off_t Naverage, Measure *measure, off_t Nmeasure, off_t *next_measure) { 148 148 149 149 off_t i, k, n, np, N; … … 169 169 tmpmeasure[N].averef = i; 170 170 np = n; 171 n = next_meas [n];171 n = next_measure[n]; 172 172 } 173 173 } … … 183 183 184 184 off_t i, j, N; 185 off_t *next_miss ;185 off_t *next_missing; 186 186 187 187 N = 0; 188 188 189 ALLOCATE (next_miss , off_t, Nmissing);189 ALLOCATE (next_missing, off_t, Nmissing); 190 190 for (i = 0; i < Naverage; i++) { 191 191 for (j = 0; j < average[i].Nmissing - 1; j++, N++) { 192 next_miss [N] = N + 1;192 next_missing[N] = N + 1; 193 193 } 194 194 if (average[i].Nmissing > 0) { 195 next_miss [N] = -1;195 next_missing[N] = -1; 196 196 if (N >= Nmissing) { 197 197 fprintf (stderr, "overflow in init_missing_links"); … … 202 202 203 203 } 204 return (next_miss );205 } 206 207 int add_miss _link (Average *average, off_t *next_miss, off_t Nmissing) {204 return (next_missing); 205 } 206 207 int add_missing_link (Average *average, off_t *next_missing, off_t Nmissing) { 208 208 209 209 off_t k, m; … … 212 212 if (average[0].Nmissing < 1) { 213 213 average[0].missingOffset = Nmissing; 214 next_miss [Nmissing] = -1;214 next_missing[Nmissing] = -1; 215 215 return (TRUE); 216 216 } 217 217 218 218 m = average[0].missingOffset; 219 for (k = 0; k < average[0].Nmissing - 1; k++) m = next_miss [m];219 for (k = 0; k < average[0].Nmissing - 1; k++) m = next_missing[m]; 220 220 /* set up references */ 221 next_miss [Nmissing] = -1;222 next_miss [m] = Nmissing;221 next_missing[Nmissing] = -1; 222 next_missing[m] = Nmissing; 223 223 return (TRUE); 224 224 } … … 227 227 we must always save the missing table, if it exists */ 228 228 229 Missing *sort_missing (Average *average, off_t Naverage, Missing *missing, off_t Nmissing, off_t *next_miss ) {229 Missing *sort_missing (Average *average, off_t Naverage, Missing *missing, off_t Nmissing, off_t *next_missing) { 230 230 231 231 off_t i, k, n, N; … … 240 240 for (k = 0; k < average[i].Nmissing; k++, N++) { 241 241 tmpmissing[N] = missing[n]; 242 n = next_miss [n];242 n = next_missing[n]; 243 243 } 244 244 } … … 254 254 255 255 off_t i, j, N; 256 off_t *next_lens ;256 off_t *next_lensing; 257 257 258 258 if (!lensing) return NULL; … … 261 261 N = 0; 262 262 263 ALLOCATE (next_lens , off_t, Nlensing);263 ALLOCATE (next_lensing, off_t, Nlensing); 264 264 for (i = 0; i < Naverage; i++) { 265 265 if (!average[i].Nlensing) continue; … … 268 268 for (j = 0; j < average[i].Nlensing - 1; j++, N++) { 269 269 myAssert (lensing[m+j+1].averef == i, "not sorted"); 270 next_lens [N] = N + 1;270 next_lensing[N] = N + 1; 271 271 if (N >= Nlensing) { 272 272 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 273 273 } 274 274 } 275 next_lens [N] = -1;275 next_lensing[N] = -1; 276 276 if (N >= Nlensing) { 277 277 fprintf (stderr, "WARNING: N out of bounds (2)\n"); … … 284 284 N++; 285 285 } 286 return (next_lens );286 return (next_lensing); 287 287 } 288 288 … … 297 297 298 298 off_t i, m, k, Nm, averef; 299 off_t *next_lens ;300 301 ALLOCATE (next_lens , off_t, Nlensing);299 off_t *next_lensing; 300 301 ALLOCATE (next_lensing, off_t, Nlensing); 302 302 303 303 /* reset the Nm, offset values for average */ … … 310 310 averef = lensing[Nm].averef; 311 311 m = average[averef].lensingOffset; 312 next_lens [Nm] = -1;312 next_lensing[Nm] = -1; 313 313 314 314 if (m == -1) { /* no links yet for source */ … … 318 318 } 319 319 320 for (k = 0; next_lens [m] != -1; k++) {321 m = next_lens [m];320 for (k = 0; next_lensing[m] != -1; k++) { 321 m = next_lensing[m]; 322 322 if (m >= Nlensing) { 323 323 fprintf (stderr, "WARNING: m out of bounds (1)\n"); … … 326 326 327 327 average[averef].Nlensing = k + 2; 328 next_lens [m] = Nm;328 next_lensing[m] = Nm; 329 329 if (m >= Nlensing) { 330 330 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 331 331 } 332 332 } 333 return (next_lens );333 return (next_lensing); 334 334 } 335 335 336 336 /* average[].lensingOffset, average[].Nlensing are valid within an addstar run */ 337 int add_lens _link (Average *average, off_t *next_lens, off_t Nlensing, off_t NLENSING) {337 int add_lensing_link (Average *average, off_t *next_lensing, off_t Nlensing, off_t NLENSING) { 338 338 339 339 off_t k, m; 340 340 341 /* if we have trouble, check validity of next_lens [m] : m < Nlensing */341 /* if we have trouble, check validity of next_lensing[m] : m < Nlensing */ 342 342 m = average[0].lensingOffset; 343 343 344 344 for (k = 0; k < average[0].Nlensing - 1; k++) { 345 m = next_lens [m];345 m = next_lensing[m]; 346 346 if (m >= NLENSING) { 347 347 fprintf (stderr, "WARNING: m out of bounds (3)\n"); … … 350 350 351 351 /* set up references */ 352 next_lens [Nlensing] = -1;352 next_lensing[Nlensing] = -1; 353 353 if (Nlensing >= NLENSING) { 354 354 fprintf (stderr, "WARNING: Nlensing out of bounds (1)\n"); … … 359 359 average[0].lensingOffset = Nlensing; 360 360 } else { 361 next_lens [m] = Nlensing;361 next_lensing[m] = Nlensing; 362 362 if (m >= NLENSING) { 363 363 fprintf (stderr, "WARNING: m out of bounds (4)\n"); … … 368 368 } 369 369 370 Lensing *sort_lensing (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next_lens ) {370 Lensing *sort_lensing (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next_lensing) { 371 371 372 372 off_t i, k, n, np, N; … … 392 392 tmplensing[N].averef = i; 393 393 np = n; 394 n = next_lens [n];394 n = next_lensing[n]; 395 395 } 396 396 } 397 397 free (lensing); 398 398 return (tmplensing); 399 } 400 401 /*** Lensobj ****************************************************************************************/ 402 403 /* build the initial links assuming the table is sorted, 404 not partial, and has a correct set of average[].lensobjOffset,Nlensobj values */ 405 off_t *init_lensobj_links (Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj) { 406 407 off_t i, j, N; 408 off_t *next_lensobj; 409 410 if (!lensobj) return NULL; 411 if (SKIP_LENSOBJ) return NULL; 412 413 N = 0; 414 415 ALLOCATE (next_lensobj, off_t, Nlensobj); 416 for (i = 0; i < Naverage; i++) { 417 if (!average[i].Nlensobj) continue; 418 // off_t m = average[i].lensobjOffset; 419 // myAssert (lensobj[m].averef == i, "not sorted"); 420 for (j = 0; j < average[i].Nlensobj - 1; j++, N++) { 421 // myAssert (lensobj[m+j+1].averef == i, "not sorted"); 422 next_lensobj[N] = N + 1; 423 if (N >= Nlensobj) { 424 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 425 } 426 } 427 next_lensobj[N] = -1; 428 if (N >= Nlensobj) { 429 fprintf (stderr, "WARNING: N out of bounds (2)\n"); 430 } 431 432 if (N >= Nlensobj) { 433 fprintf (stderr, "overflow in init_lensobj_links\n"); 434 abort (); 435 } 436 N++; 437 } 438 return (next_lensobj); 439 } 440 441 /* construct lensobj links which are valid FOR THIS LOAD 442 * - if we have a full load, we will get links which can 443 * be used by other programs (eg, relphot, etc) 444 * - if we have a partial load, the links are only valid 445 * for that partial load 446 */ 447 448 off_t *build_lensobj_links (Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj) { 449 450 fprintf (stderr, "input is not sorted but contains lensobj -- trouble\n"); 451 exit (2); 452 453 # if (0) 454 455 off_t i, m, k, Nm, averef; 456 off_t *next_lensobj; 457 458 ALLOCATE (next_lensobj, off_t, Nlensobj); 459 460 /* reset the Nm, offset values for average */ 461 for (i = 0; i < Naverage; i++) { 462 average[i].lensobjOffset = -1; 463 average[i].Nlensobj = 0; 464 } 465 466 for (Nm = 0; Nm < Nlensobj; Nm++) { 467 averef = lensobj[Nm].averef; 468 m = average[averef].lensobjOffset; 469 next_lensobj[Nm] = -1; 470 471 if (m == -1) { /* no links yet for source */ 472 average[averef].lensobjOffset = Nm; 473 average[averef].Nlensobj = 1; 474 continue; 475 } 476 477 for (k = 0; next_lensobj[m] != -1; k++) { 478 m = next_lensobj[m]; 479 if (m >= Nlensobj) { 480 fprintf (stderr, "WARNING: m out of bounds (1)\n"); 481 } 482 } 483 484 average[averef].Nlensobj = k + 2; 485 next_lensobj[m] = Nm; 486 if (m >= Nlensobj) { 487 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 488 } 489 } 490 return (next_lensobj); 491 # endif 492 } 493 494 /* average[].lensobjOffset, average[].Nlensobj are valid within an addstar run */ 495 int add_lensobj_link (Average *average, off_t *next_lensobj, off_t Nlensobj, off_t NLENSOBJ) { 496 497 off_t k, m; 498 499 /* if we have trouble, check validity of next_lensobj[m] : m < Nlensobj */ 500 m = average[0].lensobjOffset; 501 502 for (k = 0; k < average[0].Nlensobj - 1; k++) { 503 m = next_lensobj[m]; 504 if (m >= NLENSOBJ) { 505 fprintf (stderr, "WARNING: m out of bounds (3)\n"); 506 } 507 } 508 509 /* set up references */ 510 next_lensobj[Nlensobj] = -1; 511 if (Nlensobj >= NLENSOBJ) { 512 fprintf (stderr, "WARNING: Nlensobj out of bounds (1)\n"); 513 } 514 515 // if Nlensobj is 0, m may have been mis-set; add to the end 516 if ((average[0].Nlensobj == 0) || (m == -1)) { 517 average[0].lensobjOffset = Nlensobj; 518 } else { 519 next_lensobj[m] = Nlensobj; 520 if (m >= NLENSOBJ) { 521 fprintf (stderr, "WARNING: m out of bounds (4)\n"); 522 } 523 } 524 525 return (TRUE); 526 } 527 528 Lensobj *sort_lensobj (Average *average, off_t Naverage, Lensobj *lensobj, off_t Nlensobj, off_t *next_lensobj) { 529 530 off_t i, k, n, np, N; 531 Lensobj *tmplensobj; 532 533 /* fix order of Lensobj (memory intensive, but fast) */ 534 np = -1; 535 N = 0; 536 ALLOCATE (tmplensobj, Lensobj, Nlensobj); 537 for (i = 0; i < Naverage; i++) { 538 if (!average[i].Nlensobj) continue; 539 n = average[i].lensobjOffset; 540 average[i].lensobjOffset = N; 541 int myObjID = average[i].objID; 542 for (k = 0; k < average[i].Nlensobj; k++, N++) { 543 if (n == -1) { 544 fprintf (stderr, "entry after %d has a problem\n", (int) np); 545 abort(); 546 } 547 tmplensobj[N] = lensobj[n]; 548 // myAssert (lensobj[n].averef == i, "error in averef"); 549 myAssert ((lensobj[n].objID == myObjID) || (lensobj[n].objID == -1), "error in objID?"); 550 // tmplensobj[N].averef = i; 551 np = n; 552 n = next_lensobj[n]; 553 } 554 } 555 free (lensobj); 556 return (tmplensobj); 399 557 } 400 558 … … 406 564 407 565 off_t i, j, N; 408 off_t *next_star ;566 off_t *next_starpar; 409 567 410 568 if (!starpar) return NULL; … … 415 573 // NOTE that is we choose DVO_SKIP_STARPAR, catalog.starpar is NULL. 416 574 // this code will let merge_catalogs_old.c do nothing for starpar 417 ALLOCATE (next_star , off_t, Nstarpar);418 if (!starpar) return next_star ;575 ALLOCATE (next_starpar, off_t, Nstarpar); 576 if (!starpar) return next_starpar; 419 577 420 578 for (i = 0; i < Naverage; i++) { … … 424 582 for (j = 0; j < average[i].Nstarpar - 1; j++, N++) { 425 583 myAssert (starpar[m+j+1].averef == i, "not sorted"); 426 next_star [N] = N + 1;584 next_starpar[N] = N + 1; 427 585 if (N >= Nstarpar) { 428 586 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 429 587 } 430 588 } 431 next_star [N] = -1;589 next_starpar[N] = -1; 432 590 if (N >= Nstarpar) { 433 591 fprintf (stderr, "WARNING: N out of bounds (2)\n"); … … 440 598 N++; 441 599 } 442 return (next_star );600 return (next_starpar); 443 601 } 444 602 … … 453 611 454 612 off_t i, m, k, Nm, averef; 455 off_t *next_star ;456 457 ALLOCATE (next_star , off_t, Nstarpar);458 if (!starpar) return next_star ;613 off_t *next_starpar; 614 615 ALLOCATE (next_starpar, off_t, Nstarpar); 616 if (!starpar) return next_starpar; 459 617 460 618 /* reset the Nm, offset values for average */ … … 467 625 averef = starpar[Nm].averef; 468 626 m = average[averef].starparOffset; 469 next_star [Nm] = -1;627 next_starpar[Nm] = -1; 470 628 471 629 if (m == -1) { /* no links yet for source */ … … 475 633 } 476 634 477 for (k = 0; next_star [m] != -1; k++) {478 m = next_star [m];635 for (k = 0; next_starpar[m] != -1; k++) { 636 m = next_starpar[m]; 479 637 if (m >= Nstarpar) { 480 638 fprintf (stderr, "WARNING: m out of bounds (1)\n"); … … 483 641 484 642 average[averef].Nstarpar = k + 2; 485 next_star [m] = Nm;643 next_starpar[m] = Nm; 486 644 if (m >= Nstarpar) { 487 645 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 488 646 } 489 647 } 490 return (next_star );648 return (next_starpar); 491 649 } 492 650 493 651 /* average[].starparOffset, average[].Nstarpar are valid within an addstar run */ 494 int add_star _link (Average *average, off_t *next_star, off_t Nstarpar, off_t NSTARPAR) {652 int add_starpar_link (Average *average, off_t *next_starpar, off_t Nstarpar, off_t NSTARPAR) { 495 653 496 654 off_t k, m; 497 655 498 /* if we have trouble, check validity of next_star [m] : m < Nstarpar */656 /* if we have trouble, check validity of next_starpar[m] : m < Nstarpar */ 499 657 m = average[0].starparOffset; 500 658 501 659 for (k = 0; k < average[0].Nstarpar - 1; k++) { 502 m = next_star [m];660 m = next_starpar[m]; 503 661 if (m >= NSTARPAR) { 504 662 fprintf (stderr, "WARNING: m out of bounds (3)\n"); … … 507 665 508 666 /* set up references */ 509 next_star [Nstarpar] = -1;667 next_starpar[Nstarpar] = -1; 510 668 if (Nstarpar >= NSTARPAR) { 511 669 fprintf (stderr, "WARNING: Nstarpar out of bounds (1)\n"); … … 516 674 average[0].starparOffset = Nstarpar; 517 675 } else { 518 next_star [m] = Nstarpar;676 next_starpar[m] = Nstarpar; 519 677 if (m >= NSTARPAR) { 520 678 fprintf (stderr, "WARNING: m out of bounds (4)\n"); … … 525 683 } 526 684 527 StarPar *sort_starpar (Average *average, off_t Naverage, StarPar *starpar, off_t Nstarpar, off_t *next_star ) {685 StarPar *sort_starpar (Average *average, off_t Naverage, StarPar *starpar, off_t Nstarpar, off_t *next_starpar) { 528 686 529 687 off_t i, k, n, np, N; … … 552 710 tmpstarpar[N].averef = i; 553 711 np = n; 554 n = next_star [n];712 n = next_starpar[n]; 555 713 } 556 714 } … … 566 724 567 725 off_t i, j, N; 568 off_t *next_galp ;726 off_t *next_galphot; 569 727 570 728 if (galphot) return NULL; … … 573 731 N = 0; 574 732 575 ALLOCATE (next_galp , off_t, Ngalphot);733 ALLOCATE (next_galphot, off_t, Ngalphot); 576 734 for (i = 0; i < Naverage; i++) { 577 735 if (!average[i].Ngalphot) continue; … … 580 738 for (j = 0; j < average[i].Ngalphot - 1; j++, N++) { 581 739 myAssert (galphot[m+j+1].averef == i, "not sorted"); 582 next_galp [N] = N + 1;740 next_galphot[N] = N + 1; 583 741 if (N >= Ngalphot) { 584 742 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 585 743 } 586 744 } 587 next_galp [N] = -1;745 next_galphot[N] = -1; 588 746 if (N >= Ngalphot) { 589 747 fprintf (stderr, "WARNING: N out of bounds (2)\n"); … … 596 754 N++; 597 755 } 598 return (next_galp );756 return (next_galphot); 599 757 } 600 758 … … 609 767 610 768 off_t i, m, k, Nm, averef; 611 off_t *next_galp ;612 613 ALLOCATE (next_galp , off_t, Ngalphot);769 off_t *next_galphot; 770 771 ALLOCATE (next_galphot, off_t, Ngalphot); 614 772 615 773 /* reset the Nm, offset values for average */ … … 622 780 averef = galphot[Nm].averef; 623 781 m = average[averef].galphotOffset; 624 next_galp [Nm] = -1;782 next_galphot[Nm] = -1; 625 783 626 784 if (m == -1) { /* no links yet for source */ … … 630 788 } 631 789 632 for (k = 0; next_galp [m] != -1; k++) {633 m = next_galp [m];790 for (k = 0; next_galphot[m] != -1; k++) { 791 m = next_galphot[m]; 634 792 if (m >= Ngalphot) { 635 793 fprintf (stderr, "WARNING: m out of bounds (1)\n"); … … 638 796 639 797 average[averef].Ngalphot = k + 2; 640 next_galp [m] = Nm;798 next_galphot[m] = Nm; 641 799 if (m >= Ngalphot) { 642 800 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 643 801 } 644 802 } 645 return (next_galp );803 return (next_galphot); 646 804 } 647 805 648 806 /* average[].galphotOffset, average[].Ngalphot are valid within an addstar run */ 649 int add_galp _link (Average *average, off_t *next_galp, off_t Ngalphot, off_t NGALPHOT) {807 int add_galphot_link (Average *average, off_t *next_galphot, off_t Ngalphot, off_t NGALPHOT) { 650 808 651 809 off_t k, m; 652 810 653 /* if we have trouble, check validity of next_galp [m] : m < Ngalphot */811 /* if we have trouble, check validity of next_galphot[m] : m < Ngalphot */ 654 812 m = average[0].galphotOffset; 655 813 656 814 for (k = 0; k < average[0].Ngalphot - 1; k++) { 657 m = next_galp [m];815 m = next_galphot[m]; 658 816 if (m >= NGALPHOT) { 659 817 fprintf (stderr, "WARNING: m out of bounds (3)\n"); … … 662 820 663 821 /* set up references */ 664 next_galp [Ngalphot] = -1;822 next_galphot[Ngalphot] = -1; 665 823 if (Ngalphot >= NGALPHOT) { 666 824 fprintf (stderr, "WARNING: Ngalphot out of bounds (1)\n"); … … 671 829 average[0].galphotOffset = Ngalphot; 672 830 } else { 673 next_galp [m] = Ngalphot;831 next_galphot[m] = Ngalphot; 674 832 if (m >= NGALPHOT) { 675 833 fprintf (stderr, "WARNING: m out of bounds (4)\n"); … … 680 838 } 681 839 682 GalPhot *sort_galphot (Average *average, off_t Naverage, GalPhot *galphot, off_t Ngalphot, off_t *next_galp ) {840 GalPhot *sort_galphot (Average *average, off_t Naverage, GalPhot *galphot, off_t Ngalphot, off_t *next_galphot) { 683 841 684 842 off_t i, k, n, np, N; … … 704 862 tmpgalphot[N].averef = i; 705 863 np = n; 706 n = next_galp [n];864 n = next_galphot[n]; 707 865 } 708 866 } -
trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r39536 r39926 336 336 if (SKIP_MEASURE) { strextend (&command, "-skip-measure"); } 337 337 if (SKIP_LENSING) { strextend (&command, "-skip-lensing"); } 338 if (SKIP_LENSOBJ) { strextend (&command, "-skip-lensobj"); } 338 339 if (SKIP_GALPHOT) { strextend (&command, "-skip-galphot"); } 339 340 if (SKIP_STARPAR) { strextend (&command, "-skip-starpar"); } -
trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c
r39342 r39926 14 14 double *X1, *Y1, *X2, *Y2; 15 15 double dX, dY, dR; 16 off_t *N1, *N2, *next_meas , *next_lens, *next_star, *next_galp;17 off_t Nave, NAVE, Nmeas , NMEAS, Nmatch, Nlens, NLENS, Nstar, NSTAR, Ngalp, NGALP;16 off_t *N1, *N2, *next_measure, *next_lensing, *next_lensobj, *next_starpar, *next_galphot; 17 off_t Nave, NAVE, Nmeasure, NMEASURE, Nmatch, Nlensing, NLENSING, Nlensobj, NLENSOBJ, Nstarpar, NSTARPAR, Ngalphot, NGALPHOT; 18 18 int NsecfiltIn; 19 19 int NsecfiltOut; … … 51 51 /* internal counters */ 52 52 Nmatch = 0; 53 NMEAS = Nmeas = output[0].Nmeasure; 54 NLENS = Nlens = output[0].Nlensing; 55 NSTAR = Nstar = output[0].Nstarpar; 56 NGALP = Ngalp = output[0].Ngalphot; 53 NMEASURE = Nmeasure = output[0].Nmeasure; 54 NLENSING = Nlensing = output[0].Nlensing; 55 NLENSOBJ = Nlensobj = output[0].Nlensobj; 56 NSTARPAR = Nstarpar = output[0].Nstarpar; 57 NGALPHOT = Ngalphot = output[0].Ngalphot; 57 58 58 59 // current max obj ID for this catalog … … 116 117 // this version is only valid if we have done a full catalog load, and if the catalog 117 118 // is sorted while processed 118 next_meas = init_measure_links (output[0].average, Nave, output[0].measure, Nmeas); 119 next_lens = init_lensing_links (output[0].average, Nave, output[0].lensing, Nlens); 120 next_star = init_starpar_links (output[0].average, Nave, output[0].starpar, Nstar); 121 next_galp = init_galphot_links (output[0].average, Nave, output[0].galphot, Ngalp); 119 next_measure = init_measure_links (output[0].average, Nave, output[0].measure, Nmeasure); 120 next_lensing = init_lensing_links (output[0].average, Nave, output[0].lensing, Nlensing); 121 next_lensobj = init_lensobj_links (output[0].average, Nave, output[0].lensobj, Nlensobj); 122 next_starpar = init_starpar_links (output[0].average, Nave, output[0].starpar, Nstarpar); 123 next_galphot = init_galphot_links (output[0].average, Nave, output[0].galphot, Ngalphot); 122 124 } else { 123 next_meas = build_measure_links (output[0].average, Nave, output[0].measure, Nmeas); 124 next_lens = build_lensing_links (output[0].average, Nave, output[0].lensing, Nlens); 125 next_star = build_starpar_links (output[0].average, Nave, output[0].starpar, Nstar); 126 next_galp = build_galphot_links (output[0].average, Nave, output[0].galphot, Ngalp); 125 next_measure = build_measure_links (output[0].average, Nave, output[0].measure, Nmeasure); 126 next_lensing = build_lensing_links (output[0].average, Nave, output[0].lensing, Nlensing); 127 next_lensobj = build_lensobj_links (output[0].average, Nave, output[0].lensobj, Nlensobj); 128 next_starpar = build_starpar_links (output[0].average, Nave, output[0].starpar, Nstarpar); 129 next_galphot = build_galphot_links (output[0].average, Nave, output[0].galphot, Ngalphot); 127 130 } 128 131 … … 183 186 184 187 /* make sure there is space for next Nmeasure entries */ 185 if (Nmeas + input[0].average[N].Nmeasure >= NMEAS) { 186 NMEAS = Nmeas + input[0].average[N].Nmeasure + 1000; 187 REALLOCATE (next_meas, off_t, NMEAS); 188 REALLOCATE (output[0].measure, Measure, NMEAS); 189 } 190 if (Nlens + input[0].average[N].Nlensing >= NLENS) { 191 NLENS = Nlens + input[0].average[N].Nlensing + 1000; 192 REALLOCATE (next_lens, off_t, NLENS); 193 REALLOCATE (output[0].lensing, Lensing, NLENS); 194 } 195 if (Nstar + input[0].average[N].Nstarpar >= NSTAR) { 196 NSTAR = Nstar + input[0].average[N].Nstarpar + 1000; 197 REALLOCATE (next_star, off_t, NSTAR); 198 REALLOCATE (output[0].starpar, StarPar, NSTAR); 199 } 200 if (Ngalp + input[0].average[N].Ngalphot >= NGALP) { 201 NGALP = Ngalp + input[0].average[N].Ngalphot + 1000; 202 REALLOCATE (next_galp, off_t, NGALP); 203 REALLOCATE (output[0].galphot, GalPhot, NGALP); 188 if (Nmeasure + input[0].average[N].Nmeasure >= NMEASURE) { 189 NMEASURE = Nmeasure + input[0].average[N].Nmeasure + 1000; 190 REALLOCATE (next_measure, off_t, NMEASURE); 191 REALLOCATE (output[0].measure, Measure, NMEASURE); 192 } 193 if (Nlensing + input[0].average[N].Nlensing >= NLENSING) { 194 NLENSING = Nlensing + input[0].average[N].Nlensing + 1000; 195 REALLOCATE (next_lensing, off_t, NLENSING); 196 REALLOCATE (output[0].lensing, Lensing, NLENSING); 197 } 198 if (Nlensobj + input[0].average[N].Nlensobj >= NLENSOBJ) { 199 NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + 1000; 200 REALLOCATE (next_lensobj, off_t, NLENSOBJ); 201 REALLOCATE (output[0].lensobj, Lensobj, NLENSOBJ); 202 } 203 if (Nstarpar + input[0].average[N].Nstarpar >= NSTARPAR) { 204 NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + 1000; 205 REALLOCATE (next_starpar, off_t, NSTARPAR); 206 REALLOCATE (output[0].starpar, StarPar, NSTARPAR); 207 } 208 if (Ngalphot + input[0].average[N].Ngalphot >= NGALPHOT) { 209 NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + 1000; 210 REALLOCATE (next_galphot, off_t, NGALPHOT); 211 REALLOCATE (output[0].galphot, GalPhot, NGALPHOT); 204 212 } 205 213 … … 212 220 if (REPLACE_TYCHO) { 213 221 int Minp = input[0].average[N].measureOffset; 214 Nreplace = replace_tycho (&output[0].average[n], output[0].measure, next_meas , &input[0].average[N], &input[0].measure[Minp]);222 Nreplace = replace_tycho (&output[0].average[n], output[0].measure, next_measure, &input[0].average[N], &input[0].measure[Minp]); 215 223 if (Nreplace == 6) { 216 output[0].found_t[n] = Nmeas ;224 output[0].found_t[n] = Nmeasure; 217 225 i++; 218 226 continue; … … 227 235 // index to first measure for this object 228 236 // XXX this does not support lensing, starpar, or galphot measurements 229 if (replace_match (&output[0].average[n], output[0].measure, next_meas , &input[0].average[N], &input[0].measure[offset])) {237 if (replace_match (&output[0].average[n], output[0].measure, next_measure, &input[0].average[N], &input[0].measure[offset])) { 230 238 continue; 231 239 } 232 240 } 233 241 /* add to end of measurement list */ 234 add_meas _link (&output[0].average[n], next_meas, Nmeas, NMEAS);242 add_measure_link (&output[0].average[n], next_measure, Nmeasure, NMEASURE); 235 243 236 244 // set the new measurements 237 output[0].measure[Nmeas ] = input[0].measure[offset];245 output[0].measure[Nmeasure] = input[0].measure[offset]; 238 246 239 247 // old code: find R,D using average_in[0], the get offset relative to average_out[0]. no longer … … 241 249 // Rin = input[0].average[N].R - input[0].measure[offset].dR / 3600.0; 242 250 // Din = input[0].average[N].D - input[0].measure[offset].dD / 3600.0; 243 // output[0].measure[Nmeas ].dR = 3600.0*(output[0].average[n].R - Rin);244 // output[0].measure[Nmeas ].dD = 3600.0*(output[0].average[n].D - Din);245 246 output[0].measure[Nmeas ].dbFlags = 0; // XXX why reset these?247 output[0].measure[Nmeas ].averef = n;248 output[0].measure[Nmeas ].objID = output[0].average[n].objID;249 output[0].measure[Nmeas ].catID = output[0].catID;250 251 assert (output[0].measure[Nmeas ].averef < Nave);252 253 // fprintf (stderr, "Nave : "OFF_T_FMT", Nmeas : "OFF_T_FMT", dR: %f, dD: %f, catID: %d\n", n, Nmeas, output[0].measure[Nmeas].dR, output[0].measure[Nmeas].dD, output[0].measure[i].catID);254 255 float dRoff = dvoOffsetR(&output[0].measure[Nmeas ], &output[0].average[n]);251 // output[0].measure[Nmeasure].dR = 3600.0*(output[0].average[n].R - Rin); 252 // output[0].measure[Nmeasure].dD = 3600.0*(output[0].average[n].D - Din); 253 254 output[0].measure[Nmeasure].dbFlags = 0; // XXX why reset these? 255 output[0].measure[Nmeasure].averef = n; 256 output[0].measure[Nmeasure].objID = output[0].average[n].objID; 257 output[0].measure[Nmeasure].catID = output[0].catID; 258 259 assert (output[0].measure[Nmeasure].averef < Nave); 260 261 // fprintf (stderr, "Nave : "OFF_T_FMT", Nmeasure : "OFF_T_FMT", dR: %f, dD: %f, catID: %d\n", n, Nmeasure, output[0].measure[Nmeasure].dR, output[0].measure[Nmeasure].dD, output[0].measure[i].catID); 262 263 float dRoff = dvoOffsetR(&output[0].measure[Nmeasure], &output[0].average[n]); 256 264 257 265 // rationalize R 258 266 if (dRoff > +180.0*3600.0) { 259 267 // average on high end of boundary, move star up 260 output[0].measure[Nmeas ].R += 360.0;268 output[0].measure[Nmeasure].R += 360.0; 261 269 dRoff -= 360.0*3600.0; 262 270 } 263 271 if (dRoff < -180.0*3600.0) { 264 272 // average on low end of boundary, move star down 265 output[0].measure[Nmeas ].R -= 360.0;273 output[0].measure[Nmeasure].R -= 360.0; 266 274 dRoff += 360.0*3600.0; 267 275 } … … 272 280 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 273 281 output[0].average[n].R, output[0].average[n].D, 274 output[0].measure[Nmeas ].R, output[0].measure[Nmeas].D,282 output[0].measure[Nmeasure].R, output[0].measure[Nmeasure].D, 275 283 X1[i], X2[Jmin], Y1[i], Y2[Jmin]); 276 284 // XXX abort on this? -- this is a bad failure... … … 278 286 } 279 287 output[0].average[n].Nmeasure ++; 280 Nmeas ++;288 Nmeasure ++; 281 289 } 282 290 } … … 286 294 for (Nin = 0; Nin < input[0].average[N].Nlensing; Nin++) { 287 295 /* add to end of lensing list */ 288 add_lens _link (&output[0].average[n], next_lens, Nlens, NLENS);296 add_lensing_link (&output[0].average[n], next_lensing, Nlensing, NLENSING); 289 297 290 298 // set the new lensing 291 299 off_t lensoff = input[0].average[N].lensingOffset + Nin; 292 output[0].lensing[Nlens ] = input[0].lensing[lensoff];293 294 output[0].lensing[Nlens ].averef = n;295 output[0].lensing[Nlens ].objID = output[0].average[n].objID;296 output[0].lensing[Nlens ].catID = output[0].catID;300 output[0].lensing[Nlensing] = input[0].lensing[lensoff]; 301 302 output[0].lensing[Nlensing].averef = n; 303 output[0].lensing[Nlensing].objID = output[0].average[n].objID; 304 output[0].lensing[Nlensing].catID = output[0].catID; 297 305 output[0].average[n].Nlensing ++; 298 Nlens ++; 306 Nlensing ++; 307 } 308 } 309 310 // if lensobj measurements exist, add them too 311 if (output[0].lensobj && !SKIP_LENSOBJ) { 312 for (Nin = 0; Nin < input[0].average[N].Nlensobj; Nin++) { 313 /* add to end of lensobj list */ 314 add_lensobj_link (&output[0].average[n], next_lensobj, Nlensobj, NLENSOBJ); 315 316 // set the new lensobj 317 off_t lensoff = input[0].average[N].lensobjOffset + Nin; 318 output[0].lensobj[Nlensobj] = input[0].lensobj[lensoff]; 319 320 // output[0].lensobj[Nlensobj].averef = n; 321 output[0].lensobj[Nlensobj].objID = output[0].average[n].objID; 322 output[0].lensobj[Nlensobj].catID = output[0].catID; 323 output[0].average[n].Nlensobj ++; 324 Nlensobj ++; 299 325 } 300 326 } … … 304 330 for (Nin = 0; Nin < input[0].average[N].Nstarpar; Nin++) { 305 331 /* add to end of lensing list */ 306 add_star _link (&output[0].average[n], next_star, Nstar, NSTAR);332 add_starpar_link (&output[0].average[n], next_starpar, Nstarpar, NSTARPAR); 307 333 308 334 // set the new starpar 309 335 off_t staroff = input[0].average[N].starparOffset + Nin; 310 output[0].starpar[Nstar ] = input[0].starpar[staroff];311 312 output[0].starpar[Nstar ].averef = n;313 output[0].starpar[Nstar ].objID = output[0].average[n].objID;314 output[0].starpar[Nstar ].catID = output[0].catID;336 output[0].starpar[Nstarpar] = input[0].starpar[staroff]; 337 338 output[0].starpar[Nstarpar].averef = n; 339 output[0].starpar[Nstarpar].objID = output[0].average[n].objID; 340 output[0].starpar[Nstarpar].catID = output[0].catID; 315 341 output[0].average[n].Nstarpar ++; 316 Nstar ++;342 Nstarpar ++; 317 343 } 318 344 } … … 322 348 for (Nin = 0; Nin < input[0].average[N].Ngalphot; Nin++) { 323 349 /* add to end of galphot list */ 324 add_galp _link (&output[0].average[n], next_galp, Ngalp, NGALP);350 add_galphot_link (&output[0].average[n], next_galphot, Ngalphot, NGALPHOT); 325 351 326 352 // set the new galphot 327 353 off_t galpoff = input[0].average[N].galphotOffset + Nin; 328 output[0].galphot[Ngalp ] = input[0].galphot[galpoff];329 330 output[0].galphot[Ngalp ].averef = n;331 output[0].galphot[Ngalp ].objID = output[0].average[n].objID;332 output[0].galphot[Ngalp ].catID = output[0].catID;354 output[0].galphot[Ngalphot] = input[0].galphot[galpoff]; 355 356 output[0].galphot[Ngalphot].averef = n; 357 output[0].galphot[Ngalphot].objID = output[0].average[n].objID; 358 output[0].galphot[Ngalphot].catID = output[0].catID; 333 359 output[0].average[n].Ngalphot ++; 334 Ngalp ++;360 Ngalphot ++; 335 361 } 336 362 } … … 373 399 /* Nm is updated, but not written out in -update mode (for existing entries) 374 400 Nm is recalculated in build_meas_links if loaded table is not sorted */ 375 output[0].found_t[n] = Nmeas ;401 output[0].found_t[n] = Nmeasure; 376 402 i++; 377 403 } 378 // MARKTIME("find matched stars: %f sec for "OFF_T_FMT","OFF_T_FMT" stars ("OFF_T_FMT" meas)\n", dtime, Nstars, Nave, Nmeas );404 // MARKTIME("find matched stars: %f sec for "OFF_T_FMT","OFF_T_FMT" stars ("OFF_T_FMT" meas)\n", dtime, Nstars, Nave, Nmeasure); 379 405 380 406 /** incorporate unmatched image stars, if this star is in field of this catalog **/ … … 384 410 385 411 /* make sure there is space for next entry */ 386 if (Nmeas + input[0].average[N].Nmeasure >= NMEAS) { 387 NMEAS = Nmeas + input[0].average[N].Nmeasure + 1000; 388 REALLOCATE (next_meas, off_t, NMEAS); 389 REALLOCATE (output[0].measure, Measure, NMEAS); 390 } 391 if (Nlens + input[0].average[N].Nlensing >= NLENS) { 392 NLENS = Nlens + input[0].average[N].Nlensing + 1000; 393 REALLOCATE (next_lens, off_t, NLENS); 394 REALLOCATE (output[0].lensing, Lensing, NLENS); 395 } 396 if (Nstar + input[0].average[N].Nstarpar >= NSTAR) { 397 NSTAR = Nstar + input[0].average[N].Nstarpar + 1000; 398 REALLOCATE (next_star, off_t, NSTAR); 399 REALLOCATE (output[0].starpar, StarPar, NSTAR); 400 } 401 if (Ngalp + input[0].average[N].Ngalphot >= NGALP) { 402 NGALP = Ngalp + input[0].average[N].Ngalphot + 1000; 403 REALLOCATE (next_galp, off_t, NGALP); 404 REALLOCATE (output[0].galphot, GalPhot, NGALP); 412 if (Nmeasure + input[0].average[N].Nmeasure >= NMEASURE) { 413 NMEASURE = Nmeasure + input[0].average[N].Nmeasure + 1000; 414 REALLOCATE (next_measure, off_t, NMEASURE); 415 REALLOCATE (output[0].measure, Measure, NMEASURE); 416 } 417 if (Nlensing + input[0].average[N].Nlensing >= NLENSING) { 418 NLENSING = Nlensing + input[0].average[N].Nlensing + 1000; 419 REALLOCATE (next_lensing, off_t, NLENSING); 420 REALLOCATE (output[0].lensing, Lensing, NLENSING); 421 } 422 if (Nlensobj + input[0].average[N].Nlensobj >= NLENSOBJ) { 423 NLENSOBJ = Nlensobj + input[0].average[N].Nlensobj + 1000; 424 REALLOCATE (next_lensobj, off_t, NLENSOBJ); 425 REALLOCATE (output[0].lensobj, Lensobj, NLENSOBJ); 426 } 427 if (Nstarpar + input[0].average[N].Nstarpar >= NSTARPAR) { 428 NSTARPAR = Nstarpar + input[0].average[N].Nstarpar + 1000; 429 REALLOCATE (next_starpar, off_t, NSTARPAR); 430 REALLOCATE (output[0].starpar, StarPar, NSTARPAR); 431 } 432 if (Ngalphot + input[0].average[N].Ngalphot >= NGALPHOT) { 433 NGALPHOT = Ngalphot + input[0].average[N].Ngalphot + 1000; 434 REALLOCATE (next_galphot, off_t, NGALPHOT); 435 REALLOCATE (output[0].galphot, GalPhot, NGALPHOT); 405 436 } 406 437 if (Nave >= NAVE) { … … 465 496 /** add measurements for this input average object **/ 466 497 if (output[0].measure && !SKIP_MEASURE && input[0].average[N].Nmeasure) { 467 output[0].average[Nave].measureOffset = Nmeas ;498 output[0].average[Nave].measureOffset = Nmeasure; 468 499 for (Nin = 0; Nin < input[0].average[N].Nmeasure; Nin ++) { 469 500 offset = input[0].average[N].measureOffset + Nin; 470 501 471 502 // supply the measurments from this detection 472 output[0].measure[Nmeas ] = input[0].measure[offset];503 output[0].measure[Nmeasure] = input[0].measure[offset]; 473 504 474 505 // the following measure elements cannot be set until here: 475 output[0].measure[Nmeas ].dbFlags = 0;476 output[0].measure[Nmeas ].averef = Nave;477 output[0].measure[Nmeas ].objID = output[0].average[Nave].objID;478 output[0].measure[Nmeas ].catID = output[0].catID;506 output[0].measure[Nmeasure].dbFlags = 0; 507 output[0].measure[Nmeasure].averef = Nave; 508 output[0].measure[Nmeasure].objID = output[0].average[Nave].objID; 509 output[0].measure[Nmeasure].catID = output[0].catID; 479 510 480 511 // as we add measurements, update Nmeasure to match 481 512 output[0].average[Nave].Nmeasure ++; 482 513 483 /* we set next[Nmeas ] to -1 here, and update correctly below */484 next_meas [Nmeas] = -1;485 Nmeas ++;514 /* we set next[Nmeasure] to -1 here, and update correctly below */ 515 next_measure[Nmeasure] = -1; 516 Nmeasure ++; 486 517 } 487 518 int Ngroup = input[0].average[N].Nmeasure; 488 519 for (j = 0; j < Ngroup - 1; j++) { 489 next_meas [Nmeas - Ngroup + j] = Nmeas- Ngroup + j + 1;520 next_measure[Nmeasure - Ngroup + j] = Nmeasure - Ngroup + j + 1; 490 521 } 491 522 } … … 493 524 /** add lensing for this input average object **/ 494 525 if (output[0].lensing && !SKIP_LENSING && input[0].average[N].Nlensing) { 495 output[0].average[Nave].lensingOffset = Nlens ;526 output[0].average[Nave].lensingOffset = Nlensing; 496 527 for (Nin = 0; Nin < input[0].average[N].Nlensing; Nin ++) { 497 528 // supply the lensing values from this detection 498 529 off_t lensoff = input[0].average[N].lensingOffset + Nin; 499 output[0].lensing[Nlens ] = input[0].lensing[lensoff];530 output[0].lensing[Nlensing] = input[0].lensing[lensoff]; 500 531 501 532 // the following lensing elements cannot be set until here: 502 output[0].lensing[Nlens ].averef = Nave;503 output[0].lensing[Nlens ].objID = output[0].average[Nave].objID;504 output[0].lensing[Nlens ].catID = output[0].catID;533 output[0].lensing[Nlensing].averef = Nave; 534 output[0].lensing[Nlensing].objID = output[0].average[Nave].objID; 535 output[0].lensing[Nlensing].catID = output[0].catID; 505 536 506 537 // as we add lensing, update Nlensing to match 507 538 output[0].average[Nave].Nlensing ++; 508 539 509 /* we set next[Nlens ] to -1 here, and update correctly below */510 next_lens [Nlens] = -1;511 Nlens ++;540 /* we set next[Nlensing] to -1 here, and update correctly below */ 541 next_lensing[Nlensing] = -1; 542 Nlensing ++; 512 543 } 513 544 int Ngroup = input[0].average[N].Nlensing; 514 545 for (j = 0; j < Ngroup - 1; j++) { 515 next_lens[Nlens - Ngroup + j] = Nlens - Ngroup + j + 1; 546 next_lensing[Nlensing - Ngroup + j] = Nlensing - Ngroup + j + 1; 547 } 548 } 549 550 /** add lensobj for this input average object **/ 551 if (output[0].lensobj && !SKIP_LENSOBJ && input[0].average[N].Nlensobj) { 552 output[0].average[Nave].lensobjOffset = Nlensobj; 553 for (Nin = 0; Nin < input[0].average[N].Nlensobj; Nin ++) { 554 // supply the lensobj values from this detection 555 off_t lensoff = input[0].average[N].lensobjOffset + Nin; 556 output[0].lensobj[Nlensobj] = input[0].lensobj[lensoff]; 557 558 // the following lensobj elements cannot be set until here: 559 // output[0].lensobj[Nlensobj].averef = Nave; 560 output[0].lensobj[Nlensobj].objID = output[0].average[Nave].objID; 561 output[0].lensobj[Nlensobj].catID = output[0].catID; 562 563 // as we add lensobj, update Nlensobj to match 564 output[0].average[Nave].Nlensobj ++; 565 566 /* we set next[Nlensobj] to -1 here, and update correctly below */ 567 next_lensobj[Nlensobj] = -1; 568 Nlensobj ++; 569 } 570 int Ngroup = input[0].average[N].Nlensobj; 571 for (j = 0; j < Ngroup - 1; j++) { 572 next_lensobj[Nlensobj - Ngroup + j] = Nlensobj - Ngroup + j + 1; 516 573 } 517 574 } … … 519 576 /** add starpar for this input average object **/ 520 577 if (output[0].starpar && !SKIP_STARPAR && input[0].average[N].Nstarpar) { 521 output[0].average[Nave].starparOffset = Nstar ;578 output[0].average[Nave].starparOffset = Nstarpar; 522 579 for (Nin = 0; Nin < input[0].average[N].Nstarpar; Nin ++) { 523 580 // supply the starpar values from this detection 524 581 off_t staroff = input[0].average[N].starparOffset + Nin; 525 output[0].starpar[Nstar ] = input[0].starpar[staroff];582 output[0].starpar[Nstarpar] = input[0].starpar[staroff]; 526 583 527 584 // the following starpar elements cannot be set until here: 528 output[0].starpar[Nstar ].averef = Nave;529 output[0].starpar[Nstar ].objID = output[0].average[Nave].objID;530 output[0].starpar[Nstar ].catID = output[0].catID;585 output[0].starpar[Nstarpar].averef = Nave; 586 output[0].starpar[Nstarpar].objID = output[0].average[Nave].objID; 587 output[0].starpar[Nstarpar].catID = output[0].catID; 531 588 532 589 // as we add starpar, update Nstarpar to match 533 590 output[0].average[Nave].Nstarpar ++; 534 591 535 /* we set next[Nstar ] to -1 here, and update correctly below */536 next_star [Nstar] = -1;537 Nstar ++;592 /* we set next[Nstarpar] to -1 here, and update correctly below */ 593 next_starpar[Nstarpar] = -1; 594 Nstarpar ++; 538 595 } 539 596 int Ngroup = input[0].average[N].Nstarpar; 540 597 for (j = 0; j < Ngroup - 1; j++) { 541 next_star [Nstar - Ngroup + j] = Nstar - Ngroup + j + 1;598 next_starpar[Nstarpar - Ngroup + j] = Nstarpar - Ngroup + j + 1; 542 599 } 543 600 } … … 545 602 /** add galphot for this input average object **/ 546 603 if (output[0].galphot && !SKIP_GALPHOT && input[0].average[N].Ngalphot) { 547 output[0].average[Nave].galphotOffset = Ngalp ;604 output[0].average[Nave].galphotOffset = Ngalphot; 548 605 for (Nin = 0; Nin < input[0].average[N].Ngalphot; Nin ++) { 549 606 // supply the galphot values from this detection 550 607 off_t galpoff = input[0].average[N].galphotOffset + Nin; 551 output[0].galphot[Ngalp ] = input[0].galphot[galpoff];608 output[0].galphot[Ngalphot] = input[0].galphot[galpoff]; 552 609 553 610 // the following galphot elements cannot be set until here: 554 output[0].galphot[Ngalp ].averef = Nave;555 output[0].galphot[Ngalp ].objID = output[0].average[Nave].objID;556 output[0].galphot[Ngalp ].catID = output[0].catID;611 output[0].galphot[Ngalphot].averef = Nave; 612 output[0].galphot[Ngalphot].objID = output[0].average[Nave].objID; 613 output[0].galphot[Ngalphot].catID = output[0].catID; 557 614 558 615 // as we add galphot, update Ngalphot to match 559 616 output[0].average[Nave].Ngalphot ++; 560 617 561 /* we set next[Ngalp ] to -1 here, and update correctly below */562 next_galp [Ngalp] = -1;563 Ngalp ++;618 /* we set next[Ngalphot] to -1 here, and update correctly below */ 619 next_galphot[Ngalphot] = -1; 620 Ngalphot ++; 564 621 } 565 622 int Ngroup = input[0].average[N].Ngalphot; 566 623 for (j = 0; j < Ngroup - 1; j++) { 567 next_galp [Ngalp - Ngroup + j] = Ngalp- Ngroup + j + 1;624 next_galphot[Ngalphot - Ngroup + j] = Ngalphot - Ngroup + j + 1; 568 625 } 569 626 } … … 575 632 576 633 REALLOCATE (output[0].average, Average, Nave); 577 if (!SKIP_MEASURE) { REALLOCATE (output[0].measure, Measure, Nmeas); } 578 if (!SKIP_LENSING) { REALLOCATE (output[0].lensing, Lensing, Nlens); } 579 if (!SKIP_STARPAR) { REALLOCATE (output[0].starpar, StarPar, Nstar); } 580 if (!SKIP_GALPHOT) { REALLOCATE (output[0].galphot, GalPhot, Ngalp); } 634 if (!SKIP_MEASURE) { REALLOCATE (output[0].measure, Measure, Nmeasure); } 635 if (!SKIP_LENSING) { REALLOCATE (output[0].lensing, Lensing, Nlensing); } 636 if (!SKIP_LENSOBJ) { REALLOCATE (output[0].lensobj, Lensobj, Nlensobj); } 637 if (!SKIP_STARPAR) { REALLOCATE (output[0].starpar, StarPar, Nstarpar); } 638 if (!SKIP_GALPHOT) { REALLOCATE (output[0].galphot, GalPhot, Ngalphot); } 581 639 582 640 # define NOSORT 0 … … 585 643 } else { 586 644 output[0].sorted = TRUE; 587 if (!SKIP_MEASURE) { output[0].measure = sort_measure (output[0].average, Nave, output[0].measure, Nmeas, next_meas); } 588 if (!SKIP_LENSING) { output[0].lensing = sort_lensing (output[0].average, Nave, output[0].lensing, Nlens, next_lens); } 589 if (!SKIP_STARPAR) { output[0].starpar = sort_starpar (output[0].average, Nave, output[0].starpar, Nstar, next_star); } 590 if (!SKIP_GALPHOT) { output[0].galphot = sort_galphot (output[0].average, Nave, output[0].galphot, Ngalp, next_galp); } 645 if (!SKIP_MEASURE) { output[0].measure = sort_measure (output[0].average, Nave, output[0].measure, Nmeasure, next_measure); } 646 if (!SKIP_LENSING) { output[0].lensing = sort_lensing (output[0].average, Nave, output[0].lensing, Nlensing, next_lensing); } 647 if (!SKIP_LENSOBJ) { output[0].lensobj = sort_lensobj (output[0].average, Nave, output[0].lensobj, Nlensobj, next_lensobj); } 648 if (!SKIP_STARPAR) { output[0].starpar = sort_starpar (output[0].average, Nave, output[0].starpar, Nstarpar, next_starpar); } 649 if (!SKIP_GALPHOT) { output[0].galphot = sort_galphot (output[0].average, Nave, output[0].galphot, Ngalphot, next_galphot); } 591 650 } 592 651 … … 594 653 output[0].objID = objID; // new max value, save on catalog close 595 654 output[0].Naverage = Nave; 596 if (!SKIP_MEASURE) { output[0].Nmeasure = Nmeas; } 597 if (!SKIP_LENSING) { output[0].Nlensing = Nlens; } 598 if (!SKIP_STARPAR) { output[0].Nstarpar = Nstar; } 599 if (!SKIP_GALPHOT) { output[0].Ngalphot = Ngalp; } 655 if (!SKIP_MEASURE) { output[0].Nmeasure = Nmeasure; } 656 if (!SKIP_LENSING) { output[0].Nlensing = Nlensing; } 657 if (!SKIP_LENSOBJ) { output[0].Nlensobj = Nlensobj; } 658 if (!SKIP_STARPAR) { output[0].Nstarpar = Nstarpar; } 659 if (!SKIP_GALPHOT) { output[0].Ngalphot = Ngalphot; } 600 660 output[0].Nsecfilt_mem = Nave*NsecfiltOut; 601 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nlens, Ngalp: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas, Nlens, Ngalp, Nmatch); 602 603 free (next_meas); 604 free (next_lens); 605 free (next_star); 606 free (next_galp); 661 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeasure, Nlensing, Ngalphot: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeasure, Nlensing, Ngalphot, Nmatch); 662 663 free (next_measure); 664 free (next_lensing); 665 free (next_lensobj); 666 free (next_starpar); 667 free (next_galphot); 607 668 608 669 free (X2); … … 625 686 images have boundaries which are lines in pixels coords, but curve in RA and DEC 626 687 627 output[0].found_t[Ncat] but stars[Nstar ].found688 output[0].found_t[Ncat] but stars[Nstars].found 628 689 629 690 */ -
trunk/Ohana/src/fakeastro/Makefile
r39242 r39926 53 53 $(SRC)/match_fake_stars.$(ARCH).o \ 54 54 $(SRC)/fakeastro_2mass.$(ARCH).o \ 55 $(SRC)/fakeastro_gaia.$(ARCH).o \ 55 56 $(SRC)/make_2mass_measures.$(ARCH).o \ 57 $(SRC)/make_gaia_measures.$(ARCH).o \ 56 58 $(SRC)/remote_hosts.$(ARCH).o 57 59 -
trunk/Ohana/src/fakeastro/include/fakeastro.h
r38986 r39926 8 8 # define RESETTIME { gettimeofday (&startTimer, (void *) NULL); } 9 9 10 typedef enum {OP_NONE, OP_GALAXY, OP_IMAGES, OP_2MASS } FakeastroOp;10 typedef enum {OP_NONE, OP_GALAXY, OP_IMAGES, OP_2MASS, OP_GAIA} FakeastroOp; 11 11 12 12 typedef struct { … … 87 87 int VERBOSE; 88 88 int VERBOSE2; 89 int TESTING;90 89 int ONE_BIG_CHIP; 90 91 float TEST_SCALE; 92 char *GALAXY_MODEL; 91 93 92 94 int FORCE; … … 101 103 char FAKEASTRO_REF_EPOCH[80]; 102 104 char FAKEASTRO_2MASS_EPOCH[80]; 105 char FAKEASTRO_GAIA_EPOCH[80]; 103 106 104 107 float RADIUS; 105 108 float MAX_MAG_2MASS; 109 float MAX_MAG_GAIA; 106 110 107 111 SkyRegion UserPatch; … … 198 202 int fakeastro_2mass (); 199 203 int make_2mass_measures (Catalog *catalog); 204 205 int fakeastro_gaia (); 206 int make_gaia_measures (Catalog *catalog); -
trunk/Ohana/src/fakeastro/src/ConfigInit.c
r37807 r39926 19 19 // if (!ScanConfig (config, "ADDSTAR_RADIUS", "%lf", 0, &ADDSTAR_RADIUS)) ADDSTAR_RADIUS = 1.0; 20 20 21 if ((FAKEASTRO_OP == OP_GALAXY) || (FAKEASTRO_OP == OP_2MASS) ) {21 if ((FAKEASTRO_OP == OP_GALAXY) || (FAKEASTRO_OP == OP_2MASS) || (FAKEASTRO_OP == OP_GAIA)) { 22 22 // force CATDIR to be absolute (so parallel mode will work) 23 23 GetConfig (config, "CATDIR", "%s", 0, CATDIR); … … 60 60 strcpy (FAKEASTRO_2MASS_EPOCH, "2000/01/01,00:00:00"); // epoch of 2MASS astrometry 61 61 } 62 if (!ScanConfig (config, "FAKEASTRO_GAIA_EPOCH", "%s", 0, FAKEASTRO_GAIA_EPOCH)) { 63 strcpy (FAKEASTRO_GAIA_EPOCH, "2015/01/01,00:00:00"); // epoch of GAIA astrometry 64 } 62 65 63 66 /* set the default search radius */ … … 76 79 77 80 // OP_2MASS is adding detections to an existing db, the others require and empty db 78 if ( FAKEASTRO_OP != OP_2MASS) {81 if ((FAKEASTRO_OP != OP_2MASS) && (FAKEASTRO_OP != OP_GAIA)) { 79 82 // check for existence of CATDIR 80 83 struct stat filestat; -
trunk/Ohana/src/fakeastro/src/args.c
r38986 r39926 26 26 } 27 27 28 TESTING = FALSE; 28 if ((N = get_argument (*argc, argv, "-gaia"))) { 29 remove_argument (N, argc, argv); 30 FAKEASTRO_OP = OP_GAIA; 31 } 32 33 GALAXY_MODEL = NULL; 34 if ((N = get_argument (*argc, argv, "-galaxy-model"))) { 35 remove_argument (N, argc, argv); 36 GALAXY_MODEL = strcreate(argv[N]); 37 remove_argument (N, argc, argv); 38 } 39 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("ROESER"); 40 41 TEST_SCALE = 1.0; 29 42 if ((N = get_argument (*argc, argv, "-testing"))) { 30 43 remove_argument (N, argc, argv); 31 TESTING = TRUE; 44 TEST_SCALE = atof(argv[N]); 45 remove_argument (N, argc, argv); 32 46 } 33 47 ONE_BIG_CHIP = FALSE; … … 114 128 } 115 129 130 MAX_MAG_GAIA = 21.0; 131 if ((N = get_argument (*argc, argv, "-gaia-limit"))) { 132 remove_argument (N, argc, argv); 133 MAX_MAG_GAIA = atof(argv[N]); 134 remove_argument (N, argc, argv); 135 } 136 116 137 FORCE = FALSE; 117 138 if ((N = get_argument (*argc, argv, "-force"))) { … … 250 271 // } 251 272 273 GALAXY_MODEL = NULL; 274 if ((N = get_argument (*argc, argv, "-galaxy-model"))) { 275 remove_argument (N, argc, argv); 276 GALAXY_MODEL = strcreate(argv[N]); 277 remove_argument (N, argc, argv); 278 } 279 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("FEAST-HIPPARCOS"); 280 252 281 VERBOSE = VERBOSE2 = FALSE; 253 282 if ((N = get_argument (*argc, argv, "-v"))) { … … 273 302 fprintf (stderr, " additional options: \n"); 274 303 fprintf (stderr, " -region RA RA DEC DEC\n"); 275 fprintf (stderr, " -catalog (ra) (dec)\n\n"); 304 fprintf (stderr, " -catalog (ra) (dec)\n"); 305 fprintf (stderr, " -testing (scale)\n\n"); 276 306 fprintf (stderr, " -v\n"); 277 307 fprintf (stderr, " -vv\n"); -
trunk/Ohana/src/fakeastro/src/fakeastro.c
r39248 r39926 41 41 exit (0); 42 42 43 case OP_GAIA: 44 fakeastro_gaia (); 45 /* make_gaia_measures() 46 */ 47 exit (0); 48 43 49 default: 44 50 fprintf (stderr, "impossible!\n"); -
trunk/Ohana/src/fakeastro/src/initialize.c
r37807 r39926 17 17 18 18 // XXX add to config? 19 if (!InitGalaxyModel ( "ROESER")) {20 fprintf (stderr, "failed to init galaxy model \n");19 if (!InitGalaxyModel (GALAXY_MODEL)) { 20 fprintf (stderr, "failed to init galaxy model %s\n", GALAXY_MODEL); 21 21 exit (2); 22 22 } … … 30 30 31 31 // XXX add to config? 32 if (!InitGalaxyModel ( "ROESER")) {33 fprintf (stderr, "failed to init galaxy model \n");32 if (!InitGalaxyModel (GALAXY_MODEL)) { 33 fprintf (stderr, "failed to init galaxy model %s\n", GALAXY_MODEL); 34 34 exit (2); 35 35 } -
trunk/Ohana/src/fakeastro/src/make_fake_stars_catalog.c
r39248 r39926 116 116 double dDsee = ohana_gaussdev_rnd (0.0, 1.0 / SN); 117 117 118 // XXX TEST 119 // dDsee = dRsee = 0.0; 120 118 121 double dRoff = (dRpm + dRsee) / 3600.0; 119 122 double dDoff = (dDpm + dDsee) / 3600.0; -
trunk/Ohana/src/fakeastro/src/make_fakestars.c
r39589 r39926 35 35 // we can generate a distribution which is uniform on the sky, in which case 36 36 // we can limit to the selected patch analyically 37 38 // note: r & z are generated in parsec 37 39 r = pow(drand48(), 0.33333) * FAKEASTRO_RGAL; 38 40 z = 0.0; … … 48 50 int inPatch = FALSE; 49 51 while (!inPatch) { 52 // note: r & z are generated in parsec 50 53 z = ohana_gaussdev_rnd (0.0, FAKEASTRO_ZGAL); 51 54 r = sqrt(drand48()) * FAKEASTRO_RGAL; … … 68 71 // double y = r*sin(L); 69 72 73 // distance here is in parsec 70 74 double distance = sqrt (SQ(r) + SQ(z)); 71 75 … … 74 78 75 79 double uL_sol, uB_sol; 76 SolarMotionModel_radians(&uL_sol, &uB_sol, Lrad, Brad, distance); 80 SolarMotionModel_radians(&uL_sol, &uB_sol, Lrad, Brad, distance / 1000.0); 81 // note: SolarMotionModel wants distance in kpc 77 82 78 83 double uL = uL_gal + uL_sol; … … 80 85 81 86 // XXX: amplify motion to make tests easier: 82 if (TESTING) { 83 uL *= 100.0; 84 uB *= 100.0; 85 } 87 uL *= TEST_SCALE; 88 uB *= TEST_SCALE; 86 89 87 90 double uR, uD; -
trunk/Ohana/src/kapa2/include/prototypes.h
r39457 r39926 32 32 void DrawLabelsRaw PROTO((Graphic *graphic, KapaGraphWidget *graph, int color)); 33 33 void DrawTextlines PROTO((KapaGraphWidget *graph)); 34 void DrawConnect PROTO(( KapaGraphWidget *graph, Gobjects *objects));35 void DrawHistogram PROTO(( KapaGraphWidget *graph, Gobjects *objects));36 int DrawObjectN PROTO(( KapaGraphWidget *graph, Gobjects *objects));37 void DrawPoints PROTO(( KapaGraphWidget *graph, Gobjects *objects));38 void ClipLine PROTO(( double x0, double y0, double x1, double y1, double X0, double Y0, double X1, double Y1));39 void DrawXErrors PROTO(( KapaGraphWidget *graph, Gobjects *objects));40 void DrawYErrors PROTO(( KapaGraphWidget *graph, Gobjects *objects));34 void DrawConnect PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 35 void DrawHistogram PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 36 int DrawObjectN PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 37 void DrawPoints PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 38 void ClipLine PROTO((Graphic *graphic, double x0, double y0, double x1, double y1, double X0, double Y0, double X1, double Y1)); 39 void DrawXErrors PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 40 void DrawYErrors PROTO((Graphic *graphic, KapaGraphWidget *graph, Gobjects *objects)); 41 41 void DrawTick PROTO((Graphic *graphic, Axis *axis, int P, TickMarkData *tick, int naxis)); 42 42 void AxisTickScale PROTO((Axis *axis, double *range, double *major, double *minor, int *nsignif)); … … 115 115 void PSLabels PROTO((KapaGraphWidget *graph, FILE *f)); 116 116 void PSTextlines PROTO((KapaGraphWidget *graph, FILE *f)); 117 int PSObjectsN PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f)); 117 118 void PSConnect PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f)); 118 119 void PSHistogram PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f)); … … 135 136 void bDrawLabels PROTO((bDrawBuffer *buffer, KapaGraphWidget *graph)); 136 137 void bDrawTextlines PROTO((bDrawBuffer *buffer, KapaGraphWidget *graph)); 138 int bDrawObjectsN PROTO((bDrawBuffer *buffer, KapaGraphWidget *graph, Gobjects *object)); 137 139 void bDrawConnect PROTO((bDrawBuffer *buffer, KapaGraphWidget *graph, Gobjects *object)); 138 140 void bDrawHistogram PROTO((bDrawBuffer *buffer, KapaGraphWidget *graph, Gobjects *object)); -
trunk/Ohana/src/kapa2/src/DrawFrame.c
r39594 r39926 12 12 13 13 graphic = GetGraphic(); 14 15 P = 0.5 * (1 + 0.25*graph[0].axis[0].lweight) * (hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy) + hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy)); 14 16 15 17 /* each axis is drawn independently, but ticks and labels are placed according to perpendicular distance. */ … … 30 32 dfy = graph[0].axis[i].dfy + 2*dy; 31 33 32 P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy);33 P *= (1 + 0.25*lweight);34 // P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy); 35 // P *= (1 + 0.25*lweight); 34 36 35 37 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CapNotLast, JoinMiter); -
trunk/Ohana/src/kapa2/src/DrawObjects.c
r39594 r39926 8 8 # define FillCircle(X,Y,R) (XFillArc (graphic->display, graphic->window, graphic->gc, (int)(X-R), (int)(Y-R), abs(2*R+1), abs(2*R+1), 0, 23040)) 9 9 10 # define CONNECT 011 # define HISTOGRAM 112 # define POINTS 213 14 10 # define XCENTER 0.0 15 11 # define YCENTER 0.0 … … 17 13 # define JOINSTYLE JoinMiter 18 14 19 static Graphic *graphic; 15 // XXX this is not thread safe, but that is OK 16 // static Graphic *graphic; 20 17 21 18 /* draw all objects for this Graph */ … … 24 21 int i; 25 22 23 // the functions below use this global value 24 Graphic *graphic = GetGraphic(); 25 26 // this function calls all of the supporting Draw... functions below 26 27 for (i = 0; i < graph[0].Nobjects; i++) { 27 28 if (DEBUG) fprintf (stderr, "object: %d\n", i); 28 29 if (DEBUG) fprintf (stderr, "Npts: %d\n", graph[0].objects[i].Npts); 29 DrawObjectN (graph , &graph[0].objects[i]);30 DrawObjectN (graphic, graph, &graph[0].objects[i]); 30 31 } 32 XSetLineAttributes (graphic->display, graphic->gc, 0, LineSolid, CAPSTYLE, JOINSTYLE); 33 XSetForeground (graphic->display, graphic->gc, graphic->fore); 31 34 return (TRUE); 32 35 } 33 36 34 37 /* Draw a specific object in the graph */ 35 int DrawObjectN ( KapaGraphWidget *graph, Gobjects *object) {38 int DrawObjectN (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 36 39 37 40 static char dot[2] = {2,3}; … … 41 44 int lweight; 42 45 43 // this function calls all of the supporting Draw... functions below44 graphic = GetGraphic();45 46 46 lweight = MAX (1, MIN (10, object[0].lweight)); 47 47 … … 58 58 /* set line type */ 59 59 switch (object[0].ltype) { 60 case 0: 61 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CAPSTYLE, JOINSTYLE); 62 break; 63 case 1: 60 case KAPA_LINE_DOT: 64 61 XSetDashes (graphic->display, graphic->gc, 1, dot, 2); 65 XSetLineAttributes (graphic->display, graphic->gc, lweight, Line OnOffDash, CAPSTYLE, JOINSTYLE);66 break; 67 case 2:62 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineDoubleDash, CAPSTYLE, JOINSTYLE); 63 break; 64 case KAPA_LINE_DASH_SHORT: 68 65 XSetDashes (graphic->display, graphic->gc, 1, short_dash, 2); 69 XSetLineAttributes (graphic->display, graphic->gc, lweight, Line OnOffDash, CAPSTYLE, JOINSTYLE);70 break; 71 case 3:66 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineDoubleDash, CAPSTYLE, JOINSTYLE); 67 break; 68 case KAPA_LINE_DASH_LONG: 72 69 XSetDashes (graphic->display, graphic->gc, 1, long_dash, 2); 73 XSetLineAttributes (graphic->display, graphic->gc, lweight, Line OnOffDash, CAPSTYLE, JOINSTYLE);74 break; 75 case 4:70 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineDoubleDash, CAPSTYLE, JOINSTYLE); 71 break; 72 case KAPA_LINE_DOT_DASH: 76 73 XSetDashes (graphic->display, graphic->gc, 1, dot_dash, 4); 77 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineOnOffDash, CAPSTYLE, JOINSTYLE); 78 break; 74 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineDoubleDash, CAPSTYLE, JOINSTYLE); 75 break; 76 case KAPA_LINE_SOLID: 79 77 default: 80 78 XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CAPSTYLE, JOINSTYLE); … … 88 86 89 87 switch (object[0].style) { 90 case CONNECT: 91 DrawConnect (graph, object); 92 break; 93 case HISTOGRAM: 94 DrawHistogram (graph, object); 95 break; 96 case POINTS: 97 DrawPoints (graph, object); 88 case KAPA_PLOT_CONNECT: 89 DrawConnect (graphic, graph, object); 90 break; 91 case KAPA_PLOT_HISTOGRAM: 92 DrawHistogram (graphic, graph, object); 93 break; 94 case KAPA_PLOT_POINTS: 95 default: 96 DrawPoints (graphic, graph, object); 98 97 break; 99 98 } 100 99 101 100 if (object[0].etype & 0x01) { 102 DrawYErrors (graph , object);101 DrawYErrors (graphic, graph, object); 103 102 } 104 103 if (object[0].etype & 0x02) { 105 DrawXErrors (graph, object); 106 } 107 108 XSetLineAttributes (graphic->display, graphic->gc, 0, LineSolid, CAPSTYLE, JOINSTYLE); 109 XSetForeground (graphic->display, graphic->gc, graphic->fore); 104 DrawXErrors (graphic, graph, object); 105 } 110 106 return (TRUE); 111 107 } 112 108 113 109 /******/ 114 void DrawConnect ( KapaGraphWidget *graph, Gobjects *object) {110 void DrawConnect (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 115 111 116 112 int i; … … 149 145 sy1 = x[i]*myi + y[i]*myj + by + YCENTER; 150 146 151 ClipLine ( sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);147 ClipLine (graphic, sx0, sy0, sx1, sy1, X0, Y0, X1, Y1); 152 148 /* DrawLine (sx0, sy0, sx1, sy1); */ 153 149 sx0 = sx1; sy0 = sy1; … … 156 152 } 157 153 158 void ClipLine ( double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0) {154 void ClipLine (Graphic *graphic, double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0) { 159 155 160 156 /* skip line segement if both points are beyond box */ … … 212 208 /* simplify the code abit by finding triplets, watch out for a histogram of 2 points */ 213 209 # if (1) 214 void DrawHistogram ( KapaGraphWidget *graph, Gobjects *object) {210 void DrawHistogram (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 215 211 216 212 int i; … … 298 294 # else 299 295 300 void DrawHistogram ( KapaGraphWidget *graph, Gobjects *object) {296 void DrawHistogram (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 301 297 302 298 int i; … … 407 403 408 404 /******/ 409 void DrawPoints ( KapaGraphWidget *graph, Gobjects *object) {405 void DrawPoints (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 410 406 411 407 int i; … … 427 423 by = byi + byj; 428 424 429 Graphic *graphic = GetGraphic(); 430 431 /**** points are scaled by object.z ***/ 425 /**** point sizes are scaled by object.size, colors by object.color ***/ 432 426 int scaleSize = (object[0].size < 0); 433 427 int scaleColor = (object[0].color < 0); … … 437 431 x = object[0].x; y = object[0].y; z = object[0].z; 438 432 439 if (object[0].ptype == 0) { /* filled box */ 440 for (i = 0; i < object[0].Npts; i++) { 441 if (!(finite(x[i]) && finite(y[i]))) continue; 442 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 443 sy = x[i]*myi + y[i]*myj + by + YCENTER; 444 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 445 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 446 if (scaleColor) { 447 if (!finite(z[i])) continue; 448 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 449 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 450 } 451 D = scaleSize ? dz*z[i] : ds; 452 FillRectangle (sx - D, sy - D, 2*D + 1, 2*D + 1); 453 } 433 switch (object[0].ptype) { 434 case KAPA_POINT_BOX_OPEN: /* open box */ 435 for (i = 0; i < object[0].Npts; i++) { 436 if (!(finite(x[i]) && finite(y[i]))) continue; 437 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 438 sy = x[i]*myi + y[i]*myj + by + YCENTER; 439 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 440 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 441 if (scaleColor) { 442 if (!finite(z[i])) continue; 443 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 444 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 445 } 446 D = scaleSize ? dz*z[i] : ds; 447 DrawRectangle (sx - D, sy - D, 2*D, 2*D); 448 } 449 } 450 break; 451 case KAPA_POINT_CROSS: /* cross */ 452 for (i = 0; i < object[0].Npts; i++) { 453 if (!(finite(x[i]) && finite(y[i]))) continue; 454 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 455 sy = x[i]*myi + y[i]*myj + by + YCENTER; 456 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 457 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 458 if (scaleColor) { 459 if (!finite(z[i])) continue; 460 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 461 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 462 } 463 D = scaleSize ? dz*z[i] : ds; 464 DrawLine (sx - D, sy, sx + D + 1, sy); 465 DrawLine (sx, sy - D, sx, sy + D + 1); 466 } 467 } 468 break; 469 case KAPA_POINT_X: /* x */ 470 for (i = 0; i < object[0].Npts; i++) { 471 if (!(finite(x[i]) && finite(y[i]))) continue; 472 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 473 sy = x[i]*myi + y[i]*myj + by + YCENTER; 474 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 475 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 476 if (scaleColor) { 477 if (!finite(z[i])) continue; 478 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 479 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 480 } 481 D = scaleSize ? dz*z[i] : ds; 482 DrawLine (sx - D, sy + D, sx + D + 1, sy - D - 1); 483 DrawLine (sx - D, sy - D, sx + D + 1, sy + D + 1); 484 } 485 } 486 break; 487 case KAPA_POINT_TRIANGLE_SOLID: /* filled triangle */ 488 for (i = 0; i < object[0].Npts; i++) { 489 if (!(finite(x[i]) && finite(y[i]))) continue; 490 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 491 sy = x[i]*myi + y[i]*myj + by + YCENTER; 492 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 493 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 494 if (scaleColor) { 495 if (!finite(z[i])) continue; 496 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 497 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 498 } 499 D = scaleSize ? dz*z[i] : ds; 500 501 XPoint points[4]; 502 points[0].x = sx - D; points[0].y = sy + 0.58*D; 503 points[1].x = sx + D; points[1].y = sy + 0.58*D; 504 points[2].x = sx; points[2].y = sy - 1.15*D; 505 points[3].x = sx - D; points[3].y = sy + 0.58*D; 506 XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin); 507 } 508 } 509 break; 510 case KAPA_POINT_TRIANGLE_SOLID_DOWN: /* filled triangle (down) */ 511 for (i = 0; i < object[0].Npts; i++) { 512 if (!(finite(x[i]) && finite(y[i]))) continue; 513 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 514 sy = x[i]*myi + y[i]*myj + by + YCENTER; 515 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 516 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 517 if (scaleColor) { 518 if (!finite(z[i])) continue; 519 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 520 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 521 } 522 D = scaleSize ? dz*z[i] : ds; 523 524 XPoint points[4]; 525 points[0].x = sx - D; points[0].y = sy - 0.58*D; 526 points[1].x = sx + D; points[1].y = sy - 0.58*D; 527 points[2].x = sx; points[2].y = sy + 1.15*D; 528 points[3].x = sx - D; points[3].y = sy - 0.58*D; 529 XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin); 530 } 531 } 532 break; 533 case KAPA_POINT_TRIANGLE_OPEN: /* open triangle */ 534 for (i = 0; i < object[0].Npts; i++) { 535 if (!(finite(x[i]) && finite(y[i]))) continue; 536 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 537 sy = x[i]*myi + y[i]*myj + by + YCENTER; 538 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 539 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 540 if (scaleColor) { 541 if (!finite(z[i])) continue; 542 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 543 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 544 } 545 D = scaleSize ? dz*z[i] : ds; 546 DrawLine (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D); 547 DrawLine (sx + D, sy + 0.58*D, sx, sy - 1.15*D); 548 DrawLine (sx, sy - 1.15*D, sx - D, sy + 0.58*D); 549 } 550 } 551 break; 552 case KAPA_POINT_TRIANGLE_OPEN_DOWN: /* upside-down open triangle */ 553 for (i = 0; i < object[0].Npts; i++) { 554 if (!(finite(x[i]) && finite(y[i]))) continue; 555 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 556 sy = x[i]*myi + y[i]*myj + by + YCENTER; 557 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 558 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 559 if (scaleColor) { 560 if (!finite(z[i])) continue; 561 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 562 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 563 } 564 D = scaleSize ? dz*z[i] : ds; 565 DrawLine (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D); 566 DrawLine (sx + D, sy - 0.58*D, sx, sy + 1.15*D); 567 DrawLine (sx, sy + 1.15*D, sx - D, sy - 0.58*D); 568 } 569 } 570 break; 571 case KAPA_POINT_Y: /* Y */ 572 for (i = 0; i < object[0].Npts; i++) { 573 if (!(finite(x[i]) && finite(y[i]))) continue; 574 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 575 sy = x[i]*myi + y[i]*myj + by + YCENTER; 576 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 577 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 578 if (scaleColor) { 579 if (!finite(z[i])) continue; 580 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 581 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 582 } 583 D = scaleSize ? dz*z[i] : ds; 584 DrawLine (sx, sy, sx - D, sy - 0.58*D); 585 DrawLine (sx, sy, sx + D, sy - 0.58*D); 586 DrawLine (sx, sy, sx, sy + 1.15*D); 587 } 588 } 589 break; 590 case KAPA_POINT_Y_DOWN: /* upside-down Y */ 591 for (i = 0; i < object[0].Npts; i++) { 592 if (!(finite(x[i]) && finite(y[i]))) continue; 593 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 594 sy = x[i]*myi + y[i]*myj + by + YCENTER; 595 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 596 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 597 if (scaleColor) { 598 if (!finite(z[i])) continue; 599 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 600 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 601 } 602 D = scaleSize ? dz*z[i] : ds; 603 DrawLine (sx, sy, sx - D, sy + 0.58*D); 604 DrawLine (sx, sy, sx + D, sy + 0.58*D); 605 DrawLine (sx, sy, sx, sy - 1.15*D); 606 } 607 } 608 break; 609 case KAPA_POINT_CIRCLE_OPEN: /* 0 */ 610 for (i = 0; i < object[0].Npts; i++) { 611 if (!(finite(x[i]) && finite(y[i]))) continue; 612 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 613 sy = x[i]*myi + y[i]*myj + by + YCENTER; 614 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 615 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 616 if (scaleColor) { 617 if (!finite(z[i])) continue; 618 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 619 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 620 } 621 D = scaleSize ? dz*z[i] : ds; 622 DrawCircle (sx, sy, D); 623 } 624 } 625 break; 626 case KAPA_POINT_CIRCLE_SOLID: /* filled 0 */ 627 for (i = 0; i < object[0].Npts; i++) { 628 if (!(finite(x[i]) && finite(y[i]))) continue; 629 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 630 sy = x[i]*myi + y[i]*myj + by + YCENTER; 631 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 632 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 633 if (scaleColor) { 634 if (!finite(z[i])) continue; 635 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 636 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 637 } 638 D = scaleSize ? dz*z[i] : ds; 639 FillCircle (sx, sy, D); 640 DrawCircle (sx, sy, D); 641 } 642 } 643 break; 644 case KAPA_POINT_PENTAGON: /* pentagon */ 645 for (i = 0; i < object[0].Npts; i++) { 646 if (!(finite(x[i]) && finite(y[i]))) continue; 647 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 648 sy = x[i]*myi + y[i]*myj + by + YCENTER; 649 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 650 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 651 if (scaleColor) { 652 if (!finite(z[i])) continue; 653 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 654 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 655 } 656 D = scaleSize ? dz*z[i] : ds; 657 DrawLine (sx + 0.00*D, sy - 1.00*D, sx + 0.95*D, sy - 0.31*D); 658 DrawLine (sx + 0.95*D, sy - 0.31*D, sx + 0.58*D, sy + 0.81*D); 659 DrawLine (sx + 0.58*D, sy + 0.81*D, sx - 0.58*D, sy + 0.81*D); 660 DrawLine (sx - 0.58*D, sy + 0.81*D, sx - 0.95*D, sy - 0.31*D); 661 DrawLine (sx - 0.95*D, sy - 0.31*D, sx + 0.00*D, sy - 1.00*D); 662 } 663 } 664 break; 665 case KAPA_POINT_HEXAGON: /* hexagon */ 666 for (i = 0; i < object[0].Npts; i++) { 667 if (!(finite(x[i]) && finite(y[i]))) continue; 668 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 669 sy = x[i]*myi + y[i]*myj + by + YCENTER; 670 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 671 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 672 if (scaleColor) { 673 if (!finite(z[i])) continue; 674 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 675 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 676 } 677 D = scaleSize ? dz*z[i] : ds; 678 DrawLine (sx - D, sy, sx - 0.50*D, sy + 0.87*D); 679 DrawLine (sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 680 DrawLine (sx + 0.50*D, sy + 0.87*D, sx + D, sy); 681 682 DrawLine (sx + D, sy, sx + 0.50*D, sy - 0.87*D); 683 DrawLine (sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 684 DrawLine (sx - 0.50*D, sy - 0.87*D, sx - D, sy); 685 } 686 } 687 break; 688 case KAPA_POINT_PAIR_CONNECT: { /* connect pairs of points */ 689 double X0 = graph[0].axis[0].fx; 690 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 691 double Y0 = graph[0].axis[1].fy; 692 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 693 694 for (i = 0; i + 1 < object[0].Npts; i+=2) { 695 if (!(finite(x[i]) && finite(y[i]))) continue; 696 sx1 = x[i]*mxi + y[i]*mxj + bx + XCENTER; 697 sy1 = x[i]*myi + y[i]*myj + by + YCENTER; 698 if (!(finite(x[i+1]) && finite(y[i+1]))) continue; 699 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx + XCENTER; 700 sy2 = x[i+1]*myi + y[i+1]*myj + by + YCENTER; 701 ClipLine (graphic, sx1, sy1, sx2, sy2, X0, Y0, X1, Y1); 702 } 703 break; 454 704 } 455 } 456 if (object[0].ptype == 1) { /* open box */ 457 for (i = 0; i < object[0].Npts; i++) { 458 if (!(finite(x[i]) && finite(y[i]))) continue; 459 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 460 sy = x[i]*myi + y[i]*myj + by + YCENTER; 461 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 462 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 463 if (scaleColor) { 464 if (!finite(z[i])) continue; 465 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 466 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 467 } 468 D = scaleSize ? dz*z[i] : ds; 469 DrawRectangle (sx - D, sy - D, 2*D, 2*D); 470 } 471 } 472 } 473 if (object[0].ptype == 2) { /* cross */ 474 for (i = 0; i < object[0].Npts; i++) { 475 if (!(finite(x[i]) && finite(y[i]))) continue; 476 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 477 sy = x[i]*myi + y[i]*myj + by + YCENTER; 478 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 479 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 480 if (scaleColor) { 481 if (!finite(z[i])) continue; 482 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 483 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 484 } 485 D = scaleSize ? dz*z[i] : ds; 486 DrawLine (sx - D, sy, sx + D + 1, sy); 487 DrawLine (sx, sy - D, sx, sy + D + 1); 488 } 489 } 490 } 491 if (object[0].ptype == 3) { /* x */ 492 for (i = 0; i < object[0].Npts; i++) { 493 if (!(finite(x[i]) && finite(y[i]))) continue; 494 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 495 sy = x[i]*myi + y[i]*myj + by + YCENTER; 496 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 497 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 498 if (scaleColor) { 499 if (!finite(z[i])) continue; 500 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 501 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 502 } 503 D = scaleSize ? dz*z[i] : ds; 504 DrawLine (sx - D, sy + D, sx + D + 1, sy - D - 1); 505 DrawLine (sx - D, sy - D, sx + D + 1, sy + D + 1); 506 } 507 } 508 } 509 if (object[0].ptype == 4) { /* filled triangle */ 510 XPoint points[4]; 511 for (i = 0; i < object[0].Npts; i++) { 512 if (!(finite(x[i]) && finite(y[i]))) continue; 513 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 514 sy = x[i]*myi + y[i]*myj + by + YCENTER; 515 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 516 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 517 if (scaleColor) { 518 if (!finite(z[i])) continue; 519 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 520 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 521 } 522 D = scaleSize ? dz*z[i] : ds; 523 points[0].x = sx - D; points[0].y = sy + 0.58*D; 524 points[1].x = sx + D; points[1].y = sy + 0.58*D; 525 points[2].x = sx; points[2].y = sy - 1.15*D; 526 points[3].x = sx - D; points[3].y = sy + 0.58*D; 527 XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin); 528 } 529 } 530 } 531 if (object[0].ptype == 5) { /* open triangle */ 532 for (i = 0; i < object[0].Npts; i++) { 533 if (!(finite(x[i]) && finite(y[i]))) continue; 534 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 535 sy = x[i]*myi + y[i]*myj + by + YCENTER; 536 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 537 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 538 if (scaleColor) { 539 if (!finite(z[i])) continue; 540 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 541 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 542 } 543 D = scaleSize ? dz*z[i] : ds; 544 DrawLine (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D); 545 DrawLine (sx + D, sy + 0.58*D, sx, sy - 1.15*D); 546 DrawLine (sx, sy - 1.15*D, sx - D, sy + 0.58*D); 547 } 548 } 549 } 550 if (object[0].ptype == 6) { /* Y */ 551 for (i = 0; i < object[0].Npts; i++) { 552 if (!(finite(x[i]) && finite(y[i]))) continue; 553 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 554 sy = x[i]*myi + y[i]*myj + by + YCENTER; 555 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 556 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 557 if (scaleColor) { 558 if (!finite(z[i])) continue; 559 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 560 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 561 } 562 D = scaleSize ? dz*z[i] : ds; 563 DrawLine (sx, sy, sx - D, sy - 0.58*D); 564 DrawLine (sx, sy, sx + D, sy - 0.58*D); 565 DrawLine (sx, sy, sx, sy + 1.15*D); 566 } 567 } 568 } 569 if (object[0].ptype == 7) { /* 0 */ 570 for (i = 0; i < object[0].Npts; i++) { 571 if (!(finite(x[i]) && finite(y[i]))) continue; 572 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 573 sy = x[i]*myi + y[i]*myj + by + YCENTER; 574 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 575 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 576 if (scaleColor) { 577 if (!finite(z[i])) continue; 578 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 579 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 580 } 581 D = scaleSize ? dz*z[i] : ds; 582 DrawCircle (sx, sy, D); 583 } 584 } 585 } 586 if (object[0].ptype == 8) { /* pentagon */ 587 for (i = 0; i < object[0].Npts; i++) { 588 if (!(finite(x[i]) && finite(y[i]))) continue; 589 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 590 sy = x[i]*myi + y[i]*myj + by + YCENTER; 591 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 592 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 593 if (scaleColor) { 594 if (!finite(z[i])) continue; 595 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 596 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 597 } 598 D = scaleSize ? dz*z[i] : ds; 599 DrawLine (sx + 0.00*D, sy - 1.00*D, sx + 0.95*D, sy - 0.31*D); 600 DrawLine (sx + 0.95*D, sy - 0.31*D, sx + 0.58*D, sy + 0.81*D); 601 DrawLine (sx + 0.58*D, sy + 0.81*D, sx - 0.58*D, sy + 0.81*D); 602 DrawLine (sx - 0.58*D, sy + 0.81*D, sx - 0.95*D, sy - 0.31*D); 603 DrawLine (sx - 0.95*D, sy - 0.31*D, sx + 0.00*D, sy - 1.00*D); 604 } 605 } 606 } 607 if (object[0].ptype == 9) { /* hexagon */ 608 for (i = 0; i < object[0].Npts; i++) { 609 if (!(finite(x[i]) && finite(y[i]))) continue; 610 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 611 sy = x[i]*myi + y[i]*myj + by + YCENTER; 612 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 613 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 614 if (scaleColor) { 615 if (!finite(z[i])) continue; 616 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 617 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 618 } 619 D = scaleSize ? dz*z[i] : ds; 620 DrawLine (sx - D, sy, sx - 0.50*D, sy + 0.87*D); 621 DrawLine (sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 622 DrawLine (sx + 0.50*D, sy + 0.87*D, sx + D, sy); 623 624 DrawLine (sx + D, sy, sx + 0.50*D, sy - 0.87*D); 625 DrawLine (sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 626 DrawLine (sx - 0.50*D, sy - 0.87*D, sx - D, sy); 627 } 628 } 629 } 630 if (object[0].ptype == 10) { /* filled 0 */ 631 for (i = 0; i < object[0].Npts; i++) { 632 if (!(finite(x[i]) && finite(y[i]))) continue; 633 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 634 sy = x[i]*myi + y[i]*myj + by + YCENTER; 635 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 636 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 637 if (scaleColor) { 638 if (!finite(z[i])) continue; 639 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 640 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 641 } 642 D = scaleSize ? dz*z[i] : ds; 643 FillCircle (sx, sy, D); 644 } 645 } 646 } 647 if (object[0].ptype == 12) { /* filled triangle (down) */ 648 XPoint points[4]; 649 for (i = 0; i < object[0].Npts; i++) { 650 if (!(finite(x[i]) && finite(y[i]))) continue; 651 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 652 sy = x[i]*myi + y[i]*myj + by + YCENTER; 653 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 654 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 655 if (scaleColor) { 656 if (!finite(z[i])) continue; 657 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 658 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 659 } 660 D = scaleSize ? dz*z[i] : ds; 661 points[0].x = sx - D; points[0].y = sy - 0.58*D; 662 points[1].x = sx + D; points[1].y = sy - 0.58*D; 663 points[2].x = sx; points[2].y = sy + 1.15*D; 664 points[3].x = sx - D; points[3].y = sy - 0.58*D; 665 XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin); 666 } 667 } 668 } 669 if (object[0].ptype == 14) { /* upside-down filled triangle */ 670 XPoint points[4]; 671 for (i = 0; i < object[0].Npts; i++) { 672 if (!(finite(x[i]) && finite(y[i]))) continue; 673 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 674 sy = x[i]*myi + y[i]*myj + by + YCENTER; 675 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 676 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 677 if (scaleColor) { 678 if (!finite(z[i])) continue; 679 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 680 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 681 } 682 D = scaleSize ? dz*z[i] : ds; 683 points[0].x = sx - D; points[0].y = sy - 0.58*D; 684 points[1].x = sx + D; points[1].y = sy - 0.58*D; 685 points[2].x = sx; points[2].y = sy + 1.15*D; 686 points[3].x = sx - D; points[3].y = sy - 0.58*D; 687 XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin); 688 } 689 } 690 } 691 if (object[0].ptype == 15) { /* upside-down open triangle */ 692 for (i = 0; i < object[0].Npts; i++) { 693 if (!(finite(x[i]) && finite(y[i]))) continue; 694 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 695 sy = x[i]*myi + y[i]*myj + by + YCENTER; 696 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 697 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 698 if (scaleColor) { 699 if (!finite(z[i])) continue; 700 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 701 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 702 } 703 D = scaleSize ? dz*z[i] : ds; 704 DrawLine (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D); 705 DrawLine (sx + D, sy - 0.58*D, sx, sy + 1.15*D); 706 DrawLine (sx, sy + 1.15*D, sx - D, sy - 0.58*D); 707 } 708 } 709 } 710 if (object[0].ptype == 16) { /* upside-down Y */ 711 for (i = 0; i < object[0].Npts; i++) { 712 if (!(finite(x[i]) && finite(y[i]))) continue; 713 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 714 sy = x[i]*myi + y[i]*myj + by + YCENTER; 715 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 716 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 717 if (scaleColor) { 718 if (!finite(z[i])) continue; 719 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 720 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 721 } 722 D = scaleSize ? dz*z[i] : ds; 723 DrawLine (sx, sy, sx - D, sy + 0.58*D); 724 DrawLine (sx, sy, sx + D, sy + 0.58*D); 725 DrawLine (sx, sy, sx, sy - 1.15*D); 726 } 727 } 728 } 729 if (object[0].ptype == 100) { /* connect a pair of points */ 730 731 double X0 = graph[0].axis[0].fx; 732 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 733 double Y0 = graph[0].axis[1].fy; 734 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 735 736 for (i = 0; i + 1 < object[0].Npts; i+=2) { 737 if (!(finite(x[i]) && finite(y[i]))) continue; 738 sx1 = x[i]*mxi + y[i]*mxj + bx + XCENTER; 739 sy1 = x[i]*myi + y[i]*myj + by + YCENTER; 740 if (!(finite(x[i+1]) && finite(y[i+1]))) continue; 741 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx + XCENTER; 742 sy2 = x[i+1]*myi + y[i+1]*myj + by + YCENTER; 743 ClipLine (sx1, sy1, sx2, sy2, X0, Y0, X1, Y1); 744 } 705 case KAPA_POINT_BOX_SOLID: /* filled box */ 706 default: 707 for (i = 0; i < object[0].Npts; i++) { 708 if (!(finite(x[i]) && finite(y[i]))) continue; 709 sx = x[i]*mxi + y[i]*mxj + bx + XCENTER; 710 sy = x[i]*myi + y[i]*myj + by + YCENTER; 711 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 712 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 713 if (scaleColor) { 714 if (!finite(z[i])) continue; 715 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 716 XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel); 717 } 718 D = scaleSize ? dz*z[i] : ds; 719 FillRectangle (sx - D, sy - D, 2*D + 1, 2*D + 1); 720 } 721 } 722 break; 745 723 } 746 724 } 747 725 748 726 /******/ 749 void DrawXErrors ( KapaGraphWidget *graph, Gobjects *object) {727 void DrawXErrors (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 750 728 751 729 int i, bar, dz, ds, D; … … 800 778 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy))) 801 779 { 802 ClipLine ( sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);780 ClipLine (graphic, sx0, sy0, sx1, sy1, X0, Y0, X1, Y1); 803 781 if (bar) { 804 782 sx10 = sy1 - sz; 805 783 sx11 = sy1 + sz; 806 ClipLine ( sx1, sx10, sx1, sx11, X0, Y0, X1, Y1);784 ClipLine (graphic, sx1, sx10, sx1, sx11, X0, Y0, X1, Y1); 807 785 } 808 786 } … … 819 797 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy))) 820 798 { 821 ClipLine ( sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);799 ClipLine (graphic, sx0, sy0, sx1, sy1, X0, Y0, X1, Y1); 822 800 if (bar) { 823 801 sx10 = sy1 - sz; 824 802 sx11 = sy1 + sz; 825 ClipLine ( sx1, sx10, sx1, sx11, X0, Y0, X1, Y1);803 ClipLine (graphic, sx1, sx10, sx1, sx11, X0, Y0, X1, Y1); 826 804 } 827 805 } … … 830 808 831 809 /******/ 832 void DrawYErrors ( KapaGraphWidget *graph, Gobjects *object) {810 void DrawYErrors (Graphic *graphic, KapaGraphWidget *graph, Gobjects *object) { 833 811 834 812 int i, bar, dz, ds, D; … … 883 861 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy))) 884 862 { 885 ClipLine ( sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);863 ClipLine (graphic, sx0, sy0, sx1, sy1, X0, Y0, X1, Y1); 886 864 if (bar) { 887 865 sx10 = sx1 - sz; 888 866 sx11 = sx1 + sz; 889 ClipLine ( sx10, sy1, sx11, sy1, X0, Y0, X1, Y1);867 ClipLine (graphic, sx10, sy1, sx11, sy1, X0, Y0, X1, Y1); 890 868 } 891 869 } … … 904 882 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy))) 905 883 { 906 ClipLine ( sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);884 ClipLine (graphic, sx0, sy0, sx1, sy1, X0, Y0, X1, Y1); 907 885 if (bar) { 908 886 sx10 = sx1 - sz; 909 887 sx11 = sx1 + sz; 910 ClipLine ( sx10, sy1, sx11, sy1, X0, Y0, X1, Y1);888 ClipLine (graphic, sx10, sy1, sx11, sy1, X0, Y0, X1, Y1); 911 889 } 912 890 } -
trunk/Ohana/src/kapa2/src/LoadObject.c
r31665 r39926 102 102 if (DEBUG) fprintf (stderr, "loaded %d objects, using object %d\n", graph[0].objects[N].Npts, N); 103 103 104 if (USE_XWINDOW) DrawObjectN (graph, &graph[0].objects[graph[0].Nobjects-1]); 104 if (USE_XWINDOW) { 105 Graphic *graphic = GetGraphic(); 106 DrawObjectN (graphic, graph, &graph[0].objects[graph[0].Nobjects-1]); 107 } 105 108 FlushDisplay (); 106 109 -
trunk/Ohana/src/kapa2/src/PSFrame.c
r38986 r39926 11 11 12 12 graphic = GetGraphic(); 13 14 P = 0.5 * (1 + 0.25*graph[0].axis[0].lweight) * (hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy) + hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy)); 13 15 14 16 /* each axis is drawn independently */ … … 30 32 dfy = -graph[0].axis[i].dfy + 2*dy; 31 33 32 P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy);33 P *= (1 + 0.25*lweight);34 // P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy); 35 // P *= (1 + 0.25*lweight); 34 36 35 37 fprintf (f, "%.1f setlinewidth\n", lweight); -
trunk/Ohana/src/kapa2/src/PSObjects.c
r38153 r39926 7 7 # define FillCircle(X1,Y1,R) (fprintf (f, " %6.2f %6.2f %6.2f FC\n", (X1), (graphic->dy - Y1), (R))) 8 8 # define FillTriangle(X1,Y1,X2,Y2, X3, Y3) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f TF\n", (X1), (graphic->dy-Y1), (X2), (graphic->dy-Y2), (X3), (graphic->dy-Y3))) 9 # define CONNECT 0 10 # define HISTOGRAM 1 11 # define POINTS 2 12 9 10 # define CAPSTYLE 1 /* CapButt */ 11 # define JOINSTYLE 0 /* JoinMiter */ 12 13 // XXX this is not thread safe, but that is OK 13 14 static Graphic *graphic; 14 15 … … 16 17 17 18 int i; 18 double lweight; 19 static char dash[] = "5"; 20 static char dot[] = "3"; 21 19 20 // the functions below use this global value 22 21 graphic = GetGraphic(); 23 22 23 // this function calls all of the supporting Draw... functions below 24 24 for (i = 0; i < graph[0].Nobjects; i++) { 25 switch (graph[0].objects[i].ltype) { 26 case 0: 27 break; 28 case 1: 29 fprintf (f, "[%s] 0 setdash\n", dash); 30 break; 31 case 2: 25 PSObjectsN (graph, &graph[0].objects[i], f); 26 } 27 // reset to default color and style 28 fprintf (f, "[] 0 setdash\n"); 29 fprintf (f, "0.00 0.00 0.00 setrgbcolor\n"); 30 31 return (TRUE); 32 } 33 34 int PSObjectsN (KapaGraphWidget *graph, Gobjects *object, FILE *f) { 35 36 static char short_dash[] = "4 4"; 37 static char long_dash[] = "8 8"; 38 static char dot_dash[] = "2 4 4 4"; 39 static char dot[] = "2 3"; 40 41 double lweight = MAX (0, MIN (10, object->lweight)); 42 fprintf (f, "%.1f setlinewidth\n", lweight); 43 fprintf (f, "%d setlinecap %d setlinejoin\n", CAPSTYLE, JOINSTYLE); 44 45 switch (object->ltype) { 46 case KAPA_LINE_DOT: 32 47 fprintf (f, "[%s] 0 setdash\n", dot); 33 48 break; 49 case KAPA_LINE_DASH_SHORT: 50 fprintf (f, "[%s] 0 setdash\n", short_dash); 51 break; 52 case KAPA_LINE_DASH_LONG: 53 fprintf (f, "[%s] 0 setdash\n", long_dash); 54 break; 55 case KAPA_LINE_DOT_DASH: 56 fprintf (f, "[%s] 0 setdash\n", dot_dash); 57 break; 58 case KAPA_LINE_SOLID: // no need to call 'setdash' as solid is the default 34 59 default: 35 60 break; 36 }61 } 37 62 38 lweight = MAX (0, MIN (10, graph[0].objects[i].lweight)); 39 fprintf (f, "%.1f setlinewidth\n", lweight); 40 41 if (graph[0].objects[i].color >= 0) { 42 fprintf (f, "%s setrgbcolor\n", KapaColorRGBString(graph[0].objects[i].color)); 43 } 44 45 switch (graph[0].objects[i].style) { 46 case CONNECT: 47 PSConnect (graph, &graph[0].objects[i], f); 48 break; 49 case HISTOGRAM: 50 PSHistogram (graph, &graph[0].objects[i], f); 51 break; 52 case POINTS: 53 PSPoints (graph, &graph[0].objects[i], f); 54 break; 55 } 56 57 if (graph[0].objects[i].etype & 0x01) { 58 PSYErrors (graph, &graph[0].objects[i], f); 59 } 60 if (graph[0].objects[i].etype & 0x02) { 61 PSXErrors (graph, &graph[0].objects[i], f); 62 } 63 fprintf (f, "[] 0 setdash\n"); 64 fprintf (f, "0.00 0.00 0.00 setrgbcolor\n"); 63 if (object->color >= 0) { 64 fprintf (f, "%s setrgbcolor\n", KapaColorRGBString(object->color)); 65 } 66 67 switch (object->style) { 68 case KAPA_PLOT_CONNECT: 69 PSConnect (graph, object, f); 70 break; 71 case KAPA_PLOT_HISTOGRAM: 72 PSHistogram (graph, object, f); 73 break; 74 case KAPA_PLOT_POINTS: 75 default: 76 PSPoints (graph, object, f); 77 break; 78 } 79 80 if (object->etype & 0x01) { 81 PSYErrors (graph, object, f); 82 } 83 if (object->etype & 0x02) { 84 PSXErrors (graph, object, f); 65 85 } 66 86 return (TRUE); … … 303 323 } 304 324 305 // black, I think306 325 // fprintf (f, "0.00 0.00 0.00 setrgbcolor\n"); 307 326 308 /**** point s are scaled by object.z***/327 /**** point sizes are scaled by object.size, colors by object.color ***/ 309 328 int scaleSize = (object[0].size < 0); 310 329 int scaleColor = (object[0].color < 0); … … 314 333 x = object[0].x; y = object[0].y; z = object[0].z; 315 334 316 if (object[0].ptype == 0) { /* filled box */ 317 for (i = 0; i < object[0].Npts; i++) { 318 if (!(finite(x[i]) && finite(y[i]))) continue; 319 sx = x[i]*mxi + y[i]*mxj + bx; 320 sy = x[i]*myi + y[i]*myj + by; 321 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 322 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 323 { 324 if (scaleColor) { 325 if (!finite(z[i])) continue; 326 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 327 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 328 } 329 D = scaleSize ? dz*z[i] : ds; 330 FillRectangle (sx, sy, 2*D, 2*D); 331 } 335 switch (object[0].ptype) { 336 case KAPA_POINT_BOX_OPEN: /* open box */ 337 for (i = 0; i < object[0].Npts; i++) { 338 if (!(finite(x[i]) && finite(y[i]))) continue; 339 sx = x[i]*mxi + y[i]*mxj + bx; 340 sy = x[i]*myi + y[i]*myj + by; 341 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 342 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 343 if (scaleColor) { 344 if (!finite(z[i])) continue; 345 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 346 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 347 } 348 D = scaleSize ? dz*z[i] : ds; 349 DrawRectangle (sx, sy, 2*D, 2*D); 350 } 351 } 352 break; 353 case KAPA_POINT_CROSS: /* cross */ 354 for (i = 0; i < object[0].Npts; i++) { 355 if (!(finite(x[i]) && finite(y[i]))) continue; 356 sx = x[i]*mxi + y[i]*mxj + bx; 357 sy = x[i]*myi + y[i]*myj + by; 358 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 359 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 360 if (scaleColor) { 361 if (!finite(z[i])) continue; 362 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 363 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 364 } 365 D = scaleSize ? dz*z[i] : ds; 366 DrawLine (sx - D, sy, sx + D, sy); 367 DrawLine (sx, sy - D, sx, sy + D); 368 } 369 } 370 break; 371 case KAPA_POINT_X: /* x */ 372 for (i = 0; i < object[0].Npts; i++) { 373 if (!(finite(x[i]) && finite(y[i]))) continue; 374 sx = x[i]*mxi + y[i]*mxj + bx; 375 sy = x[i]*myi + y[i]*myj + by; 376 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 377 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 378 if (scaleColor) { 379 if (!finite(z[i])) continue; 380 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 381 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 382 } 383 D = scaleSize ? dz*z[i] : ds; 384 DrawLine (sx + D, sy - D, sx - D, sy + D); 385 DrawLine (sx - D, sy - D, sx + D, sy + D); 386 } 387 } 388 break; 389 case KAPA_POINT_TRIANGLE_SOLID: /* filled triangle */ 390 for (i = 0; i < object[0].Npts; i++) { 391 if (!(finite(x[i]) && finite(y[i]))) continue; 392 sx = x[i]*mxi + y[i]*mxj + bx; 393 sy = x[i]*myi + y[i]*myj + by; 394 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 395 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 396 if (scaleColor) { 397 if (!finite(z[i])) continue; 398 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 399 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 400 } 401 D = scaleSize ? dz*z[i] : ds; 402 FillTriangle (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 403 } 404 } 405 break; 406 case KAPA_POINT_TRIANGLE_SOLID_DOWN: /* open triangle */ 407 for (i = 0; i < object[0].Npts; i++) { 408 if (!(finite(x[i]) && finite(y[i]))) continue; 409 sx = x[i]*mxi + y[i]*mxj + bx; 410 sy = x[i]*myi + y[i]*myj + by; 411 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 412 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 413 if (scaleColor) { 414 if (!finite(z[i])) continue; 415 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 416 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 417 } 418 D = scaleSize ? dz*z[i] : ds; 419 FillTriangle (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D, sx, sy - 1.15*D); 420 } 421 } 422 break; 423 case KAPA_POINT_TRIANGLE_OPEN: /* open triangle */ 424 for (i = 0; i < object[0].Npts; i++) { 425 if (!(finite(x[i]) && finite(y[i]))) continue; 426 sx = x[i]*mxi + y[i]*mxj + bx; 427 sy = x[i]*myi + y[i]*myj + by; 428 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 429 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 430 if (scaleColor) { 431 if (!finite(z[i])) continue; 432 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 433 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 434 } 435 D = scaleSize ? dz*z[i] : ds; 436 DrawLine (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D); 437 DrawLine (sx + D, sy - 0.58*D, sx, sy + 1.15*D); 438 DrawLine (sx, sy + 1.15*D, sx - D, sy - 0.58*D); 439 } 440 } 441 break; 442 case KAPA_POINT_TRIANGLE_OPEN_DOWN: /* upside-down open triangle */ 443 for (i = 0; i < object[0].Npts; i++) { 444 if (!(finite(x[i]) && finite(y[i]))) continue; 445 sx = x[i]*mxi + y[i]*mxj + bx; 446 sy = x[i]*myi + y[i]*myj + by; 447 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 448 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 449 if (scaleColor) { 450 if (!finite(z[i])) continue; 451 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 452 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 453 } 454 D = scaleSize ? dz*z[i] : ds; 455 DrawLine (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D); 456 DrawLine (sx + D, sy + 0.58*D, sx, sy - 1.15*D); 457 DrawLine (sx, sy - 1.15*D, sx - D, sy + 0.58*D); 458 } 459 } 460 break; 461 case KAPA_POINT_Y: /* Y */ 462 for (i = 0; i < object[0].Npts; i++) { 463 if (!(finite(x[i]) && finite(y[i]))) continue; 464 sx = x[i]*mxi + y[i]*mxj + bx; 465 sy = x[i]*myi + y[i]*myj + by; 466 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 467 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 468 if (scaleColor) { 469 if (!finite(z[i])) continue; 470 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 471 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 472 } 473 D = scaleSize ? dz*z[i] : ds; 474 DrawLine (sx, sy, sx - D, sy + 0.58*D); 475 DrawLine (sx, sy, sx + D, sy + 0.58*D); 476 DrawLine (sx, sy, sx, sy - 1.15*D); 477 } 478 } 479 break; 480 case KAPA_POINT_Y_DOWN: /* upside-down Y */ 481 for (i = 0; i < object[0].Npts; i++) { 482 if (!(finite(x[i]) && finite(y[i]))) continue; 483 sx = x[i]*mxi + y[i]*mxj + bx; 484 sy = x[i]*myi + y[i]*myj + by; 485 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 486 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 487 if (scaleColor) { 488 if (!finite(z[i])) continue; 489 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 490 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 491 } 492 D = scaleSize ? dz*z[i] : ds; 493 DrawLine (sx, sy, sx - D, sy - 0.58*D); 494 DrawLine (sx, sy, sx + D, sy - 0.58*D); 495 DrawLine (sx, sy, sx, sy + 1.15*D); 496 } 497 } 498 break; 499 case KAPA_POINT_CIRCLE_OPEN: /* 0 */ 500 for (i = 0; i < object[0].Npts; i++) { 501 if (!(finite(x[i]) && finite(y[i]))) continue; 502 sx = x[i]*mxi + y[i]*mxj + bx; 503 sy = x[i]*myi + y[i]*myj + by; 504 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 505 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 506 if (scaleColor) { 507 if (!finite(z[i])) continue; 508 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 509 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 510 } 511 D = scaleSize ? dz*z[i] : ds; 512 DrawCircle (sx, sy, D); 513 } 514 } 515 break; 516 case KAPA_POINT_CIRCLE_SOLID: /* filled 0 */ 517 for (i = 0; i < object[0].Npts; i++) { 518 if (!(finite(x[i]) && finite(y[i]))) continue; 519 sx = x[i]*mxi + y[i]*mxj + bx; 520 sy = x[i]*myi + y[i]*myj + by; 521 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 522 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 523 if (scaleColor) { 524 if (!finite(z[i])) continue; 525 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 526 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 527 } 528 D = scaleSize ? dz*z[i] : ds; 529 FillCircle (sx, sy, D); 530 } 531 } 532 break; 533 case KAPA_POINT_PENTAGON: /* pentagon */ 534 for (i = 0; i < object[0].Npts; i++) { 535 if (!(finite(x[i]) && finite(y[i]))) continue; 536 sx = x[i]*mxi + y[i]*mxj + bx; 537 sy = x[i]*myi + y[i]*myj + by; 538 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 539 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 540 if (scaleColor) { 541 if (!finite(z[i])) continue; 542 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 543 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 544 } 545 D = scaleSize ? dz*z[i] : ds; 546 DrawLine (sx + 0.00*D, sy + 1.00*D, sx + 0.95*D, sy + 0.31*D); 547 DrawLine (sx + 0.95*D, sy + 0.31*D, sx + 0.58*D, sy - 0.81*D); 548 DrawLine (sx + 0.58*D, sy - 0.81*D, sx - 0.58*D, sy - 0.81*D); 549 DrawLine (sx - 0.58*D, sy - 0.81*D, sx - 0.95*D, sy + 0.31*D); 550 DrawLine (sx - 0.95*D, sy + 0.31*D, sx + 0.00*D, sy + 1.00*D); 551 } 552 } 553 break; 554 case KAPA_POINT_HEXAGON: /* hexagon */ 555 for (i = 0; i < object[0].Npts; i++) { 556 if (!(finite(x[i]) && finite(y[i]))) continue; 557 sx = x[i]*mxi + y[i]*mxj + bx; 558 sy = x[i]*myi + y[i]*myj + by; 559 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 560 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 561 if (scaleColor) { 562 if (!finite(z[i])) continue; 563 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 564 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 565 } 566 D = scaleSize ? dz*z[i] : ds; 567 DrawLine (sx - D, sy, sx - 0.50*D, sy + 0.87*D); 568 DrawLine (sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 569 DrawLine (sx + 0.50*D, sy + 0.87*D, sx + D, sy); 570 571 DrawLine (sx + D, sy, sx + 0.50*D, sy - 0.87*D); 572 DrawLine (sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 573 DrawLine (sx - 0.50*D, sy - 0.87*D, sx - D, sy); 574 } 575 } 576 break; 577 case KAPA_POINT_PAIR_CONNECT: { /* connect pairs of points */ 578 double X0 = graph[0].axis[0].fx; 579 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 580 double Y0 = graph[0].axis[1].fy; 581 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 582 583 for (i = 0; i + 1 < object[0].Npts; i+=2) { 584 if (!(finite(x[i]) && finite(y[i]))) continue; 585 sx1 = x[i]*mxi + y[i]*mxj + bx; 586 sy1 = x[i]*myi + y[i]*myj + by; 587 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 588 sy2 = x[i+1]*myi + y[i+1]*myj + by; 589 ClipLinePS (sx1, sy1, sx2, sy2, X0, Y0, X1, Y1, f); 590 } 591 break; 332 592 } 333 } 334 if (object[0].ptype == 1) { /* open box */ 335 for (i = 0; i < object[0].Npts; i++) { 336 if (!(finite(x[i]) && finite(y[i]))) continue; 337 sx = x[i]*mxi + y[i]*mxj + bx; 338 sy = x[i]*myi + y[i]*myj + by; 339 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 340 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 341 { 342 if (scaleColor) { 343 if (!finite(z[i])) continue; 344 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 345 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 346 } 347 D = scaleSize ? dz*z[i] : ds; 348 DrawRectangle (sx, sy, 2*D, 2*D); 349 } 350 } 351 } 352 if (object[0].ptype == 2) { /* cross */ 353 for (i = 0; i < object[0].Npts; i++) { 354 if (!(finite(x[i]) && finite(y[i]))) continue; 355 sx = x[i]*mxi + y[i]*mxj + bx; 356 sy = x[i]*myi + y[i]*myj + by; 357 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 358 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 359 { 360 if (scaleColor) { 361 if (!finite(z[i])) continue; 362 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 363 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 364 } 365 D = scaleSize ? dz*z[i] : ds; 366 DrawLine (sx - D, sy, sx + D, sy); 367 DrawLine (sx, sy - D, sx, sy + D); 368 } 369 } 370 } 371 if (object[0].ptype == 3) { /* x */ 372 for (i = 0; i < object[0].Npts; i++) { 373 if (!(finite(x[i]) && finite(y[i]))) continue; 374 sx = x[i]*mxi + y[i]*mxj + bx; 375 sy = x[i]*myi + y[i]*myj + by; 376 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 377 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 378 { 379 if (scaleColor) { 380 if (!finite(z[i])) continue; 381 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 382 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 383 } 384 D = scaleSize ? dz*z[i] : ds; 385 DrawLine (sx + D, sy - D, sx - D, sy + D); 386 DrawLine (sx - D, sy - D, sx + D, sy + D); 387 } 388 } 389 } 390 if (object[0].ptype == 4) { /* filled triangle */ 391 for (i = 0; i < object[0].Npts; i++) { 392 if (!(finite(x[i]) && finite(y[i]))) continue; 393 sx = x[i]*mxi + y[i]*mxj + bx; 394 sy = x[i]*myi + y[i]*myj + by; 395 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 396 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 397 { 398 if (scaleColor) { 399 if (!finite(z[i])) continue; 400 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 401 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 402 } 403 D = scaleSize ? dz*z[i] : ds; 404 FillTriangle (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 405 } 406 } 407 } 408 if (object[0].ptype == 14) { /* filled triangle */ 409 for (i = 0; i < object[0].Npts; i++) { 410 if (!(finite(x[i]) && finite(y[i]))) continue; 411 sx = x[i]*mxi + y[i]*mxj + bx; 412 sy = x[i]*myi + y[i]*myj + by; 413 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 414 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 415 { 416 if (scaleColor) { 417 if (!finite(z[i])) continue; 418 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 419 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 420 } 421 D = scaleSize ? dz*z[i] : ds; 422 FillTriangle (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D, sx, sy - 1.15*D); 423 } 424 } 425 } 426 if (object[0].ptype == 5) { /* open triangle */ 427 for (i = 0; i < object[0].Npts; i++) { 428 if (!(finite(x[i]) && finite(y[i]))) continue; 429 sx = x[i]*mxi + y[i]*mxj + bx; 430 sy = x[i]*myi + y[i]*myj + by; 431 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 432 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 433 { 434 if (scaleColor) { 435 if (!finite(z[i])) continue; 436 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 437 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 438 } 439 D = scaleSize ? dz*z[i] : ds; 440 DrawLine (sx - D, sy - 0.58*D, sx + D, sy - 0.58*D); 441 DrawLine (sx + D, sy - 0.58*D, sx, sy + 1.15*D); 442 DrawLine (sx, sy + 1.15*D, sx - D, sy - 0.58*D); 443 } 444 } 445 } 446 if (object[0].ptype == 15) { /* upside-down open triangle */ 447 for (i = 0; i < object[0].Npts; i++) { 448 if (!(finite(x[i]) && finite(y[i]))) continue; 449 sx = x[i]*mxi + y[i]*mxj + bx; 450 sy = x[i]*myi + y[i]*myj + by; 451 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 452 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 453 { 454 if (scaleColor) { 455 if (!finite(z[i])) continue; 456 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 457 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 458 } 459 D = scaleSize ? dz*z[i] : ds; 460 DrawLine (sx - D, sy + 0.58*D, sx + D, sy + 0.58*D); 461 DrawLine (sx + D, sy + 0.58*D, sx, sy - 1.15*D); 462 DrawLine (sx, sy - 1.15*D, sx - D, sy + 0.58*D); 463 } 464 } 465 } 466 if (object[0].ptype == 6) { /* Y */ 467 for (i = 0; i < object[0].Npts; i++) { 468 if (!(finite(x[i]) && finite(y[i]))) continue; 469 sx = x[i]*mxi + y[i]*mxj + bx; 470 sy = x[i]*myi + y[i]*myj + by; 471 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 472 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 473 { 474 if (scaleColor) { 475 if (!finite(z[i])) continue; 476 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 477 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 478 } 479 D = scaleSize ? dz*z[i] : ds; 480 DrawLine (sx, sy, sx - D, sy + 0.58*D); 481 DrawLine (sx, sy, sx + D, sy + 0.58*D); 482 DrawLine (sx, sy, sx, sy - 1.15*D); 483 } 484 } 485 } 486 if (object[0].ptype == 16) { /* Y */ 487 for (i = 0; i < object[0].Npts; i++) { 488 if (!(finite(x[i]) && finite(y[i]))) continue; 489 sx = x[i]*mxi + y[i]*mxj + bx; 490 sy = x[i]*myi + y[i]*myj + by; 491 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 492 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 493 { 494 if (scaleColor) { 495 if (!finite(z[i])) continue; 496 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 497 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 498 } 499 D = scaleSize ? dz*z[i] : ds; 500 DrawLine (sx, sy, sx - D, sy - 0.58*D); 501 DrawLine (sx, sy, sx + D, sy - 0.58*D); 502 DrawLine (sx, sy, sx, sy + 1.15*D); 503 } 504 } 505 } 506 if (object[0].ptype == 7) { /* 0 */ 507 for (i = 0; i < object[0].Npts; i++) { 508 if (!(finite(x[i]) && finite(y[i]))) continue; 509 sx = x[i]*mxi + y[i]*mxj + bx; 510 sy = x[i]*myi + y[i]*myj + by; 511 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 512 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 513 { 514 if (scaleColor) { 515 if (!finite(z[i])) continue; 516 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 517 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 518 } 519 D = scaleSize ? dz*z[i] : ds; 520 DrawCircle (sx, sy, D); 521 } 522 } 523 } 524 if (object[0].ptype == 8) { /* pentagon */ 525 for (i = 0; i < object[0].Npts; i++) { 526 if (!(finite(x[i]) && finite(y[i]))) continue; 527 sx = x[i]*mxi + y[i]*mxj + bx; 528 sy = x[i]*myi + y[i]*myj + by; 529 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 530 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 531 { 532 if (scaleColor) { 533 if (!finite(z[i])) continue; 534 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 535 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 536 } 537 D = scaleSize ? dz*z[i] : ds; 538 DrawLine (sx + 0.00*D, sy + 1.00*D, sx + 0.95*D, sy + 0.31*D); 539 DrawLine (sx + 0.95*D, sy + 0.31*D, sx + 0.58*D, sy - 0.81*D); 540 DrawLine (sx + 0.58*D, sy - 0.81*D, sx - 0.58*D, sy - 0.81*D); 541 DrawLine (sx - 0.58*D, sy - 0.81*D, sx - 0.95*D, sy + 0.31*D); 542 DrawLine (sx - 0.95*D, sy + 0.31*D, sx + 0.00*D, sy + 1.00*D); 543 } 544 } 545 } 546 if (object[0].ptype == 9) { /* hexagon */ 547 for (i = 0; i < object[0].Npts; i++) { 548 if (!(finite(x[i]) && finite(y[i]))) continue; 549 sx = x[i]*mxi + y[i]*mxj + bx; 550 sy = x[i]*myi + y[i]*myj + by; 551 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 552 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 553 { 554 if (scaleColor) { 555 if (!finite(z[i])) continue; 556 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 557 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 558 } 559 D = scaleSize ? dz*z[i] : ds; 560 DrawLine (sx - D, sy, sx - 0.50*D, sy + 0.87*D); 561 DrawLine (sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 562 DrawLine (sx + 0.50*D, sy + 0.87*D, sx + D, sy); 563 564 DrawLine (sx + D, sy, sx + 0.50*D, sy - 0.87*D); 565 DrawLine (sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 566 DrawLine (sx - 0.50*D, sy - 0.87*D, sx - D, sy); 567 } 568 } 569 } 570 if (object[0].ptype == 10) { /* 0 */ 571 for (i = 0; i < object[0].Npts; i++) { 572 if (!(finite(x[i]) && finite(y[i]))) continue; 573 sx = x[i]*mxi + y[i]*mxj + bx; 574 sy = x[i]*myi + y[i]*myj + by; 575 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 576 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 577 { 578 if (scaleColor) { 579 if (!finite(z[i])) continue; 580 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 581 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 582 } 583 D = scaleSize ? dz*z[i] : ds; 584 FillCircle (sx, sy, D); 585 } 586 } 587 } 588 if (object[0].ptype == 100) { /* connect a pair of points */ 589 double X0 = graph[0].axis[0].fx; 590 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 591 double Y0 = graph[0].axis[1].fy; 592 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 593 594 for (i = 0; i + 1 < object[0].Npts; i+=2) { 595 if (!(finite(x[i]) && finite(y[i]))) continue; 596 sx1 = x[i]*mxi + y[i]*mxj + bx; 597 sy1 = x[i]*myi + y[i]*myj + by; 598 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 599 sy2 = x[i+1]*myi + y[i+1]*myj + by; 600 ClipLinePS (sx1, sy1, sx2, sy2, X0, Y0, X1, Y1, f); 601 } 602 } 603 593 case KAPA_POINT_BOX_SOLID: /* filled box */ 594 default: 595 for (i = 0; i < object[0].Npts; i++) { 596 if (!(finite(x[i]) && finite(y[i]))) continue; 597 sx = x[i]*mxi + y[i]*mxj + bx; 598 sy = x[i]*myi + y[i]*myj + by; 599 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 600 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 601 if (scaleColor) { 602 if (!finite(z[i])) continue; 603 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 604 fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]); 605 } 606 D = scaleSize ? dz*z[i] : ds; 607 FillRectangle (sx, sy, 2*D, 2*D); 608 } 609 } 610 break; 611 } 604 612 free (pixel1); 605 613 free (pixel2); -
trunk/Ohana/src/kapa2/src/bDrawFrame.c
r38986 r39926 11 11 12 12 // don't need graphic, unlink DrawFrame 13 14 P = 0.5 * (1 + 0.25*graph[0].axis[0].lweight) * (hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy) + hypot (graph[0].axis[0].dfx, graph[0].axis[0].dfy)); 13 15 14 16 /* each axis is drawn independently */ … … 28 30 dfx = graph[0].axis[i].dfx + 2*dx; 29 31 dfy = graph[0].axis[i].dfy + 2*dy; 30 P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy); 31 P *= (1 + 0.25*lweight); 32 33 // P = hypot (graph[0].axis[(i+1)%2].dfx, graph[0].axis[(i+1)%2].dfy); 34 // P *= (1 + 0.25*lweight); 32 35 33 36 bDrawSetStyle (buffer, color, lweight, 0); -
trunk/Ohana/src/kapa2/src/bDrawObjects.c
r38153 r39926 18 18 19 19 int i; 20 int type; 21 int weight; 22 bDrawColor color; 23 bDrawColor black; 24 20 21 // the functions below use this global value 25 22 graphic = GetGraphic(); 26 23 27 black = KapaColorByName ("black");24 // this function calls all of the supporting bDraw... functions below 28 25 for (i = 0; i < graph[0].Nobjects; i++) { 29 30 weight = MAX (0, MIN (10, graph[0].objects[i].lweight)); 31 type = graph[0].objects[i].ltype; 32 color = graph[0].objects[i].color; 33 bDrawSetStyle (buffer, color, weight, type); 34 35 switch (graph[0].objects[i].style) { 36 case CONNECT: 37 bDrawConnect (buffer, graph, &graph[0].objects[i]); 38 break; 39 case HISTOGRAM: 40 bDrawHistogram (buffer, graph, &graph[0].objects[i]); 41 break; 42 case POINTS: 43 bDrawPoints (buffer, graph, &graph[0].objects[i]); 44 break; 45 } 46 47 if (graph[0].objects[i].etype & 0x01) { 48 bDrawYErrors (buffer, graph, &graph[0].objects[i]); 49 } 50 if (graph[0].objects[i].etype & 0x02) { 51 bDrawXErrors (buffer, graph, &graph[0].objects[i]); 52 } 53 } 26 bDrawObjectsN (buffer, graph, &graph[0].objects[i]); 27 } 28 bDrawColor black = KapaColorByName ("black"); 54 29 bDrawSetStyle (buffer, black, 0, 0); 30 return (TRUE); 31 } 32 33 int bDrawObjectsN (bDrawBuffer *buffer, KapaGraphWidget *graph, Gobjects *object) { 34 35 int weight = MAX (0, MIN (10, object->lweight)); 36 bDrawSetStyle (buffer, object->color, weight, object->ltype); 37 38 switch (object->style) { 39 case KAPA_PLOT_CONNECT: 40 bDrawConnect (buffer, graph, object); 41 break; 42 case KAPA_PLOT_HISTOGRAM: 43 bDrawHistogram (buffer, graph, object); 44 break; 45 case KAPA_PLOT_POINTS: 46 default: 47 bDrawPoints (buffer, graph, object); 48 break; 49 } 50 51 if (object->etype & 0x01) { 52 bDrawYErrors (buffer, graph, object); 53 } 54 if (object->etype & 0x02) { 55 bDrawXErrors (buffer, graph, object); 56 } 57 55 58 return (TRUE); 56 59 } … … 298 301 x = object[0].x; y = object[0].y; z = object[0].z; 299 302 300 if (object[0].ptype == 0) { /* filled box */ 301 for (i = 0; i < object[0].Npts; i++) { 302 if (!(finite(x[i]) && finite(y[i]))) continue; 303 sx = x[i]*mxi + y[i]*mxj + bx; 304 sy = x[i]*myi + y[i]*myj + by; 305 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 306 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 307 { 308 if (scaleColor) { 309 if (!finite(z[i])) continue; 310 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 311 buffer->bColor_R = pixel1[pixel]; 312 buffer->bColor_G = pixel2[pixel]; 313 buffer->bColor_B = pixel3[pixel]; 314 } 315 D = scaleSize ? dz*z[i] : ds; 316 FillRectangle (buffer, sx, sy, 2*D, 2*D); 317 // plot range saturated by bDrawRectFill 318 } 303 switch (object[0].ptype) { 304 case KAPA_POINT_BOX_OPEN: /* open box */ 305 for (i = 0; i < object[0].Npts; i++) { 306 if (!(finite(x[i]) && finite(y[i]))) continue; 307 sx = x[i]*mxi + y[i]*mxj + bx; 308 sy = x[i]*myi + y[i]*myj + by; 309 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 310 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 311 if (scaleColor) { 312 if (!finite(z[i])) continue; 313 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 314 buffer->bColor_R = pixel1[pixel]; 315 buffer->bColor_G = pixel2[pixel]; 316 buffer->bColor_B = pixel3[pixel]; 317 } 318 D = scaleSize ? dz*z[i] : ds; 319 DrawRectangle (buffer, sx, sy, 2*D, 2*D); 320 // plot range saturated by bDrawRectOpen 321 } 322 } 323 break; 324 case KAPA_POINT_CROSS: /* cross */ 325 for (i = 0; i < object[0].Npts; i++) { 326 if (!(finite(x[i]) && finite(y[i]))) continue; 327 sx = x[i]*mxi + y[i]*mxj + bx; 328 sy = x[i]*myi + y[i]*myj + by; 329 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 330 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 331 if (scaleColor) { 332 if (!finite(z[i])) continue; 333 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 334 buffer->bColor_R = pixel1[pixel]; 335 buffer->bColor_G = pixel2[pixel]; 336 buffer->bColor_B = pixel3[pixel]; 337 } 338 D = scaleSize ? dz*z[i] : ds; 339 DrawLine (buffer, sx - D, sy, sx + D, sy); 340 DrawLine (buffer, sx, sy - D, sx, sy + D); 341 // out-of-range points skipped by bDrawPoint 342 } 343 } 344 break; 345 case KAPA_POINT_X: /* x */ 346 for (i = 0; i < object[0].Npts; i++) { 347 if (!(finite(x[i]) && finite(y[i]))) continue; 348 sx = x[i]*mxi + y[i]*mxj + bx; 349 sy = x[i]*myi + y[i]*myj + by; 350 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 351 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 352 if (scaleColor) { 353 if (!finite(z[i])) continue; 354 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 355 buffer->bColor_R = pixel1[pixel]; 356 buffer->bColor_G = pixel2[pixel]; 357 buffer->bColor_B = pixel3[pixel]; 358 } 359 D = scaleSize ? dz*z[i] : ds; 360 DrawLine (buffer, sx + D, sy - D, sx - D, sy + D); 361 DrawLine (buffer, sx - D, sy - D, sx + D, sy + D); 362 // out-of-range points skipped by bDrawPoint 363 } 364 } 365 break; 366 case KAPA_POINT_TRIANGLE_SOLID: /* filled triangle */ 367 for (i = 0; i < object[0].Npts; i++) { 368 if (!(finite(x[i]) && finite(y[i]))) continue; 369 sx = x[i]*mxi + y[i]*mxj + bx; 370 sy = x[i]*myi + y[i]*myj + by; 371 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 372 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 373 if (scaleColor) { 374 if (!finite(z[i])) continue; 375 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 376 buffer->bColor_R = pixel1[pixel]; 377 buffer->bColor_G = pixel2[pixel]; 378 buffer->bColor_B = pixel3[pixel]; 379 } 380 D = scaleSize ? dz*z[i] : ds; 381 // FillTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 382 FillTriangle (buffer, sx, sy + 0.58*D, D, -1.73*D); 383 // out-of-range points skipped by bDrawPoint 384 } 385 } 386 break; 387 case KAPA_POINT_TRIANGLE_SOLID_DOWN: /* open triangle */ 388 for (i = 0; i < object[0].Npts; i++) { 389 if (!(finite(x[i]) && finite(y[i]))) continue; 390 sx = x[i]*mxi + y[i]*mxj + bx; 391 sy = x[i]*myi + y[i]*myj + by; 392 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 393 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 394 if (scaleColor) { 395 if (!finite(z[i])) continue; 396 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 397 buffer->bColor_R = pixel1[pixel]; 398 buffer->bColor_G = pixel2[pixel]; 399 buffer->bColor_B = pixel3[pixel]; 400 } 401 D = scaleSize ? dz*z[i] : ds; 402 // FillTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 403 FillTriangle (buffer, sx, sy - 0.58*D, D, +1.73*D); 404 // out-of-range points skipped by bDrawPoint 405 } 406 } 407 break; 408 case KAPA_POINT_TRIANGLE_OPEN: /* open triangle */ 409 for (i = 0; i < object[0].Npts; i++) { 410 if (!(finite(x[i]) && finite(y[i]))) continue; 411 sx = x[i]*mxi + y[i]*mxj + bx; 412 sy = x[i]*myi + y[i]*myj + by; 413 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 414 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 415 if (scaleColor) { 416 if (!finite(z[i])) continue; 417 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 418 buffer->bColor_R = pixel1[pixel]; 419 buffer->bColor_G = pixel2[pixel]; 420 buffer->bColor_B = pixel3[pixel]; 421 } 422 D = scaleSize ? dz*z[i] : ds; 423 OpenTriangle (buffer, sx - D, sy + 0.58*D, sx + D, sy + 0.58*D, sx, sy - 1.15*D); 424 // out-of-range points skipped by bDrawPoint 425 } 426 } 427 break; 428 case KAPA_POINT_TRIANGLE_OPEN_DOWN: /* upside-down open triangle */ 429 for (i = 0; i < object[0].Npts; i++) { 430 if (!(finite(x[i]) && finite(y[i]))) continue; 431 sx = x[i]*mxi + y[i]*mxj + bx; 432 sy = x[i]*myi + y[i]*myj + by; 433 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 434 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 435 if (scaleColor) { 436 if (!finite(z[i])) continue; 437 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 438 buffer->bColor_R = pixel1[pixel]; 439 buffer->bColor_G = pixel2[pixel]; 440 buffer->bColor_B = pixel3[pixel]; 441 } 442 D = scaleSize ? dz*z[i] : ds; 443 OpenTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 444 // out-of-range points skipped by bDrawPoint 445 } 446 } 447 break; 448 case KAPA_POINT_Y: /* Y */ 449 for (i = 0; i < object[0].Npts; i++) { 450 if (!(finite(x[i]) && finite(y[i]))) continue; 451 sx = x[i]*mxi + y[i]*mxj + bx; 452 sy = x[i]*myi + y[i]*myj + by; 453 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 454 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 455 if (scaleColor) { 456 if (!finite(z[i])) continue; 457 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 458 buffer->bColor_R = pixel1[pixel]; 459 buffer->bColor_G = pixel2[pixel]; 460 buffer->bColor_B = pixel3[pixel]; 461 } 462 D = scaleSize ? dz*z[i] : ds; 463 DrawLine (buffer, sx, sy, sx - D, sy - 0.58*D); 464 DrawLine (buffer, sx, sy, sx + D, sy - 0.58*D); 465 DrawLine (buffer, sx, sy, sx, sy + 1.15*D); 466 // out-of-range points skipped by bDrawPoint 467 } 468 } 469 break; 470 case KAPA_POINT_Y_DOWN: /* upside-down Y */ 471 for (i = 0; i < object[0].Npts; i++) { 472 if (!(finite(x[i]) && finite(y[i]))) continue; 473 sx = x[i]*mxi + y[i]*mxj + bx; 474 sy = x[i]*myi + y[i]*myj + by; 475 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 476 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 477 if (scaleColor) { 478 if (!finite(z[i])) continue; 479 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 480 buffer->bColor_R = pixel1[pixel]; 481 buffer->bColor_G = pixel2[pixel]; 482 buffer->bColor_B = pixel3[pixel]; 483 } 484 D = scaleSize ? dz*z[i] : ds; 485 DrawLine (buffer, sx, sy, sx - D, sy + 0.58*D); 486 DrawLine (buffer, sx, sy, sx + D, sy + 0.58*D); 487 DrawLine (buffer, sx, sy, sx, sy - 1.15*D); 488 // out-of-range points skipped by bDrawPoint 489 } 490 } 491 break; 492 case KAPA_POINT_CIRCLE_OPEN: /* 0 */ 493 for (i = 0; i < object[0].Npts; i++) { 494 if (!(finite(x[i]) && finite(y[i]))) continue; 495 sx = x[i]*mxi + y[i]*mxj + bx; 496 sy = x[i]*myi + y[i]*myj + by; 497 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 498 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 499 if (scaleColor) { 500 if (!finite(z[i])) continue; 501 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 502 buffer->bColor_R = pixel1[pixel]; 503 buffer->bColor_G = pixel2[pixel]; 504 buffer->bColor_B = pixel3[pixel]; 505 } 506 D = scaleSize ? dz*z[i] : ds; 507 DrawCircle (buffer, sx, sy, D); 508 // out-of-range points skipped by bDrawPoint 509 } 510 } 511 break; 512 case KAPA_POINT_CIRCLE_SOLID: /* filled 0 */ 513 for (i = 0; i < object[0].Npts; i++) { 514 if (!(finite(x[i]) && finite(y[i]))) continue; 515 sx = x[i]*mxi + y[i]*mxj + bx; 516 sy = x[i]*myi + y[i]*myj + by; 517 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 518 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 519 if (scaleColor) { 520 if (!finite(z[i])) continue; 521 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 522 buffer->bColor_R = pixel1[pixel]; 523 buffer->bColor_G = pixel2[pixel]; 524 buffer->bColor_B = pixel3[pixel]; 525 } 526 D = scaleSize ? dz*z[i] : ds; 527 FillCircle (buffer, sx, sy, D); 528 // out-of-range points skipped by bDrawLineHorizontal 529 } 530 } 531 break; 532 case KAPA_POINT_PENTAGON: /* pentagon */ 533 for (i = 0; i < object[0].Npts; i++) { 534 if (!(finite(x[i]) && finite(y[i]))) continue; 535 sx = x[i]*mxi + y[i]*mxj + bx; 536 sy = x[i]*myi + y[i]*myj + by; 537 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 538 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 539 if (scaleColor) { 540 if (!finite(z[i])) continue; 541 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 542 buffer->bColor_R = pixel1[pixel]; 543 buffer->bColor_G = pixel2[pixel]; 544 buffer->bColor_B = pixel3[pixel]; 545 } 546 D = scaleSize ? dz*z[i] : ds; 547 DrawLine (buffer, sx + 0.00*D, sy - 1.00*D, sx + 0.95*D, sy - 0.31*D); 548 DrawLine (buffer, sx + 0.95*D, sy - 0.31*D, sx + 0.58*D, sy + 0.81*D); 549 DrawLine (buffer, sx + 0.58*D, sy + 0.81*D, sx - 0.58*D, sy + 0.81*D); 550 DrawLine (buffer, sx - 0.58*D, sy + 0.81*D, sx - 0.95*D, sy - 0.31*D); 551 DrawLine (buffer, sx - 0.95*D, sy - 0.31*D, sx + 0.00*D, sy - 1.00*D); 552 // out-of-range points skipped by bDrawPoint 553 } 554 } 555 break; 556 case KAPA_POINT_HEXAGON: /* hexagon */ 557 for (i = 0; i < object[0].Npts; i++) { 558 if (!(finite(x[i]) && finite(y[i]))) continue; 559 sx = x[i]*mxi + y[i]*mxj + bx; 560 sy = x[i]*myi + y[i]*myj + by; 561 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 562 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 563 if (scaleColor) { 564 if (!finite(z[i])) continue; 565 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 566 buffer->bColor_R = pixel1[pixel]; 567 buffer->bColor_G = pixel2[pixel]; 568 buffer->bColor_B = pixel3[pixel]; 569 } 570 D = scaleSize ? dz*z[i] : ds; 571 DrawLine (buffer, sx - D, sy, sx - 0.50*D, sy + 0.87*D); 572 DrawLine (buffer, sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 573 DrawLine (buffer, sx + 0.50*D, sy + 0.87*D, sx + D, sy); 574 DrawLine (buffer, sx + D, sy, sx + 0.50*D, sy - 0.87*D); 575 DrawLine (buffer, sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 576 DrawLine (buffer, sx - 0.50*D, sy - 0.87*D, sx - D, sy); 577 // out-of-range points skipped by bDrawPoint 578 } 579 } 580 break; 581 case KAPA_POINT_PAIR_CONNECT: { /* connect pairs of points */ 582 583 double X0 = graph[0].axis[0].fx; 584 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 585 double Y0 = graph[0].axis[1].fy; 586 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 587 588 for (i = 0; i + 1 < object[0].Npts; i+=2) { 589 if (!(finite(x[i]) && finite(y[i]))) continue; 590 sx1 = x[i]*mxi + y[i]*mxj + bx; 591 sy1 = x[i]*myi + y[i]*myj + by; 592 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 593 sy2 = x[i+1]*myi + y[i+1]*myj + by; 594 bDrawClipLine (buffer, sx1, sy1, sx2, sy2, X0, Y0, X1, Y1); 595 } 596 break; 319 597 } 320 } 321 if (object[0].ptype == 1) { /* open box */ 322 for (i = 0; i < object[0].Npts; i++) { 323 if (!(finite(x[i]) && finite(y[i]))) continue; 324 sx = x[i]*mxi + y[i]*mxj + bx; 325 sy = x[i]*myi + y[i]*myj + by; 326 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 327 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 328 { 329 if (scaleColor) { 330 if (!finite(z[i])) continue; 331 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 332 buffer->bColor_R = pixel1[pixel]; 333 buffer->bColor_G = pixel2[pixel]; 334 buffer->bColor_B = pixel3[pixel]; 335 } 336 D = scaleSize ? dz*z[i] : ds; 337 DrawRectangle (buffer, sx, sy, 2*D, 2*D); 338 // plot range saturated by bDrawRectOpen 339 } 340 } 341 } 342 if (object[0].ptype == 2) { /* cross */ 343 for (i = 0; i < object[0].Npts; i++) { 344 if (!(finite(x[i]) && finite(y[i]))) continue; 345 sx = x[i]*mxi + y[i]*mxj + bx; 346 sy = x[i]*myi + y[i]*myj + by; 347 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 348 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 349 { 350 if (scaleColor) { 351 if (!finite(z[i])) continue; 352 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 353 buffer->bColor_R = pixel1[pixel]; 354 buffer->bColor_G = pixel2[pixel]; 355 buffer->bColor_B = pixel3[pixel]; 356 } 357 D = scaleSize ? dz*z[i] : ds; 358 DrawLine (buffer, sx - D, sy, sx + D, sy); 359 DrawLine (buffer, sx, sy - D, sx, sy + D); 360 // out-of-range points skipped by bDrawPoint 361 } 362 } 363 } 364 if (object[0].ptype == 3) { /* x */ 365 for (i = 0; i < object[0].Npts; i++) { 366 if (!(finite(x[i]) && finite(y[i]))) continue; 367 sx = x[i]*mxi + y[i]*mxj + bx; 368 sy = x[i]*myi + y[i]*myj + by; 369 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 370 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 371 { 372 if (scaleColor) { 373 if (!finite(z[i])) continue; 374 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 375 buffer->bColor_R = pixel1[pixel]; 376 buffer->bColor_G = pixel2[pixel]; 377 buffer->bColor_B = pixel3[pixel]; 378 } 379 D = scaleSize ? dz*z[i] : ds; 380 DrawLine (buffer, sx + D, sy - D, sx - D, sy + D); 381 DrawLine (buffer, sx - D, sy - D, sx + D, sy + D); 382 // out-of-range points skipped by bDrawPoint 383 } 384 } 385 } 386 if (object[0].ptype == 4) { /* filled triangle */ 387 for (i = 0; i < object[0].Npts; i++) { 388 if (!(finite(x[i]) && finite(y[i]))) continue; 389 sx = x[i]*mxi + y[i]*mxj + bx; 390 sy = x[i]*myi + y[i]*myj + by; 391 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 392 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 393 { 394 if (scaleColor) { 395 if (!finite(z[i])) continue; 396 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 397 buffer->bColor_R = pixel1[pixel]; 398 buffer->bColor_G = pixel2[pixel]; 399 buffer->bColor_B = pixel3[pixel]; 400 } 401 D = scaleSize ? dz*z[i] : ds; 402 // FillTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 403 FillTriangle (buffer, sx, sy + 0.58*D, D, -1.73*D); 404 // out-of-range points skipped by bDrawPoint 405 } 406 } 407 } 408 if (object[0].ptype == 14) { /* filled triangle */ 409 for (i = 0; i < object[0].Npts; i++) { 410 if (!(finite(x[i]) && finite(y[i]))) continue; 411 sx = x[i]*mxi + y[i]*mxj + bx; 412 sy = x[i]*myi + y[i]*myj + by; 413 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 414 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 415 { 416 if (scaleColor) { 417 if (!finite(z[i])) continue; 418 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 419 buffer->bColor_R = pixel1[pixel]; 420 buffer->bColor_G = pixel2[pixel]; 421 buffer->bColor_B = pixel3[pixel]; 422 } 423 D = scaleSize ? dz*z[i] : ds; 424 // FillTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 425 FillTriangle (buffer, sx, sy - 0.58*D, D, +1.73*D); 426 // out-of-range points skipped by bDrawPoint 427 } 428 } 429 } 430 if (object[0].ptype == 5) { /* open triangle */ 431 for (i = 0; i < object[0].Npts; i++) { 432 if (!(finite(x[i]) && finite(y[i]))) continue; 433 sx = x[i]*mxi + y[i]*mxj + bx; 434 sy = x[i]*myi + y[i]*myj + by; 435 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 436 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 437 { 438 if (scaleColor) { 439 if (!finite(z[i])) continue; 440 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 441 buffer->bColor_R = pixel1[pixel]; 442 buffer->bColor_G = pixel2[pixel]; 443 buffer->bColor_B = pixel3[pixel]; 444 } 445 D = scaleSize ? dz*z[i] : ds; 446 OpenTriangle (buffer, sx - D, sy + 0.58*D, sx + D, sy + 0.58*D, sx, sy - 1.15*D); 447 // out-of-range points skipped by bDrawPoint 448 } 449 } 450 } 451 if (object[0].ptype == 15) { /* open triangle */ 452 for (i = 0; i < object[0].Npts; i++) { 453 if (!(finite(x[i]) && finite(y[i]))) continue; 454 sx = x[i]*mxi + y[i]*mxj + bx; 455 sy = x[i]*myi + y[i]*myj + by; 456 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 457 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 458 { 459 if (scaleColor) { 460 if (!finite(z[i])) continue; 461 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 462 buffer->bColor_R = pixel1[pixel]; 463 buffer->bColor_G = pixel2[pixel]; 464 buffer->bColor_B = pixel3[pixel]; 465 } 466 D = scaleSize ? dz*z[i] : ds; 467 OpenTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 468 // out-of-range points skipped by bDrawPoint 469 } 470 } 471 } 472 if (object[0].ptype == 6) { /* Y */ 473 for (i = 0; i < object[0].Npts; i++) { 474 if (!(finite(x[i]) && finite(y[i]))) continue; 475 sx = x[i]*mxi + y[i]*mxj + bx; 476 sy = x[i]*myi + y[i]*myj + by; 477 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 478 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 479 { 480 if (scaleColor) { 481 if (!finite(z[i])) continue; 482 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 483 buffer->bColor_R = pixel1[pixel]; 484 buffer->bColor_G = pixel2[pixel]; 485 buffer->bColor_B = pixel3[pixel]; 486 } 487 D = scaleSize ? dz*z[i] : ds; 488 DrawLine (buffer, sx, sy, sx - D, sy - 0.58*D); 489 DrawLine (buffer, sx, sy, sx + D, sy - 0.58*D); 490 DrawLine (buffer, sx, sy, sx, sy + 1.15*D); 491 // out-of-range points skipped by bDrawPoint 492 } 493 } 494 } 495 if (object[0].ptype == 16) { /* Y */ 496 for (i = 0; i < object[0].Npts; i++) { 497 if (!(finite(x[i]) && finite(y[i]))) continue; 498 sx = x[i]*mxi + y[i]*mxj + bx; 499 sy = x[i]*myi + y[i]*myj + by; 500 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 501 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 502 { 503 if (scaleColor) { 504 if (!finite(z[i])) continue; 505 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 506 buffer->bColor_R = pixel1[pixel]; 507 buffer->bColor_G = pixel2[pixel]; 508 buffer->bColor_B = pixel3[pixel]; 509 } 510 D = scaleSize ? dz*z[i] : ds; 511 DrawLine (buffer, sx, sy, sx - D, sy + 0.58*D); 512 DrawLine (buffer, sx, sy, sx + D, sy + 0.58*D); 513 DrawLine (buffer, sx, sy, sx, sy - 1.15*D); 514 // out-of-range points skipped by bDrawPoint 515 } 516 } 517 } 518 if (object[0].ptype == 7) { /* 0 */ 519 for (i = 0; i < object[0].Npts; i++) { 520 if (!(finite(x[i]) && finite(y[i]))) continue; 521 sx = x[i]*mxi + y[i]*mxj + bx; 522 sy = x[i]*myi + y[i]*myj + by; 523 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 524 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 525 { 526 if (scaleColor) { 527 if (!finite(z[i])) continue; 528 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 529 buffer->bColor_R = pixel1[pixel]; 530 buffer->bColor_G = pixel2[pixel]; 531 buffer->bColor_B = pixel3[pixel]; 532 } 533 D = scaleSize ? dz*z[i] : ds; 534 DrawCircle (buffer, sx, sy, D); 535 // out-of-range points skipped by bDrawPoint 536 } 537 } 538 } 539 if (object[0].ptype == 8) { /* pentagon */ 540 for (i = 0; i < object[0].Npts; i++) { 541 if (!(finite(x[i]) && finite(y[i]))) continue; 542 sx = x[i]*mxi + y[i]*mxj + bx; 543 sy = x[i]*myi + y[i]*myj + by; 544 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 545 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 546 { 547 if (scaleColor) { 548 if (!finite(z[i])) continue; 549 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 550 buffer->bColor_R = pixel1[pixel]; 551 buffer->bColor_G = pixel2[pixel]; 552 buffer->bColor_B = pixel3[pixel]; 553 } 554 D = scaleSize ? dz*z[i] : ds; 555 DrawLine (buffer, sx + 0.00*D, sy - 1.00*D, sx + 0.95*D, sy - 0.31*D); 556 DrawLine (buffer, sx + 0.95*D, sy - 0.31*D, sx + 0.58*D, sy + 0.81*D); 557 DrawLine (buffer, sx + 0.58*D, sy + 0.81*D, sx - 0.58*D, sy + 0.81*D); 558 DrawLine (buffer, sx - 0.58*D, sy + 0.81*D, sx - 0.95*D, sy - 0.31*D); 559 DrawLine (buffer, sx - 0.95*D, sy - 0.31*D, sx + 0.00*D, sy - 1.00*D); 560 // out-of-range points skipped by bDrawPoint 561 } 562 } 563 } 564 if (object[0].ptype == 9) { /* hexagon */ 565 for (i = 0; i < object[0].Npts; i++) { 566 if (!(finite(x[i]) && finite(y[i]))) continue; 567 sx = x[i]*mxi + y[i]*mxj + bx; 568 sy = x[i]*myi + y[i]*myj + by; 569 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 570 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 571 { 572 if (scaleColor) { 573 if (!finite(z[i])) continue; 574 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 575 buffer->bColor_R = pixel1[pixel]; 576 buffer->bColor_G = pixel2[pixel]; 577 buffer->bColor_B = pixel3[pixel]; 578 } 579 D = scaleSize ? dz*z[i] : ds; 580 DrawLine (buffer, sx - D, sy, sx - 0.50*D, sy + 0.87*D); 581 DrawLine (buffer, sx - 0.50*D, sy + 0.87*D, sx + 0.50*D, sy + 0.87*D); 582 DrawLine (buffer, sx + 0.50*D, sy + 0.87*D, sx + D, sy); 583 DrawLine (buffer, sx + D, sy, sx + 0.50*D, sy - 0.87*D); 584 DrawLine (buffer, sx + 0.50*D, sy - 0.87*D, sx - 0.50*D, sy - 0.87*D); 585 DrawLine (buffer, sx - 0.50*D, sy - 0.87*D, sx - D, sy); 586 // out-of-range points skipped by bDrawPoint 587 } 588 } 589 } 590 if (object[0].ptype == 10) { /* filled circle */ 591 for (i = 0; i < object[0].Npts; i++) { 592 if (!(finite(x[i]) && finite(y[i]))) continue; 593 sx = x[i]*mxi + y[i]*mxj + bx; 594 sy = x[i]*myi + y[i]*myj + by; 595 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 596 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 597 { 598 if (scaleColor) { 599 if (!finite(z[i])) continue; 600 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 601 buffer->bColor_R = pixel1[pixel]; 602 buffer->bColor_G = pixel2[pixel]; 603 buffer->bColor_B = pixel3[pixel]; 604 } 605 D = scaleSize ? dz*z[i] : ds; 606 FillCircle (buffer, sx, sy, D); 607 // out-of-range points skipped by bDrawLineHorizontal 608 } 609 } 610 } 611 if (object[0].ptype == 12) { /* filled triangle (down) */ 612 for (i = 0; i < object[0].Npts; i++) { 613 if (!(finite(x[i]) && finite(y[i]))) continue; 614 sx = x[i]*mxi + y[i]*mxj + bx; 615 sy = x[i]*myi + y[i]*myj + by; 616 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 617 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) 618 { 619 if (scaleColor) { 620 if (!finite(z[i])) continue; 621 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 622 buffer->bColor_R = pixel1[pixel]; 623 buffer->bColor_G = pixel2[pixel]; 624 buffer->bColor_B = pixel3[pixel]; 625 } 626 D = scaleSize ? dz*z[i] : ds; 627 // FillTriangle (buffer, sx - D, sy - 0.58*D, sx + D, sy - 0.58*D, sx, sy + 1.15*D); 628 FillTriangle (buffer, sx, sy + 0.58*D, D, 1.73*D); 629 // out-of-range points skipped by bDrawPoint 630 } 631 } 632 } 633 if (object[0].ptype == 100) { /* connect a pair of points */ 634 635 double X0 = graph[0].axis[0].fx; 636 double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx; 637 double Y0 = graph[0].axis[1].fy; 638 double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy; 639 640 for (i = 0; i + 1 < object[0].Npts; i+=2) { 641 if (!(finite(x[i]) && finite(y[i]))) continue; 642 sx1 = x[i]*mxi + y[i]*mxj + bx; 643 sy1 = x[i]*myi + y[i]*myj + by; 644 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 645 sy2 = x[i+1]*myi + y[i+1]*myj + by; 646 bDrawClipLine (buffer, sx1, sy1, sx2, sy2, X0, Y0, X1, Y1); 647 } 648 } 649 598 case KAPA_POINT_BOX_SOLID: /* filled box */ 599 for (i = 0; i < object[0].Npts; i++) { 600 if (!(finite(x[i]) && finite(y[i]))) continue; 601 sx = x[i]*mxi + y[i]*mxj + bx; 602 sy = x[i]*myi + y[i]*myj + by; 603 if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) && 604 (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) { 605 if (scaleColor) { 606 if (!finite(z[i])) continue; 607 int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1))); 608 buffer->bColor_R = pixel1[pixel]; 609 buffer->bColor_G = pixel2[pixel]; 610 buffer->bColor_B = pixel3[pixel]; 611 } 612 D = scaleSize ? dz*z[i] : ds; 613 FillRectangle (buffer, sx, sy, 2*D, 2*D); 614 // plot range saturated by bDrawRectFill 615 } 616 } 617 break; 618 } 650 619 free (pixel1); 651 620 free (pixel2); -
trunk/Ohana/src/libdvo/include/dvo.h
r39670 r39926 114 114 /* Measure.flags values -- these values are 32 bit (as of PS1_V1) */ 115 115 typedef enum { 116 ID_MEAS_NOCAL = 0x00000001, // detection ignored for this analysis (photcode, time range) -- internal only 117 ID_MEAS_POOR_PHOTOM = 0x00000002, // detection is photometry outlier 118 ID_MEAS_SKIP_PHOTOM = 0x00000004, // detection was ignored for photometry measurement 119 ID_MEAS_AREA = 0x00000008, // detection near image edge 120 ID_MEAS_POOR_ASTROM = 0x00000010, // detection is astrometry outlier 121 ID_MEAS_SKIP_ASTROM = 0x00000020, // detection was ignored for astrometry measurement 122 ID_MEAS_USED_OBJ = 0x00000040, // detection was used during update objects 123 ID_MEAS_USED_CHIP = 0x00000080, // detection was used during update chips (XXX this probably does not make it into the db) 124 ID_MEAS_BLEND_MEAS = 0x00000100, // detection is within radius of multiple objects 125 ID_MEAS_BLEND_OBJ = 0x00000200, // multiple detections within radius of object 126 ID_MEAS_WARP_USED = 0x00000400, // measurement used to find mean warp photometry 127 ID_MEAS_UNMASKED_ASTRO = 0x00000800, // measurement was not masked in final astrometry fit 128 ID_MEAS_BLEND_MEAS_X = 0x00001000, // detection is within radius of multiple objects across catalogs 129 ID_MEAS_ARTIFACT = 0x00002000, // detection is thought to be non-astronomical 130 ID_MEAS_SYNTH_MAG = 0x00004000, // magnitude is synthetic 131 ID_MEAS_PHOTOM_UBERCAL = 0x00008000, // externally-supplied zero point from ubercal analysis 132 ID_MEAS_STACK_PRIMARY = 0x00010000, // this stack measurement is in the primary skycell 133 ID_MEAS_STACK_PHOT_SRC = 0x00020000, // this measurement supplied the stack photometry 134 ID_MEAS_ICRF_QSO = 0x00040000, // this measurement is an ICRF reference position 135 ID_MEAS_IMAGE_EPOCH = 0x00080000, // this measurement is registered to the image epoch (not tied to ref catalog epoch) 136 ID_MEAS_PHOTOM_PSF = 0x00100000, // this measurement is used for the mean psf mag 137 ID_MEAS_PHOTOM_APER = 0x00200000, // this measurement is used for the mean ap mag 138 ID_MEAS_PHOTOM_KRON = 0x00400000, // this measurement is used for the mean kron mag 139 ID_MEAS_MASKED_PSF = 0x01000000, // this measurement is masked based on IRLS weights for mean psf mag 140 ID_MEAS_MASKED_APER = 0x02000000, // this measurement is masked based on IRLS weights for mean ap mag 141 ID_MEAS_MASKED_KRON = 0x04000000, // this measurement is masked based on IRLS weights for mean kron mag 116 ID_MEAS_NOCAL = 0x00000001, // detection ignored for this analysis (photcode, time range) -- internal only 117 ID_MEAS_POOR_PHOTOM = 0x00000002, // detection is photometry outlier 118 ID_MEAS_SKIP_PHOTOM = 0x00000004, // detection was ignored for photometry measurement 119 ID_MEAS_AREA = 0x00000008, // detection near image edge 120 ID_MEAS_POOR_ASTROM = 0x00000010, // detection is astrometry outlier 121 ID_MEAS_SKIP_ASTROM = 0x00000020, // detection was ignored for astrometry measurement 122 ID_MEAS_USED_OBJ = 0x00000040, // detection was used during update objects 123 ID_MEAS_USED_CHIP = 0x00000080, // detection was used during update chips (XXX this probably does not make it into the db) 124 ID_MEAS_BLEND_MEAS = 0x00000100, // detection is within radius of multiple objects 125 ID_MEAS_BLEND_OBJ = 0x00000200, // multiple detections within radius of object 126 ID_MEAS_WARP_USED = 0x00000400, // measurement used to find mean warp photometry 127 ID_MEAS_UNMASKED_ASTRO = 0x00000800, // measurement was not masked in final astrometry fit 128 ID_MEAS_BLEND_MEAS_X = 0x00001000, // detection is within radius of multiple objects across catalogs 129 ID_MEAS_ARTIFACT = 0x00002000, // detection is thought to be non-astronomical 130 ID_MEAS_SYNTH_MAG = 0x00004000, // magnitude is synthetic 131 ID_MEAS_PHOTOM_UBERCAL = 0x00008000, // externally-supplied zero point from ubercal analysis 132 ID_MEAS_STACK_PRIMARY = 0x00010000, // this stack measurement is in the primary skycell 133 ID_MEAS_STACK_PHOT_SRC = 0x00020000, // this measurement supplied the stack photometry 134 ID_MEAS_ICRF_QSO = 0x00040000, // this measurement is an ICRF reference position 135 ID_MEAS_IMAGE_EPOCH = 0x00080000, // this measurement is registered to the image epoch (not tied to ref catalog epoch) 136 ID_MEAS_PHOTOM_PSF = 0x00100000, // this measurement is used for the mean psf mag 137 ID_MEAS_PHOTOM_APER = 0x00200000, // this measurement is used for the mean ap mag 138 ID_MEAS_PHOTOM_KRON = 0x00400000, // this measurement is used for the mean kron mag 139 ID_MEAS_MASKED_PSF = 0x01000000, // this measurement is masked based on IRLS weights for mean psf mag 140 ID_MEAS_MASKED_APER = 0x02000000, // this measurement is masked based on IRLS weights for mean ap mag 141 ID_MEAS_MASKED_KRON = 0x04000000, // this measurement is masked based on IRLS weights for mean kron mag 142 ID_MEAS_OBJECT_HAS_2MASS = 0x10000000, // measurement comes from an object with 2mass data 143 ID_MEAS_OBJECT_HAS_GAIA = 0x20000000, // measurement comes from an object with gaia data 144 ID_MEAS_OBJECT_HAS_TYCHO = 0x40000000, // measurement comes from an object with tycho data 142 145 } DVOMeasureFlags; 143 146 … … 233 236 ID_SECF_STACK_BESTDET = 0x00008000, // PS1 stack best measurement is a detection (not forced) 234 237 ID_SECF_STACK_PRIMDET = 0x00010000, // PS1 stack primary measurement is a detection (not forced) 238 239 ID_SECF_HAS_SDSS = 0x00100000, // this photcode has SDSS photometry 240 ID_SECF_HAS_HSC = 0x00200000, // this photcode has HSC photometry 241 ID_SECF_HAS_CFH = 0x00400000, // this photcode has CFH photometry (mostly Megacam) 242 ID_SECF_HAS_DES = 0x00800000, // this photcode has DES photometry 243 235 244 ID_SECF_OBJ_EXT = 0x01000000, // extended in this band 236 245 -
trunk/Ohana/src/libdvo/src/ImageMetadataSelection.c
r37807 r39926 59 59 } 60 60 61 // note that this function is called by the dvo clients and uses the 'metadata' table 62 // generated by the dvo shell for the mosaic images only. 61 63 Coords *MatchMosaicMetadata (unsigned int imageID) { 62 64 … … 73 75 mosaic.crval2 = image[m].crval2; 74 76 77 // note that image->theta is calculated based on pc1_1, pc1_2 when the metadata file is 78 // generated 75 79 mosaic.pc1_1 = cos(RAD_DEG*image[m].theta); 76 80 mosaic.pc1_2 = sin(RAD_DEG*image[m].theta); -
trunk/Ohana/src/libdvo/src/coordops.c
r39608 r39926 84 84 85 85 /** extra polynomial terms **/ 86 // for ZPN, these are used to modify the radial distance and not the X,Y coords 86 87 if ((coords[0].Npolyterms > 1) && (proj != PROJ_ZPN)) { 87 88 X2 = X*X; … … 126 127 if (proj == PROJ_WRP) { 127 128 if (!coords->mosaic) { 128 myAbort ("missing mosaic element"); 129 // myAbort ("missing mosaic element"); 130 *ra = L; 131 *dec = M; 129 132 return (FALSE); 130 133 } … … 157 160 ctht = 0.0; 158 161 } else { 159 T = DEG_RAD / R; 160 stht = T / sqrt ( 1.0 + T*T); 161 ctht = 1.0 / sqrt ( 1.0 + T*T); 162 // T = DEG_RAD / R; // T in 1/radians 163 // stht = T / sqrt ( 1.0 + T*T); 164 // ctht = 1.0 / sqrt ( 1.0 + T*T); 165 166 T = RAD_DEG * R; 167 stht = 1.0 / sqrt ( 1.0 + T*T); 168 ctht = T / sqrt ( 1.0 + T*T); 162 169 } 170 break; 171 case PROJ_SIN: 172 // R = (180/pi) cos (theta) 173 ctht = RAD_DEG * R; 174 stht = sqrt (1 - ctht*ctht); 163 175 break; 164 176 case PROJ_STG: … … 167 179 ctht = sqrt (1 - stht*stht); 168 180 break; 169 case PROJ_SIN:170 // R = (180/pi) cos (theta)171 ctht = RAD_DEG * R;172 stht = sqrt (1 - ctht*ctht);173 break;174 181 case PROJ_ARC: 175 182 // R = 90 - theta (degrees) … … 177 184 stht = cos (RAD_DEG * R); 178 185 break; 179 180 case PROJ_ZPN:181 // R = 90 - theta (degrees)182 // this is wrong because we are ignoring the distortion183 // XXX For now, just solve for terms up to n = 3184 185 // Ro = (pi/180)(90 - theta)186 // R = (180/pi)sum (P_i R^i)187 188 if (UKIRT_ONLY) {189 double Ro = RAD_DEG * R;190 double P1 = coords[0].polyterms[0][1];191 double P3 = coords[0].polyterms[0][3];192 193 // find the roots of f(gamma) = P1 gamma + P3 gamma^3 - Ro194 // starting guess for gamma is Ro / P1195 double gamma = Ro / P1;196 197 int i;198 for (i = 0; i < 5; i++) {199 double F = P1*gamma + P3*gamma*gamma*gamma - Ro;200 double dFdgamma = P1 + 3.0*P3*gamma*gamma;201 202 double gamma_new = gamma - F / dFdgamma;203 gamma = gamma_new;204 }205 206 double theta = 90.0 - gamma * DEG_RAD ;207 ctht = cos (RAD_DEG * theta);208 stht = sin (RAD_DEG * theta);209 break;210 }211 186 212 187 case PROJ_ZEA: … … 220 195 ctht = sqrt (1 - stht*stht); 221 196 break; 197 198 case PROJ_ZPN: 199 200 // the forward projection is: 201 // theta = atan2(stht, ctht) 202 // gamma = (pi/2 - theta) : theta in radians 203 // Ro = sum (P_i gamma^i) 204 // R = (180/pi) Ro 205 206 // given R, we need to find theta: 207 // Ro = R * (pi / 180) = sum (P_i gamma^i) 208 // solve sum (P_i gamma^i) - Ro = 0 using Newton-Raphson 209 210 // use Ro to get a guess for gamma and iterate 211 212 { 213 double Ro = RAD_DEG * R; 214 215 // find the roots of f(gamma) - Ro = 0 216 // starting guess for gamma is (Ro - P0) / P1 217 double gamma = (Ro - coords[0].polyterms[0][0]) / coords[0].polyterms[1][0]; 218 219 int iter; 220 for (iter = 0; iter < 5; iter++) { 221 222 double Rc = 0.0; // this will hold the ander 223 double dR = 0.0; 224 for (int i = coords[0].Npolyterms - 1; i > 1; i--) { 225 double Pi = (i < 7) ? coords[0].polyterms[i][0] : coords[0].polyterms[i-7][1]; 226 Rc = (Rc + Pi)*gamma; 227 dR = (dR + i*Pi)*gamma; 228 } 229 double P0 = coords[0].polyterms[0][0]; 230 double P1 = coords[0].polyterms[1][0]; 231 Rc = (Rc + P1)*gamma + P0; 232 dR = (dR + P1); 233 234 double gamma_new = gamma - (Rc - Ro) / dR; 235 gamma = gamma_new; 236 } 237 238 double theta = 90.0 - gamma * DEG_RAD ; 239 ctht = cos (RAD_DEG * theta); 240 stht = sin (RAD_DEG * theta); 241 break; 242 } 243 222 244 default: 223 245 return (FALSE); … … 354 376 355 377 case PROJ_ZPN: 378 // the forward projection is: 379 // theta = atan2(stht, ctht) 380 // gamma = (pi/2 - theta) : theta in radians 381 // Ro = sum (P_i gamma^i) 382 // R = (180/pi) Ro 383 356 384 // Ro = (pi/180)(90 - theta) 357 385 // R = (180/pi)sum (P_i R^i) 386 387 // is ZPN defined for Npolyterms = 0 or 1? 388 358 389 ctht = hypot(sphi, cphi); 359 390 theta = atan2 (stht, ctht); 360 391 361 double Rc; 362 if (UKIRT_ONLY) { 363 double P1 = coords[0].polyterms[0][1]; 364 double P3 = coords[0].polyterms[0][3]; 365 double gamma = RAD_DEG * (90 - DEG_RAD * theta); 366 Rc = P1*gamma + P3*gamma*gamma*gamma; 367 } else { 368 double Ro = RAD_DEG * (90 - DEG_RAD * theta); 369 370 // i = 0 .. Npolyterms - 1 (1 <= Npolyterms <= 21) 371 i = coords[0].Npolyterms - 1; 372 Rc = 0.0; 373 while (i > 0) { 374 if (i < 7) { 375 Rc = (Rc + coords[0].polyterms[0][i])*Ro; 376 } else { 377 Rc = (Rc + coords[0].polyterms[1][i-7])*Ro; 378 } 379 i --; 380 } 381 Rc += coords[0].polyterms[0][i]; 392 double Ro; 393 double gamma = M_PI_2 - theta; 394 395 // i = 0 .. Npolyterms - 1 (1 <= Npolyterms <= 21) 396 Ro = 0.0; 397 for (i = coords[0].Npolyterms - 1; i > 0; i --) { 398 double Pi = (i < 7) ? coords[0].polyterms[i][0] : coords[0].polyterms[i-7][1]; 399 Ro = (Ro + Pi)*gamma; 382 400 } 383 Rc = DEG_RAD * Rc; 401 Ro += coords[0].polyterms[0][0]; 402 403 Rc = DEG_RAD * Ro; 384 404 385 405 *L = (ctht == 0.0) ? 0.0 : +Rc * sphi / ctht ; … … 609 629 enum {COORD_TYPE_NONE, COORD_TYPE_PC, COORD_TYPE_ROT, COORD_TYPE_CD, COORD_TYPE_LIN}; 610 630 631 int GetRadialZPN (Coords *coords, Header *header); 632 611 633 int GetCoords (Coords *coords, Header *header) { 612 634 613 int i,status, status1, status2, itmp, Polynomial, Polyterm;635 int status, status1, status2, itmp, Polynomial, Polyterm; 614 636 double Lambda, rotate, rotate1, rotate2, scale; 615 637 double equinox; … … 666 688 status &= gfits_scan (header, "PC002002", "%f", 1, &coords[0].pc2_2); 667 689 690 ctype = &coords[0].ctype[4]; 691 692 // read the ZPN coeffients PV2_i (i = 0 < 14) 693 // ZPN is inconsistent with the other Polynomial types 694 if (!strcmp (ctype, "-ZPN")) { 695 GetRadialZPN (coords, header); 696 break; 697 } 698 668 699 /* set NPLYTERM based on header. if NPLYTERM is missing, it should have a 669 700 value of 0, unless the projection type is one of PLY, DIS, WRP, in which 670 701 case it should be set to 3 */ 671 ctype = &coords[0].ctype[4];672 702 Polynomial = !strcmp (ctype, "-PLY") || !strcmp (ctype, "-DIS") || !strcmp (ctype, "-WRP"); 673 703 Polyterm = gfits_scan (header, "NPLYTERM", "%d", 1, &itmp); … … 723 753 coords[0].pc2_1 = sin(rotate*RAD_DEG) / Lambda; 724 754 coords[0].pc2_2 = cos(rotate*RAD_DEG); 755 756 // read the ZPN coeffients PV2_i (i = 0 < 14) 757 if (!strcmp (&coords[0].ctype[4], "-ZPN")) GetRadialZPN (coords, header); 725 758 break; 726 759 … … 744 777 coords[0].pc2_2 /= scale; 745 778 746 if (!strcmp (&coords[0].ctype[4], "-ZPN")) { 747 int found; 748 for (i = 0; i < 14; i++) { 749 char name[64]; 750 snprintf (name, 64, "PV2_%d", i); 751 if (i < 7) { 752 found = gfits_scan (header, name, "%f", 1, &coords[0].polyterms[0][i]); 753 } else { 754 found = gfits_scan (header, name, "%f", 1, &coords[0].polyterms[1][i-7]); 755 } 756 if ((i == 0) && !found) { 757 coords[0].polyterms[0][0] = 0.0; 758 continue; 759 } 760 if ((i == 1) && !found) { 761 coords[0].polyterms[0][1] = 1.0; 762 continue; 763 } 764 if (!found) { 765 coords[0].Npolyterms = i; 766 break; 767 } 768 } 769 } 779 // read the ZPN coeffients PV2_i (i = 0 < 14) 780 if (!strcmp (&coords[0].ctype[4], "-ZPN")) GetRadialZPN (coords, header); 770 781 break; 771 782 … … 819 830 } 820 831 return (status); 832 } 833 834 int GetRadialZPN (Coords *coords, Header *header) { 835 836 // RA---ZPN can have up to 14 radial polynomial terms. these are stored in 837 // polyterms[0][0] - [6][0] for the first 7 and [0][1] - [6][1] for the rest 838 // these terms are coeffients of a polynomial of the radial distances 839 840 // read the ZPN coeffients PV2_i (i = 0 < 14) 841 int found; 842 int Nmax = 0; 843 for (int i = 0; i < 14; i++) { 844 char name[64]; 845 snprintf (name, 64, "PV2_%d", i); 846 if (i < 7) { 847 coords[0].polyterms[i][0] = 0.0; 848 found = gfits_scan (header, name, "%f", 1, &coords[0].polyterms[i][0]); 849 } else { 850 coords[0].polyterms[i-7][1] = 0.0; 851 found = gfits_scan (header, name, "%f", 1, &coords[0].polyterms[i-7][1]); 852 } 853 // PV2_1 is implicit if not present 854 if ((i == 1) && !found) { 855 coords[0].polyterms[1][0] = 1.0; 856 continue; 857 } 858 // set Npolyterms based on the largest coefficient found 859 if (found) { 860 Nmax = i; 861 } 862 } 863 coords[0].Npolyterms = Nmax + 1; 864 return TRUE; 821 865 } 822 866 -
trunk/Ohana/src/libdvo/src/dbExtractMeasures.c
r39670 r39926 427 427 break; 428 428 case MEAS_TMEAN: /* OK */ 429 value.Flt = TimeValue (average[0].Tmean, TimeReference, TimeFormat); 430 break; 431 case MEAS_TRANGE: /* OK */ 429 432 value.Flt = GetTimeRange (average[0].Trange, TimeFormat); 430 break;431 case MEAS_TRANGE: /* OK */432 value.Flt = TimeValue (average[0].Trange, 0, TimeFormat);433 433 break; 434 434 case MEAS_NMEAS: /* OK */ … … 461 461 break; 462 462 case MEAS_RA_FIT_OFFSET: /* OK */ 463 // RA_epoch_fit = RA_mean + uR*(t - Tmean)/cos(dec) + plx*parR 464 // note that this extraction ignores parallax 463 465 dT = (measure[0].t - average[0].Tmean) / (86400*365.25); 464 dR = dvoOffsetR (measure, average); 465 value.Flt = average[0].uR * dT + dR; 466 dR = dvoOffsetR (measure, average); // RA_epoch - RA_mean (** NOT local linear distance **) 467 value.Flt = dR*cos(RAD_DEG*measure[0].D) - average[0].uR * dT; 468 // this is the local linear distance of the measurement from the fit 466 469 break; 467 470 case MEAS_DEC_FIT_OFFSET: /* OK */ 468 471 dT = (measure[0].t - average[0].Tmean) / (86400*365.25); 469 472 dD = dvoOffsetD (measure, average); 470 value.Flt = average[0].uD * dT + dD;473 value.Flt = dD - average[0].uD * dT; 471 474 break; 472 475 case MEAS_RA_OFFSET_ERR: /* OK */ -
trunk/Ohana/src/libdvo/src/galaxy_model.c
r39588 r39926 28 28 V_sol = 11.18; // km/sec 29 29 W_sol = 7.61; // km/sec 30 return TRUE; 31 } 32 if (!strcmp(version, "TEST-CONSTANT")) { 33 // use for testing 34 A_oort = +47.40; // km/sec/kpc 35 B_oort = -47.40; // km/sec/kpc 36 U_sol = 0.00; // km/sec 37 V_sol = 0.00; // km/sec 38 W_sol = 0.00; // km/sec 39 return TRUE; 40 } 41 if (!strcmp(version, "TEST-ZERO")) { 42 // use for testing 43 A_oort = 0.00; // km/sec/kpc 44 B_oort = 0.00; // km/sec/kpc 45 U_sol = 0.00; // km/sec 46 V_sol = 0.00; // km/sec 47 W_sol = 0.00; // km/sec 30 48 return TRUE; 31 49 } -
trunk/Ohana/src/libfits/header/F_H_field.c
r38986 r39926 90 90 ptr = buf + 9; // start of following keyword 91 91 if (strncmp (field, ptr, Nfield)) continue; 92 if (ptr[Nfield + 1] != '=') continue; // the strncmp above will match a longer string which matches the subset of field (e.g., FOO will match FOOBAR and FOO). test for the following '=' sign 92 93 Nfound ++; 93 94 if (Nfound == N) return (ptr); -
trunk/Ohana/src/libkapa/Makefile
r39590 r39926 34 34 $(SRC)/KapaWindow.$(ARCH).o \ 35 35 $(SRC)/KapaColors.$(ARCH).o \ 36 $(SRC)/KapaStyles.$(ARCH).o \ 36 37 $(SRC)/KapaOpen.$(ARCH).o 37 38 -
trunk/Ohana/src/libkapa/include/kapa.h
r38986 r39926 25 25 typedef struct sockaddr_in KapaSockAddress; 26 26 27 typedef struct { 28 float *data1d; 29 float **data2d; 30 int Nx; 31 int Ny; 32 } KiiImage; 33 34 typedef struct { 35 float x; 36 float y; 37 float dx; 38 float dy; 39 float angle; 40 int type; 41 } KiiOverlayBase; 42 43 typedef struct { 44 float x; 45 float y; 46 float dx; 47 float dy; 48 float angle; 49 int type; 50 char *text; 51 } KiiOverlay; 27 // retain historical numerical definitions: 28 typedef enum { 29 KAPA_LINE_INVALID_MIN = -1, 30 KAPA_LINE_SOLID = 0, 31 KAPA_LINE_DOT = 1, 32 KAPA_LINE_DASH_SHORT = 2, 33 KAPA_LINE_DASH_LONG = 3, 34 KAPA_LINE_DOT_DASH = 4, 35 KAPA_LINE_INVALID_MAX = 5, 36 } KapaLineType; 37 38 // retain historical numerical definitions: 39 typedef enum { 40 KAPA_PLOT_INVALID_MIN = -1, 41 KAPA_PLOT_CONNECT = 0, 42 KAPA_PLOT_HISTOGRAM = 1, 43 KAPA_PLOT_POINTS = 2, 44 KAPA_PLOT_INVALID_MAX = 3, 45 } KapaPlotStyle; 46 47 typedef enum { 48 KAPA_POINT_INVALID_MIN = -1, 49 KAPA_POINT_BOX_SOLID = 0, 50 KAPA_POINT_BOX_OPEN = 1, 51 KAPA_POINT_CROSS = 2, // OR PLUS 52 KAPA_POINT_X = 3, 53 KAPA_POINT_Y = 4, 54 KAPA_POINT_TRIANGLE_SOLID = 5, 55 KAPA_POINT_TRIANGLE_OPEN = 6, 56 KAPA_POINT_CIRCLE_OPEN = 7, 57 KAPA_POINT_PENTAGON = 8, 58 KAPA_POINT_HEXAGON = 9, 59 KAPA_POINT_CIRCLE_SOLID = 10, 60 KAPA_POINT_TRIANGLE_SOLID_DOWN = 11, 61 KAPA_POINT_TRIANGLE_OPEN_DOWN = 12, 62 KAPA_POINT_Y_DOWN = 13, 63 KAPA_POINT_INVALID_MAX = 14, 64 KAPA_POINT_PAIR_CONNECT = 100, // change to a plot style? 65 } KapaPointStyle; 66 // note that PAIR_CONNECT was historically 100 67 52 68 53 69 typedef enum { … … 75 91 KAPA_PS_RAWPAGE 76 92 } KapaPSmode; 93 94 typedef struct { 95 float *data1d; 96 float **data2d; 97 int Nx; 98 int Ny; 99 } KiiImage; 100 101 typedef struct { 102 float x; 103 float y; 104 float dx; 105 float dy; 106 float angle; 107 int type; 108 } KiiOverlayBase; 109 110 typedef struct { 111 float x; 112 float y; 113 float dx; 114 float dy; 115 float angle; 116 int type; 117 char *text; 118 } KiiOverlay; 77 119 78 120 typedef struct { … … 219 261 unsigned long *KapaX11colors (Display *display, Colormap colormap, unsigned long default_color, int *Ncolors); 220 262 263 /* KapaStyles.c */ 264 KapaLineType KapaLineTypeFromString (char *string); 265 KapaPlotStyle KapaPlotStyleFromString (char *string); 266 KapaPointStyle KapaPointStyleFromString (char *string); 267 221 268 /* RotFont.c */ 222 269 void InitRotFonts PROTO((void)); -
trunk/Ohana/src/libkapa/src/KapaOpen.c
r39457 r39926 6 6 # define MY_PORT 2500 7 7 # define MY_PORT_MAX 2520 8 # define MY_WAIT 100000 8 # define MY_WAIT 1000000 9 9 # define DEBUG 0 10 10 -
trunk/Ohana/src/libkapa/src/KapaWindow.c
r39652 r39926 449 449 return (TRUE); 450 450 } 451 -
trunk/Ohana/src/libkapa/src/bDrawFuncs.c
r36488 r39926 222 222 e = 0; 223 223 for (X = X1, N = 0; X <= X2; X++, N++) { 224 if (buffer->bType == 1) { DashOn = (N % 10) < 5; } 225 if (buffer->bType == 2) { DashOn = (N % 6) < 3; } 224 if (buffer->bType == KAPA_LINE_DOT) { 225 DashOn = (N % 5) == 0 || (N % 5) == 1; 226 } 227 if (buffer->bType == KAPA_LINE_DASH_SHORT) { 228 DashOn = (N % 8) < 4; 229 } 230 if (buffer->bType == KAPA_LINE_DASH_LONG) { 231 DashOn = (N % 16) < 8; 232 } 233 if (buffer->bType == KAPA_LINE_DOT_DASH) { 234 DashOn = ((N % 12) < 2) || ((N % 12 >= 6) && (N % 12 < 10)) ; 235 } 226 236 if (swapcoords) { 227 237 if (DashOn) bDrawPoint (buffer, Y,X); -
trunk/Ohana/src/opihi/cmd.astro/csystem.c
r39591 r39926 125 125 opihi_flt *yptr = yvec[0].elements.Flt; 126 126 127 opihi_flt *uxptr = uxvec ? xvec[0].elements.Flt : NULL;128 opihi_flt *uyptr = uyvec ? yvec[0].elements.Flt : NULL;127 opihi_flt *uxptr = uxvec ? uxvec[0].elements.Flt : NULL; 128 opihi_flt *uyptr = uyvec ? uyvec[0].elements.Flt : NULL; 129 129 130 130 for (i = 0; i < xvec[0].Nelements; i++, xptr++, yptr++) { -
trunk/Ohana/src/opihi/cmd.astro/fitplx_irls.c
r39610 r39926 158 158 // now that the mask has been updated, we need to recalculate mean epoch and positions 159 159 // XXX make this conditional on actually masking unmasked points above 160 PlxSetMeanEpoch (R, D, T, &Rmean, &Dmean, &Tmean, mask, Ntotal);161 PlxSetEpochPosition (&fitdata, R, D, dR, dD, T, mask, Ntotal, &coords, Tmean);160 // PlxSetMeanEpoch (R, D, T, &Rmean, &Dmean, &Tmean, mask, Ntotal); 161 // PlxSetEpochPosition (&fitdata, R, D, dR, dD, T, mask, Ntotal, &coords, Tmean); 162 162 163 163 PlxFitData sample; … … 218 218 // fprintf (stderr, "%f +/- %f | %f %f\n", fit.p, fit.dp, fit.uR, fit.uD); 219 219 220 /* 221 FILE *f = fopen ("test.pf.dat", "w"); 220 Vector *dRresPMP, *dDresPMP, *dRresPLX, *dDresPLX; 221 222 // save fit residuals (with only pm removed, and pm and plx removed) 223 if ((dRresPMP = SelectVector ("dRresPMP", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dRresPMP"); 224 if ((dDresPMP = SelectVector ("dDresPMP", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dDresPMP"); 225 if ((dRresPLX = SelectVector ("dRresPLX", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dRresPLX"); 226 if ((dDresPLX = SelectVector ("dDresPLX", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dDresPLX"); 227 228 ResetVector (dRresPMP, OPIHI_FLT, Ntotal); 229 ResetVector (dDresPMP, OPIHI_FLT, Ntotal); 230 ResetVector (dRresPLX, OPIHI_FLT, Ntotal); 231 ResetVector (dDresPLX, OPIHI_FLT, Ntotal); 232 222 233 for (i = 0; i < Ntotal; i++) { 223 double Xf = fit.Ro + fit.uR*fitdata.t[i] + fit.p*fitdata.pX[i]; 224 double Yf = fit.Do + fit.uD*fitdata.t[i] + fit.p*fitdata.pY[i]; 225 fprintf (f, "%f : %f %f : %f %f : %f : %f %f : %f %f\n", T[i], R[i], D[i], Xf, Yf, fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.pX[i], fitdata.pY[i]); 226 } 227 fclose (f); 228 */ 234 235 double x0, y0; 236 RD_to_XY (&x0, &y0, R[i], D[i], &coords); 237 238 double pX0, pY0; 239 ParFactor (&pX0, &pY0, R[i], D[i], T[i]); 240 241 double t0 = (T[i] - Tmean)/365.25; 242 243 double Xpmp = fit.Ro + fit.uR*t0 + fit.p*pX0; 244 double Ypmp = fit.Do + fit.uD*t0 + fit.p*pY0; 245 double Xplx = fit.Ro + fit.uR*t0; 246 double Yplx = fit.Do + fit.uD*t0; 247 248 dRresPMP->elements.Flt[i] = x0 - Xpmp; 249 dDresPMP->elements.Flt[i] = y0 - Ypmp; 250 dRresPLX->elements.Flt[i] = x0 - Xplx; 251 dDresPLX->elements.Flt[i] = y0 - Yplx; 252 } 229 253 230 254 // fprintf (stderr, "Roff, Doff: %f, %f; dRo, dDo: %f, %f\n", fit.Ro, fit.Do, fit.dRo, fit.dDo); -
trunk/Ohana/src/opihi/cmd.astro/spex1dgas.c
r33662 r39926 108 108 IDList = NULL; 109 109 XoList = NULL; 110 {111 // init random numbers112 long A, B;113 A = time(NULL);114 for (B = 0; A == time(NULL); B++);115 srand48(B);116 }117 110 111 // srand48() is called by startup.c 112 118 113 if (argc != 11) goto usage; 119 114 -
trunk/Ohana/src/opihi/cmd.astro/spex2dgas.c
r33662 r39926 120 120 float XoMax, YoMax; 121 121 122 { 123 // init random numbers 124 long A, B; 125 A = time(NULL); 126 for (B = 0; A == time(NULL); B++); 127 srand48(B); 128 } 129 122 // srand48() is called by startup.c 123 130 124 if (argc != 9) goto usage; 131 125 -
trunk/Ohana/src/opihi/cmd.astro/spexseq.c
r39457 r39926 90 90 int Nobject = 0; 91 91 92 {93 // init random numbers94 long A, B;95 A = time(NULL);96 for (B = 0; A == time(NULL); B++);97 srand48(B);98 }99 100 92 if (argc != 6) goto usage; 93 94 // srand48() is called by startup.c 101 95 102 96 // XXX enforce matching lengths on the three vectors -
trunk/Ohana/src/opihi/cmd.data/Makefile
r39638 r39926 124 124 $(SRC)/resize.$(ARCH).o \ 125 125 $(SRC)/relocate.$(ARCH).o \ 126 $(SRC)/rndseed.$(ARCH).o \ 126 127 $(SRC)/roll.$(ARCH).o \ 127 128 $(SRC)/rotate.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r39638 r39926 113 113 int reindex PROTO((int, char **)); 114 114 int relocate PROTO((int, char **)); 115 int rndseed PROTO((int, char **)); 115 116 int roll PROTO((int, char **)); 116 117 int rotate PROTO((int, char **)); … … 293 294 {1, "relocate", relocate, "set graphics/image window position"}, 294 295 {1, "roll", roll, "roll image to new start point"}, 296 {1, "rndseed", rndseed, "set the pseudo-random seed"}, 295 297 {1, "rotate", rotate, "rotate image"}, 296 298 {1, "save", save, "save an SAOimage style image overlay"}, -
trunk/Ohana/src/opihi/cmd.data/match2d.c
r36084 r39926 1 1 # include "data.h" 2 2 3 int find_matches2d (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2 );3 int find_matches2d (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2, Vector *radiusMatch); 4 4 int find_matches2d_closest (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index); 5 6 int find_matches2d_sphere (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2, Vector *radiusMatch); 7 int find_matches2d_sphere_closest (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index); 5 8 6 9 // match2d (X1) (Y1) (X2) (Y2) (Radius) [-index1 (index1)] [-index2 (index2)] [-nomatch1 nomatch1] [-nomatch2 nomatch2] … … 23 26 } 24 27 28 int SPHERE_DISTANCE = FALSE; 29 if ((N = get_argument (argc, argv, "-sphere"))) { 30 remove_argument (N, &argc, argv); 31 SPHERE_DISTANCE = TRUE; 32 } 33 if ((N = get_argument (argc, argv, "-sky"))) { 34 remove_argument (N, &argc, argv); 35 SPHERE_DISTANCE = TRUE; 36 } 37 25 38 if ((N = get_argument (argc, argv, "-index1"))) { 26 39 remove_argument (N, &argc, argv); … … 37 50 } else { 38 51 if ((index2 = SelectVector ("index2", ANYVECTOR, TRUE)) == NULL) return (FALSE); 52 } 53 54 55 Vector *radiusMatch = NULL; 56 if ((N = get_argument (argc, argv, "-radius"))) { 57 if (CLOSEST) { 58 gprint (GP_ERR, "error: -radius and -closest are currently incompatible\n"); 59 return (FALSE); 60 } 61 remove_argument (N, &argc, argv); 62 if ((radiusMatch = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE); 63 remove_argument (N, &argc, argv); 39 64 } 40 65 … … 84 109 } 85 110 86 if (CLOSEST) { 111 if (SPHERE_DISTANCE) { 112 if (CLOSEST) { 113 find_matches2d_sphere_closest (X1vec, Y1vec, X2vec, Y2vec, Radius, index1); 114 find_matches2d_sphere_closest (X2vec, Y2vec, X1vec, Y1vec, Radius, index2); 115 } else { 116 find_matches2d_sphere (X1vec, Y1vec, X2vec, Y2vec, Radius, index1, index2, radiusMatch); 117 } 118 } else { 119 if (CLOSEST) { 87 120 find_matches2d_closest (X1vec, Y1vec, X2vec, Y2vec, Radius, index1); 88 121 find_matches2d_closest (X2vec, Y2vec, X1vec, Y1vec, Radius, index2); 89 } else {90 find_matches2d (X1vec, Y1vec, X2vec, Y2vec, Radius, index1, index2 );91 }92 122 } else { 123 find_matches2d (X1vec, Y1vec, X2vec, Y2vec, Radius, index1, index2, radiusMatch); 124 } 125 } 93 126 return (TRUE); 94 127 … … 108 141 gprint (GP_ERR, "use 'reindex' to generate new vectors based on these index vectors\n"); 109 142 143 gprint (GP_ERR, "if -sphere or -sky is supplied, (x1,y1) and (x2,y2) are treaded as (ra,dec) or (long,lat) pairs in degrees\n"); 144 145 gprint (GP_ERR, "if -radius (vector) is supplied, the vector will be filled with the distance between the matched pairs\n"); 146 gprint (GP_ERR, " not valid with -closest\n"); 110 147 return FALSE; 111 148 } 112 149 113 150 // we are not defining a relative offset DX,DY for now 114 int find_matches2d (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2 ) {151 int find_matches2d (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2, Vector *radiusMatch) { 115 152 116 153 off_t i, j, first_j, I, J, *N1, *N2, Nmatch, NMATCH, DMATCH; … … 122 159 ResetVector (index1, OPIHI_INT, NMATCH); 123 160 ResetVector (index2, OPIHI_INT, NMATCH); 161 if (radiusMatch) ResetVector (radiusMatch, OPIHI_FLT, NMATCH); 124 162 125 163 ALLOCATE (N1, off_t, X1->Nelements); … … 154 192 index1->elements.Int[Nmatch] = I; 155 193 index2->elements.Int[Nmatch] = J; 194 if (radiusMatch) radiusMatch->elements.Flt[Nmatch] = dR; 156 195 157 196 // XXX track matches 1 and 2 with internal vector, save new nomatch index vectors … … 163 202 REALLOCATE (index1->elements.Int, opihi_int, NMATCH); 164 203 REALLOCATE (index2->elements.Int, opihi_int, NMATCH); 204 if (radiusMatch) { REALLOCATE (radiusMatch->elements.Flt, opihi_flt, NMATCH); } 165 205 } 166 206 } … … 171 211 index1->Nelements = Nmatch; 172 212 index2->Nelements = Nmatch; 213 if (radiusMatch) radiusMatch->Nelements = Nmatch; 173 214 174 215 free (N1); … … 246 287 return (TRUE); 247 288 } 289 290 double gcdist (double r1, double d1, double r2, double d2) { 291 double num,den; 292 r1 *= RAD_DEG; 293 d1 *= RAD_DEG; 294 r2 *= RAD_DEG; 295 d2 *= RAD_DEG; 296 297 num = sqrt(pow((cos(d2) * sin(r2 - r1)),2) + 298 pow((cos(d1) * sin(d2) - 299 sin(d1) * cos(d2) * cos(r2 - r1)),2)); 300 den = (sin(d1) * sin(d2) + cos(d1) * cos(d2) * cos(r2 - r1)); 301 return(atan2(num,den) * (180 / M_PI)); 302 } 303 304 typedef struct { 305 double sD; 306 double cD; 307 double sR; 308 double cR; 309 } Match2D_PreCalc; 310 311 double gcdist_PreCalc_v0 (Match2D_PreCalc *p1, Match2D_PreCalc *p2) { 312 double num,den; 313 314 num = sqrt(pow((p2->cD * (p2->sR*p1->cR - p1->sR*p2->cR)),2) + 315 pow((p1->cD * p2->sD - 316 p1->sD * p2->cD * (p2->cR*p1->cR + p2->sR*p1->sR)),2)); 317 den = (p1->sD * p2->sD + p1->cD * p2->cD * (p2->cR*p1->cR + p2->sR*p1->sR)); 318 return(atan2(num,den) * (180 / M_PI)); 319 } 320 321 // we are not defining a relative offset DX,DY for now 322 double gcdist_PreCalc (Match2D_PreCalc *p1, Match2D_PreCalc *p2) { 323 double num,den; 324 325 // double Qd = p1->sD * p1->cD * p2->sD * p2->cD; 326 // double Qr = p1->sR * p1->cR * p2->sR * p2->cR; 327 328 // double Xa 329 // = SQ(p2->cD * p1->cR * p2->sR) 330 // + SQ(p2->cD * p1->sR * p2->cR) - 331 // - 2 * SQ(p2->cD) * Qr; 332 333 double cdR = (p2->cR*p1->cR + p2->sR*p1->sR); 334 335 double Xa = SQ(p2->cD * p2->sR * p1->cR - p2->cD * p1->sR * p2->cR); 336 double Xb = SQ(p1->cD * p2->sD - p1->sD * p2->cD * cdR); 337 338 num = sqrt(Xa + Xb); 339 den = (p1->sD * p2->sD + p1->cD * p2->cD * cdR); 340 return(atan2(num,den) * (180 / M_PI)); 341 } 342 343 // we are not defining a relative offset DX,DY for now 344 int find_matches2d_sphere (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index1, Vector *index2, Vector *radiusMatch) { 345 346 off_t i, j, first_j, I, J, *N1, *N2, Nmatch, NMATCH, DMATCH; 347 double dY, dR; 348 349 NMATCH = MAX(MAX(0.05*X1->Nelements, 0.05*X2->Nelements), 1000); 350 DMATCH = NMATCH; 351 352 ResetVector (index1, OPIHI_INT, NMATCH); 353 ResetVector (index2, OPIHI_INT, NMATCH); 354 if (radiusMatch) ResetVector (radiusMatch, OPIHI_FLT, NMATCH); 355 356 ALLOCATE (N1, off_t, X1->Nelements); 357 ALLOCATE (N2, off_t, X2->Nelements); 358 359 ALLOCATE_PTR (A1, Match2D_PreCalc, X1->Nelements); 360 ALLOCATE_PTR (A2, Match2D_PreCalc, X2->Nelements); 361 362 for (i = 0; i < X1->Nelements; i++) { 363 A1[i].sR = sin(RAD_DEG*X1->elements.Flt[i]); 364 A1[i].cR = cos(RAD_DEG*X1->elements.Flt[i]); 365 A1[i].sD = sin(RAD_DEG*Y1->elements.Flt[i]); 366 A1[i].cD = cos(RAD_DEG*Y1->elements.Flt[i]); 367 N1[i] = i; 368 } 369 for (i = 0; i < X2->Nelements; i++) { 370 A2[i].sR = sin(RAD_DEG*X2->elements.Flt[i]); 371 A2[i].cR = cos(RAD_DEG*X2->elements.Flt[i]); 372 A2[i].sD = sin(RAD_DEG*Y2->elements.Flt[i]); 373 A2[i].cD = cos(RAD_DEG*Y2->elements.Flt[i]); 374 N2[i] = i; 375 } 376 377 // sort from one pole to the other 378 sort_coords_indexonly (Y1->elements.Flt, X1->elements.Flt, N1, X1->Nelements); 379 sort_coords_indexonly (Y2->elements.Flt, X2->elements.Flt, N2, X2->Nelements); 380 381 Nmatch = 0; 382 for (i = j = 0; (i < X1->Nelements) && (j < X2->Nelements);) { 383 I = N1[i]; 384 J = N2[j]; 385 386 // we can use dY as minimal requirement: if dY > Radius, we are too far apart 387 dY = Y1->elements.Flt[I] - Y2->elements.Flt[J]; 388 389 if (dY <= -1.02*Radius) { i++; continue; } 390 if (dY >= +1.02*Radius) { j++; continue; } 391 392 // look for all matches of list2() to list1(i) 393 first_j = j; 394 for (j = first_j; (dY > -1.02*Radius) && (j < X2->Nelements); j++) { 395 J = N2[j]; 396 397 dR = gcdist_PreCalc (&A1[I], &A2[J]); 398 // dR = gcdist (X1->elements.Flt[I], Y1->elements.Flt[I], X2->elements.Flt[J], Y2->elements.Flt[J]); 399 400 if (dR < Radius) { 401 index1->elements.Int[Nmatch] = I; 402 index2->elements.Int[Nmatch] = J; 403 if (radiusMatch) radiusMatch->elements.Flt[Nmatch] = dR; 404 405 // XXX track matches 1 and 2 with internal vector, save new nomatch index vectors 406 // after this loop 407 408 Nmatch ++; 409 if (Nmatch >= NMATCH) { 410 NMATCH += DMATCH; 411 REALLOCATE (index1->elements.Int, opihi_int, NMATCH); 412 REALLOCATE (index2->elements.Int, opihi_int, NMATCH); 413 if (radiusMatch) { REALLOCATE (radiusMatch->elements.Flt, opihi_flt, NMATCH); } 414 } 415 } 416 } 417 j = first_j; 418 i++; 419 } 420 index1->Nelements = Nmatch; 421 index2->Nelements = Nmatch; 422 if (radiusMatch) radiusMatch->Nelements = Nmatch; 423 424 free (A1); 425 free (A2); 426 427 free (N1); 428 free (N2); 429 430 return (TRUE); 431 } 432 433 // we are not defining a relative offset DX,DY for now 434 int find_matches2d_sphere_closest (Vector *X1, Vector *Y1, Vector *X2, Vector *Y2, double Radius, Vector *index) { 435 436 off_t i, j, Jmin, Ji, I, J, *N1, *N2; 437 double dY, dR, Rmin; 438 439 ResetVector (index, OPIHI_INT, X1->Nelements); 440 for (i = 0; i < index->Nelements; i++) { index->elements.Int[i] = -1; } 441 442 ALLOCATE (N1, off_t, X1->Nelements); 443 ALLOCATE (N2, off_t, X2->Nelements); 444 445 ALLOCATE_PTR (A1, Match2D_PreCalc, X1->Nelements); 446 ALLOCATE_PTR (A2, Match2D_PreCalc, X2->Nelements); 447 448 for (i = 0; i < X1->Nelements; i++) { 449 A1[i].sR = sin(RAD_DEG*X1->elements.Flt[i]); 450 A1[i].cR = cos(RAD_DEG*X1->elements.Flt[i]); 451 A1[i].sD = sin(RAD_DEG*Y1->elements.Flt[i]); 452 A1[i].cD = cos(RAD_DEG*Y1->elements.Flt[i]); 453 N1[i] = i; 454 } 455 for (i = 0; i < X2->Nelements; i++) { 456 A2[i].sR = sin(RAD_DEG*X2->elements.Flt[i]); 457 A2[i].cR = cos(RAD_DEG*X2->elements.Flt[i]); 458 A2[i].sD = sin(RAD_DEG*Y2->elements.Flt[i]); 459 A2[i].cD = cos(RAD_DEG*Y2->elements.Flt[i]); 460 N2[i] = i; 461 } 462 463 // sort from one pole to the other 464 sort_coords_indexonly (Y1->elements.Flt, X1->elements.Flt, N1, X1->Nelements); 465 sort_coords_indexonly (Y2->elements.Flt, X2->elements.Flt, N2, X2->Nelements); 466 467 for (i = j = 0; (i < X1->Nelements) && (j < X2->Nelements);) { 468 I = N1[i]; 469 J = N2[j]; 470 471 // we can use dY as minimal requirement: if dY > Radius, we are too far apart 472 dY = Y1->elements.Flt[I] - Y2->elements.Flt[J]; 473 474 if (dY <= -1.02*Radius) { 475 // no match in list 2 to this entry 476 index->elements.Int[I] = -1; // (probably not needed --- index is init'ed above)o 477 i++; 478 continue; 479 } 480 if (dY >= +1.02*Radius) { j++; continue; } 481 482 // look for all matches of list2() to list1(i) 483 Jmin = -1; 484 Rmin = Radius; 485 for (Ji = j; (dY > -1.02*Radius) && (Ji < X2->Nelements); Ji++) { 486 J = N2[Ji]; 487 488 dR = gcdist_PreCalc (&A1[I], &A2[J]); 489 // dR = gcdist (X1->elements.Flt[I], Y1->elements.Flt[I], X2->elements.Flt[J], Y2->elements.Flt[J]); 490 491 if (dR < Rmin) { 492 Rmin = dR; 493 Jmin = J; 494 } 495 } 496 497 498 // no match in list 2 to this entry 499 if (Jmin == -1) { 500 index->elements.Int[I] = -1; 501 i++; 502 continue; 503 } 504 index->elements.Int[I] = Jmin; 505 i++; 506 } 507 508 free (A1); 509 free (A2); 510 511 free (N1); 512 free (N2); 513 514 return (TRUE); 515 } 516 517 -
trunk/Ohana/src/opihi/cmd.data/stats-new.c
r15274 r39926 129 129 ALLOCATE (values, float, Nsample); 130 130 131 A = time(NULL); 132 for (B = 0; A == time(NULL); B++); 133 srand48(B); 131 // srand48() is called by startup.c 134 132 135 133 *buffer = (float *) matrix[0].buffer; -
trunk/Ohana/src/opihi/dvo/imbox.c
r37807 r39926 15 15 16 16 if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE; 17 18 char *xaxis = NULL; 19 if ((N = get_argument (argc, argv, "-xaxis"))) { 20 remove_argument (N, &argc, argv); 21 xaxis = strcreate (argv[N]); 22 remove_argument (N, &argc, argv); 23 } 24 char *yaxis = NULL; 25 if ((N = get_argument (argc, argv, "-yaxis"))) { 26 remove_argument (N, &argc, argv); 27 yaxis = strcreate (argv[N]); 28 remove_argument (N, &argc, argv); 29 } 17 30 18 31 SOLO_PHU = FALSE; … … 61 74 // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive 62 75 // and needs to be at least checked. 63 haveNx = gfits_scan (&header, "IMNAXIS1", "%d", 1, &Nx); 64 haveNy = gfits_scan (&header, "IMNAXIS2", "%d", 1, &Ny); 76 haveNx = FALSE; 77 if (xaxis) { 78 haveNx = gfits_scan (&header, xaxis, "%d", 1, &Nx); 79 } 80 if (!haveNx) { 81 haveNx = gfits_scan (&header, "IMNAXIS1", "%d", 1, &Nx); 82 } 83 if (!haveNx) { 84 haveNx = gfits_scan (&header, "ZNAXIS1", "%d", 1, &Nx); 85 } 86 if (!haveNx) { 87 haveNx = gfits_scan (&header, "NAXIS1", "%d", 1, &Nx); 88 } 65 89 66 if (!haveNx && !haveNy) { 67 haveNx = gfits_scan (&header, "ZNAXIS1", "%d", 1, &Nx); 90 haveNy = FALSE; 91 if (yaxis) { 92 haveNy = gfits_scan (&header, yaxis, "%d", 1, &Ny); 93 } 94 if (!haveNy) { 95 haveNy = gfits_scan (&header, "IMNAXIS2", "%d", 1, &Ny); 96 } 97 if (!haveNy) { 68 98 haveNy = gfits_scan (&header, "ZNAXIS2", "%d", 1, &Ny); 69 99 } 70 71 if (!haveNx && !haveNy) { 72 haveNx = gfits_scan (&header, "NAXIS1", "%d", 1, &Nx); 100 if (!haveNy) { 73 101 haveNy = gfits_scan (&header, "NAXIS2", "%d", 1, &Ny); 74 102 } … … 137 165 free (Xvec.elements.Flt); 138 166 free (Yvec.elements.Flt); 167 if (xaxis) free (xaxis); 168 if (yaxis) free (yaxis); 139 169 return (TRUE); 140 170 -
trunk/Ohana/src/opihi/dvo/imdense.c
r37807 r39926 4 4 int imdense (int argc, char **argv) { 5 5 6 long A, B;7 6 off_t i, Nimage; 8 7 int kapa, N, status, NPTS; … … 27 26 Rmax = graphmode.coords.crval1 + 182.0; 28 27 29 A = time(NULL); 30 for (B = 0; A == time(NULL); B++); 31 srand48(B); 28 // srand48() is called by startup.c 32 29 33 30 N = 0; -
trunk/Ohana/src/opihi/dvo/skycat.c
r39457 r39926 78 78 if (table) { 79 79 int hostID = (regions[i][0].hostFlags & DATA_USE_BCK) ? regions[i][0].backupID : regions[i][0].hostID; 80 int index = table->index[hostID]; 81 snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name); 80 if (hostID) { 81 int index = table->index[hostID]; 82 snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name); 83 } else { 84 strcpy (hostfile, skylist[0].filename[i]); 85 } 82 86 } else { 83 87 strcpy (hostfile, skylist[0].filename[i]); -
trunk/Ohana/src/opihi/lib.data/style_args.c
r13479 r39926 29 29 if ((N = get_argument (*argc, argv, "-lt"))) { 30 30 remove_argument (N, argc, argv); 31 graphmode[0].ltype = atof(argv[N]);31 graphmode[0].ltype = KapaLineTypeFromString(argv[N]); 32 32 remove_argument (N, argc, argv); 33 33 } … … 39 39 if ((N = get_argument (*argc, argv, "-pt"))) { 40 40 remove_argument (N, argc, argv); 41 graphmode[0].ptype = atof(argv[N]);41 graphmode[0].ptype = KapaPointStyleFromString(argv[N]); 42 42 remove_argument (N, argc, argv); 43 43 } … … 63 63 if ((N = get_argument (*argc, argv, "-x"))) { 64 64 remove_argument (N, argc, argv); 65 graphmode[0].style = atof(argv[N]);65 graphmode[0].style = KapaPlotStyleFromString(argv[N]); 66 66 remove_argument (N, argc, argv); 67 67 } -
trunk/Ohana/src/opihi/lib.shell/startup.c
r33963 r39926 51 51 gfits_set_unsign_mode (FALSE); 52 52 53 set_variable ("M_PI", M_PI); 54 set_variable ("M_E", M_E); 55 set_variable ("M_c", 299792459.0); // meter / second 56 set_variable ("M_c_cgs", 29979245900.0); // cm / second 57 58 set_variable ("M_h", 6.62607004e-34); // meter^2 kg / second (J s) 59 set_variable ("M_h_cgs", 6.62607004e-27); // erg s 60 61 set_variable ("M_kB", 1.38064853e-23); // J / K 62 set_variable ("M_kB_cgs", 1.38064853e-16); // erg / K 63 53 64 /* check history file permission */ 54 65 { -
trunk/Ohana/src/photdbc/src/make_subcatalog.c
r38441 r39926 7 7 int found; 8 8 off_t i, j, k, offset; 9 off_t N AVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt;9 off_t Nm, Nsecfilt; 10 10 double mag, minMag, minSigma; 11 11 int keep, *secKeep; … … 27 27 28 28 /* we are moving only the subset of measurements from catalog[0] to subcatalog[0] */ 29 NAVERAGE = 50; 30 NMEASURE = 1000; 31 Nmeasure = Naverage = 0; 29 off_t NAVERAGE = 50; off_t Naverage = 0; 30 off_t NMEASURE = 1000; off_t Nmeasure = 0; 31 off_t NLENSING = 1000; off_t Nlensing = 0; 32 off_t NLENSOBJ = 1000; off_t Nlensobj = 0; 33 off_t NSTARPAR = 1000; off_t Nstarpar = 0; 34 off_t NGALPHOT = 1000; off_t Ngalphot = 0; 35 32 36 REALLOCATE (subcatalog[0].average, Average, NAVERAGE); 33 37 REALLOCATE (subcatalog[0].secfilt, SecFilt, NAVERAGE*Nsecfilt); 34 38 REALLOCATE (subcatalog[0].measure, Measure, NMEASURE); 39 REALLOCATE (subcatalog[0].lensing, Lensing, NLENSING); 40 REALLOCATE (subcatalog[0].lensobj, Lensobj, NLENSOBJ); 41 REALLOCATE (subcatalog[0].starpar, StarPar, NSTARPAR); 42 REALLOCATE (subcatalog[0].galphot, GalPhot, NGALPHOT); 35 43 36 44 for (i = 0; i < catalog[0].Naverage; i++) { … … 39 47 // XXX: temporary check make sure that this object belongs in this region 40 48 // used to fix the pole area in the reference catalog 41 {49 if (0) { 42 50 double R = catalog[0].average[i].R; 43 51 double D = catalog[0].average[i].D; … … 177 185 subcatalog[0].average[Naverage].Nmissing = 0; 178 186 subcatalog[0].average[Naverage].Nmeasure = Nm; 187 188 // **** lensing 189 Nm = 0; 190 subcatalog[0].average[Naverage].lensingOffset = Nlensing; 191 for (j = 0; j < catalog[0].average[i].Nlensing; j++) { 192 193 offset = catalog[0].average[i].lensingOffset + j; 194 195 subcatalog[0].lensing[Nlensing] = catalog[0].lensing[offset]; 196 subcatalog[0].lensing[Nlensing].averef = Naverage; 197 198 Nlensing ++; 199 Nm ++; 200 if (Nlensing == NLENSING) { 201 NLENSING += 1000; 202 REALLOCATE (subcatalog[0].lensing, Lensing, NLENSING); 203 } 204 } 205 subcatalog[0].average[Naverage].Nlensing = Nm; 206 207 // **** lensobj 208 Nm = 0; 209 subcatalog[0].average[Naverage].lensobjOffset = Nlensobj; 210 for (j = 0; j < catalog[0].average[i].Nlensobj; j++) { 211 212 offset = catalog[0].average[i].lensobjOffset + j; 213 214 subcatalog[0].lensobj[Nlensobj] = catalog[0].lensobj[offset]; 215 216 Nlensobj ++; 217 Nm ++; 218 if (Nlensobj == NLENSOBJ) { 219 NLENSOBJ += 1000; 220 REALLOCATE (subcatalog[0].lensobj, Lensobj, NLENSOBJ); 221 } 222 } 223 subcatalog[0].average[Naverage].Nlensobj = Nm; 224 225 // **** starpar 226 Nm = 0; 227 subcatalog[0].average[Naverage].starparOffset = Nstarpar; 228 for (j = 0; j < catalog[0].average[i].Nstarpar; j++) { 229 230 offset = catalog[0].average[i].starparOffset + j; 231 232 subcatalog[0].starpar[Nstarpar] = catalog[0].starpar[offset]; 233 subcatalog[0].starpar[Nstarpar].averef = Naverage; 234 235 Nstarpar ++; 236 Nm ++; 237 if (Nstarpar == NSTARPAR) { 238 NSTARPAR += 1000; 239 REALLOCATE (subcatalog[0].starpar, StarPar, NSTARPAR); 240 } 241 } 242 subcatalog[0].average[Naverage].Nstarpar = Nm; 243 244 // **** galphot 245 Nm = 0; 246 subcatalog[0].average[Naverage].galphotOffset = Ngalphot; 247 for (j = 0; j < catalog[0].average[i].Ngalphot; j++) { 248 249 offset = catalog[0].average[i].galphotOffset + j; 250 251 subcatalog[0].galphot[Ngalphot] = catalog[0].galphot[offset]; 252 subcatalog[0].galphot[Ngalphot].averef = Naverage; 253 254 Ngalphot ++; 255 Nm ++; 256 if (Ngalphot == NGALPHOT) { 257 NGALPHOT += 1000; 258 REALLOCATE (subcatalog[0].galphot, GalPhot, NGALPHOT); 259 } 260 } 261 subcatalog[0].average[Naverage].Ngalphot = Nm; 262 179 263 Naverage ++; 180 264 if (Naverage == NAVERAGE) { … … 187 271 REALLOCATE (subcatalog[0].measure, Measure, MAX (Nmeasure, 1)); 188 272 REALLOCATE (subcatalog[0].secfilt, SecFilt, Nsecfilt*MAX (Naverage, 1)); 273 REALLOCATE (subcatalog[0].lensing, Lensing, MAX (Nlensing, 1)); 274 REALLOCATE (subcatalog[0].lensobj, Lensobj, MAX (Nlensobj, 1)); 275 REALLOCATE (subcatalog[0].starpar, StarPar, MAX (Nstarpar, 1)); 276 REALLOCATE (subcatalog[0].galphot, GalPhot, MAX (Ngalphot, 1)); 277 189 278 subcatalog[0].Naverage = Naverage; 190 279 subcatalog[0].Nmeasure = Nmeasure; 191 280 subcatalog[0].Nsecfilt = Nsecfilt; 281 subcatalog[0].Nlensing = Nlensing; 282 subcatalog[0].Nlensobj = Nlensobj; 283 subcatalog[0].Nstarpar = Nstarpar; 284 subcatalog[0].Ngalphot = Ngalphot; 285 192 286 subcatalog[0].Nsecfilt_mem = Naverage * Nsecfilt; 193 287 -
trunk/Ohana/src/photdbc/src/photdbc_catalogs.c
r38986 r39926 26 26 incatalog.filename = hostID ? hostfile : skylist[0].filename[i]; 27 27 incatalog.Nsecfilt = GetPhotcodeNsecfilt (); 28 incatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT; 28 29 incatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT; 30 incatalog.catflags |= DVO_LOAD_MEASURE | DVO_LOAD_MISSING; 31 incatalog.catflags |= DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ; 32 incatalog.catflags |= DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT; 29 33 30 34 // an error exit status here is a significant error … … 57 61 outcatalog.catcompress = CATCOMPRESS ? dvo_catalog_catcompress (CATCOMPRESS) : incatalog.catcompress; // set the default catcompress from config data 58 62 outcatalog.Nsecfilt = incatalog.Nsecfilt; // inherit from the incatalog 59 outcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 63 64 outcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT; 65 outcatalog.catflags |= DVO_LOAD_MEASURE | DVO_LOAD_MISSING; 66 outcatalog.catflags |= DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ; 67 outcatalog.catflags |= DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT; 60 68 61 69 // output catalogs always represent the same skyregions as the input catalogs -
trunk/Ohana/src/relastro/include/relastro.h
r39693 r39926 33 33 typedef enum {OP_NONE, OP_IMAGES, OP_HIGH_SPEED, OP_MERGE_SOURCE, OP_UPDATE_OBJECTS, OP_UPDATE_OFFSETS, OP_LOAD_OBJECTS, OP_HPM, OP_PARALLEL_REGIONS, OP_PARALLEL_IMAGES, OP_REPAIR_STACKS, OP_REPAIR_WARPS, OP_REPAIR_OBJECT_ID} RelastroOp; 34 34 35 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS} FitTarget;35 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, SET_CHIPS, TARGET_MOSAICS} FitTarget; 36 36 37 37 typedef enum { … … 144 144 int Nfit; 145 145 int converged; 146 int useWeight; 147 146 148 } FitAstromResult; 147 149 … … 296 298 } CheckMeasureResult; 297 299 298 # define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM300 // # define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM 299 301 300 302 /* global variables set in parameter file */ … … 315 317 int PARALLEL_REGIONS_MANUAL; 316 318 char *MANUAL_UNIQUER; 319 int CATCH_UP; 317 320 318 321 int HOST_ID; … … 352 355 int VERBOSE2; 353 356 357 float TEST_SCALE; 358 char *GALAXY_MODEL; 359 354 360 int USE_FIXED_PIXCOORDS; 355 361 int USE_GALAXY_MODEL; … … 363 369 int USE_IMAGE_COORDS_FOR_REPAIR; 364 370 int USE_ALL_IMAGES; 371 int KEEP_ALL_IMAGES_RA; 365 372 int CHECK_MEASURE_TO_IMAGE; 373 374 int SKIP_PS1_CHIP; 375 int SKIP_PS1_STACK; 376 int SKIP_HSC; 377 int SKIP_CFH; 378 379 int UPDATE_PS1_STACK_MEASURE; 380 int UPDATE_PS1_CHIP_MEASURE; 381 int UPDATE_HSC_MEASURE; 382 int UPDATE_CFH_MEASURE; 383 384 int APPLY_PROPER_MOTION; 366 385 367 386 int RESET; … … 383 402 int CHIPMAP; 384 403 404 int *ChipMapLoop; 405 int *ChipOrderLoop; 406 char *ChipMapLoopStr; 407 char *ChipOrderLoopStr; 408 385 409 int N_BOOTSTRAP_SAMPLES; 386 410 … … 407 431 408 432 float *LoopWeight2MASS; 433 char *LoopWeight2MASSstr; 434 409 435 float *LoopWeightTycho; 410 char *LoopWeight2MASSstr;411 436 char *LoopWeightTychostr; 437 438 float *LoopWeightGAIA; 439 char *LoopWeightGAIAstr; 412 440 413 441 int ImagSelect; … … 433 461 434 462 FitMode FIT_MODE; 463 int USE_IRLS; 464 int ALLOW_IRLS; 435 465 436 466 RelastroOp RELASTRO_OP; … … 498 528 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 499 529 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int FULLINIT)); 500 void initImages PROTO((Image *input, off_t *line_number, off_t N ));530 void initImages PROTO((Image *input, off_t *line_number, off_t N, int isSubset)); 501 531 void freeImages PROTO((char *dbImagePtr)); 502 532 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog)); … … 744 774 int isGPC1stack (int photcode); 745 775 int isGPC1warp (int photcode); 776 int isHSCchip (int photcode); 777 int isCFHchip (int photcode); 746 778 747 779 int save_astrom_table (); -
trunk/Ohana/src/relastro/src
- Property svn:mergeinfo changed
/branches/czw_branch/20160809/Ohana/src/relastro/src (added) merged: 39719,39730-39731,39735,39738,39746-39747,39751,39761,39765-39767,39771,39783,39794-39795,39811,39918
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relastro/src/BootstrapOps.c
r39457 r39926 77 77 case FIT_RESULT_RA: 78 78 // result->Ro = median; 79 result->dRo = sigma;79 result->dRo = MAX(sigma, result->dRo); 80 80 break; 81 81 case FIT_RESULT_DEC: 82 82 // result->Do = median; 83 result->dDo = sigma;83 result->dDo = MAX(sigma, result->dDo); 84 84 break; 85 85 case FIT_RESULT_uR: 86 86 // result->uR = median; 87 result->duR = sigma;87 result->duR = MAX(sigma, result->duR); 88 88 break; 89 89 case FIT_RESULT_uD: 90 90 // result->uD = median; 91 result->duD = sigma;91 result->duD = MAX(sigma, result->duD); 92 92 break; 93 93 case FIT_RESULT_PLX: 94 94 // result->p = median; 95 result->dp = sigma;95 result->dp = MAX(sigma, result->dp); 96 96 break; 97 97 default: -
trunk/Ohana/src/relastro/src/BrightCatalog.c
r39457 r39926 353 353 /*** MeasureTiny ***/ 354 354 { 355 ohana_memcheck (1);355 // ohana_memcheck (1); 356 356 gfits_create_table_header (&theader, "BINTABLE", "MEASURE_TINY"); 357 357 358 ohana_memcheck (1);358 // ohana_memcheck (1); 359 359 360 360 gfits_define_bintable_column (&theader, "D", "RA", "ra", "degrees", 1.0, 0.0); … … 429 429 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Nmeasure); 430 430 431 fprintf (stderr, "--------------- after set_bintable RA --------------");432 ohana_memdump_file (stderr, TRUE);431 // fprintf (stderr, "--------------- after set_bintable RA --------------"); 432 // ohana_memdump_file (stderr, TRUE); 433 433 434 434 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); -
trunk/Ohana/src/relastro/src/ConfigInit.c
r39396 r39926 84 84 SetZeroPoint (25.0); 85 85 86 if (USE_GALAXY_MODEL) {87 if (!InitGalaxyModel ("FEAST-HIPPARCOS")) {88 fprintf (stderr, "failed to init galaxy model\n");89 exit (2);90 }91 }92 93 86 FreeConfigFile(); 94 87 free (config); -
trunk/Ohana/src/relastro/src/FitAstromOps.c
r39610 r39926 257 257 fit->converged = FALSE; 258 258 259 // this is an input value 260 // if true, use the IRLS modified weight 261 fit->useWeight = FALSE; 262 259 263 return; 260 264 } -
trunk/Ohana/src/relastro/src/FitChip.c
r39457 r39926 78 78 order_use = MIN(MIN(order_use, CHIPMAP), 6); // can only go up to 6th order map (can be user limited) 79 79 } else { 80 order_use = MIN( order_use, 3); // can only go up to 3rd order for polynomials80 order_use = MIN(MIN(order_use, CHIPORDER), 3); // can only go up to 3rd order for polynomials 81 81 } 82 82 … … 206 206 if (VERBOSE2) fprintf (stderr, "fit sigma: %f (%f, %f) : full: %f (%f, %f), scatter limit: %f (%d full, %d bright, %d fit, %d all) (%d %d %d %d %d)\n", dRsig, dLsig, dMsig, dRsigFull, dLsigFull, dMsigFull, dRmax, NstatFull, Nstat, fit[0].Npts, Nmatch, nMask1, nMask2, nMask3, nMask4, nMask5); 207 207 208 image[0].dXpixSys = dLsig; 209 image[0].dYpixSys = dMsig; 208 // need to convert dLsig, dMsig back to pixel scale (or up to arcsec) 209 210 float plateScale; 211 if (image[0].coords.mosaic) { 212 // NOTE: for the full pixel to sky plate scale, use this: 213 // float plateScaleX = 3600.0*image[0].coords.mosaic->cdelt1*image[0].coords.cdelt1; 214 // float plateScaleY = 3600.0*image[0].coords.mosaic->cdelt2*image[0].coords.cdelt2; 215 216 // since we are compare L,M values, just need to compensate for focal plate to sky: 217 float plateScaleX = 3600.0*fabs(image[0].coords.mosaic->cdelt1); 218 float plateScaleY = 3600.0*fabs(image[0].coords.mosaic->cdelt2); 219 plateScale = 0.5*(plateScaleX + plateScaleY); 220 } else { 221 // since we are compare L,M values, just need to compensate for arcsec vs degrees: 222 plateScale = 3600.0; 223 } 224 225 image[0].dXpixSys = plateScale*dLsig; 226 image[0].dYpixSys = plateScale*dMsig; 210 227 image[0].nFitAstrom = fit[0].Npts; 211 228 212 // fprintf (stderr, "%s %6.3f %4d %4d\n", image[0].name, image[0].refColor, Ncolor, image[0].nFitAstrom);229 if (VERBOSE2) fprintf (stderr, "%s | %6.3f %6.3f | %4d %4d | %6.3f %6.3f\n", image[0].name, image[0].refColorRed, image[0].refColorBlue, Ncolor, image[0].nFitAstrom, image[0].dXpixSys, image[0].dYpixSys); 213 230 214 231 if (fit) fit_free (fit); -
trunk/Ohana/src/relastro/src/FitPM.c
r39612 r39926 25 25 } 26 26 27 fit->useWeight = FALSE; // Ordinary Least Squares 27 28 if (!FitPM_MinChisq (fit, data, points, Npoints)) return FALSE; 28 29 if (!FitPM_SetChisq (fit, data, points, Npoints)) return FALSE; … … 47 48 48 49 // Solve OLS equation 50 fit->useWeight = FALSE; // Ordinary Least Squares 49 51 if (!FitPM_MinChisq(fit, data, points, Npoints)) { 50 52 return(FALSE); … … 69 71 70 72 // Iteratively reweight and solve 71 double sigma_hat = 0.0; // save for the error model73 // double sigma_hat = 0.0; // save for the error model 72 74 int converged = FALSE; 73 75 int iterations = 0; … … 90 92 91 93 // Solve with the new weights 94 fit->useWeight = TRUE; // Reweighted Least Squares 92 95 if (!FitPM_MinChisq(fit, data, points, Npoints)) { 93 96 … … 104 107 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 105 108 } 106 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;109 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 107 110 break; 108 111 } … … 119 122 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 120 123 } 121 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;124 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 122 125 123 126 // Check convergence … … 159 162 // NOTE EAM: in tests (fitpm.c), they seem to be too large by a factor of ~5.37 160 163 if (data->getError) { 161 double ax = 0.0, ay = 0.0; 162 double bx = 0.0, by = 0.0; 163 164 for (i = 0; i < Npoints; i++) { 165 ax += dpsi_cauchy(points[i].rx / points[i].dX); 166 ay += dpsi_cauchy(points[i].ry / points[i].dY); 167 168 bx += SQ(points[i].Wx); 169 by += SQ(points[i].Wy); 170 } 171 ax /= 1.0 * Npoints; // mean(psi_dot(r)) 172 ay /= 1.0 * Npoints; 173 bx /= 1.0 * (Npoints - data->Nterms); // mean(psi^2(r)) * (N / (N-p)) 174 by /= 1.0 * (Npoints - data->Nterms); 175 176 double lambda_x = 1.0 + (data->Nterms / Npoints) * (1 - ax) / ax; 177 double lambda_y = 1.0 + (data->Nterms / Npoints) * (1 - ay) / ay; 178 179 double sigma_robust_x = lambda_x * sqrt(bx) * sigma_hat * 2.385 / ax; 180 double sigma_robust_y = lambda_y * sqrt(by) * sigma_hat * 2.385 / ay; 181 182 // This is actually sigma^2, as that's the factor in the covariance (dumouchel 4.1) 183 double sigma_final_x = MAX(SQ(sigma_robust_x), (2 * Npoints * SQ(sigma_robust_x) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 184 double sigma_final_y = MAX(SQ(sigma_robust_y), (2 * Npoints * SQ(sigma_robust_y) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 185 186 fit[0].dRo = sqrt(data->Cov[0][0]); 187 fit[0].duR = sqrt(data->Cov[1][1]); 188 fit[0].dDo = sqrt(data->Cov[2][2]); 189 fit[0].duD = sqrt(data->Cov[3][3]); 190 191 fit[0].dRo *= sigma_final_x; 192 fit[0].duR *= sigma_final_x; 193 fit[0].dDo *= sigma_final_y; 194 fit[0].duD *= sigma_final_y; 164 FitAstromResult fitErrors; 165 FitAstromResultInit (&fitErrors); 166 fitErrors.useWeight = FALSE; 167 168 FitPM_MinChisq(&fitErrors, data, points, Npoints); 169 170 // we use the errors from a simple OLS, ignoring masked points 171 fit[0].dRo = fitErrors.dRo; 172 fit[0].duR = fitErrors.duR; 173 fit[0].dDo = fitErrors.dDo; 174 fit[0].duD = fitErrors.duD; 195 175 } 196 176 … … 212 192 Nfit ++; 213 193 214 wx = points[i].qx; 215 wy = points[i].qy; 194 if (fit->useWeight) { 195 wx = points[i].qx; 196 wy = points[i].qy; 197 } else { 198 wx = points[i].Qx; 199 wy = points[i].Qy; 200 } 216 201 217 202 Wx += wx; -
trunk/Ohana/src/relastro/src/FitPMandPar.c
r39612 r39926 25 25 } 26 26 27 fit->useWeight = FALSE; // Ordinary Least Squares 27 28 if (!FitPMandPar_MinChisq (fit, data, points, Npoints)) return FALSE; 28 29 if (!FitPMandPar_SetChisq (fit, data, points, Npoints)) return FALSE; … … 47 48 48 49 // Solve OLS equation: failure here means the chisq matrix is degenerate, give up entirely 50 fit->useWeight = FALSE; // Ordinary Least Squares 49 51 if (!FitPMandPar_MinChisq(fit, data, points, Npoints)) { 50 52 return(FALSE); … … 69 71 70 72 // Iteratively reweight and solve 71 double sigma_hat = 0.0; // save for the error model73 // double sigma_hat = 0.0; // save for the error model 72 74 int converged = FALSE; 73 75 int iterations = 0; … … 90 92 91 93 // Solve with the new weights 94 fit->useWeight = TRUE; // Reweighted Least Squares 92 95 if (!FitPMandPar_MinChisq(fit, data, points, Npoints)) { 93 96 … … 105 108 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 106 109 } 107 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;110 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 108 111 break; 109 112 } … … 120 123 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 121 124 } 122 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;125 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 123 126 124 127 // Check convergence … … 157 160 } 158 161 159 // this section calculates the formal error on the weightedfit using the covariance values160 // NOTE EAM: in tests (fitpm.c), they seem to be too large by a factor of ~5.37162 // this section calculates the formal error on the regular (unweighted) fit using the covariance values 163 // NOTE 20160929 : use only the unmasked points to calculate the error 161 164 if (data->getError) { 162 double ax = 0.0, ay = 0.0; 163 double bx = 0.0, by = 0.0; 164 165 for (i = 0; i < Npoints; i++) { 166 ax += dpsi_cauchy(points[i].rx / points[i].dX); 167 ay += dpsi_cauchy(points[i].ry / points[i].dY); 168 169 bx += SQ(points[i].Wx); 170 by += SQ(points[i].Wy); 171 } 172 ax /= 1.0 * Npoints; // mean(psi_dot(r)) 173 ay /= 1.0 * Npoints; 174 bx /= 1.0 * (Npoints - data->Nterms); // mean(psi^2(r)) * (N / (N-p)) 175 by /= 1.0 * (Npoints - data->Nterms); 176 177 double lambda_x = 1.0 + (data->Nterms / Npoints) * (1 - ax) / ax; 178 double lambda_y = 1.0 + (data->Nterms / Npoints) * (1 - ay) / ay; 179 180 double sigma_robust_x = lambda_x * sqrt(bx) * sigma_hat * 2.385 / ax; 181 double sigma_robust_y = lambda_y * sqrt(by) * sigma_hat * 2.385 / ay; 182 183 // This is actually sigma^2, as that's the factor in the covariance (dumouchel 4.1) 184 double sigma_final_x = MAX(SQ(sigma_robust_x), (2 * Npoints * SQ(sigma_robust_x) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 185 double sigma_final_y = MAX(SQ(sigma_robust_y), (2 * Npoints * SQ(sigma_robust_y) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 186 187 fit[0].dRo = sqrt(data->Cov[0][0]); 188 fit[0].duR = sqrt(data->Cov[1][1]); 189 fit[0].dDo = sqrt(data->Cov[2][2]); 190 fit[0].duD = sqrt(data->Cov[3][3]); 191 fit[0].dp = sqrt(data->Cov[4][4]); 192 193 fit[0].dRo *= sigma_final_x; 194 fit[0].duR *= sigma_final_x; 195 fit[0].dDo *= sigma_final_y; 196 fit[0].duD *= sigma_final_y; 197 fit[0].dp *= sqrt(sigma_final_x * sigma_final_y); 165 FitAstromResult fitErrors; 166 FitAstromResultInit (&fitErrors); 167 fitErrors.useWeight = FALSE; 168 169 FitPMandPar_MinChisq(&fitErrors, data, points, Npoints); 170 171 // we use the errors from a simple OLS, ignoring masked points 172 fit[0].dRo = fitErrors.dRo; 173 fit[0].duR = fitErrors.duR; 174 fit[0].dDo = fitErrors.dDo; 175 fit[0].duD = fitErrors.duD; 176 fit[0].dp = fitErrors.dp; 198 177 } 199 178 … … 219 198 Nfit ++; 220 199 221 wx = points[i].qx; 222 wy = points[i].qy; 200 if (fit->useWeight) { 201 wx = points[i].qx; 202 wy = points[i].qy; 203 } else { 204 wx = points[i].Qx; 205 wy = points[i].Qy; 206 } 223 207 224 208 Wx += wx; -
trunk/Ohana/src/relastro/src/FitPosPMfixed.c
r39612 r39926 54 54 } 55 55 56 fit->useWeight = FALSE; // Ordinary Least Squares 56 57 if (!FitPosPMfixed_MinChisq (fit, data, points, Npoints)) { 57 58 if (!FitPosPMfixed_Single (fit, points, Npoints)) return FALSE; … … 83 84 84 85 // Solve OLS equation 86 fit->useWeight = FALSE; // Ordinary Least Squares 85 87 if (!FitPosPMfixed_MinChisq(fit, data, points, Npoints)) { 86 88 return(FALSE); … … 105 107 106 108 // Iteratively reweight and solve 107 double sigma_hat = 0.0; // save for the error model109 // double sigma_hat = 0.0; // save for the error model 108 110 int converged = FALSE; 109 111 int iterations = 0; … … 126 128 127 129 // Solve with the new weights 130 fit->useWeight = TRUE; // Reweighted Least Squares 128 131 if (!FitPosPMfixed_MinChisq(fit, data, points, Npoints)) { 129 132 … … 138 141 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 139 142 } 140 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;143 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 141 144 break; 142 145 } … … 153 156 points[i].u = sqrt(SQ(points[i].rx / points[i].dX) + SQ(points[i].ry / points[i].dY)); 154 157 } 155 sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745;158 // sigma_hat = MedianAbsDeviation(points, Npoints) / 0.6745; 156 159 157 160 // Check convergence … … 193 196 // NOTE EAM: in tests (fitpm.c), they seem to be too large by a factor of ~5.37 194 197 if (data->getError) { 195 double ax = 0.0, ay = 0.0; 196 double bx = 0.0, by = 0.0; 197 198 for (i = 0; i < Npoints; i++) { 199 ax += dpsi_cauchy(points[i].rx / points[i].dX); 200 ay += dpsi_cauchy(points[i].ry / points[i].dY); 201 202 bx += SQ(points[i].Wx); 203 by += SQ(points[i].Wy); 204 } 205 ax /= 1.0 * Npoints; // mean(psi_dot(r)) 206 ay /= 1.0 * Npoints; 207 bx /= 1.0 * (Npoints - data->Nterms); // mean(psi^2(r)) * (N / (N-p)) 208 by /= 1.0 * (Npoints - data->Nterms); 209 210 double lambda_x = 1.0 + (data->Nterms / Npoints) * (1 - ax) / ax; 211 double lambda_y = 1.0 + (data->Nterms / Npoints) * (1 - ay) / ay; 212 213 double sigma_robust_x = lambda_x * sqrt(bx) * sigma_hat * 2.385 / ax; 214 double sigma_robust_y = lambda_y * sqrt(by) * sigma_hat * 2.385 / ay; 215 216 // This is actually sigma^2, as that's the factor in the covariance (dumouchel 4.1) 217 double sigma_final_x = MAX(SQ(sigma_robust_x), (2 * Npoints * SQ(sigma_robust_x) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 218 double sigma_final_y = MAX(SQ(sigma_robust_y), (2 * Npoints * SQ(sigma_robust_y) + SQ(data->Nterms * sigma_ols)) / (2 * Npoints + SQ(data->Nterms))); 219 220 fit[0].dRo = sqrt(data->Cov[0][0]); 221 fit[0].dDo = sqrt(data->Cov[1][1]); 222 223 fit[0].dRo *= sigma_final_x; 224 fit[0].dDo *= sigma_final_y; 198 FitAstromResult fitErrors; 199 FitAstromResultInit (&fitErrors); 200 fitErrors.useWeight = FALSE; 201 202 FitPosPMfixed_MinChisq(&fitErrors, data, points, Npoints); 203 204 // we use the errors from a simple OLS, ignoring masked points 205 fit[0].dRo = fitErrors.dRo; 206 fit[0].duR = fitErrors.duR; 207 fit[0].dDo = fitErrors.dDo; 208 fit[0].duD = fitErrors.duD; 209 fit[0].dp = fitErrors.dp; 225 210 } 226 211 … … 242 227 Nfit ++; 243 228 244 wx = points[i].qx; 245 wy = points[i].qy; 229 if (fit->useWeight) { 230 wx = points[i].qx; 231 wy = points[i].qy; 232 } else { 233 wx = points[i].Qx; 234 wy = points[i].Qy; 235 } 246 236 247 237 Wx += wx; -
trunk/Ohana/src/relastro/src/GetAstromError.c
r39457 r39926 48 48 if (isnan(code[0].astromErrSys)) return NAN; 49 49 50 if (measure[0].photcode == 1030) { 51 if (mode == ERROR_MODE_RA) { 52 dPobs = pow(10.0, (6.0 * measure[0].dXccd - 3.0)); // dXccd is a value in pixels 53 } 54 if (mode == ERROR_MODE_DEC) { 55 dPobs = pow(10.0, (6.0 * measure[0].dYccd - 3.0)); // dXccd is a value in pixels 56 } 57 } 58 50 59 AS = code[0].astromErrScale; 51 60 MS = code[0].astromErrMagScale; … … 69 78 // to match the 2MASS / Tycho / ICRS reference frame. As Nloop gets higher, the weight 70 79 // needs to drop to allow the ps1 measurements to drive the solution 80 int isGAIA = USE_GALAXY_MODEL && !isImage && (measure[0].photcode == 1030); 71 81 int is2MASS = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2011) && (measure[0].photcode <= 2013); 72 82 int isTycho = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2020) && (measure[0].photcode <= 2021); 83 84 int hasGAIA = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_GAIA); 73 85 int has2MASS = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_2MASS); 86 int hasTycho = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_TYCHO); 74 87 75 88 // modest hack: if the object has 2MASS or Tycho, we set this internal bit and adjust the … … 79 92 dPtotal = dPtotal / LoopWeight2MASS[Nloop]; 80 93 } 94 if (hasGAIA && LoopWeightGAIA && (Nloop >= 0)) { 95 dPtotal = dPtotal / LoopWeightGAIA[Nloop]; 96 } 97 if (hasTycho && LoopWeightTycho && (Nloop >= 0)) { 98 dPtotal = dPtotal / LoopWeightTycho[Nloop]; 99 } 100 81 101 if (is2MASS && LoopWeight2MASS && (Nloop >= 0)) { 82 102 dPtotal = dPtotal / LoopWeight2MASS[Nloop]; 103 } 104 if (isGAIA && LoopWeightGAIA && (Nloop >= 0)) { 105 dPtotal = dPtotal / LoopWeightGAIA[Nloop]; 83 106 } 84 107 if (isTycho && LoopWeightTycho && (Nloop >= 0)) { … … 120 143 // do not raise an exception, just send back the result 121 144 if (isnan(code[0].astromErrSys)) return NAN; 145 146 if (measure[0].photcode == 1030) { 147 if (mode == ERROR_MODE_RA) { 148 dPobs = pow(10.0, (6.0 * measure[0].dXccd - 3.0)); // dXccd is a value in pixels 149 } 150 if (mode == ERROR_MODE_DEC) { 151 dPobs = pow(10.0, (6.0 * measure[0].dYccd - 3.0)); // dXccd is a value in pixels 152 } 153 } 122 154 123 155 AS = code[0].astromErrScale; … … 143 175 // to match the 2MASS / Tycho / ICRS reference frame. As Nloop gets higher, the weight 144 176 // needs to drop to allow the ps1 measurements to drive the solution 177 int isGAIA = USE_GALAXY_MODEL && !isImage && (measure[0].photcode == 1030); 145 178 int is2MASS = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2011) && (measure[0].photcode <= 2013); 146 179 int isTycho = USE_GALAXY_MODEL && !isImage && (measure[0].photcode >= 2020) && (measure[0].photcode <= 2021); 180 181 int hasGAIA = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_GAIA); 147 182 int has2MASS = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_2MASS); 183 int hasTycho = USE_GALAXY_MODEL && isImage && (measure[0].dbFlags & ID_MEAS_OBJECT_HAS_TYCHO); 148 184 149 185 // modest hack: if the object has 2MASS or Tycho, we set this internal bit and adjust the … … 153 189 dPtotal = dPtotal / LoopWeight2MASS[Nloop]; 154 190 } 191 if (hasGAIA && LoopWeightGAIA && (Nloop >= 0)) { 192 dPtotal = dPtotal / LoopWeightGAIA[Nloop]; 193 } 194 if (hasTycho && LoopWeightTycho && (Nloop >= 0)) { 195 dPtotal = dPtotal / LoopWeightTycho[Nloop]; 196 } 197 155 198 if (is2MASS && LoopWeight2MASS) { 156 199 dPtotal = dPtotal / LoopWeight2MASS[Nloop]; 200 } 201 if (isGAIA && LoopWeightGAIA && (Nloop >= 0)) { 202 dPtotal = dPtotal / LoopWeightGAIA[Nloop]; 157 203 } 158 204 if (isTycho && LoopWeightTycho) { -
trunk/Ohana/src/relastro/src/ImageOps.c
r39580 r39926 6 6 static Image *image; // list of available images 7 7 static off_t Nimage; // number of available images 8 static int isImageSubset; 8 9 9 10 // if we read only a subset of the rows from the Image FITS, LineNumber tells us to which row … … 78 79 } 79 80 80 void initImages (Image *input, off_t *line_number, off_t N ) {81 void initImages (Image *input, off_t *line_number, off_t N, int isSubset) { 81 82 82 83 off_t i; 83 84 85 isImageSubset = isSubset; 84 86 image = input; 85 87 LineNumber = line_number; … … 136 138 // we call gfits_db_free as well as this function. sometimes those point at the same 137 139 // memory location, in which case we should only do the free once. 138 if (( void *) dbImagePtr != (void *) image) free (image);140 if (((void *) dbImagePtr != (void *) image) && isImageSubset) free (image); 139 141 free_astrom_table(); 140 142 } … … 793 795 ref[i].D = catalog[c].average[n].D; 794 796 797 int XVERB = FALSE; 798 XVERB |= (catalog[c].average[n].objID == OBJ_ID_SRC) && (catalog[c].average[n].catID == CAT_ID_SRC); 799 XVERB |= (catalog[c].average[n].objID == OBJ_ID_DST) && (catalog[c].average[n].catID == CAT_ID_DST); 800 if (XVERB) { 801 fprintf (stderr, "found test object\n"); 802 } 803 795 804 // if we are applying the galaxy model, move the reference position... 796 if ( USE_GALAXY_MODEL) {805 if (APPLY_PROPER_MOTION) { 797 806 // apply proper-motion from average position to measure epoch: 798 807 float dTime = (measure[0].t - catalog[c].average[n].Tmean) / (86400*365.25) ; // time relative to Tmean in years … … 934 943 } 935 944 936 # if (0)937 /** lifted from relphot/StarOps.clean_measures */938 void FlagOutliers2D(Catalog *catalog);939 940 // operates on Full values (not tiny)941 void FlagOutliers (Catalog *catalog) {942 943 // XXX FlagOutliers is now just using FlagOutliers2D944 FlagOutliers2D(catalog);945 return;946 947 int Ndel, Nave;948 off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;949 double Ns, theta, x, y;950 double *R, *D, *dR, *dD;951 StatType statsR, statsD;952 953 Nsecfilt = GetPhotcodeNsecfilt();954 assert(catalog[0].Nsecfilt == Nsecfilt);955 956 if (VERBOSE2) fprintf (stderr, "marking poor measures\n");957 Nmax = 0;958 for (i = 0; i < catalog[0].Naverage; i++) {959 Nmax = MAX (Nmax, catalog[0].average[i].Nmeasure);960 }961 962 ALLOCATE (R, double, Nmax);963 ALLOCATE (D, double, Nmax);964 ALLOCATE (dR, double, Nmax);965 ALLOCATE (dD, double, Nmax);966 967 /* it makes no sense to mark 3-sigma outliers with <5 measurements */968 TOOFEW = MAX (5, SRC_MEAS_TOOFEW);969 970 Ns = CLIP_THRESH;971 Ndel = Nave = 0;972 973 /* loop over each object in the catalog */974 for (j = 0; j < catalog[0].Naverage; j++) {975 976 // pointer to this set of measurements977 m = catalog[0].average[j].measureOffset;978 Measure *measure = &catalog[0].measure[m];979 980 /* accumulate list of valid measurements */981 N = 0;982 for (k = 0; k < catalog[0].average[j].Nmeasure; k++) {983 // skip measurements based on user selected criteria984 if (!MeasFilterTest(&measure[k], FALSE)) continue;985 R[N] = measure[k].R;986 D[N] = measure[k].D;987 dR[N] = GetAstromError (&measure[k], ERROR_MODE_RA);988 dD[N] = GetAstromError (&measure[k], ERROR_MODE_DEC);989 if (isnan(R[N]) || isnan(D[N])) continue;990 N++;991 }992 if (N <= TOOFEW) continue;993 994 /* 3-sigma clip based on stats of inner 50% */995 initstats ("MEAN");996 liststats (R, dR, N, &statsR);997 liststats (D, dD, N, &statsD);998 999 statsR.sigma = MAX (MIN_ERROR, statsR.sigma);1000 statsD.sigma = MAX (MIN_ERROR, statsD.sigma);1001 1002 /* compare per-object distance to this standard deviation, and flag outliers*/1003 N = 0;1004 for (k = 0; k < catalog[0].average[j].Nmeasure; k++) {1005 // reset flag on each invocation1006 measure[k].dbFlags &= ~ID_MEAS_POOR_ASTROM;1007 1008 // skip measurements based on user selected criteria1009 if (!MeasFilterTest(&measure[k], FALSE)) continue;1010 1011 x = measure[k].R - statsR.median;1012 y = measure[k].D - statsD.median;1013 theta = atan2(y,x);1014 if ((x*x + y*y) > (SQR(statsR.sigma * Ns * cos(theta)) +1015 SQR(statsD.sigma * Ns * sin(theta)))) {1016 measure[k].dbFlags |= ID_MEAS_POOR_ASTROM;1017 Ndel++;1018 }1019 N++;1020 Nave ++;1021 }1022 1023 // examine results1024 // relastroVisualPlotOutliers(catalog, catalog[0].average[j].measureOffset, catalog[0].average[j].Nmeasure, statsR, statsD, Ns);1025 }1026 1027 if (VERBOSE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave);1028 free (R);1029 free (dR);1030 free (D);1031 free (dD);1032 }1033 1034 1035 /** an alternative outlier rejection scheme */1036 void FlagOutliers2D (Catalog *catalog) {1037 1038 int Ndel, Nave;1039 off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;1040 double *index;1041 double Ns, theta, x, y;1042 double *R, *D, *dR, *dD, *d2;1043 StatType statsR, statsD;1044 1045 // XXX we are not going to use this for now1046 return;1047 1048 Nsecfilt = GetPhotcodeNsecfilt();1049 assert(catalog[0].Nsecfilt == Nsecfilt);1050 1051 if (VERBOSE2) fprintf (stderr, "marking poor measures\n");1052 Nmax = 0;1053 for (i = 0; i < catalog[0].Naverage; i++) {1054 Nmax = MAX (Nmax, catalog[0].average[i].Nmeasure);1055 }1056 1057 ALLOCATE (R, double, Nmax);1058 ALLOCATE (D, double, Nmax);1059 ALLOCATE (dR, double, Nmax);1060 ALLOCATE (dD, double, Nmax);1061 ALLOCATE (d2, double, Nmax);1062 ALLOCATE (index, double, Nmax);1063 1064 /* it makes no sense to mark 3-sigma outliers with <5 measurements */1065 TOOFEW = MAX (5, SRC_MEAS_TOOFEW);1066 1067 Ns = CLIP_THRESH;1068 Ndel = Nave = 0;1069 1070 /* loop over each object in the catalog */1071 for (j = 0; j < catalog[0].Naverage; j++) {1072 1073 // pointer to this set of measurements1074 m = catalog[0].average[j].measureOffset;1075 Measure *measure = &catalog[0].measure[m];1076 1077 /* accumulate list of valid measurements */1078 N = 0;1079 for (k = 0; k < catalog[0].average[j].Nmeasure; k++) {1080 1081 // reset flag on each invocation1082 measure[k].dbFlags &= ~ID_MEAS_POOR_ASTROM;1083 1084 // skip measurements based on user selected criteria1085 if (!MeasFilterTest(&measure[k], FALSE)) continue;1086 R[N] = measure[k].R;1087 D[N] = measure[k].D;1088 dR[N] = GetAstromError(&measure[k], ERROR_MODE_RA);1089 dD[N] = GetAstromError(&measure[k], ERROR_MODE_DEC);1090 if (isnan(R[N]) || isnan(D[N])) continue;1091 N++;1092 }1093 if (N <= TOOFEW) continue;1094 1095 /* calculate mean of all points*/1096 initstats ("MEAN");1097 liststats (R, dR, N, &statsR);1098 liststats (D, dD, N, &statsD);1099 statsR.sigma = MAX (MIN_ERROR, statsR.sigma);1100 statsD.sigma = MAX (MIN_ERROR, statsD.sigma);1101 1102 /* calculate deviations of all points*/1103 N = 0;1104 for (k = 0; k < catalog[0].average[j].Nmeasure; k++) {1105 // skip bad measurements1106 if (!MeasFilterTest(&measure[k], FALSE)) continue;1107 x = measure[k].R - statsR.median;1108 y = measure[k].D - statsD.median;1109 theta = atan2(y,x);1110 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) +1111 SQR(statsD.sigma * Ns * sin(theta)));1112 index[N] = k;1113 N++;1114 }1115 1116 // sort d21117 dsortpair(d2, index, N);1118 N = (N/2 > (N-1)) ? N/2 : N-1;1119 1120 // recalculate image center, sigma based on closest 50% of points1121 for (k = 0; k < N; k++) {1122 off_t ind = (off_t) index[k];1123 R[k] = measure[ind].R;1124 D[k] = measure[ind].D;1125 dR[k] = GetAstromError(&measure[ind], ERROR_MODE_RA);1126 dD[k] = GetAstromError(&measure[ind], ERROR_MODE_DEC);1127 }1128 liststats (R, dR, N, &statsR);1129 liststats (D, dD, N, &statsD);1130 statsR.sigma = MAX (MIN_ERROR, statsR.sigma);1131 statsD.sigma = MAX (MIN_ERROR, statsD.sigma);1132 1133 // use these new statistics to flag outliers1134 N = 0;1135 for (k = 0; k < catalog[0].average[j].Nmeasure; k++) {1136 //skip bad measurements1137 if (!MeasFilterTest(&measure[k], FALSE)) continue;1138 x = measure[k].R - statsR.median;1139 y = measure[k].D - statsD.median;1140 theta = atan2(y,x);1141 d2[N] = (x*x + y*y) / (SQR(statsR.sigma * Ns * cos(theta)) +1142 SQR(statsD.sigma * Ns * sin(theta)));1143 if ((d2[N]) > 1) {1144 measure[k].dbFlags |= ID_MEAS_POOR_ASTROM;1145 Ndel ++;1146 }1147 N++;1148 Nave++;1149 } // done rejecting outliers1150 1151 // examine results1152 // relastroVisualPlotOutliers(catalog, catalog[0].average[j].measureOffset, catalog[0].average[j].Nmeasure, statsR, statsD, Ns);1153 1154 } // done looping over objects1155 1156 if (VERBOSE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave);1157 free (R);1158 free (dR);1159 free (D);1160 free (dD);1161 free (d2);1162 free (index);1163 }1164 1165 /** Determine whether a measurement should be included in the analysis, based on supplied filter criteria */1166 // we only optionally apply the sigma limit: for object averages, this should not be used1167 int MeasFilterTestTiny(MeasureTiny *measure, int applySigmaLim) {1168 int found, k;1169 long mask;1170 PhotCode *code;1171 float mag;1172 1173 if (!finite(measure[0].R) || !finite(measure[0].D)) return FALSE;1174 if (!finite(measure[0].M)) return FALSE; //XXX is this necessary for all relastro tasks?1175 if (!finite(measure[0].dM)) return FALSE; //XXX is this necessary for all relastro tasks?1176 1177 if ((MinBadQF > 0.0) && (isGPC1chip(measure[0].photcode) || isGPC1stack(measure[0].photcode))) {1178 if (!isfinite(measure[0].psfQF)) { return FALSE; };1179 if (measure[0].psfQF < MinBadQF) { return FALSE; };1180 }1181 1182 /* select measurements by photcode, or equiv photcode, if specified */1183 if (NphotcodesKeep > 0) {1184 found = FALSE;1185 for (k = 0; (k < NphotcodesKeep) && !found; k++) {1186 if (photcodesKeep[k][0].code == measure[0].photcode) found = TRUE;1187 if (photcodesKeep[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;1188 }1189 if (!found) return FALSE;1190 }1191 1192 if (NphotcodesSkip > 0) {1193 found = FALSE;1194 for (k = 0; (k < NphotcodesSkip) && !found; k++) {1195 if (photcodesSkip[k][0].code == measure[0].photcode) found = TRUE;1196 if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;1197 }1198 if (found) return FALSE;1199 }1200 1201 /* select measurements by time */1202 if (TimeSelect) {1203 if (measure[0].t < TSTART) return FALSE;1204 if (measure[0].t > TSTOP) return FALSE;1205 }1206 1207 /* select measurements by quality */1208 if (PhotFlagSelect) {1209 if (PhotFlagBad) {1210 mask = PhotFlagBad;1211 } else {1212 code = GetPhotcodebyCode (measure[0].photcode);1213 if (!code) return FALSE;1214 mask = code[0].astromBadMask;1215 }1216 if (mask & measure[0].photFlags) return FALSE;1217 }1218 1219 /* select measurements by measurement error */1220 // this is a bit convoluted: applySigmaLim is only TRUE when this function is1221 // called by bcatalog. for UpdateObjects, it is FALSE1222 if (applySigmaLim && (SIGMA_LIM > 0) && (measure[0].dM > SIGMA_LIM)) {1223 return FALSE;1224 }1225 1226 /* select measurements by mag limit */1227 if (ImagSelect) {1228 mag = PhotInstTiny (measure, MAG_CLASS_PSF);1229 if (mag < ImagMin || mag > ImagMax) return FALSE;1230 }1231 1232 return TRUE;1233 }1234 1235 # define SUPER_VERBOSE 01236 1237 /** Determine whether a measurement should be included in the analysis, based on supplied filter criteria */1238 // we only optionally apply the sigma limit: for object averages, this should not be used (should it?)1239 int MeasFilterTest(Measure *measure, int applySigmaLim) {1240 int found, k;1241 long mask;1242 PhotCode *code;1243 float mag;1244 1245 if (!finite(measure[0].R) || !finite(measure[0].D)) { if (SUPER_VERBOSE) fprintf (stderr, "filter 1\n"); return FALSE; };1246 if (!finite(measure[0].M)) { if (SUPER_VERBOSE) fprintf (stderr, "filter 2\n"); return FALSE; }; //XXX is this necessary for all relastro tasks?1247 if (!finite(measure[0].dM)) { if (SUPER_VERBOSE) fprintf (stderr, "filter 3\n"); return FALSE; }; //XXX is this necessary for all relastro tasks?1248 1249 /* select measurements by photcode, or equiv photcode, if specified */1250 if (NphotcodesKeep > 0) {1251 found = FALSE;1252 for (k = 0; (k < NphotcodesKeep) && !found; k++) {1253 if (photcodesKeep[k][0].code == measure[0].photcode) found = TRUE;1254 if (photcodesKeep[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;1255 }1256 if (!found) { if (SUPER_VERBOSE) fprintf (stderr, "filter 4\n"); return FALSE; };1257 }1258 1259 if (NphotcodesSkip > 0) {1260 found = FALSE;1261 for (k = 0; (k < NphotcodesSkip) && !found; k++) {1262 if (photcodesSkip[k][0].code == measure[0].photcode) found = TRUE;1263 if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;1264 }1265 if (found) { if (SUPER_VERBOSE) fprintf (stderr, "filter 5\n"); return FALSE; };1266 }1267 1268 if ((MinBadQF > 0.0) && isGPC1chip(measure[0].photcode)) {1269 if (!isfinite(measure[0].psfQF)) { if (SUPER_VERBOSE) fprintf (stderr, "filter 6\n"); return FALSE; };1270 if (measure[0].psfQF < MinBadQF) { if (SUPER_VERBOSE) fprintf (stderr, "filter 7\n"); return FALSE; };1271 }1272 1273 /* select measurements by time */1274 if (TimeSelect) {1275 if (measure[0].t < TSTART) { if (SUPER_VERBOSE) fprintf (stderr, "filter 8\n"); return FALSE; };1276 if (measure[0].t > TSTOP) { if (SUPER_VERBOSE) fprintf (stderr, "filter 9\n"); return FALSE; };1277 }1278 1279 /* select measurements by quality */1280 if (PhotFlagSelect) {1281 if (PhotFlagBad) {1282 mask = PhotFlagBad;1283 } else {1284 code = GetPhotcodebyCode (measure[0].photcode);1285 if (!code) { if (SUPER_VERBOSE) fprintf (stderr, "filter 10\n"); return FALSE; };1286 mask = code[0].astromBadMask;1287 }1288 if (mask & measure[0].photFlags) { if (SUPER_VERBOSE) fprintf (stderr, "filter 11\n"); return FALSE; };1289 }1290 1291 /* select measurements by measurement error */1292 if (applySigmaLim && (SIGMA_LIM > 0) && (measure[0].dM > SIGMA_LIM)) {1293 { if (SUPER_VERBOSE) fprintf (stderr, "filter 12\n"); return FALSE; };1294 }1295 1296 /* select measurements by mag limit */1297 if (ImagSelect) {1298 mag = PhotInst (measure, MAG_CLASS_PSF);1299 if (mag < ImagMin || mag > ImagMax) { if (SUPER_VERBOSE) fprintf (stderr, "filter 13\n"); return FALSE; };1300 }1301 1302 return TRUE;1303 }1304 # endif -
trunk/Ohana/src/relastro/src/StarMaps.c
r39457 r39926 166 166 dLmax = dMmax = 0.0; 167 167 168 float plateScale; 169 if (images[N].coords.mosaic) { 170 // NOTE: for the full pixel to sky plate scale, use this: 171 // float plateScaleX = 3600.0*images[N].coords.mosaic->cdelt1*images[N].coords.cdelt1; 172 // float plateScaleY = 3600.0*images[N].coords.mosaic->cdelt2*images[N].coords.cdelt2; 173 174 // since we are compare L,M values, just need to compensate for focal plate to sky: 175 float plateScaleX = 3600.0*fabs(images[N].coords.mosaic->cdelt1); 176 float plateScaleY = 3600.0*fabs(images[N].coords.mosaic->cdelt2); 177 plateScale = 0.5*(plateScaleX + plateScaleY); 178 } else { 179 // since we are compare L,M values, just need to compensate for arcsec vs degrees: 180 plateScale = 3600.0; 181 } 182 168 183 for (i = 0; i < starmap[N].Npoints; i++) { 169 184 … … 171 186 XY_to_LM (&L, &M, starmap[N].points[i].X, starmap[N].points[i].Y, &images[N].coords); 172 187 173 starmap[N].points[i].dL = starmap[N].points[i].L - L;174 starmap[N].points[i].dM = starmap[N].points[i].M - M;188 starmap[N].points[i].dL = plateScale*(starmap[N].points[i].L - L); 189 starmap[N].points[i].dM = plateScale*(starmap[N].points[i].M - M); 175 190 176 191 dLmax = MAX(fabs(starmap[N].points[i].dL), dLmax); -
trunk/Ohana/src/relastro/src/UpdateChips.c
r39457 r39926 42 42 AstromErrorSetLoop (Nloop, TRUE); 43 43 44 // if ChipMapLoop or ChipOrderLoop is set use that to define the value of CHIPMAP and/or CHIPORDER this loop 45 if (ChipMapLoop) { CHIPMAP = ChipMapLoop[Nloop]; } 46 if (ChipOrderLoop) { CHIPORDER = ChipOrderLoop[Nloop]; } 47 44 48 if (NTHREADS) { 45 49 UpdateChips_threaded (catalog, Ncatalog); … … 60 64 for (i = 0; i < Nimage; i++) { 61 65 62 VERBOSE_IMAGE = !strcmp(image[i].name, "o5745g0516o.356887.cm.982631.smf[XY54]"); 66 VERBOSE = FALSE; 67 VERBOSE_IMAGE |= !strcmp(image[i].name, "o5745g0516o.356887.cm.982631.smf[XY45]"); 68 VERBOSE_IMAGE |= !strcmp(image[i].name, "o5745g0526o.356899.cm.982643.smf[XY45]"); 69 VERBOSE_IMAGE |= !strcmp(image[i].name, "o5748g0436o.358811.cm.982690.smf[XY34]"); 63 70 64 71 // XXX looks like everything below is thread safe : we can unroll this into a set of 65 72 // helper functions that grab the next available chip.... 66 73 74 // allow certain cameras to stay static 75 if (SKIP_PS1_CHIP && isGPC1chip (image[i].photcode)) { Nskip ++; mode[i] = 0; continue; } 76 if (SKIP_PS1_STACK && isGPC1stack(image[i].photcode)) { Nskip ++; mode[i] = 0; continue; } 77 if (SKIP_HSC && isHSCchip (image[i].photcode)) { Nskip ++; mode[i] = 0; continue; } 78 if (SKIP_CFH && isCFHchip (image[i].photcode)) { Nskip ++; mode[i] = 0; continue; } 79 67 80 /* skip all except WRP images */ 68 81 if (strcmp(&image[i].coords.ctype[4], "-WRP")) { … … 160 173 setImageRaw (catalog, Ncatalog, i, raw, Nraw, MODE_MOSAIC); 161 174 if (USE_GALAXY_MODEL) { 162 // XXX DEPRECATE?175 // the image calibration was calculated using a galaxy motion model 163 176 image[i].flags |= ID_IMAGE_ASTROM_GMM; 164 177 } … … 281 294 } 282 295 296 // allow certain cameras to stay static 297 if (SKIP_PS1_CHIP && isGPC1chip (image[i].photcode)) { threadinfo->Nskip ++; threadinfo->mode[i] = 0; continue; } 298 if (SKIP_PS1_STACK && isGPC1stack(image[i].photcode)) { threadinfo->Nskip ++; threadinfo->mode[i] = 0; continue; } 299 if (SKIP_HSC && isHSCchip (image[i].photcode)) { threadinfo->Nskip ++; threadinfo->mode[i] = 0; continue; } 300 if (SKIP_CFH && isCFHchip (image[i].photcode)) { threadinfo->Nskip ++; threadinfo->mode[i] = 0; continue; } 301 283 302 /* skip all except WRP images */ 284 303 if (strcmp(&image[i].coords.ctype[4], "-WRP")) { -
trunk/Ohana/src/relastro/src/UpdateMeasures.c
r39624 r39926 115 115 116 116 // only modify the chip coordinates 117 if (isGPC1chip (measureT->photcode)) { 117 if (UPDATE_PS1_STACK_MEASURE && isGPC1stack (measureT->photcode)) { 118 measureT->R = R; 119 measureT->D = D; 120 if (measureB) { 121 measureB->R = R; 122 measureB->D = D; 123 } 124 } 125 // only modify the chip coordinates 126 if (UPDATE_PS1_CHIP_MEASURE && isGPC1chip (measureT->photcode)) { 127 measureT->R = R; 128 measureT->D = D; 129 if (measureB) { 130 measureB->R = R; 131 measureB->D = D; 132 } 133 } 134 // only modify the chip coordinates 135 if (UPDATE_HSC_MEASURE && isGPC1chip (measureT->photcode)) { 136 measureT->R = R; 137 measureT->D = D; 138 if (measureB) { 139 measureB->R = R; 140 measureB->D = D; 141 } 142 } 143 // only modify the chip coordinates 144 if (UPDATE_CFH_MEASURE && isGPC1chip (measureT->photcode)) { 118 145 measureT->R = R; 119 146 measureT->D = D; -
trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c
r39693 r39926 167 167 strextend (&command, "relastro_client -update-offsets"); 168 168 strextend (&command, "-hostID %d", group->hosts[i][0].hostID); 169 strextend (&command, "-hostdir %s", group->hosts[i][0].pathname); 170 169 171 strextend (&command, "-D CATDIR %s", CATDIR); 170 strextend (&command, "-hostdir %s", group->hosts[i][0].pathname);171 172 strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 172 173 strextend (&command, "-statmode %s", STATMODE); 173 174 strextend (&command, "-minerror %f", MIN_ERROR); 174 175 176 strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 177 strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 178 175 179 if (FIT_MODE == FIT_PM_ONLY) strextend (&command, "-pm"); 176 180 if (FIT_MODE == FIT_PAR_ONLY) strextend (&command, "-par"); … … 180 184 if (VERBOSE2) strextend (&command, "-vv"); 181 185 if (RESET) strextend (&command, "-reset"); 182 if (UPDATE) strextend (&command, "-update");183 184 if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");185 186 186 187 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 187 188 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 188 189 if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");190 189 if (FlagOutlier) strextend (&command, "-clip %d", CLIP_THRESH); 191 190 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 192 191 193 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images");194 192 if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 195 196 if (REPAIR_STACKS) strextend (&command, "-repair-stacks-on-update");197 if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures");198 199 193 if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); 200 194 if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); … … 204 198 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 205 199 206 if (N_BOOTSTRAP_SAMPLES > 1) strextend (&command, "-bootstrap-samples %d", N_BOOTSTRAP_SAMPLES);207 208 200 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 209 201 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); … … 213 205 } 214 206 207 if (REPAIR_STACKS) strextend (&command, "-repair-stacks-on-update"); 208 if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures"); 209 210 if (UPDATE_PS1_STACK_MEASURE) strextend (&command, "-update-ps1-stack"); 211 if (UPDATE_PS1_CHIP_MEASURE) strextend (&command, "-update-ps1-chip"); 212 if (UPDATE_HSC_MEASURE) strextend (&command, "-update-hsc"); 213 if (UPDATE_CFH_MEASURE) strextend (&command, "-update-cfh"); 214 215 if (UPDATE) strextend (&command, "-update"); 216 if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images"); 217 if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search"); 218 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images"); 219 215 220 if (MinBadQF > 0.0) strextend (&command, "-min-bad-psfqf %f", MinBadQF); 216 221 if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset %f", MaxMeanOffset); 222 if (N_BOOTSTRAP_SAMPLES > 1) strextend (&command, "-bootstrap-samples %d", N_BOOTSTRAP_SAMPLES); 217 223 218 224 if (TimeSelect) { … … 300 306 strextend (&command, "relastro_client -update-offsets"); 301 307 strextend (&command, "-hostID %d", table->hosts[i].hostID); 308 strextend (&command, "-hostdir %s", table->hosts[i].pathname); 309 302 310 strextend (&command, "-D CATDIR %s", CATDIR); 303 strextend (&command, "-hostdir %s", table->hosts[i].pathname);304 311 strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 305 312 strextend (&command, "-statmode %s", STATMODE); 306 313 strextend (&command, "-minerror %f", MIN_ERROR); 307 314 315 strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 316 strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 317 308 318 if (FIT_MODE == FIT_PM_ONLY) strextend (&command, "-pm"); 309 319 if (FIT_MODE == FIT_PAR_ONLY) strextend (&command, "-par"); … … 313 323 if (VERBOSE2) strextend (&command, "-vv"); 314 324 if (RESET) strextend (&command, "-reset"); 315 if (UPDATE) strextend (&command, "-update");316 317 if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");318 325 319 326 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 320 327 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 321 322 if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");323 328 if (FlagOutlier) strextend (&command, "-clip %d", CLIP_THRESH); 324 329 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 325 330 326 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images");327 331 if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 328 329 if (REPAIR_STACKS) strextend (&command, "-repair-stacks-on-update");330 if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures");331 332 332 if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); 333 333 if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); … … 337 337 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 338 338 339 if (N_BOOTSTRAP_SAMPLES > 1) strextend (&command, "-bootstrap-samples %d", N_BOOTSTRAP_SAMPLES);340 341 339 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 342 340 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); … … 345 343 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 346 344 } 345 346 if (REPAIR_STACKS) strextend (&command, "-repair-stacks-on-update"); 347 if (CHECK_MEASURE_TO_IMAGE) strextend (&command, "-check-measures"); 348 349 if (UPDATE_PS1_STACK_MEASURE) strextend (&command, "-update-ps1-stack"); 350 if (UPDATE_PS1_CHIP_MEASURE) strextend (&command, "-update-ps1-chip"); 351 if (UPDATE_HSC_MEASURE) strextend (&command, "-update-hsc"); 352 if (UPDATE_CFH_MEASURE) strextend (&command, "-update-cfh"); 353 354 if (UPDATE) strextend (&command, "-update"); 355 if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images"); 356 if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search"); 357 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images"); 358 359 if (N_BOOTSTRAP_SAMPLES > 1) strextend (&command, "-bootstrap-samples %d", N_BOOTSTRAP_SAMPLES); 347 360 348 361 if (MinBadQF > 0.0) strextend (&command, "-min-bad-psfqf %f", MinBadQF); -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r39617 r39926 5 5 # define PAR_MIN_NPTS 7 6 6 # define PAR_MIN_NPTS_BOOT 6 7 # define PM_MIN_NPTS 48 # define PM_MIN_NPTS_BOOT 39 # define POS_MIN_NPTS 310 # define POS_MIN_NPTS_BOOT 27 # define PM_MIN_NPTS 5 8 # define PM_MIN_NPTS_BOOT 4 9 # define POS_MIN_NPTS 4 10 # define POS_MIN_NPTS_BOOT 4 11 11 12 12 typedef enum { 13 SELECT_MEAS_HAS_DATA = 1, 14 SELECT_MEAS_HAS_STACK = 2, 15 SELECT_MEAS_HAS_2MASS = 4, 13 SELECT_MEAS_HAS_DATA = 0x01, 14 SELECT_MEAS_HAS_STACK = 0x02, 15 SELECT_MEAS_HAS_2MASS = 0x04, 16 SELECT_MEAS_HAS_GAIA = 0x08, 17 SELECT_MEAS_HAS_TYCHO = 0x10, 16 18 } SelectMeasureStatus; 17 19 … … 181 183 if (Trange < PM_DT_MIN) { 182 184 // not enough baseline for proper motion, only set mean position 183 mode = FIT_AVERAGE;184 185 goto justPosition; 185 186 } 186 187 if (parRange < PAR_FACTOR_MIN) { 187 188 // not enough parallax factor range, skip parallax 188 mode = FIT_PM_ONLY;189 189 goto skipParallax; 190 190 } 191 191 if (fitStats->Npoints < PAR_MIN_NPTS) { 192 192 // not enough data, skip parallax 193 mode = FIT_PM_ONLY;194 193 goto skipParallax; 195 194 } 196 195 197 196 // we are going to use the IRLS analysis to calculate the mean solution and the masking 198 // then run N_BOOTSTRAP_SAMPLES to measure the errors 199 fitStats->fitdataPar->getError = !N_BOOTSTRAP_SAMPLES; 200 if (!FitPMandPar_IRLS (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 201 mode = FIT_PM_ONLY; 202 goto skipParallax; 203 } 204 205 if (N_BOOTSTRAP_SAMPLES) { 197 // then run N_BOOTSTRAP_SAMPLES to measure the errors. We first measure the OLS error, 198 // and choose the max of the OLS and bootstrap errors 199 fitStats->fitdataPar->getError = TRUE; 200 if (USE_IRLS) { 201 if (!FitPMandPar_IRLS (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 202 goto skipParallax; 203 } 204 } else { 205 if (!FitPMandPar_Basic (&fitPar, fitStats->fitdataPar, fitStats->points, fitStats->Npoints)) { 206 goto skipParallax; 207 } 208 } 209 210 // in the fits above, we have saved the formal error for the unmasked points. 211 // if we do not have enough points for bootstrap, we will keep those errors 212 if (N_BOOTSTRAP_SAMPLES && (fitPar.Nfit >= PAR_MIN_NPTS_BOOT)) { 206 213 fitStats->Nfit = 0; 207 214 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 208 if (Nnomask < PAR_MIN_NPTS_BOOT) { 209 // if we do not have enough points to assess parallax error, we cannot dothe bootstrap analysis.210 mode = FIT_PM_ONLY; 211 goto skipParallax;212 } 215 216 // if we do not have enough points to assess parallax error, skip the bootstrap analysis. 217 // (I think the test above means we never do this skip) 218 if (Nnomask < PAR_MIN_NPTS_BOOT) goto skipParallaxBootstrap; 219 213 220 for (k = 0; k < fitStats->NfitAlloc; k++) { 214 221 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); … … 216 223 fitStats->Nfit ++; 217 224 } 218 // these calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 225 226 // These calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 227 // this call expects the fitted parameters to have the formal error set: it will apply the 228 // max of the formal and bootstrap errors 219 229 BootstrapRobustStats (&fitPar, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 220 230 BootstrapRobustStats (&fitPar, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); … … 224 234 } 225 235 236 skipParallaxBootstrap: 226 237 // project Ro, Do back to RA,DEC 227 238 XY_to_RD (&fitPar.Ro, &fitPar.Do, fitPar.Ro, fitPar.Do, &fitStats->coords); … … 242 253 valid = valid && (fabs(fitPar.uD) < 4.0); 243 254 valid = valid && (fabs(fitPar.p) < 2.0); 244 if (!valid) { 245 mode = FIT_PM_ONLY; 246 } else { 255 if (valid) { 247 256 average[0].flags |= ID_OBJ_USE_PAR; 248 257 } … … 254 263 if ((mode == FIT_PM_ONLY) || (mode == FIT_PM_AND_PAR)) { 255 264 if (Trange < PM_DT_MIN) { 256 mode = FIT_AVERAGE;257 265 goto justPosition; 258 266 } 259 267 if (fitStats->Npoints < PM_MIN_NPTS) { 260 mode = FIT_AVERAGE;261 268 goto justPosition; 262 269 } 263 270 264 271 // if we have fitted (and accepted) a parallax model, get the best pm fit and chisq 265 // given the set of points (mask is respected) 266 if (average[0].flags & ID_OBJ_USE_PAR) { 272 // given the set of points (mask is respected). Alternatively, if we do not request 273 // IRLS fitting, the just use OLS fitting (skip bootstrap) 274 if ((average[0].flags & ID_OBJ_USE_PAR) || !USE_IRLS) { 267 275 if (!FitPM_Basic (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 268 276 average[0].flags |= ID_OBJ_BAD_PM; 269 277 goto justPosition; 270 278 } 271 } else { 272 fitStats->fitdataPM->getError = !N_BOOTSTRAP_SAMPLES; 273 if (!FitPM_IRLS (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 274 mode = FIT_AVERAGE; 275 goto justPosition; 276 } 277 if (N_BOOTSTRAP_SAMPLES) { 278 fitStats->Nfit = 0; 279 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 280 if (Nnomask < PM_MIN_NPTS_BOOT) { 281 mode = FIT_AVERAGE; 282 goto justPosition; 283 } 284 for (k = 0; k < fitStats->NfitAlloc; k++) { 285 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 286 if (!FitPM_Basic (&fitStats->fit[k], fitStats->fitdataPM, fitStats->sample, Nnomask)) continue; 287 fitStats->Nfit ++; 288 } 289 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 290 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); 291 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_uR); 292 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_uD); 293 } 294 } 295 279 goto skipProperMotionBootstrap; 280 } 281 282 // we are going to use the IRLS analysis to calculate the mean solution and the masking 283 // then run N_BOOTSTRAP_SAMPLES to measure the errors. We first measure the OLS error, 284 // and choose the max of the OLS and bootstrap errors 285 fitStats->fitdataPM->getError = TRUE; 286 if (!FitPM_IRLS (&fitPM, fitStats->fitdataPM, fitStats->points, fitStats->Npoints)) { 287 goto justPosition; 288 } 289 290 // in the fits above, we have saved the formal error for the unmasked points. 291 // if we do not have enough points for bootstrap, we will keep those errors 292 if (N_BOOTSTRAP_SAMPLES && (fitPM.Nfit >= PM_MIN_NPTS_BOOT)) { 293 fitStats->Nfit = 0; 294 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 295 296 // if we do not have enough points to assess p.m. error, skip the bootstrap analysis. 297 // (I think the test above means we never do this skip) 298 if (Nnomask < PM_MIN_NPTS_BOOT) goto skipProperMotionBootstrap; 299 300 for (k = 0; k < fitStats->NfitAlloc; k++) { 301 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 302 if (!FitPM_Basic (&fitStats->fit[k], fitStats->fitdataPM, fitStats->sample, Nnomask)) continue; 303 fitStats->Nfit ++; 304 } 305 306 // These calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 307 // this call expects the fitted parameters to have the formal error set: it will apply the 308 // max of the formal and bootstrap errors 309 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 310 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); 311 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_uR); 312 BootstrapRobustStats (&fitPM, fitStats->fit, fitStats->Nfit, FIT_RESULT_uD); 313 } 314 315 skipProperMotionBootstrap: 296 316 // project Ro, Do back to RA,DEC 297 317 XY_to_RD (&fitPM.Ro, &fitPM.Do, fitPM.Ro, fitPM.Do, &fitStats->coords); … … 300 320 fitStats->Npm ++; 301 321 322 // XXX a hard-wired hack... 302 323 // unless there is a clear problems (below) with the proper-motion fit or we have a parallax fit, we will use pm fit 303 324 int valid = TRUE; … … 309 330 valid = valid && (fabs(fitPM.uD) < 4.0); 310 331 if (!valid) { 311 mode = FIT_AVERAGE;312 332 average[0].flags |= ID_OBJ_BAD_PM; 313 333 } else { … … 323 343 // if we only have one point, this is silly... 324 344 345 // set the proper motion (to the galaxy model or average value, if desired; else to 0,0) 325 346 FitAstromResultSetPM (&fitPos, 1, average); 326 // fprintf (stderr, "fit 1: %f %f : %f %f\n", fitPos.Ro, fitPos.Do, fitPos.uR, fitPos.uD); 327 if (average[0].flags & (ID_OBJ_USE_PAR | ID_OBJ_USE_PM)) { 347 348 // if we already have a valid fit (pm or par), use OLS to fit the position 349 // alternatively, if we do not request IRLS, use OLS 350 // alternatively, if we do not have enough points, use OLS 351 if ((average[0].flags & (ID_OBJ_USE_PAR | ID_OBJ_USE_PM)) || (fitStats->Npoints < POS_MIN_NPTS) || !USE_IRLS) { 328 352 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 329 // if this fails, stick with the PM and/or PAR fit from above 353 // if this fails, stick with the PM and/or PAR fit from above, or use a single value 330 354 goto doneWithFit; 331 355 } 332 } else { 333 if (fitStats->Npoints < POS_MIN_NPTS) { 334 // I will not try to outlier-reject, just calculate the weighted average 335 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 336 // if we have tried this, we have not masked any points; we will find a single unmasked point below 337 goto doneWithFit; 338 } 356 // if we have not already gotten a good fit, use this fit 357 if (!(average[0].flags & (ID_OBJ_USE_PAR | ID_OBJ_USE_PM))) { 339 358 average[0].flags |= ID_OBJ_USE_AVE; 340 359 average[0].flags |= ID_OBJ_RAW_AVE; 341 goto useBasic; 342 } 343 if (!FitPosPMfixed_IRLS (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 344 // if the above fails, we need to clear the masks and try again below 345 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 346 // just calculate the weighted average 347 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 348 // if this fails, find a single unmasked point below 349 goto doneWithFit; 350 } 351 average[0].flags |= ID_OBJ_USE_AVE; 352 average[0].flags |= ID_OBJ_RAW_AVE; 353 goto useBasic; 354 } 355 // fprintf (stderr, "fit 2: %f %f : %f %f\n", fitPos.Ro, fitPos.Do, fitPos.uR, fitPos.uD); 356 if (N_BOOTSTRAP_SAMPLES) { 357 fitStats->Nfit = 0; 358 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 359 if (Nnomask < POS_MIN_NPTS_BOOT) { 360 // if the above fails, we need to clear the masks and try again below 361 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 362 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 363 // if this fails, find a single unmasked point below 364 goto doneWithFit; 365 } 366 average[0].flags |= ID_OBJ_USE_AVE; 367 average[0].flags |= ID_OBJ_RAW_AVE; 368 goto useBasic; 369 } 370 FitAstromResultSetPM (fitStats->fit, fitStats->NfitAlloc, average); 371 for (k = 0; k < fitStats->NfitAlloc; k++) { 372 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 373 if (!FitPosPMfixed_Basic (&fitStats->fit[k], fitStats->fitdataPos, fitStats->sample, Nnomask)) continue; 374 fitStats->Nfit ++; 375 } 376 BootstrapRobustStats (&fitPos, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 377 BootstrapRobustStats (&fitPos, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); 360 } 361 goto useBasic; 362 } 363 364 // try the IRLS fitting, otherwise give up and use OLS 365 if (!FitPosPMfixed_IRLS (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 366 // if the above fails, we need to clear the masks and try again below 367 FitPointsClearMasks (fitStats->points, fitStats->Npoints); 368 // just calculate the weighted average 369 if (!FitPosPMfixed_Basic (&fitPos, fitStats->fitdataPos, fitStats->points, fitStats->Npoints)) { 370 // if this fails, find a single unmasked point below 371 goto doneWithFit; 378 372 } 379 373 average[0].flags |= ID_OBJ_USE_AVE; 374 average[0].flags |= ID_OBJ_RAW_AVE; 375 goto useBasic; 376 } 377 average[0].flags |= ID_OBJ_USE_AVE; 378 379 if (N_BOOTSTRAP_SAMPLES && (fitPos.Nfit >= POS_MIN_NPTS_BOOT)) { 380 fitStats->Nfit = 0; 381 int Nnomask = BootstrapSaveUnmasked (fitStats->nomask, fitStats->points, fitStats->Npoints); 382 383 if (Nnomask < POS_MIN_NPTS_BOOT) goto useBasic; 384 385 FitAstromResultSetPM (fitStats->fit, fitStats->NfitAlloc, average); 386 for (k = 0; k < fitStats->NfitAlloc; k++) { 387 BootstrapResample (fitStats->sample, fitStats->nomask, Nnomask); 388 if (!FitPosPMfixed_Basic (&fitStats->fit[k], fitStats->fitdataPos, fitStats->sample, Nnomask)) continue; 389 fitStats->Nfit ++; 390 } 391 392 // These calls set the ERRORS on the fit parameters, not the fit values (set in IRLS above) 393 // this call expects the fitted parameters to have the formal error set: it will apply the 394 // max of the formal and bootstrap errors 395 BootstrapRobustStats (&fitPos, fitStats->fit, fitStats->Nfit, FIT_RESULT_RA); 396 BootstrapRobustStats (&fitPos, fitStats->fit, fitStats->Nfit, FIT_RESULT_DEC); 380 397 } 381 398 … … 544 561 average[0].dP = fit.dp; // parallax error in arcsec 545 562 563 546 564 average[0].ChiSqAve = fitPos.chisq; 547 565 average[0].ChiSqPM = fitPM.chisq; … … 666 684 667 685 int has2MASS = FALSE; 686 int hasGAIA = FALSE; 687 int hasTycho = FALSE; 668 688 int hasStack = FALSE; 669 689 if (stackEntry) *stackEntry = -1; … … 774 794 Npoints++; 775 795 776 if ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)) {777 has2MASS = TRUE;778 }796 hasGAIA = (measure[k].photcode == 1030); 797 has2MASS = ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)); 798 hasTycho = ((measure[k].photcode >= 2020) && (measure[k].photcode <= 2021)); 779 799 780 800 myAssert (Npoints <= fit->NpointsAlloc, "oops"); … … 796 816 measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_2MASS; 797 817 } 818 if (hasGAIA) { 819 measure[k].dbFlags |= ID_MEAS_OBJECT_HAS_GAIA; 820 } else { 821 measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_GAIA; 822 } 823 if (hasTycho) { 824 measure[k].dbFlags |= ID_MEAS_OBJECT_HAS_TYCHO; 825 } else { 826 measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_TYCHO; 827 } 798 828 } 799 829 … … 803 833 if (hasStack) status |= SELECT_MEAS_HAS_STACK; 804 834 if (has2MASS) status |= SELECT_MEAS_HAS_2MASS; 835 if (hasGAIA) status |= SELECT_MEAS_HAS_GAIA; 836 if (hasTycho) status |= SELECT_MEAS_HAS_TYCHO; 805 837 return status; 806 838 } … … 822 854 823 855 int i; 856 857 myAbort ("this should not be called anymore"); 824 858 825 859 // add up the chi square for the fit … … 852 886 int i; 853 887 854 if ( USE_GALAXY_MODEL) {888 if (APPLY_PROPER_MOTION) { 855 889 for (i = 0; i < Nfit; i++) { 856 fit[i].uR = average->uRgal; 857 fit[i].uD = average->uDgal; 890 if (USE_GALAXY_MODEL) { 891 fit[i].uR = average->uRgal; 892 fit[i].uD = average->uDgal; 893 } else { 894 fit[i].uR = average->uR; 895 fit[i].uD = average->uD; 896 } 858 897 } 859 898 } else { -
trunk/Ohana/src/relastro/src/UpdateStacks.c
r39457 r39926 3 3 // NOTE: we only measure the systematic floor of the astrometric scatter per stack, no change to the calibration 4 4 int UpdateStacks (Catalog *catalog, int Ncatalog) { 5 6 if (SKIP_PS1_STACK) return TRUE; 5 7 6 8 off_t Nimage; … … 46 48 47 49 // XXX: I need to convert dLsig, dMsig from degrees to pixels 48 dLsig *= 3600.0 / 0.25;49 dMsig *= 3600.0 / 0.25;50 dLsig *= 3600.0; 51 dMsig *= 3600.0; 50 52 51 53 image[i].dXpixSys = dLsig; -
trunk/Ohana/src/relastro/src/args.c
r39693 r39926 1 1 # include "relastro.h" 2 void usage ( void);3 void usage_client ( void);2 void usage (int argc, char **argv); 3 void usage_client (int argc, char **argv); 4 4 void usage_merge_source (void); 5 5 void usage_merge_source_id (char *name); 6 6 float *ParseLoopWeights (char *rawlist); 7 int *ParseLoopOrder (char *rawlist, int minValue); 7 8 8 9 int args (int argc, char **argv) { … … 39 40 remove_argument (N, &argc, argv); 40 41 41 if (argc != 1) usage ( );42 if (argc != 1) usage (argc, argv); 42 43 return TRUE; 43 44 } … … 76 77 remove_argument (N, &argc, argv); 77 78 CHECK_MEASURE_TO_IMAGE = TRUE; 79 } 80 81 // catch-up mode : for a re-run, allow the sync file to be ahead of the desired location: 82 CATCH_UP = FALSE; 83 if ((N = get_argument (argc, argv, "-catch-up"))) { 84 remove_argument (N, &argc, argv); 85 CATCH_UP = TRUE; 78 86 } 79 87 … … 105 113 remove_argument (N, &argc, argv); 106 114 RELASTRO_OP = OP_PARALLEL_IMAGES; 107 if (N >= argc) usage ();115 if (N >= argc) usage (argc, argv); 108 116 IMAGE_TABLE = strcreate (argv[N]); 109 117 remove_argument (N, &argc, argv); 110 if (!REGION_FILE) usage ();118 if (!REGION_FILE) usage (argc, argv); 111 119 } 112 120 … … 114 122 remove_argument (N, &argc, argv); 115 123 RELASTRO_OP = OP_IMAGES; 124 } 125 126 // used to decide if changes to the image parameters get applied to the measures 127 APPLY_OFFSETS = FALSE; 128 if ((N = get_argument (argc, argv, "-apply-offsets"))) { 129 remove_argument (N, &argc, argv); 130 APPLY_OFFSETS = TRUE; 131 } 132 133 APPLY_PROPER_MOTION = FALSE; 134 if ((N = get_argument (argc, argv, "-apply-proper-motion"))) { 135 remove_argument (N, &argc, argv); 136 APPLY_PROPER_MOTION = TRUE; 137 } 138 139 SKIP_PS1_CHIP = FALSE; 140 if ((N = get_argument (argc, argv, "-skip-ps1-chip"))) { 141 remove_argument (N, &argc, argv); 142 SKIP_PS1_CHIP = TRUE; 143 } 144 SKIP_PS1_STACK = FALSE; 145 if ((N = get_argument (argc, argv, "-skip-ps1-stack"))) { 146 remove_argument (N, &argc, argv); 147 SKIP_PS1_STACK = TRUE; 148 } 149 SKIP_HSC = FALSE; 150 if ((N = get_argument (argc, argv, "-skip-hsc"))) { 151 remove_argument (N, &argc, argv); 152 SKIP_HSC = TRUE; 153 } 154 SKIP_CFH = FALSE; 155 if ((N = get_argument (argc, argv, "-skip-cfh"))) { 156 remove_argument (N, &argc, argv); 157 SKIP_CFH = TRUE; 158 } 159 160 UPDATE_PS1_STACK_MEASURE = FALSE; 161 if ((N = get_argument (argc, argv, "-update-ps1-stack"))) { 162 remove_argument (N, &argc, argv); 163 UPDATE_PS1_STACK_MEASURE = TRUE; 164 } 165 UPDATE_PS1_CHIP_MEASURE = FALSE; 166 if ((N = get_argument (argc, argv, "-update-ps1-chip"))) { 167 remove_argument (N, &argc, argv); 168 UPDATE_PS1_CHIP_MEASURE = TRUE; 169 } 170 UPDATE_HSC_MEASURE = FALSE; 171 if ((N = get_argument (argc, argv, "-update-hsc"))) { 172 remove_argument (N, &argc, argv); 173 UPDATE_HSC_MEASURE = TRUE; 174 } 175 UPDATE_CFH_MEASURE = FALSE; 176 if ((N = get_argument (argc, argv, "-update-cfh"))) { 177 remove_argument (N, &argc, argv); 178 UPDATE_CFH_MEASURE = TRUE; 179 } 180 if (RELASTRO_OP == OP_UPDATE_OFFSETS) { 181 if (!UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) { 182 fprintf (stderr, "for -update-offsets, need to select at least one of -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n"); 183 exit (2); 184 } 185 } 186 if ((RELASTRO_OP == OP_PARALLEL_IMAGES) || (RELASTRO_OP == OP_IMAGES)) { 187 if (APPLY_OFFSETS && !UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) { 188 fprintf (stderr, "for [-images or -parallel-images] with -apply-offsets, need to select at least one of -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n"); 189 exit (2); 190 } 191 } 192 193 // for fitting objects, this is always the same as 'ALLOW_IRLS' below, but for fitting 194 // images, this is set to FALSE while doing the fit for the image parameters 195 USE_IRLS = TRUE; 196 ALLOW_IRLS = TRUE; 197 if ((N = get_argument (argc, argv, "-no-irls"))) { 198 remove_argument (N, &argc, argv); 199 USE_IRLS = FALSE; 200 ALLOW_IRLS = FALSE; 116 201 } 117 202 … … 120 205 remove_argument (N, &argc, argv); 121 206 RELASTRO_OP = OP_PARALLEL_REGIONS; 122 if (!REGION_FILE) usage ();207 if (!REGION_FILE) usage (argc, argv); 123 208 if ((N = get_argument (argc, argv, "-parallel-regions-manual"))) { 124 209 remove_argument (N, &argc, argv); … … 128 213 129 214 if ((N = get_argument (argc, argv, "-testobj1"))) { 130 if (N > argc - 3) usage ( );215 if (N > argc - 3) usage (argc, argv); 131 216 remove_argument (N, &argc, argv); 132 217 OBJ_ID_SRC = strtol(argv[N], &endptr, 0); 133 if (*endptr) usage ( );218 if (*endptr) usage (argc, argv); 134 219 remove_argument (N, &argc, argv); 135 220 CAT_ID_SRC = strtol(argv[N], &endptr, 0); 136 if (*endptr) usage ( );221 if (*endptr) usage (argc, argv); 137 222 remove_argument (N, &argc, argv); 138 223 } 139 224 140 225 if ((N = get_argument (argc, argv, "-testobj2"))) { 141 if (N > argc - 3) usage ( );226 if (N > argc - 3) usage (argc, argv); 142 227 remove_argument (N, &argc, argv); 143 228 OBJ_ID_DST = strtol(argv[N], &endptr, 0); 144 if (*endptr) usage ( );229 if (*endptr) usage (argc, argv); 145 230 remove_argument (N, &argc, argv); 146 231 CAT_ID_DST = strtol(argv[N], &endptr, 0); 147 if (*endptr) usage ( );232 if (*endptr) usage (argc, argv); 148 233 remove_argument (N, &argc, argv); 149 234 } … … 167 252 if ((N = get_argument (argc, argv, "-high-speed"))) { 168 253 // XXX include a parallax / no-parallax option 169 if (N >= argc - 4) usage ();254 if (N >= argc - 4) usage (argc, argv); 170 255 RELASTRO_OP = OP_HIGH_SPEED; 171 256 remove_argument (N, &argc, argv); … … 181 266 182 267 if ((N = get_argument (argc, argv, "-hpm"))) { 183 if (N >= argc - 2) usage ();268 if (N >= argc - 2) usage (argc, argv); 184 269 RELASTRO_OP = OP_HPM; 185 270 remove_argument (N, &argc, argv); … … 212 297 FIT_TARGET = TARGET_MOSAICS; 213 298 } 299 if ((N = get_argument (argc, argv, "-set-chips"))) { 300 remove_argument (N, &argc, argv); 301 FIT_TARGET = SET_CHIPS; 302 } 214 303 215 304 FlagOutlier = FALSE; … … 231 320 } 232 321 233 if (RELASTRO_OP == OP_NONE) usage ();234 235 if (((RELASTRO_OP == OP_IMAGES) || (RELASTRO_OP == OP_PARALLEL_REGIONS) || (RELASTRO_OP == OP_PARALLEL_IMAGES)) && (FIT_TARGET == TARGET_NONE)) usage ();322 if (RELASTRO_OP == OP_NONE) usage (argc, argv); 323 324 if (((RELASTRO_OP == OP_IMAGES) || (RELASTRO_OP == OP_PARALLEL_REGIONS) || (RELASTRO_OP == OP_PARALLEL_IMAGES)) && (FIT_TARGET == TARGET_NONE)) usage (argc, argv); 236 325 237 326 /* specify portion of the sky : allow default of all sky? */ … … 303 392 } 304 393 394 KEEP_ALL_IMAGES_RA = FALSE; 395 if ((N = get_argument (argc, argv, "-keep-all-images-ra"))) { 396 remove_argument (N, &argc, argv); 397 KEEP_ALL_IMAGES_RA = TRUE; 398 } 399 305 400 USE_BASIC_CHECK = FALSE; 306 401 if ((N = get_argument (argc, argv, "-basic-image-search"))) { … … 315 410 remove_argument (N, &argc, argv); 316 411 MaxDensityUse = TRUE; 317 }318 319 APPLY_OFFSETS = FALSE;320 if ((N = get_argument (argc, argv, "-apply-offsets"))) {321 remove_argument (N, &argc, argv);322 APPLY_OFFSETS = TRUE;323 412 } 324 413 … … 439 528 } 440 529 441 CHIPORDER = 0;442 if ((N = get_argument (argc, argv, "-chiporder"))) {443 remove_argument (N, &argc, argv);444 CHIPORDER = atoi(argv[N]);445 remove_argument (N, &argc, argv);446 }447 448 CHIPMAP = 0;449 if ((N = get_argument (argc, argv, "-chipmap"))) {450 remove_argument (N, &argc, argv);451 CHIPMAP = atoi(argv[N]);452 remove_argument (N, &argc, argv);453 454 }455 456 530 SAVEPLOT = FALSE; 457 531 PLOTSTUFF = FALSE; … … 580 654 } 581 655 656 // e.g., -chiporderloop 3,4,5 657 // NOTE: this must come after -nloop above 658 ChipOrderLoop = NULL; 659 ChipOrderLoopStr = NULL; 660 CHIPORDER = 1; 661 if ((N = get_argument (argc, argv, "-chiporder"))) { 662 remove_argument (N, &argc, argv); 663 CHIPORDER = atoi(argv[N]); 664 remove_argument (N, &argc, argv); 665 } 666 if ((N = get_argument (argc, argv, "-chiporderloop"))) { 667 remove_argument (N, &argc, argv); 668 ChipOrderLoopStr = strcreate(argv[N]); 669 ChipOrderLoop = ParseLoopOrder (argv[N], 1); 670 remove_argument (N, &argc, argv); 671 } 672 673 ChipMapLoop = NULL; 674 ChipMapLoopStr = NULL; 675 CHIPMAP = 0; 676 if ((N = get_argument (argc, argv, "-chipmap"))) { 677 remove_argument (N, &argc, argv); 678 CHIPMAP = atoi(argv[N]); 679 remove_argument (N, &argc, argv); 680 681 } 682 if ((N = get_argument (argc, argv, "-chipmaploop"))) { 683 remove_argument (N, &argc, argv); 684 ChipMapLoopStr = strcreate(argv[N]); 685 ChipMapLoop = ParseLoopOrder (argv[N], 0); 686 remove_argument (N, &argc, argv); 687 } 688 689 582 690 // e.g., -loop-weights-2mass 1000,300,300,200,200,100 583 691 // NOTE: this must come after -nloop above … … 591 699 } 592 700 LoopWeightTycho = NULL; 701 LoopWeightTychostr = NULL; 593 702 if ((N = get_argument (argc, argv, "-loop-weights-tycho"))) { 594 703 remove_argument (N, &argc, argv); … … 597 706 remove_argument (N, &argc, argv); 598 707 } 708 LoopWeightGAIA = NULL; 709 LoopWeightGAIAstr = NULL; 710 if ((N = get_argument (argc, argv, "-loop-weights-gaia"))) { 711 remove_argument (N, &argc, argv); 712 LoopWeightGAIAstr = strcreate(argv[N]); 713 LoopWeightGAIA = ParseLoopWeights (argv[N]); 714 remove_argument (N, &argc, argv); 715 } 716 717 GALAXY_MODEL = NULL; 718 if ((N = get_argument (argc, argv, "-galaxy-model"))) { 719 remove_argument (N, &argc, argv); 720 GALAXY_MODEL = strcreate(argv[N]); 721 remove_argument (N, &argc, argv); 722 } 723 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("FEAST-HIPPARCOS"); 724 725 // for testing, allow the galaxy model scale to be non-unity 726 TEST_SCALE = 1.0; 727 if ((N = get_argument (argc, argv, "-testing"))) { 728 remove_argument (N, &argc, argv); 729 TEST_SCALE = atof(argv[N]); 730 remove_argument (N, &argc, argv); 731 } 599 732 600 733 NTHREADS = 0; … … 605 738 } 606 739 607 if (argc != 1) usage ( );740 if (argc != 1) usage (argc, argv); 608 741 return TRUE; 609 742 } … … 614 747 FREE (LoopWeight2MASSstr); 615 748 FREE (LoopWeightTychostr); 749 FREE (LoopWeightGAIAstr); 750 FREE (LoopWeight2MASS); 751 FREE (LoopWeightTycho); 752 FREE (LoopWeightGAIA); 753 754 FREE (ChipMapLoop); 755 FREE (ChipMapLoopStr); 756 FREE (ChipOrderLoop); 757 FREE (ChipOrderLoopStr); 616 758 617 759 FREE (PHOTCODE_SKIP_LIST); … … 628 770 FREE (BCATALOG); 629 771 FREE (HOSTDIR); 772 FREE (GALAXY_MODEL); 630 773 631 774 // these are set in initialize … … 673 816 remove_argument (N, &argc, argv); 674 817 } 675 if (!HOST_ID) usage_client ();818 if (!HOST_ID) usage_client (argc, argv); 676 819 677 820 HOSTDIR = NULL; … … 681 824 remove_argument (N, &argc, argv); 682 825 } 683 if (!HOSTDIR) usage_client ();826 if (!HOSTDIR) usage_client (argc, argv); 684 827 685 828 if ((N = get_argument (argc, argv, "-load-objects"))) { … … 726 869 } 727 870 871 SKIP_PS1_CHIP = FALSE; 872 if ((N = get_argument (argc, argv, "-skip-ps1-chip"))) { 873 remove_argument (N, &argc, argv); 874 SKIP_PS1_CHIP = TRUE; 875 } 876 SKIP_PS1_STACK = FALSE; 877 if ((N = get_argument (argc, argv, "-skip-ps1-stack"))) { 878 remove_argument (N, &argc, argv); 879 SKIP_PS1_STACK = TRUE; 880 } 881 SKIP_HSC = FALSE; 882 if ((N = get_argument (argc, argv, "-skip-hsc"))) { 883 remove_argument (N, &argc, argv); 884 SKIP_HSC = TRUE; 885 } 886 SKIP_CFH = FALSE; 887 if ((N = get_argument (argc, argv, "-skip-cfh"))) { 888 remove_argument (N, &argc, argv); 889 SKIP_CFH = TRUE; 890 } 891 892 UPDATE_PS1_STACK_MEASURE = FALSE; 893 if ((N = get_argument (argc, argv, "-update-ps1-stack"))) { 894 remove_argument (N, &argc, argv); 895 UPDATE_PS1_STACK_MEASURE = TRUE; 896 } 897 UPDATE_PS1_CHIP_MEASURE = FALSE; 898 if ((N = get_argument (argc, argv, "-update-ps1-chip"))) { 899 remove_argument (N, &argc, argv); 900 UPDATE_PS1_CHIP_MEASURE = TRUE; 901 } 902 UPDATE_HSC_MEASURE = FALSE; 903 if ((N = get_argument (argc, argv, "-update-hsc"))) { 904 remove_argument (N, &argc, argv); 905 UPDATE_HSC_MEASURE = TRUE; 906 } 907 UPDATE_CFH_MEASURE = FALSE; 908 if ((N = get_argument (argc, argv, "-update-cfh"))) { 909 remove_argument (N, &argc, argv); 910 UPDATE_CFH_MEASURE = TRUE; 911 } 912 if (RELASTRO_OP == OP_UPDATE_OFFSETS) { 913 if (!UPDATE_PS1_STACK_MEASURE && !UPDATE_PS1_CHIP_MEASURE && !UPDATE_HSC_MEASURE && !UPDATE_CFH_MEASURE) { 914 fprintf (stderr, "for -update-offsets, need to select at least one of -update-ps1-stack, -update-ps1-chip, -update-hsc, -update-cfh\n"); 915 exit (2); 916 } 917 } 918 728 919 // check for object fitting modes 729 920 if ((N = get_argument (argc, argv, "-pm"))) { … … 742 933 if ((N = get_argument (argc, argv, "-high-speed"))) { 743 934 // XXX include a parallax / no-parallax option 744 if (N >= argc - 5) usage_client ();935 if (N >= argc - 5) usage_client (argc, argv); 745 936 RELASTRO_OP = OP_HIGH_SPEED; 746 937 remove_argument (N, &argc, argv); … … 756 947 757 948 if ((N = get_argument (argc, argv, "-hpm"))) { 758 if (N >= argc - 3) usage ();949 if (N >= argc - 3) usage_client (argc, argv); 759 950 RELASTRO_OP = OP_HPM; 760 951 remove_argument (N, &argc, argv); … … 766 957 767 958 if ((N = get_argument (argc, argv, "-testobj1"))) { 768 if (N > argc - 3) usage ();959 if (N > argc - 3) usage_client (argc, argv); 769 960 remove_argument (N, &argc, argv); 770 961 OBJ_ID_SRC = strtol(argv[N], &endptr, 0); 771 if (*endptr) usage ();962 if (*endptr) usage_client (argc, argv); 772 963 remove_argument (N, &argc, argv); 773 964 CAT_ID_SRC = strtol(argv[N], &endptr, 0); 774 if (*endptr) usage ();965 if (*endptr) usage_client (argc, argv); 775 966 remove_argument (N, &argc, argv); 776 967 } 777 968 778 969 if ((N = get_argument (argc, argv, "-testobj2"))) { 779 if (N > argc - 3) usage ();970 if (N > argc - 3) usage_client (argc, argv); 780 971 remove_argument (N, &argc, argv); 781 972 OBJ_ID_DST = strtol(argv[N], &endptr, 0); 782 if (*endptr) usage ();973 if (*endptr) usage_client (argc, argv); 783 974 remove_argument (N, &argc, argv); 784 975 CAT_ID_DST = strtol(argv[N], &endptr, 0); 785 if (*endptr) usage ();976 if (*endptr) usage_client (argc, argv); 786 977 remove_argument (N, &argc, argv); 787 978 } … … 805 996 } 806 997 807 if (RELASTRO_OP == OP_NONE) usage_client(); 998 GALAXY_MODEL = NULL; 999 if ((N = get_argument (argc, argv, "-galaxy-model"))) { 1000 remove_argument (N, &argc, argv); 1001 GALAXY_MODEL = strcreate(argv[N]); 1002 remove_argument (N, &argc, argv); 1003 } 1004 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("FEAST-HIPPARCOS"); 1005 1006 // for testing, allow the galaxy model scale to be non-unity 1007 TEST_SCALE = 1.0; 1008 if ((N = get_argument (argc, argv, "-testing"))) { 1009 remove_argument (N, &argc, argv); 1010 TEST_SCALE = atof(argv[N]); 1011 remove_argument (N, &argc, argv); 1012 } 1013 1014 if (RELASTRO_OP == OP_NONE) usage_client (argc, argv); 808 1015 809 1016 /* specify portion of the sky : allow default of all sky? */ … … 1032 1239 } 1033 1240 1034 if (argc != 1) usage_client ( );1241 if (argc != 1) usage_client (argc, argv); 1035 1242 return TRUE; 1036 1243 } … … 1049 1256 FREE(HIGH_SPEED_DIR); 1050 1257 FREE(BCATALOG); 1051 FREE (HOSTDIR); 1258 FREE(HOSTDIR); 1259 FREE(GALAXY_MODEL); 1052 1260 1053 1261 // these are set in initialize … … 1066 1274 } 1067 1275 1068 void usage ( ) {1276 void usage (int argc, char **argv) { 1069 1277 fprintf (stderr, "ERROR: USAGE: relastro -images -update-simple [options]\n"); 1070 1278 fprintf (stderr, " OR: relastro -images -update-chips [options]\n"); … … 1116 1324 fprintf (stderr, " -v\n"); 1117 1325 fprintf (stderr, " \n"); 1326 1327 fprintf (stderr, "remaining args: "); 1328 for (int i = 0; i < argc; i++) { 1329 fprintf (stderr, "%s ", argv[i]); 1330 } 1331 fprintf (stderr, "\n"); 1332 1118 1333 exit (2); 1119 1334 } 1120 1335 1121 void usage_client ( ) {1336 void usage_client (int argc, char **argv) { 1122 1337 fprintf (stderr, "ERROR: USAGE: relastro_client -load\n"); 1123 1338 fprintf (stderr, " OR: relastro_client -update-offsets\n"); … … 1150 1365 fprintf (stderr, " -v\n"); 1151 1366 fprintf (stderr, " \n"); 1367 1368 fprintf (stderr, "remaining args: "); 1369 for (int i = 0; i < argc; i++) { 1370 fprintf (stderr, "%s ", argv[i]); 1371 } 1372 fprintf (stderr, "\n"); 1373 1152 1374 exit (2); 1153 1375 } … … 1189 1411 } 1190 1412 1413 // this sets the last loops to match the last value... 1191 1414 while (Nloop < NLOOP) { 1192 1415 weights[Nloop] = weights[Nloop - 1]; 1193 1416 Nloop ++; 1194 1417 } 1418 1195 1419 return weights; 1196 1420 } 1421 1422 int *ParseLoopOrder (char *rawlist, int minValue) { 1423 1424 int *orders = NULL; 1425 ALLOCATE (orders, int, NLOOP); 1426 1427 int Nloop = 0; 1428 1429 /* parse the comma-separated list of photcodes */ 1430 char *myList = strcreate(rawlist); 1431 char *list = myList; 1432 char *entry = NULL; 1433 char *ptr = NULL; 1434 while ((Nloop < NLOOP) && ((entry = strtok_r (list, ",", &ptr)) != NULL)) { 1435 list = NULL; // pass NULL on successive strtok_r calls 1436 1437 orders[Nloop] = atoi(entry); 1438 if (orders[Nloop] < minValue) { 1439 fprintf (stderr, "order cannot be < %d: %s\n", minValue, rawlist); 1440 exit (3); 1441 } 1442 1443 Nloop ++; 1444 } 1445 free (myList); 1446 1447 if (Nloop == 0) { 1448 fprintf (stderr, "syntax error parsing orders: %s\n", rawlist); 1449 exit (3); 1450 } 1451 1452 // this sets the last loops to match the last value... 1453 while (Nloop < NLOOP) { 1454 orders[Nloop] = orders[Nloop - 1]; 1455 Nloop ++; 1456 } 1457 1458 return orders; 1459 } -
trunk/Ohana/src/relastro/src/assign_images.c
r39457 r39926 40 40 41 41 // register the image array with ImageOps.c for later getimageByID calls 42 initImages (image, NULL, Nimage );42 initImages (image, NULL, Nimage, FALSE); 43 43 44 44 if (VERBOSE) fprintf (stderr, "finding images\n"); … … 72 72 73 73 for (j = 0; j < Nimage; j++) { 74 75 // allow certain cameras to stay static 76 if (SKIP_PS1_CHIP && isGPC1chip (image[j].photcode)) continue; 77 if (SKIP_PS1_STACK && isGPC1stack(image[j].photcode)) continue; 78 if (SKIP_HSC && isHSCchip (image[j].photcode)) continue; 79 if (SKIP_CFH && isCFHchip (image[j].photcode)) continue; 74 80 75 81 /* select images by photcode, or equiv photcode, if specified */ -
trunk/Ohana/src/relastro/src/bcatalog.c
r39587 r39926 72 72 73 73 int myNskip1 = 0, myNskip2 = 0, myNskip3 = 0, myNskip4 = 0, myNskip5 = 0, myNskip6 = 0; 74 75 int NgaiaObject = 0; 74 76 75 77 /* exclude stars not in range or with too few measurements */ … … 187 189 if (isGPC1warp(catalog[0].measure[offset].photcode)) continue; 188 190 191 // allow certain cameras to stay static 192 if (SKIP_PS1_CHIP && isGPC1chip(catalog[0].measure[offset].photcode)) continue; 193 if (SKIP_PS1_STACK && isGPC1stack(catalog[0].measure[offset].photcode)) continue; 194 if (SKIP_HSC && isHSCchip(catalog[0].measure[offset].photcode)) continue; 195 if (SKIP_CFH && isCFHchip(catalog[0].measure[offset].photcode)) continue; 196 189 197 // filter objects based on user supplied criteria, including SIGMA_LIM 190 198 if (!MeasFilterTest(&catalog[0].measure[offset], TRUE)) { … … 250 258 } 251 259 260 if (catalog[0].measure[offset].photcode == 1030) { NgaiaObject ++; } 261 252 262 CopyMeasureToTiny (&subcatalog[0].measureT[Nmeasure], &catalog[0].measure[offset]); 253 263 // subcatalog[0].measure[Nmeasure] = catalog[0].measure[offset]; … … 281 291 } 282 292 } 283 fprintf (stderr, "skips: %d %d %d %d %d %d \n", myNskip1, myNskip2, myNskip3, myNskip4, myNskip5, myNskip6);293 fprintf (stderr, "skips: %d %d %d %d %d %d, Ngaia: %d\n", myNskip1, myNskip2, myNskip3, myNskip4, myNskip5, myNskip6, NgaiaObject); 284 294 REALLOCATE (subcatalog[0].average, Average, MAX (Naverage, 1)); 285 295 REALLOCATE (subcatalog[0].measureT, MeasureTiny, MAX (Nmeasure, 1)); -
trunk/Ohana/src/relastro/src/extra.c
r37261 r39926 39 39 return FALSE; 40 40 } 41 42 // for now (20160925) I need to identify HSC chips explicitly. generalize in the future 43 int isHSCchip (int photcode) { 44 45 if ((photcode >= 20000) && (photcode <= 20111)) return TRUE; // g-band 46 if ((photcode >= 21000) && (photcode <= 21111)) return TRUE; // r-band 47 if ((photcode >= 22000) && (photcode <= 22111)) return TRUE; // i-band 48 if ((photcode >= 23000) && (photcode <= 23111)) return TRUE; // z-band 49 if ((photcode >= 24000) && (photcode <= 24111)) return TRUE; // y-band 50 51 return FALSE; 52 } 53 54 // for now (20160925) I need to identify CFH chips explicitly. generalize in the future 55 int isCFHchip (int photcode) { 56 57 if ((photcode >= 100) && (photcode <= 152)) return TRUE; // g-band 58 if ((photcode >= 200) && (photcode <= 252)) return TRUE; // r-band 59 if ((photcode >= 300) && (photcode <= 352)) return TRUE; // i-band 60 if ((photcode >= 400) && (photcode <= 452)) return TRUE; // z-band 61 if ((photcode >= 500) && (photcode <= 552)) return TRUE; // y-band 62 63 return FALSE; 64 } -
trunk/Ohana/src/relastro/src/initialize.c
r39457 r39926 11 11 ConfigInit (&argc, argv); 12 12 args (argc, argv); 13 14 if (USE_GALAXY_MODEL) { 15 if (!InitGalaxyModel (GALAXY_MODEL)) { 16 fprintf (stderr, "failed to init galaxy model %s\n", GALAXY_MODEL); 17 exit (2); 18 } 19 } 13 20 14 21 if (RELASTRO_OP == OP_MERGE_SOURCE) return; -
trunk/Ohana/src/relastro/src/launch_region_hosts.c
r39457 r39926 81 81 strextend (&command, "-region-hosts %s", REGION_FILE); 82 82 strextend (&command, "-region-hostID %d", host->hostID); 83 83 84 strextend (&command, "-D CATDIR %s", CATDIR); 84 85 strextend (&command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat); 85 86 strextend (&command, "-statmode %s", STATMODE); 86 87 strextend (&command, "-minerror %f", MIN_ERROR); 87 strextend (&command, "-nloop %d", NLOOP); 88 strextend (&command, "-threads %d", NTHREADS); 88 89 strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 90 strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 91 92 strextend (&command, " -D RELASTRO_MIN_DISTANCE_MOD %f", MIN_DISTANCE_MOD); 93 strextend (&command, " -D RELASTRO_MAX_DISTANCE_MOD %f", MAX_DISTANCE_MOD); 94 strextend (&command, " -D RELASTRO_MAX_DISTANCE_MOD_ERR %f", MAX_DISTANCE_MOD_ERR); 95 96 strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL); 97 strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT); 98 99 strextend (&command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX); 100 strextend (&command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS); 101 102 strextend (&command, "-D USE_ICRF_LOCAL %d", USE_ICRF_LOCAL); 103 strextend (&command, "-D USE_ICRF_SHFIT %d", USE_ICRF_SHFIT); 104 strextend (&command, "-D USE_ICRF_POLE %d", USE_ICRF_POLE); 89 105 90 106 switch (FIT_TARGET) { … … 98 114 strextend (&command, "-update-mosaics"); 99 115 break; 116 case SET_CHIPS: 117 strextend (&command, "-set-chips"); 118 break; 100 119 case TARGET_NONE: 101 120 abort(); … … 105 124 if (VERBOSE2) strextend (&command, "-vv"); 106 125 if (RESET) strextend (&command, "-reset"); 126 127 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 128 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 129 if (FlagOutlier) strextend (&command, "-clip %d", CLIP_THRESH); 130 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 131 132 if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 133 if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); 134 if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); 135 if (PhotFlagSelect) strextend (&command, "+photflags"); 136 if (PhotFlagBad) strextend (&command, "+photflagbad %d", PhotFlagBad); 137 if (PhotFlagPoor) strextend (&command, "+photflagpoor %d", PhotFlagPoor); 138 139 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 140 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 141 } 142 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 143 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 144 } 145 146 if (TEST_SCALE != 1.0) strextend (&command, "-testing %f", TEST_SCALE); 147 148 if (SKIP_PS1_CHIP) strextend (&command, "-skip-ps1-chip"); 149 if (SKIP_PS1_STACK) strextend (&command, "-skip-ps1-stack"); 150 if (SKIP_HSC) strextend (&command, "-skip-hsc"); 151 if (SKIP_CFH) strextend (&command, "-skip-cfh"); 152 153 strextend (&command, "-nloop %d", NLOOP); 154 strextend (&command, "-threads %d", NTHREADS); 155 156 if (PHOTCODE_RESET_LIST) strextend (&command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST); 157 107 158 if (UPDATE) strextend (&command, "-update"); 108 159 if (PARALLEL) strextend (&command, "-parallel"); 109 160 if (PARALLEL_MANUAL) strextend (&command, "-parallel-manual"); 110 161 if (PARALLEL_SERIAL) strextend (&command, "-parallel-serial"); 111 if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); 112 if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); 113 if (PHOTCODE_RESET_LIST) strextend (&command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST); 114 115 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 116 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 117 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 118 119 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 120 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 121 } 122 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 123 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 124 } 125 126 if (PhotFlagSelect) strextend (&command, "+photflags"); 127 if (PhotFlagBad) strextend (&command, "+photflagbad %d", PhotFlagBad); 128 if (PhotFlagPoor) strextend (&command, "+photflagpoor %d", PhotFlagPoor); 129 162 163 strextend (&command, "-chiporder %d", CHIPORDER); 130 164 if (CHIPMAP) strextend (&command, "-chipmap %d", CHIPMAP); 165 if (ChipMapLoop) strextend (&command, "-chipmaploop %s", ChipMapLoopStr); 166 if (ChipOrderLoop) strextend (&command, "-chiporderloop %s", ChipOrderLoopStr); 167 131 168 if (RESET_IMAGES) strextend (&command, "-reset-images"); 132 169 … … 136 173 if (LoopWeight2MASS) { strextend (&command, "-loop-weights-2mass %s", LoopWeight2MASSstr); } 137 174 if (LoopWeightTycho) { strextend (&command, "-loop-weights-tycho %s", LoopWeightTychostr); } 138 139 strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 140 strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 141 strextend (&command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX); 142 strextend (&command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS); 143 144 strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL); 145 146 strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT); 147 strextend (&command, "-D USE_ICRF_LOCAL %d", USE_ICRF_LOCAL); 148 strextend (&command, "-D USE_ICRF_SHFIT %d", USE_ICRF_SHFIT); 149 strextend (&command, "-D USE_ICRF_POLE %d", USE_ICRF_POLE); 150 151 if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 175 if (LoopWeightGAIA) { strextend (&command, "-loop-weights-gaia %s", LoopWeightGAIAstr); } 176 if (APPLY_PROPER_MOTION) strextend (&command, "-apply-proper-motion"); 152 177 153 178 if (TimeSelect) { -
trunk/Ohana/src/relastro/src/load_catalogs.c
r39466 r39926 178 178 strextend (&command, "relastro_client -load-objects %s", table->hosts[i].results); 179 179 strextend (&command, " -hostID %d", table->hosts[i].hostID); 180 strextend (&command, " -hostdir %s", table->hosts[i].pathname); 181 180 182 strextend (&command, " -D CATDIR %s", CATDIR); 181 strextend (&command, " -hostdir %s", table->hosts[i].pathname);182 183 strextend (&command, " -region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 183 184 strextend (&command, " -statmode %s", STATMODE); 184 185 strextend (&command, " -minerror %f", MIN_ERROR); 186 185 187 strextend (&command, " -D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 188 strextend (&command, " -D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 189 186 190 strextend (&command, " -D RELASTRO_MIN_DISTANCE_MOD %f", MIN_DISTANCE_MOD); 187 191 strextend (&command, " -D RELASTRO_MAX_DISTANCE_MOD %f", MAX_DISTANCE_MOD); 188 192 strextend (&command, " -D RELASTRO_MAX_DISTANCE_MOD_ERR %f", MAX_DISTANCE_MOD_ERR); 189 193 194 strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL); 195 strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT); 196 190 197 if (FIT_MODE == FIT_PM_ONLY) strextend (&command, "-pm"); 191 198 if (FIT_MODE == FIT_PAR_ONLY) strextend (&command, "-par"); 192 199 if (FIT_MODE == FIT_PM_AND_PAR) strextend (&command, "-pmpar"); 193 200 194 if (VERBOSE) strextend (&command, "-v"); 195 if (VERBOSE2) strextend (&command, "-vv"); 196 if (RESET) strextend (&command, "-reset"); 197 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 198 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 199 if (FlagOutlier) strextend (&command, "-clip %d", CLIP_THRESH); 200 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 201 202 if (USE_ICRF_CORRECT) strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT); 203 if (USE_GALAXY_MODEL) strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL); 204 205 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 206 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 207 } 208 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 209 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 210 } 211 212 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images"); 201 if (VERBOSE) strextend (&command, "-v"); 202 if (VERBOSE2) strextend (&command, "-vv"); 203 if (RESET) strextend (&command, "-reset"); 204 205 if (ImagSelect) strextend (&command, "-instmag %f %f", ImagMin, ImagMax); 206 if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue); 207 if (FlagOutlier) strextend (&command, "-clip %d", CLIP_THRESH); 208 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 209 213 210 if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); 214 211 if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); … … 217 214 if (PhotFlagBad) strextend (&command, "+photflagbad %d", PhotFlagBad); 218 215 if (PhotFlagPoor) strextend (&command, "+photflagpoor %d", PhotFlagPoor); 216 217 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 218 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 219 } 220 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 221 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 222 } 223 224 if (SKIP_PS1_CHIP) strextend (&command, "-skip-ps1-chip"); 225 if (SKIP_PS1_STACK) strextend (&command, "-skip-ps1-stack"); 226 if (SKIP_HSC) strextend (&command, "-skip-hsc"); 227 if (SKIP_CFH) strextend (&command, "-skip-cfh"); 228 229 if (USE_ALL_IMAGES) strextend (&command, "-use-all-images"); 230 219 231 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 220 232 … … 282 294 CatalogSplitter *catalogs = BrightCatalogSplitInit (Nsecfilt); 283 295 296 ohana_memstats (TRUE); 297 284 298 for (i = 0; i < table->Nhosts; i++) { 285 299 … … 296 310 free (bcatalog->secfilt); 297 311 free (bcatalog); 312 313 ohana_memstats (TRUE); 298 314 } 299 315 … … 320 336 321 337 BrightCatalogSplitFree (catalogs); 338 ohana_memstats (TRUE); 322 339 323 340 return (catalog); -
trunk/Ohana/src/relastro/src/load_images.c
r39474 r39926 66 66 } 67 67 68 initImages (subset, LineNumber, Nsubset );68 initImages (subset, LineNumber, Nsubset, !USE_ALL_IMAGES); 69 69 MARKTIME(" init images: %f sec\n", dtime); 70 70 -
trunk/Ohana/src/relastro/src/relastro_images.c
r39580 r39926 16 16 int finalPassMode = FIT_MODE; // start with the globally-defined fit mode 17 17 FIT_MODE = FIT_AVERAGE; 18 19 int RESET_ON_UPDATE = RESET; 20 RESET = TRUE; // we need to reset when we load the bright catalog subset 18 21 19 22 /* lock and load the image db table */ … … 65 68 // XXX NOTE : for 2mass reset, photcodesKeep should now limit to 2MASS measurements 66 69 70 USE_IRLS = FALSE; // do not use IRLS yet -- leads to excessive outlier rejections in the loops 71 67 72 /* major modes */ 68 73 switch (FIT_TARGET) { … … 90 95 break; 91 96 97 case SET_CHIPS: 98 // we just want to fit the selected chips to the mean positions 99 UpdateChips (catalog, Ncatalog, 0); // measure.X,Y -> R,D, fit image.coords 100 MARKTIME("update chips: %f sec\n", dtime); 101 102 break; 103 92 104 case TARGET_MOSAICS: 93 105 for (i = 0; i < NLOOP; i++) { … … 102 114 } 103 115 104 if (!UPDATE) {105 freeStarMaps();106 gfits_db_free (&db);107 ohana_memcheck (VERBOSE);108 ohana_memdump (VERBOSE);109 exit (0);110 }111 112 116 // free the image / measurement pointers 113 117 freeImageBins (Ncatalog); … … 117 121 free (catalog); 118 122 freeMosaics (); 123 124 if (!UPDATE) { 125 freeStarMaps(); 126 dvo_image_unlock (&db); 127 freeImages (db.ftable.buffer); 128 gfits_db_free (&db); 129 return TRUE; 130 } 119 131 120 132 // If we did NOT use all images, then we applied the measured corrections to a subset of … … 154 166 // iterate over catalogs to make detection coordinates consistant 155 167 if (APPLY_OFFSETS) { 168 USE_IRLS = ALLOW_IRLS; // now that we have fitted the images, choose the user's option 169 RESET = RESET_ON_UPDATE; 156 170 UpdateObjectOffsets (skylist, 0, NULL); 157 171 } -
trunk/Ohana/src/relastro/src/relastro_objects.c
r39457 r39926 159 159 strextend (&command, "relastro_client -update-objects"); 160 160 strextend (&command, "-hostID %d", table->hosts[i].hostID); 161 strextend (&command, "-hostdir %s", table->hosts[i].pathname); 162 161 163 strextend (&command, "-D CATDIR %s", CATDIR); 162 strextend (&command, "-hostdir %s", table->hosts[i].pathname);163 164 strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 164 165 strextend (&command, "-statmode %s", STATMODE); 166 strextend (&command, "-minerror %f", MIN_ERROR); 167 168 strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM); 169 strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW); 165 170 166 171 if (FIT_MODE == FIT_PM_ONLY) { strextend (&command, "-pm"); } … … 171 176 if (VERBOSE2) { strextend (&command, "-vv"); } 172 177 if (RESET) { strextend (&command, "-reset"); } 173 if (UPDATE) { strextend (&command, "-update"); } 178 174 179 if (ImagSelect) { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); } 175 180 if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); } 176 181 if (FlagOutlier) { strextend (&command, "-clip %d", CLIP_THRESH); } 177 178 if (USE_ALL_IMAGES) { strextend (&command, "-use-all-images"); } 182 if (ExcludeBogus) strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius); 183 179 184 if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); } 180 185 if (PHOTCODE_KEEP_LIST) { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); } … … 185 190 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 186 191 192 if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) { 193 strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG); 194 } 195 if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) { 196 strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG); 197 } 198 199 if (UPDATE) { strextend (&command, "-update"); } 200 if (USE_ALL_IMAGES) { strextend (&command, "-use-all-images"); } 201 187 202 if (MinBadQF > 0.0) strextend (&command, "-min-bad-psfqf %f", MinBadQF); 188 203 if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset %f", MaxMeanOffset); -
trunk/Ohana/src/relastro/src/relastro_parallel_images.c
r39580 r39926 61 61 initMosaics (image, Nimage); 62 62 63 initImages (image, NULL, Nimage );63 initImages (image, NULL, Nimage, FALSE); 64 64 65 65 SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); … … 103 103 104 104 client_logger_message ("starting the loops: %s\n", myHostName); 105 106 RESET = TRUE; // we need to reset when we load the bright catalog subset 107 FIT_MODE = FIT_AVERAGE; // we need to only fit the average 108 USE_IRLS = FALSE; // do not use IRLS yet -- leads to excessive outlier rejections in the loops 105 109 106 110 /* major modes */ -
trunk/Ohana/src/relastro/src/select_images.c
r39474 r39926 121 121 } 122 122 123 // allow certain cameras to stay static 124 if (SKIP_PS1_CHIP && isGPC1chip (timage[i].photcode)) continue; 125 if (SKIP_PS1_STACK && isGPC1stack(timage[i].photcode)) continue; 126 if (SKIP_HSC && isHSCchip (timage[i].photcode)) continue; 127 if (SKIP_CFH && isCFHchip (timage[i].photcode)) continue; 128 123 129 /* select images by photcode, or equiv photcode, if specified */ 124 130 if (NphotcodesKeep > 0) { … … 187 193 if (DmaxImage < DminSkyRegion) continue; 188 194 195 if (KEEP_ALL_IMAGES_RA) goto found_it; 196 189 197 // the sky region RA is defined to be 0 - 360.0 190 198 if (RminImage > RmaxSkyRegion) continue; -
trunk/Ohana/src/relastro/src/syncfile.c
r36871 r39926 39 39 int loop; 40 40 sscanf (message, "%*s %d", &loop); 41 if (CATCH_UP && (nloop < loop)) return TRUE; // if I am behind this machine, I need to catch up! 41 42 if (loop != nloop) { 42 43 usleep (2000000); -
trunk/Ohana/src/relphot/include/relphot.h
r39648 r39926 309 309 int RESET_ZEROPTS; 310 310 int REPAIR_WARPS; 311 int PRESERVE_PS1; 311 312 int UPDATE; 312 313 int SAVE_IMAGE_UPDATES; … … 616 617 int isTYCHO (int photcode); 617 618 619 int isHSCchip (int photcode); 620 int isCFHchip (int photcode); 621 618 622 int magStatsByRanking (StatDataSet *dataset, StatType *stats); 619 623 -
trunk/Ohana/src/relphot/src/args.c
r39642 r39926 226 226 remove_argument (N, &argc, argv); 227 227 REPAIR_WARPS = TRUE; 228 } 229 230 PRESERVE_PS1 = FALSE; 231 if ((N = get_argument (argc, argv, "-preserve-ps1"))) { 232 remove_argument (N, &argc, argv); 233 PRESERVE_PS1 = TRUE; 228 234 } 229 235 … … 672 678 } 673 679 680 PRESERVE_PS1 = FALSE; 681 if ((N = get_argument (argc, argv, "-preserve-ps1"))) { 682 remove_argument (N, &argc, argv); 683 PRESERVE_PS1 = TRUE; 684 } 685 674 686 REPAIR_WARPS = FALSE; 675 687 if ((N = get_argument (argc, argv, "-repair-warps"))) { -
trunk/Ohana/src/relphot/src/extra.c
r38993 r39926 2 2 3 3 // for now (20140710) I need to identify gpc1 chips explicitly. generalize in the future 4 // note that the 4000, 14000, 15000 sets are SIMTEST (*not* synthetic) 4 5 int whichGPC1filter (int photcode) { 5 6 6 if (((photcode > 10000) && (photcode < 10077)) || (photcode == 4100)) return PS1_g; // g-band 7 if (((photcode > 10000) && (photcode < 10077)) || (photcode == 4100)) return PS1_g; // g-band 7 8 if (((photcode > 10100) && (photcode < 10177)) || (photcode == 4200)) return PS1_r; // r-band 8 9 if (((photcode > 10200) && (photcode < 10277)) || (photcode == 4300)) return PS1_i; // i-band … … 83 84 } 84 85 86 // for now (20160925) I need to identify HSC chips explicitly. generalize in the future 87 int isHSCchip (int photcode) { 88 89 if ((photcode >= 20000) && (photcode <= 20111)) return TRUE; // g-band 90 if ((photcode >= 21000) && (photcode <= 21111)) return TRUE; // r-band 91 if ((photcode >= 22000) && (photcode <= 22111)) return TRUE; // i-band 92 if ((photcode >= 23000) && (photcode <= 23111)) return TRUE; // z-band 93 if ((photcode >= 24000) && (photcode <= 24111)) return TRUE; // y-band 94 95 return FALSE; 96 } 97 98 // for now (20160925) I need to identify CFH chips explicitly. generalize in the future 99 int isCFHchip (int photcode) { 100 101 if ((photcode >= 100) && (photcode <= 152)) return TRUE; // g-band 102 if ((photcode >= 200) && (photcode <= 252)) return TRUE; // r-band 103 if ((photcode >= 300) && (photcode <= 352)) return TRUE; // i-band 104 if ((photcode >= 400) && (photcode <= 452)) return TRUE; // z-band 105 if ((photcode >= 500) && (photcode <= 552)) return TRUE; // y-band 106 107 return FALSE; 108 } 109 -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r39511 r39926 239 239 if (RESET) { strextend (&command, "-reset"); } 240 240 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 241 if (PRESERVE_PS1) { strextend (&command, "-preserve-ps1"); } 241 242 if (UPDATE) { strextend (&command, "-update"); } 242 243 if (IS_DIFF_DB) { strextend (&command, "-is-diff-db"); } -
trunk/Ohana/src/relphot/src/relphot_objects.c
r39643 r39926 243 243 if (RESET_ZEROPTS) { strextend (&command, "-reset-zpts"); } 244 244 if (REPAIR_WARPS) { strextend (&command, "-repair-warps"); } 245 if (PRESERVE_PS1) { strextend (&command, "-preserve-ps1"); } 245 246 if (IS_DIFF_DB) { strextend (&command, "-is-diff-db"); } 246 247 if (UPDATE) { strextend (&command, "-update"); } -
trunk/Ohana/src/relphot/src/setMrelCatalog.c
r39636 r39926 142 142 int Galaxy2MASS = FALSE; 143 143 int haveTYCHO = FALSE; 144 int haveHSC = FALSE; 145 int haveCFH = FALSE; 144 146 145 147 float stargalmax = 0.0; … … 163 165 164 166 if (isTYCHO(measureT[k].photcode)) { haveTYCHO = TRUE; } 167 if (isHSCchip(measureT[k].photcode)) { haveHSC = TRUE; } 168 if (isCFHchip(measureT[k].photcode)) { haveCFH = TRUE; } 165 169 166 170 if (is2MASS(measureT[k].photcode)) { … … 317 321 // now calculate the mean stats for the Nsec bands. 318 322 for (Nsec = 0; Nsec < Nsecfilt; Nsec++) { 319 dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_CHIP); // this does not reset astrometry or STACK bits 323 324 // if we detected this object in PS1, or do not request -preserve-ps1, keep the mean photometry values 325 if (!PRESERVE_PS1 || !(secfilt[Nsec].flags & ID_SECF_HAS_PS1)) { 326 dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_CHIP); // this does not reset astrometry or STACK bits 327 } 328 329 if (haveTYCHO) { 330 secfilt[Nsec].flags |= ID_SECF_HAS_TYCHO; 331 } 332 if (haveHSC) { 333 secfilt[Nsec].flags |= ID_SECF_HAS_HSC; 334 } 335 if (haveCFH) { 336 secfilt[Nsec].flags |= ID_SECF_HAS_CFH; 337 } 338 339 if (PRESERVE_PS1 && (secfilt[Nsec].flags & ID_SECF_HAS_PS1)) continue; 340 // if -preserve-ps1 is set and this object has PS1 data, skip the rest of the steps: 320 341 321 342 // XXX hardwired grizy = (01234) JHK = (567) w = (8) … … 324 345 } else { 325 346 secfilt[Nsec].Ncode = results->Nmeas[Nsec]; // 2MASS data if it exists 326 }327 328 if (haveTYCHO) {329 secfilt[Nsec].flags |= ID_SECF_HAS_TYCHO;330 347 } 331 348 -
trunk/Ohana/src/uniphot/include/setgalmodel.h
r38986 r39926 10 10 char *HOSTDIR; 11 11 int VERBOSE; 12 int TESTING;13 12 int UPDATE; 14 13 int PARALLEL; … … 18 17 char *SINGLE_CPT; 19 18 19 float TEST_SCALE; 20 char *GALAXY_MODEL; 20 21 SkyRegion UserPatch; 21 22 -
trunk/Ohana/src/uniphot/include/setphot.h
r39356 r39926 67 67 int VERBOSE; 68 68 int RESET; 69 int PHOTCODE_MIN; 70 int PHOTCODE_MAX; 69 71 int UBERCAL; // load the supplied ubercal zero point fits table (with flat-field corrections) 70 72 int NO_METADATA; // the supplied ubercal data has no descriptive metadata -
trunk/Ohana/src/uniphot/src/initialize_setgalmodel.c
r39225 r39926 45 45 46 46 // XXX add to config? 47 if (!InitGalaxyModel ( "FEAST-HIPPARCOS")) {48 fprintf (stderr, "failed to init galaxy model \n");47 if (!InitGalaxyModel (GALAXY_MODEL)) { 48 fprintf (stderr, "failed to init galaxy model %s\n", GALAXY_MODEL); 49 49 exit (2); 50 50 } … … 92 92 } 93 93 94 TESTING = FALSE; 94 GALAXY_MODEL = NULL; 95 if ((N = get_argument (argc, argv, "-galaxy-model"))) { 96 remove_argument (N, &argc, argv); 97 GALAXY_MODEL = strcreate(argv[N]); 98 remove_argument (N, &argc, argv); 99 } 100 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("FEAST-HIPPARCOS"); 101 102 TEST_SCALE = 1.0; 95 103 if ((N = get_argument (argc, argv, "-testing"))) { 96 TESTING = TRUE; 104 remove_argument (N, &argc, argv); 105 TEST_SCALE = atof(argv[N]); 97 106 remove_argument (N, &argc, argv); 98 107 } … … 171 180 } 172 181 173 // XXX add to config?174 if (!InitGalaxyModel ( "ROESER")) {182 // from args 183 if (!InitGalaxyModel (GALAXY_MODEL)) { 175 184 fprintf (stderr, "failed to init galaxy model\n"); 176 185 exit (2); … … 212 221 } 213 222 214 TESTING = FALSE; 223 GALAXY_MODEL = NULL; 224 if ((N = get_argument (argc, argv, "-galaxy-model"))) { 225 remove_argument (N, &argc, argv); 226 GALAXY_MODEL = strcreate(argv[N]); 227 remove_argument (N, &argc, argv); 228 } 229 if (!GALAXY_MODEL) GALAXY_MODEL = strcreate ("FEAST-HIPPARCOS"); 230 231 TEST_SCALE = 1.0; 215 232 if ((N = get_argument (argc, argv, "-testing"))) { 216 TESTING = TRUE; 233 remove_argument (N, &argc, argv); 234 TEST_SCALE = atof(argv[N]); 217 235 remove_argument (N, &argc, argv); 218 236 } -
trunk/Ohana/src/uniphot/src/initialize_setphot.c
r39356 r39926 109 109 if ((N = get_argument (argc, argv, "-reset"))) { 110 110 RESET = TRUE; 111 remove_argument (N, &argc, argv); 112 } 113 114 PHOTCODE_MIN = 0; 115 PHOTCODE_MAX = 0; 116 if ((N = get_argument (argc, argv, "-photcode-range"))) { 117 remove_argument (N, &argc, argv); 118 PHOTCODE_MIN = atoi (argv[N]); 119 remove_argument (N, &argc, argv); 120 PHOTCODE_MAX = atoi (argv[N]); 111 121 remove_argument (N, &argc, argv); 112 122 } -
trunk/Ohana/src/uniphot/src/initialize_setphot_client.c
r39356 r39926 96 96 } 97 97 98 PHOTCODE_MIN = 0; 99 PHOTCODE_MAX = 0; 100 if ((N = get_argument (argc, argv, "-photcode-range"))) { 101 remove_argument (N, &argc, argv); 102 PHOTCODE_MIN = atoi (argv[N]); 103 remove_argument (N, &argc, argv); 104 PHOTCODE_MAX = atoi (argv[N]); 105 remove_argument (N, &argc, argv); 106 } 107 98 108 // region of interest 99 109 UserPatch.Rmin = 0; -
trunk/Ohana/src/uniphot/src/update_catalog_setgalmodel.c
r39586 r39926 33 33 34 34 // fake or real QSOs are marked with FeH = +/- 100.0 35 if (fabs(starpar->FeH) > 99.0) continue; 35 if (fabs(starpar->FeH) > 99.0) { 36 starpar->uRA = 0.0; 37 starpar->uDEC = 0.0; 38 average[i].uRgal = 0.0; 39 average[i].uDgal = 0.0; 40 continue; 41 } 36 42 37 // NOTE: distance is in kiloparsec43 // NOTE: DistMag is standard (10pc reference). SolarMotionModel wants distance in kiloparsec: 38 44 double distance = pow(10.0, 0.2*(starpar->DistMag + 5.0)) / 1000.0; 39 45 … … 51 57 52 58 // XXX: amplify motion to make tests easier: 53 if (TESTING) { 54 uL *= 100.0; 55 uB *= 100.0; 56 } 59 uL *= TEST_SCALE; 60 uB *= TEST_SCALE; 57 61 58 62 double uR, uD; -
trunk/Ohana/src/uniphot/src/update_catalog_setphot.c
r39457 r39926 1 1 # include "setphot.h" 2 3 // XXX I need to add a few things for HSC + MC + GPC1: 4 // * I can generate a zpt table for the MC exposures using the nominal zero points 5 // * for the HSC data, I need to add a function to define Mflat as a function of Xmos, Ymos 2 6 3 7 void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage, CamPhotomCorrection *camcorr) { … … 14 18 Measure *measure = &catalog[0].measure[i]; 15 19 16 // only do GPC1 data for now17 if (measure[0].photcode < 10000) continue;18 if (measure[0].photcode > 10600) continue;20 // XXX deprecated 2016.09.22 : only do GPC1 data for now 21 // if (measure[0].photcode < 10000) continue; 22 // if (measure[0].photcode > 10600) continue; 19 23 24 // only do DEP photcodes (skip REF, etc) 25 PhotCode *code = GetPhotcodebyCode (measure[0].photcode); 26 if (!code) continue; // invalid photcode 27 if (code->type != PHOT_DEP) continue; 28 29 // allow a restriction on the modified zpts: 30 if (PHOTCODE_MAX) { 31 if (measure[0].photcode < PHOTCODE_MIN) continue; 32 if (measure[0].photcode > PHOTCODE_MAX) continue; 33 } 34 20 35 off_t idx = measure[0].imageID; 21 36 if (idx <= 0) continue; // detections with imageID == 0 do not have a valid image (eg, ref photcode) … … 33 48 Mflat = CamPhotomCorrectionValue (camcorr, flat_id, measure[0].Xccd, measure[0].Yccd); 34 49 } 50 51 # if (0) 52 // the mosaic lookup is broken : fix it then redo this block 53 if (radialZP) { 54 mosaic = MatchMosaicMetadata (measure[0].imageID); 55 if (mosaic == NULL) break; 56 double Rm = measure[0].R; 57 double Dm = measure[0].D; 58 RD_to_XY (&XMOS_MEAS, &YMOS_MEAS, Rm, Dm, mosaic); 59 Mflat = RadialZPtrend (XMOS_MEAS, XMOS_MEAS); 60 } 61 # endif 35 62 36 63 measure[0].Mcal = Mcal; -
trunk/Ohana/src/uniphot/src/update_dvo_setgalmodel.c
r39225 r39926 98 98 99 99 if (VERBOSE) { strextend (&command, "-v"); } 100 if (TEST ING) { strextend (&command, "-testing"); }100 if (TEST_SCALE != 1.0){ strextend (&command, "-testing %f", TEST_SCALE); } 101 101 if (UPDATE) { strextend (&command, "-update"); } 102 102 if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); } -
trunk/Ohana/src/uniphot/src/update_dvo_setphot.c
r39356 r39926 179 179 if (DCR_RESET) { strextend (&command, "-DCR-reset"); } 180 180 if (CAM_RESET) { strextend (&command, "-CAM-reset"); } 181 182 if (PHOTCODE_MAX) { strextend (&command, "-photcode-range %d %d", PHOTCODE_MIN, PHOTCODE_MAX); } 181 183 182 184 fprintf (stderr, "command: %s\n", command); -
trunk/ippScripts/scripts/camera_exp.pl
r35800 r39926 404 404 405 405 # Construct FPA continuity corrected background images 406 if ( $camera =~ /ISP/) {406 if (($camera =~ /ISP/)||($camera =~ /HSC/)) { 407 407 print "Skipping FPA continuity corrected background images for ISP\n"; 408 408 } elsif ($do_bkg) { -
trunk/ippScripts/scripts/nightly_science.pl
- Property svn:mergeinfo deleted
-
trunk/ippTools/src/stacktool.c
r38062 r39926 1328 1328 psFree(where); 1329 1329 1330 // This needs to be sorted by skycell_id, or the ppSkycell calls to mosaic things 1331 // don't work properly. 1332 psStringAppend(&query, " ORDER BY stackRun.skycell_id "); 1333 1330 1334 // treat limit == 0 as "no limit" 1331 1335 if (limit) { -
trunk/ippconfig/dvo.photcodes
r39705 r39926 152 152 2022 TYCHO_B_2MASS ref 0.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 153 153 2023 TYCHO_V_2MASS ref 0.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 154 155 1030 GAIA_G_DR1 ref 0.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 154 156 155 157 2025 BSC_U ref 0.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 … … 988 990 566 MOSAIC2.I.06 dep 24.887 0.000 0.000 - - 0.0000 0 3 0.000 0.000 1.000 0.000 0x0000 0x3888 0x0000 0x0000 989 991 567 MOSAIC2.I.07 dep 24.912 0.000 0.000 - - 0.0000 0 3 0.000 0.000 1.000 0.000 0x0000 0x3888 0x0000 0x0000 990 20000 HSC.g.00 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 991 20001 HSC.g.01 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 992 20002 HSC.g.02 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 993 20003 HSC.g.03 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 994 20004 HSC.g.04 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 995 20005 HSC.g.05 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 996 20006 HSC.g.06 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 997 20007 HSC.g.07 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 998 20008 HSC.g.08 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 999 20009 HSC.g.09 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1000 20010 HSC.g.10 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1001 20011 HSC.g.11 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1002 20012 HSC.g.12 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1003 20013 HSC.g.13 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1004 20014 HSC.g.14 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1005 20015 HSC.g.15 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1006 20016 HSC.g.16 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1007 20017 HSC.g.17 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1008 20018 HSC.g.18 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1009 20019 HSC.g.19 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1010 20020 HSC.g.20 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1011 20021 HSC.g.21 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1012 20022 HSC.g.22 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1013 20023 HSC.g.23 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1014 20024 HSC.g.24 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1015 20025 HSC.g.25 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1016 20026 HSC.g.26 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1017 20027 HSC.g.27 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1018 20028 HSC.g.28 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1019 20029 HSC.g.29 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1020 20030 HSC.g.30 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1021 20031 HSC.g.31 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1022 20032 HSC.g.32 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1023 20033 HSC.g.33 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1024 20034 HSC.g.34 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1025 20035 HSC.g.35 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1026 20036 HSC.g.36 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1027 20037 HSC.g.37 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1028 20038 HSC.g.38 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1029 20039 HSC.g.39 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1030 20040 HSC.g.40 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1031 20041 HSC.g.41 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1032 20042 HSC.g.42 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1033 20043 HSC.g.43 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1034 20044 HSC.g.44 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1035 20045 HSC.g.45 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1036 20046 HSC.g.46 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1037 20047 HSC.g.47 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1038 20048 HSC.g.48 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1039 20049 HSC.g.49 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1040 20050 HSC.g.50 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1041 20051 HSC.g.51 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1042 20052 HSC.g.52 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1043 20053 HSC.g.53 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1044 20054 HSC.g.54 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1045 20055 HSC.g.55 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1046 20056 HSC.g.56 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1047 20057 HSC.g.57 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1048 20058 HSC.g.58 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1049 20059 HSC.g.59 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1050 20060 HSC.g.60 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1051 20061 HSC.g.61 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1052 20062 HSC.g.62 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1053 20063 HSC.g.63 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1054 20064 HSC.g.64 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1055 20065 HSC.g.65 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1056 20066 HSC.g.66 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1057 20067 HSC.g.67 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1058 20068 HSC.g.68 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1059 20069 HSC.g.69 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1060 20070 HSC.g.70 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1061 20071 HSC.g.71 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1062 20072 HSC.g.72 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1063 20073 HSC.g.73 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1064 20074 HSC.g.74 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1065 20075 HSC.g.75 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1066 20076 HSC.g.76 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1067 20077 HSC.g.77 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1068 20078 HSC.g.78 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1069 20079 HSC.g.79 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1070 20080 HSC.g.80 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1071 20081 HSC.g.81 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1072 20082 HSC.g.82 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1073 20083 HSC.g.83 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1074 20084 HSC.g.84 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1075 20085 HSC.g.85 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1076 20086 HSC.g.86 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1077 20087 HSC.g.87 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1078 20088 HSC.g.88 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1079 20089 HSC.g.89 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1080 20090 HSC.g.90 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1081 20091 HSC.g.91 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1082 20092 HSC.g.92 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1083 20093 HSC.g.93 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1084 20094 HSC.g.94 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1085 20095 HSC.g.95 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1086 20096 HSC.g.96 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1087 20097 HSC.g.97 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1088 20098 HSC.g.98 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1089 20099 HSC.g.99 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1090 20100 HSC.g.100 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1091 20101 HSC.g.101 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1092 20102 HSC.g.102 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1093 20103 HSC.g.103 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1094 20104 HSC.g.104 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1095 20105 HSC.g.105 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1096 20106 HSC.g.106 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1097 20107 HSC.g.107 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1098 20108 HSC.g.108 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1099 20109 HSC.g.109 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1100 20110 HSC.g.110 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1101 20111 HSC.g.111 dep 25.000 0.000 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1102 21000 HSC.r.00 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1103 21001 HSC.r.01 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1104 21002 HSC.r.02 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1105 21003 HSC.r.03 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1106 21004 HSC.r.04 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1107 21005 HSC.r.05 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1108 21006 HSC.r.06 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1109 21007 HSC.r.07 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1110 21008 HSC.r.08 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1111 21009 HSC.r.09 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1112 21010 HSC.r.10 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1113 21011 HSC.r.11 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1114 21012 HSC.r.12 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1115 21013 HSC.r.13 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1116 21014 HSC.r.14 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1117 21015 HSC.r.15 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1118 21016 HSC.r.16 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1119 21017 HSC.r.17 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1120 21018 HSC.r.18 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1121 21019 HSC.r.19 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1122 21020 HSC.r.20 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1123 21021 HSC.r.21 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1124 21022 HSC.r.22 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1125 21023 HSC.r.23 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1126 21024 HSC.r.24 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1127 21025 HSC.r.25 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1128 21026 HSC.r.26 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1129 21027 HSC.r.27 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1130 21028 HSC.r.28 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1131 21029 HSC.r.29 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1132 21030 HSC.r.30 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1133 21031 HSC.r.31 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1134 21032 HSC.r.32 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1135 21033 HSC.r.33 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1136 21034 HSC.r.34 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1137 21035 HSC.r.35 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1138 21036 HSC.r.36 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1139 21037 HSC.r.37 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1140 21038 HSC.r.38 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1141 21039 HSC.r.39 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1142 21040 HSC.r.40 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1143 21041 HSC.r.41 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1144 21042 HSC.r.42 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1145 21043 HSC.r.43 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1146 21044 HSC.r.44 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1147 21045 HSC.r.45 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1148 21046 HSC.r.46 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1149 21047 HSC.r.47 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1150 21048 HSC.r.48 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1151 21049 HSC.r.49 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1152 21050 HSC.r.50 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1153 21051 HSC.r.51 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1154 21052 HSC.r.52 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1155 21053 HSC.r.53 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1156 21054 HSC.r.54 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1157 21055 HSC.r.55 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1158 21056 HSC.r.56 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1159 21057 HSC.r.57 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1160 21058 HSC.r.58 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1161 21059 HSC.r.59 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1162 21060 HSC.r.60 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1163 21061 HSC.r.61 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1164 21062 HSC.r.62 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1165 21063 HSC.r.63 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1166 21064 HSC.r.64 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1167 21065 HSC.r.65 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1168 21066 HSC.r.66 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1169 21067 HSC.r.67 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1170 21068 HSC.r.68 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1171 21069 HSC.r.69 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1172 21070 HSC.r.70 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1173 21071 HSC.r.71 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1174 21072 HSC.r.72 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1175 21073 HSC.r.73 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1176 21074 HSC.r.74 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1177 21075 HSC.r.75 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1178 21076 HSC.r.76 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1179 21077 HSC.r.77 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1180 21078 HSC.r.78 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1181 21079 HSC.r.79 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1182 21080 HSC.r.80 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1183 21081 HSC.r.81 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1184 21082 HSC.r.82 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1185 21083 HSC.r.83 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1186 21084 HSC.r.84 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1187 21085 HSC.r.85 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1188 21086 HSC.r.86 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1189 21087 HSC.r.87 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1190 21088 HSC.r.88 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1191 21089 HSC.r.89 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1192 21090 HSC.r.90 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1193 21091 HSC.r.91 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1194 21092 HSC.r.92 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1195 21093 HSC.r.93 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1196 21094 HSC.r.94 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1197 21095 HSC.r.95 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1198 21096 HSC.r.96 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1199 21097 HSC.r.97 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1200 21098 HSC.r.98 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1201 21099 HSC.r.99 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1202 21100 HSC.r.100 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1203 21101 HSC.r.101 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1204 21102 HSC.r.102 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1205 21103 HSC.r.103 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1206 21104 HSC.r.104 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1207 21105 HSC.r.105 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1208 21106 HSC.r.106 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1209 21107 HSC.r.107 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1210 21108 HSC.r.108 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1211 21109 HSC.r.109 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1212 21110 HSC.r.110 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1213 21111 HSC.r.111 dep 25.000 0.000 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1214 22000 HSC.i.00 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1215 22001 HSC.i.01 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1216 22002 HSC.i.02 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1217 22003 HSC.i.03 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1218 22004 HSC.i.04 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1219 22005 HSC.i.05 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1220 22006 HSC.i.06 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1221 22007 HSC.i.07 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1222 22008 HSC.i.08 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1223 22009 HSC.i.09 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1224 22010 HSC.i.10 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1225 22011 HSC.i.11 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1226 22012 HSC.i.12 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1227 22013 HSC.i.13 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1228 22014 HSC.i.14 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1229 22015 HSC.i.15 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1230 22016 HSC.i.16 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1231 22017 HSC.i.17 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1232 22018 HSC.i.18 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1233 22019 HSC.i.19 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1234 22020 HSC.i.20 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1235 22021 HSC.i.21 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1236 22022 HSC.i.22 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1237 22023 HSC.i.23 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1238 22024 HSC.i.24 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1239 22025 HSC.i.25 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1240 22026 HSC.i.26 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1241 22027 HSC.i.27 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1242 22028 HSC.i.28 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1243 22029 HSC.i.29 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1244 22030 HSC.i.30 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1245 22031 HSC.i.31 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1246 22032 HSC.i.32 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1247 22033 HSC.i.33 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1248 22034 HSC.i.34 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1249 22035 HSC.i.35 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1250 22036 HSC.i.36 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1251 22037 HSC.i.37 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1252 22038 HSC.i.38 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1253 22039 HSC.i.39 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1254 22040 HSC.i.40 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1255 22041 HSC.i.41 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1256 22042 HSC.i.42 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1257 22043 HSC.i.43 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1258 22044 HSC.i.44 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1259 22045 HSC.i.45 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1260 22046 HSC.i.46 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1261 22047 HSC.i.47 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1262 22048 HSC.i.48 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1263 22049 HSC.i.49 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1264 22050 HSC.i.50 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1265 22051 HSC.i.51 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1266 22052 HSC.i.52 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1267 22053 HSC.i.53 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1268 22054 HSC.i.54 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1269 22055 HSC.i.55 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1270 22056 HSC.i.56 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1271 22057 HSC.i.57 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1272 22058 HSC.i.58 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1273 22059 HSC.i.59 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1274 22060 HSC.i.60 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1275 22061 HSC.i.61 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1276 22062 HSC.i.62 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1277 22063 HSC.i.63 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1278 22064 HSC.i.64 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1279 22065 HSC.i.65 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1280 22066 HSC.i.66 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1281 22067 HSC.i.67 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1282 22068 HSC.i.68 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1283 22069 HSC.i.69 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1284 22070 HSC.i.70 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1285 22071 HSC.i.71 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1286 22072 HSC.i.72 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1287 22073 HSC.i.73 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1288 22074 HSC.i.74 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1289 22075 HSC.i.75 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1290 22076 HSC.i.76 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1291 22077 HSC.i.77 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1292 22078 HSC.i.78 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1293 22079 HSC.i.79 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1294 22080 HSC.i.80 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1295 22081 HSC.i.81 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1296 22082 HSC.i.82 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1297 22083 HSC.i.83 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1298 22084 HSC.i.84 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1299 22085 HSC.i.85 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1300 22086 HSC.i.86 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1301 22087 HSC.i.87 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1302 22088 HSC.i.88 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1303 22089 HSC.i.89 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1304 22090 HSC.i.90 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1305 22091 HSC.i.91 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1306 22092 HSC.i.92 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1307 22093 HSC.i.93 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1308 22094 HSC.i.94 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1309 22095 HSC.i.95 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1310 22096 HSC.i.96 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1311 22097 HSC.i.97 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1312 22098 HSC.i.98 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1313 22099 HSC.i.99 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1314 22100 HSC.i.100 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1315 22101 HSC.i.101 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1316 22102 HSC.i.102 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1317 22103 HSC.i.103 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1318 22104 HSC.i.104 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1319 22105 HSC.i.105 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1320 22106 HSC.i.106 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1321 22107 HSC.i.107 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1322 22108 HSC.i.108 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1323 22109 HSC.i.109 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1324 22110 HSC.i.110 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1325 22111 HSC.i.111 dep 25.000 0.000 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1326 23000 HSC.z.00 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1327 23001 HSC.z.01 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1328 23002 HSC.z.02 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1329 23003 HSC.z.03 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1330 23004 HSC.z.04 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1331 23005 HSC.z.05 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1332 23006 HSC.z.06 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1333 23007 HSC.z.07 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1334 23008 HSC.z.08 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1335 23009 HSC.z.09 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1336 23010 HSC.z.10 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1337 23011 HSC.z.11 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1338 23012 HSC.z.12 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1339 23013 HSC.z.13 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1340 23014 HSC.z.14 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1341 23015 HSC.z.15 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1342 23016 HSC.z.16 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1343 23017 HSC.z.17 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1344 23018 HSC.z.18 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1345 23019 HSC.z.19 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1346 23020 HSC.z.20 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1347 23021 HSC.z.21 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1348 23022 HSC.z.22 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1349 23023 HSC.z.23 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1350 23024 HSC.z.24 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1351 23025 HSC.z.25 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1352 23026 HSC.z.26 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1353 23027 HSC.z.27 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1354 23028 HSC.z.28 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1355 23029 HSC.z.29 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1356 23030 HSC.z.30 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1357 23031 HSC.z.31 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1358 23032 HSC.z.32 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1359 23033 HSC.z.33 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1360 23034 HSC.z.34 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1361 23035 HSC.z.35 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1362 23036 HSC.z.36 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1363 23037 HSC.z.37 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1364 23038 HSC.z.38 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1365 23039 HSC.z.39 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1366 23040 HSC.z.40 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1367 23041 HSC.z.41 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1368 23042 HSC.z.42 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1369 23043 HSC.z.43 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1370 23044 HSC.z.44 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1371 23045 HSC.z.45 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1372 23046 HSC.z.46 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1373 23047 HSC.z.47 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1374 23048 HSC.z.48 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1375 23049 HSC.z.49 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1376 23050 HSC.z.50 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1377 23051 HSC.z.51 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1378 23052 HSC.z.52 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1379 23053 HSC.z.53 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1380 23054 HSC.z.54 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1381 23055 HSC.z.55 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1382 23056 HSC.z.56 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1383 23057 HSC.z.57 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1384 23058 HSC.z.58 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1385 23059 HSC.z.59 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1386 23060 HSC.z.60 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1387 23061 HSC.z.61 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1388 23062 HSC.z.62 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1389 23063 HSC.z.63 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1390 23064 HSC.z.64 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1391 23065 HSC.z.65 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1392 23066 HSC.z.66 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1393 23067 HSC.z.67 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1394 23068 HSC.z.68 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1395 23069 HSC.z.69 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1396 23070 HSC.z.70 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1397 23071 HSC.z.71 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1398 23072 HSC.z.72 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1399 23073 HSC.z.73 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1400 23074 HSC.z.74 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1401 23075 HSC.z.75 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1402 23076 HSC.z.76 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1403 23077 HSC.z.77 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1404 23078 HSC.z.78 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1405 23079 HSC.z.79 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1406 23080 HSC.z.80 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1407 23081 HSC.z.81 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1408 23082 HSC.z.82 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1409 23083 HSC.z.83 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1410 23084 HSC.z.84 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1411 23085 HSC.z.85 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1412 23086 HSC.z.86 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1413 23087 HSC.z.87 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1414 23088 HSC.z.88 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1415 23089 HSC.z.89 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1416 23090 HSC.z.90 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1417 23091 HSC.z.91 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1418 23092 HSC.z.92 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1419 23093 HSC.z.93 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1420 23094 HSC.z.94 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1421 23095 HSC.z.95 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1422 23096 HSC.z.96 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1423 23097 HSC.z.97 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1424 23098 HSC.z.98 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1425 23099 HSC.z.99 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1426 23100 HSC.z.100 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1427 23101 HSC.z.101 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1428 23102 HSC.z.102 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1429 23103 HSC.z.103 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1430 23104 HSC.z.104 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1431 23105 HSC.z.105 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1432 23106 HSC.z.106 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1433 23107 HSC.z.107 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1434 23108 HSC.z.108 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1435 23109 HSC.z.109 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1436 23110 HSC.z.110 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1437 23111 HSC.z.111 dep 25.000 0.000 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 992 993 20000 HSC.g.00 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 994 20001 HSC.g.01 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 995 20002 HSC.g.02 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 996 20003 HSC.g.03 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 997 20004 HSC.g.04 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 998 20005 HSC.g.05 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 999 20006 HSC.g.06 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1000 20007 HSC.g.07 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1001 20008 HSC.g.08 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1002 20009 HSC.g.09 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1003 20010 HSC.g.10 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1004 20011 HSC.g.11 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1005 20012 HSC.g.12 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1006 20013 HSC.g.13 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1007 20014 HSC.g.14 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1008 20015 HSC.g.15 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1009 20016 HSC.g.16 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1010 20017 HSC.g.17 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1011 20018 HSC.g.18 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1012 20019 HSC.g.19 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1013 20020 HSC.g.20 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1014 20021 HSC.g.21 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1015 20022 HSC.g.22 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1016 20023 HSC.g.23 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1017 20024 HSC.g.24 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1018 20025 HSC.g.25 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1019 20026 HSC.g.26 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1020 20027 HSC.g.27 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1021 20028 HSC.g.28 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1022 20029 HSC.g.29 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1023 20030 HSC.g.30 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1024 20031 HSC.g.31 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1025 20032 HSC.g.32 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1026 20033 HSC.g.33 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1027 20034 HSC.g.34 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1028 20035 HSC.g.35 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1029 20036 HSC.g.36 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1030 20037 HSC.g.37 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1031 20038 HSC.g.38 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1032 20039 HSC.g.39 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1033 20040 HSC.g.40 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1034 20041 HSC.g.41 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1035 20042 HSC.g.42 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1036 20043 HSC.g.43 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1037 20044 HSC.g.44 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1038 20045 HSC.g.45 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1039 20046 HSC.g.46 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1040 20047 HSC.g.47 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1041 20048 HSC.g.48 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1042 20049 HSC.g.49 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1043 20050 HSC.g.50 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1044 20051 HSC.g.51 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1045 20052 HSC.g.52 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1046 20053 HSC.g.53 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1047 20054 HSC.g.54 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1048 20055 HSC.g.55 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1049 20056 HSC.g.56 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1050 20057 HSC.g.57 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1051 20058 HSC.g.58 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1052 20059 HSC.g.59 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1053 20060 HSC.g.60 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1054 20061 HSC.g.61 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1055 20062 HSC.g.62 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1056 20063 HSC.g.63 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1057 20064 HSC.g.64 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1058 20065 HSC.g.65 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1059 20066 HSC.g.66 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1060 20067 HSC.g.67 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1061 20068 HSC.g.68 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1062 20069 HSC.g.69 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1063 20070 HSC.g.70 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1064 20071 HSC.g.71 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1065 20072 HSC.g.72 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1066 20073 HSC.g.73 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1067 20074 HSC.g.74 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1068 20075 HSC.g.75 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1069 20076 HSC.g.76 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1070 20077 HSC.g.77 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1071 20078 HSC.g.78 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1072 20079 HSC.g.79 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1073 20080 HSC.g.80 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1074 20081 HSC.g.81 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1075 20082 HSC.g.82 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1076 20083 HSC.g.83 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1077 20084 HSC.g.84 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1078 20085 HSC.g.85 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1079 20086 HSC.g.86 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1080 20087 HSC.g.87 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1081 20088 HSC.g.88 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1082 20089 HSC.g.89 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1083 20090 HSC.g.90 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1084 20091 HSC.g.91 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1085 20092 HSC.g.92 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1086 20093 HSC.g.93 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1087 20094 HSC.g.94 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1088 20095 HSC.g.95 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1089 20096 HSC.g.96 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1090 20097 HSC.g.97 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1091 20098 HSC.g.98 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1092 20099 HSC.g.99 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1093 20100 HSC.g.100 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1094 20101 HSC.g.101 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1095 20102 HSC.g.102 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1096 20103 HSC.g.103 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1097 20104 HSC.g.104 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1098 20105 HSC.g.105 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1099 20106 HSC.g.106 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1100 20107 HSC.g.107 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1101 20108 HSC.g.108 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1102 20109 HSC.g.109 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1103 20110 HSC.g.110 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1104 20111 HSC.g.111 dep 26.750 -0.150 0.000 - - 0.0000 0 1 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1105 21000 HSC.r.00 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1106 21001 HSC.r.01 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1107 21002 HSC.r.02 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1108 21003 HSC.r.03 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1109 21004 HSC.r.04 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1110 21005 HSC.r.05 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1111 21006 HSC.r.06 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1112 21007 HSC.r.07 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1113 21008 HSC.r.08 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1114 21009 HSC.r.09 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1115 21010 HSC.r.10 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1116 21011 HSC.r.11 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1117 21012 HSC.r.12 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1118 21013 HSC.r.13 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1119 21014 HSC.r.14 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1120 21015 HSC.r.15 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1121 21016 HSC.r.16 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1122 21017 HSC.r.17 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1123 21018 HSC.r.18 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1124 21019 HSC.r.19 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1125 21020 HSC.r.20 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1126 21021 HSC.r.21 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1127 21022 HSC.r.22 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1128 21023 HSC.r.23 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1129 21024 HSC.r.24 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1130 21025 HSC.r.25 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1131 21026 HSC.r.26 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1132 21027 HSC.r.27 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1133 21028 HSC.r.28 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1134 21029 HSC.r.29 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1135 21030 HSC.r.30 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1136 21031 HSC.r.31 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1137 21032 HSC.r.32 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1138 21033 HSC.r.33 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1139 21034 HSC.r.34 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1140 21035 HSC.r.35 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1141 21036 HSC.r.36 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1142 21037 HSC.r.37 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1143 21038 HSC.r.38 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1144 21039 HSC.r.39 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1145 21040 HSC.r.40 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1146 21041 HSC.r.41 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1147 21042 HSC.r.42 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1148 21043 HSC.r.43 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1149 21044 HSC.r.44 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1150 21045 HSC.r.45 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1151 21046 HSC.r.46 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1152 21047 HSC.r.47 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1153 21048 HSC.r.48 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1154 21049 HSC.r.49 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1155 21050 HSC.r.50 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1156 21051 HSC.r.51 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1157 21052 HSC.r.52 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1158 21053 HSC.r.53 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1159 21054 HSC.r.54 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1160 21055 HSC.r.55 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1161 21056 HSC.r.56 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1162 21057 HSC.r.57 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1163 21058 HSC.r.58 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1164 21059 HSC.r.59 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1165 21060 HSC.r.60 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1166 21061 HSC.r.61 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1167 21062 HSC.r.62 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1168 21063 HSC.r.63 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1169 21064 HSC.r.64 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1170 21065 HSC.r.65 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1171 21066 HSC.r.66 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1172 21067 HSC.r.67 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1173 21068 HSC.r.68 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1174 21069 HSC.r.69 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1175 21070 HSC.r.70 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1176 21071 HSC.r.71 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1177 21072 HSC.r.72 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1178 21073 HSC.r.73 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1179 21074 HSC.r.74 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1180 21075 HSC.r.75 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1181 21076 HSC.r.76 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1182 21077 HSC.r.77 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1183 21078 HSC.r.78 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1184 21079 HSC.r.79 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1185 21080 HSC.r.80 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1186 21081 HSC.r.81 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1187 21082 HSC.r.82 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1188 21083 HSC.r.83 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1189 21084 HSC.r.84 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1190 21085 HSC.r.85 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1191 21086 HSC.r.86 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1192 21087 HSC.r.87 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1193 21088 HSC.r.88 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1194 21089 HSC.r.89 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1195 21090 HSC.r.90 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1196 21091 HSC.r.91 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1197 21092 HSC.r.92 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1198 21093 HSC.r.93 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1199 21094 HSC.r.94 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1200 21095 HSC.r.95 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1201 21096 HSC.r.96 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1202 21097 HSC.r.97 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1203 21098 HSC.r.98 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1204 21099 HSC.r.99 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1205 21100 HSC.r.100 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1206 21101 HSC.r.101 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1207 21102 HSC.r.102 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1208 21103 HSC.r.103 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1209 21104 HSC.r.104 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1210 21105 HSC.r.105 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1211 21106 HSC.r.106 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1212 21107 HSC.r.107 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1213 21108 HSC.r.108 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1214 21109 HSC.r.109 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1215 21110 HSC.r.110 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1216 21111 HSC.r.111 dep 27.100 -0.100 0.000 - - 0.0000 0 2 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1217 22000 HSC.i.00 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1218 22001 HSC.i.01 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1219 22002 HSC.i.02 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1220 22003 HSC.i.03 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1221 22004 HSC.i.04 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1222 22005 HSC.i.05 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1223 22006 HSC.i.06 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1224 22007 HSC.i.07 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1225 22008 HSC.i.08 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1226 22009 HSC.i.09 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1227 22010 HSC.i.10 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1228 22011 HSC.i.11 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1229 22012 HSC.i.12 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1230 22013 HSC.i.13 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1231 22014 HSC.i.14 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1232 22015 HSC.i.15 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1233 22016 HSC.i.16 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1234 22017 HSC.i.17 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1235 22018 HSC.i.18 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1236 22019 HSC.i.19 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1237 22020 HSC.i.20 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1238 22021 HSC.i.21 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1239 22022 HSC.i.22 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1240 22023 HSC.i.23 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1241 22024 HSC.i.24 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1242 22025 HSC.i.25 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1243 22026 HSC.i.26 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1244 22027 HSC.i.27 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1245 22028 HSC.i.28 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1246 22029 HSC.i.29 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1247 22030 HSC.i.30 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1248 22031 HSC.i.31 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1249 22032 HSC.i.32 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1250 22033 HSC.i.33 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1251 22034 HSC.i.34 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1252 22035 HSC.i.35 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1253 22036 HSC.i.36 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1254 22037 HSC.i.37 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1255 22038 HSC.i.38 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1256 22039 HSC.i.39 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1257 22040 HSC.i.40 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1258 22041 HSC.i.41 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1259 22042 HSC.i.42 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1260 22043 HSC.i.43 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1261 22044 HSC.i.44 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1262 22045 HSC.i.45 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1263 22046 HSC.i.46 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1264 22047 HSC.i.47 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1265 22048 HSC.i.48 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1266 22049 HSC.i.49 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1267 22050 HSC.i.50 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1268 22051 HSC.i.51 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1269 22052 HSC.i.52 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1270 22053 HSC.i.53 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1271 22054 HSC.i.54 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1272 22055 HSC.i.55 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1273 22056 HSC.i.56 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1274 22057 HSC.i.57 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1275 22058 HSC.i.58 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1276 22059 HSC.i.59 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1277 22060 HSC.i.60 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1278 22061 HSC.i.61 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1279 22062 HSC.i.62 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1280 22063 HSC.i.63 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1281 22064 HSC.i.64 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1282 22065 HSC.i.65 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1283 22066 HSC.i.66 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1284 22067 HSC.i.67 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1285 22068 HSC.i.68 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1286 22069 HSC.i.69 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1287 22070 HSC.i.70 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1288 22071 HSC.i.71 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1289 22072 HSC.i.72 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1290 22073 HSC.i.73 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1291 22074 HSC.i.74 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1292 22075 HSC.i.75 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1293 22076 HSC.i.76 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1294 22077 HSC.i.77 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1295 22078 HSC.i.78 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1296 22079 HSC.i.79 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1297 22080 HSC.i.80 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1298 22081 HSC.i.81 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1299 22082 HSC.i.82 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1300 22083 HSC.i.83 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1301 22084 HSC.i.84 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1302 22085 HSC.i.85 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1303 22086 HSC.i.86 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1304 22087 HSC.i.87 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1305 22088 HSC.i.88 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1306 22089 HSC.i.89 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1307 22090 HSC.i.90 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1308 22091 HSC.i.91 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1309 22092 HSC.i.92 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1310 22093 HSC.i.93 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1311 22094 HSC.i.94 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1312 22095 HSC.i.95 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1313 22096 HSC.i.96 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1314 22097 HSC.i.97 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1315 22098 HSC.i.98 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1316 22099 HSC.i.99 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1317 22100 HSC.i.100 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1318 22101 HSC.i.101 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1319 22102 HSC.i.102 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1320 22103 HSC.i.103 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1321 22104 HSC.i.104 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1322 22105 HSC.i.105 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1323 22106 HSC.i.106 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1324 22107 HSC.i.107 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1325 22108 HSC.i.108 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1326 22109 HSC.i.109 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1327 22110 HSC.i.110 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1328 22111 HSC.i.111 dep 27.000 -0.040 0.000 - - 0.0000 0 3 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1329 23000 HSC.z.00 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1330 23001 HSC.z.01 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1331 23002 HSC.z.02 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1332 23003 HSC.z.03 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1333 23004 HSC.z.04 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1334 23005 HSC.z.05 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1335 23006 HSC.z.06 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1336 23007 HSC.z.07 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1337 23008 HSC.z.08 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1338 23009 HSC.z.09 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1339 23010 HSC.z.10 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1340 23011 HSC.z.11 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1341 23012 HSC.z.12 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1342 23013 HSC.z.13 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1343 23014 HSC.z.14 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1344 23015 HSC.z.15 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1345 23016 HSC.z.16 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1346 23017 HSC.z.17 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1347 23018 HSC.z.18 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1348 23019 HSC.z.19 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1349 23020 HSC.z.20 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1350 23021 HSC.z.21 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1351 23022 HSC.z.22 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1352 23023 HSC.z.23 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1353 23024 HSC.z.24 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1354 23025 HSC.z.25 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1355 23026 HSC.z.26 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1356 23027 HSC.z.27 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1357 23028 HSC.z.28 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1358 23029 HSC.z.29 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1359 23030 HSC.z.30 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1360 23031 HSC.z.31 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1361 23032 HSC.z.32 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1362 23033 HSC.z.33 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1363 23034 HSC.z.34 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1364 23035 HSC.z.35 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1365 23036 HSC.z.36 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1366 23037 HSC.z.37 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1367 23038 HSC.z.38 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1368 23039 HSC.z.39 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1369 23040 HSC.z.40 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1370 23041 HSC.z.41 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1371 23042 HSC.z.42 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1372 23043 HSC.z.43 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1373 23044 HSC.z.44 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1374 23045 HSC.z.45 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1375 23046 HSC.z.46 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1376 23047 HSC.z.47 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1377 23048 HSC.z.48 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1378 23049 HSC.z.49 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1379 23050 HSC.z.50 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1380 23051 HSC.z.51 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1381 23052 HSC.z.52 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1382 23053 HSC.z.53 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1383 23054 HSC.z.54 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1384 23055 HSC.z.55 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1385 23056 HSC.z.56 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1386 23057 HSC.z.57 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1387 23058 HSC.z.58 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1388 23059 HSC.z.59 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1389 23060 HSC.z.60 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1390 23061 HSC.z.61 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1391 23062 HSC.z.62 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1392 23063 HSC.z.63 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1393 23064 HSC.z.64 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1394 23065 HSC.z.65 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1395 23066 HSC.z.66 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1396 23067 HSC.z.67 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1397 23068 HSC.z.68 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1398 23069 HSC.z.69 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1399 23070 HSC.z.70 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1400 23071 HSC.z.71 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1401 23072 HSC.z.72 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1402 23073 HSC.z.73 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1403 23074 HSC.z.74 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1404 23075 HSC.z.75 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1405 23076 HSC.z.76 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1406 23077 HSC.z.77 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1407 23078 HSC.z.78 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1408 23079 HSC.z.79 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1409 23080 HSC.z.80 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1410 23081 HSC.z.81 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1411 23082 HSC.z.82 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1412 23083 HSC.z.83 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1413 23084 HSC.z.84 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1414 23085 HSC.z.85 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1415 23086 HSC.z.86 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1416 23087 HSC.z.87 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1417 23088 HSC.z.88 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1418 23089 HSC.z.89 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1419 23090 HSC.z.90 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1420 23091 HSC.z.91 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1421 23092 HSC.z.92 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1422 23093 HSC.z.93 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1423 23094 HSC.z.94 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1424 23095 HSC.z.95 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1425 23096 HSC.z.96 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1426 23097 HSC.z.97 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1427 23098 HSC.z.98 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1428 23099 HSC.z.99 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1429 23100 HSC.z.100 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1430 23101 HSC.z.101 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1431 23102 HSC.z.102 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1432 23103 HSC.z.103 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1433 23104 HSC.z.104 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1434 23105 HSC.z.105 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1435 23106 HSC.z.106 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1436 23107 HSC.z.107 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1437 23108 HSC.z.108 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1438 23109 HSC.z.109 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1439 23110 HSC.z.110 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1440 23111 HSC.z.111 dep 26.200 -0.030 0.000 - - 0.0000 0 4 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1438 1441 24000 HSC.y.00 dep 25.000 0.000 0.000 - - 0.0000 0 5 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1439 1442 24001 HSC.y.01 dep 25.000 0.000 0.000 - - 0.0000 0 5 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 … … 1548 1551 24110 HSC.y.110 dep 25.000 0.000 0.000 - - 0.0000 0 5 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1549 1552 24111 HSC.y.111 dep 25.000 0.000 0.000 - - 0.0000 0 5 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1553 25000 HSC.NB921.00 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1554 25001 HSC.NB921.01 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1555 25002 HSC.NB921.02 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1556 25003 HSC.NB921.03 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1557 25004 HSC.NB921.04 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1558 25005 HSC.NB921.05 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1559 25006 HSC.NB921.06 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1560 25007 HSC.NB921.07 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1561 25008 HSC.NB921.08 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1562 25009 HSC.NB921.09 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1563 25010 HSC.NB921.10 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1564 25011 HSC.NB921.11 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1565 25012 HSC.NB921.12 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1566 25013 HSC.NB921.13 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1567 25014 HSC.NB921.14 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1568 25015 HSC.NB921.15 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1569 25016 HSC.NB921.16 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1570 25017 HSC.NB921.17 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1571 25018 HSC.NB921.18 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1572 25019 HSC.NB921.19 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1573 25020 HSC.NB921.20 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1574 25021 HSC.NB921.21 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1575 25022 HSC.NB921.22 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1576 25023 HSC.NB921.23 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1577 25024 HSC.NB921.24 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1578 25025 HSC.NB921.25 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1579 25026 HSC.NB921.26 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1580 25027 HSC.NB921.27 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1581 25028 HSC.NB921.28 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1582 25029 HSC.NB921.29 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1583 25030 HSC.NB921.30 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1584 25031 HSC.NB921.31 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1585 25032 HSC.NB921.32 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1586 25033 HSC.NB921.33 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1587 25034 HSC.NB921.34 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1588 25035 HSC.NB921.35 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1589 25036 HSC.NB921.36 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1590 25037 HSC.NB921.37 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1591 25038 HSC.NB921.38 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1592 25039 HSC.NB921.39 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1593 25040 HSC.NB921.40 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1594 25041 HSC.NB921.41 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1595 25042 HSC.NB921.42 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1596 25043 HSC.NB921.43 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1597 25044 HSC.NB921.44 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1598 25045 HSC.NB921.45 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1599 25046 HSC.NB921.46 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1600 25047 HSC.NB921.47 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1601 25048 HSC.NB921.48 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1602 25049 HSC.NB921.49 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1603 25050 HSC.NB921.50 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1604 25051 HSC.NB921.51 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1605 25052 HSC.NB921.52 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1606 25053 HSC.NB921.53 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1607 25054 HSC.NB921.54 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1608 25055 HSC.NB921.55 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1609 25056 HSC.NB921.56 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1610 25057 HSC.NB921.57 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1611 25058 HSC.NB921.58 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1612 25059 HSC.NB921.59 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1613 25060 HSC.NB921.60 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1614 25061 HSC.NB921.61 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1615 25062 HSC.NB921.62 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1616 25063 HSC.NB921.63 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1617 25064 HSC.NB921.64 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1618 25065 HSC.NB921.65 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1619 25066 HSC.NB921.66 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1620 25067 HSC.NB921.67 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1621 25068 HSC.NB921.68 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1622 25069 HSC.NB921.69 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1623 25070 HSC.NB921.70 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1624 25071 HSC.NB921.71 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1625 25072 HSC.NB921.72 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1626 25073 HSC.NB921.73 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1627 25074 HSC.NB921.74 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1628 25075 HSC.NB921.75 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1629 25076 HSC.NB921.76 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1630 25077 HSC.NB921.77 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1631 25078 HSC.NB921.78 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1632 25079 HSC.NB921.79 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1633 25080 HSC.NB921.80 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1634 25081 HSC.NB921.81 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1635 25082 HSC.NB921.82 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1636 25083 HSC.NB921.83 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1637 25084 HSC.NB921.84 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1638 25085 HSC.NB921.85 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1639 25086 HSC.NB921.86 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1640 25087 HSC.NB921.87 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1641 25088 HSC.NB921.88 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1642 25089 HSC.NB921.89 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1643 25090 HSC.NB921.90 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1644 25091 HSC.NB921.91 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1645 25092 HSC.NB921.92 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1646 25093 HSC.NB921.93 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1647 25094 HSC.NB921.94 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1648 25095 HSC.NB921.95 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1649 25096 HSC.NB921.96 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1650 25097 HSC.NB921.97 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1651 25098 HSC.NB921.98 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1652 25099 HSC.NB921.99 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1653 25100 HSC.NB921.100 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1654 25101 HSC.NB921.101 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1655 25102 HSC.NB921.102 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1656 25103 HSC.NB921.103 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1657 25104 HSC.NB921.104 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1658 25105 HSC.NB921.105 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1659 25106 HSC.NB921.106 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1660 25107 HSC.NB921.107 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1661 25108 HSC.NB921.108 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1662 25109 HSC.NB921.109 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1663 25110 HSC.NB921.110 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1664 25111 HSC.NB921.111 dep 25.000 0.000 0.000 - - 0.0000 0 - 0.000 0.000 0.000 0.000 0x0000 0x0000 0x0000 0x0000 1665 -
trunk/ippconfig/hsc
-
Property svn:ignore
set to
Makefile
Makefile.in
-
Property svn:ignore
set to
-
trunk/ippconfig/hsc/Makefile.am
r39705 r39926 7 7 format_raw.config \ 8 8 format_mef.config \ 9 format_cmf.config \ 9 10 ppImage.config \ 10 11 ppMerge.config \ 11 12 psastro.config \ 12 ppStats.config 13 ppStats.config \ 14 ppStack.config 13 15 14 16 install_DATA = $(install_files) -
trunk/ippconfig/hsc/camera.config
r39705 r39926 5 5 MEF STR hsc/format_mef.config # for output cmfs from, e.g., camera 6 6 RAW STR hsc/format_raw.config 7 CMF STR hsc/format_cmf.config # chip output cmfs 7 8 # SPLIT STR hsc/format_split.config 8 9 END … … 139 140 z STR HSC-z 140 141 y STR HSC-Y 142 NB921 STR NB0921 141 143 END 142 144 … … 176 178 # PPSTACK STR hsc/ppStack.config # ppStack recipe 177 179 PPSTATS STR hsc/ppStats.config 180 PPSTACK STR hsc/ppStack.config 178 181 END 179 182 -
trunk/ippconfig/hsc/format_mef.config
r39705 r39926 193 193 FPA.FILTER STR FILTER01 194 194 FPA.FILTERID STR FILTER01 195 FPA.POSANGLE STR INR-STR 196 # FPA.POSANGLE STR INST-PA (not sure which is right) 195 # FPA.POSANGLE STR INR-STR -- this is equivalent to the GPC1 ROT, not POS 196 FPA.POSANGLE STR INST-PA 197 197 FPA.RA STR RA 198 198 FPA.DEC STR DEC … … 219 219 # FPA.ENV.DIR STR OUT-TMP 220 220 FPA.TELTEMP.TRUSS STR DOM-TMP # Mid truss temperatures (C 221 FPA.ZP STR ZPT_OBS 222 221 223 222 224 CHIP.TEMP STR DET-TMP -
trunk/ippconfig/hsc/format_raw.config
r39705 r39926 5 5 TELESCOP STR Subaru 6 6 INSTRUME STR Hyper Suprime-Cam 7 #NAXIS S32 2 # with 2 this is an image (with 0, this is an output smf)7 NAXIS S32 2 # with 2 this is an image (with 0, this is an output smf) 8 8 END 9 9 … … 192 192 FPA.FILTER STR FILTER01 193 193 FPA.FILTERID STR FILTER01 194 FPA.POSANGLE STR INR-STR195 # FPA.POSANGLE STR INST-PA (not sure which is right) 194 # FPA.POSANGLE STR INR-STR 195 FPA.POSANGLE STR INST-PA 196 196 FPA.RA STR RA 197 197 FPA.DEC STR DEC -
trunk/ippconfig/hsc/ppImage.config
r39504 r39926 14 14 FILTER STR FPA.FILTERID 15 15 END 16 17 FRINGE METADATA 18 FILTER STR FPA.FILTERID 19 END 16 20 END 21 22 FRINGE.FILTERS MULTI 23 FRINGE.FILTERS STR HSC-Y 17 24 18 25 # Standard chip processing … … 31 38 FLAT BOOL TRUE # Flat-field normalisation 32 39 MASK BOOL TRUE # Mask bad pixels 33 FRINGE BOOL FALSE# Fringe subtraction40 FRINGE BOOL TRUE # Fringe subtraction 34 41 BIN1.FITS BOOL TRUE # Save 1st binned chip image? 35 42 BIN2.FITS BOOL TRUE # Save 2nd binned chip image? … … 91 98 END 92 99 100 # This is the processing recipe for fringes 101 PPIMAGE_OBDSF METADATA 102 BASE.FITS BOOL TRUE # Save base detrended image? 103 BASE.MASK.FITS BOOL TRUE # Save base detrended image? 104 BASE.VARIANCE.FITS BOOL TRUE # Save base detrended image? 105 CHIP.FITS BOOL FALSE # Save chip-mosaic-ed image? 106 CHIP.MASK.FITS BOOL FALSE # Save chip-mosaic-ed image? 107 CHIP.VARIANCE.FITS BOOL FALSE # Save chip-mosaic-ed image? 108 OVERSCAN BOOL TRUE # Overscan subtraction 109 NONLIN BOOL FALSE # Non-linearity correction; not implemented 110 BIAS BOOL TRUE # Bias subtraction 111 DARK BOOL FALSE # Dark subtraction 112 SHUTTER BOOL FALSE # Shutter correction 113 FLAT BOOL TRUE # Flat-field normalisation 114 MASK BOOL TRUE # Mask bad pixels 115 MASK.BUILD BOOL FALSE # Build internal mask? 116 FRINGE BOOL FALSE # Fringe subtraction 117 PHOTOM BOOL FALSE # Source identification and photometry 118 ASTROM.CHIP BOOL FALSE # Astrometry per chip? 119 ASTROM.MOSAIC BOOL FALSE # Astrometry for mosaic? 120 BIN1.FITS BOOL TRUE # Save 1st binned chip image? 121 BIN2.FITS BOOL TRUE # Save 2nd binned chip image? 122 END 123 93 124 # Overscan, bias, dark, shutter, flat-field -- use FLAT_PREMASK 94 125 PPIMAGE_FLATMASK_PROCESS METADATA -
trunk/ippconfig/hsc/ppMerge.config
r39504 r39926 1 2 FRINGE.NUM S32 6250 # number of fringe regions per cell 3 FRINGE.SIZE S32 5 # Half-size of fringe regions 4 FRINGE.XSMOOTH S32 3 # Number of smoothing regions per cell in x 5 FRINGE.YSMOOTH S32 3 # Number of smoothing regions per cell in y 6 FRINGE.SMOOTH BOOL T # Smooth the output image? 7 FRINGE.SMOOTH.SIGMA F32 2.0 # Sigma of smoothing Gaussian 8 1 9 2 10 # Bias combination --- don't want min/max rejection … … 12 20 STDEV STR ROBUST_STDEV # Statistic to use to measure the stdev 13 21 END 22 23 -
trunk/ippconfig/hsc/psastro.config
r39504 r39926 6 6 DVO.GETSTAR.OUTFORMAT STR PS1_DEV_0 7 7 DVO.GETSTAR.PHOTCODE STR i 8 DVO.GETSTAR.MAX.RHO F32 10000.08 DVO.GETSTAR.MAX.RHO F32 30000.0 9 9 DVO.GETSTAR.MIN.MAG F32 12.0 10 10 DVO.GETSTAR.MIN.MAG.INST F32 -15.0 … … 13 13 PHOTCODE.DATA METADATA 14 14 FILTER STR g 15 ZEROPT F32 2 8.015 ZEROPT F32 26.75 16 16 PHOTCODE STR g 17 17 GHOST_MAX_MAG F32 -16.5 … … 19 19 PHOTCODE.DATA METADATA 20 20 FILTER STR r 21 ZEROPT F32 2 8.021 ZEROPT F32 27.1 22 22 PHOTCODE STR r 23 23 GHOST_MAX_MAG F32 -20.0 … … 25 25 PHOTCODE.DATA METADATA 26 26 FILTER STR i 27 ZEROPT F32 2 6.927 ZEROPT F32 27.0 28 28 PHOTCODE STR i 29 29 GHOST_MAX_MAG F32 -25.0 … … 31 31 PHOTCODE.DATA METADATA 32 32 FILTER STR z 33 ZEROPT F32 28.0 33 ZEROPT F32 26.2 34 PHOTCODE STR z 35 GHOST_MAX_MAG F32 -25.0 36 END 37 PHOTCODE.DATA METADATA 38 FILTER STR y 39 ZEROPT F32 25.1 40 PHOTCODE STR y 41 GHOST_MAX_MAG F32 -25.0 42 END 43 PHOTCODE.DATA METADATA 44 FILTER STR NB921 45 ZEROPT F32 25.4 34 46 PHOTCODE STR z 35 47 GHOST_MAX_MAG F32 -25.0 36 48 END 37 49 50 51 PSASTRO.USE.MODEL BOOL TRUE 52 53 # extra field for ref stars: 54 PSASTRO.PHOTOM.WINDOW.SIGMA F32 0.0 55 56 PSASTRO.GRID.MIN.ANGLE F32 -2.0 # start angle (degrees) 57 PSASTRO.GRID.MAX.ANGLE F32 +2.0 58 PSASTRO.GRID.DEL.ANGLE F32 1.0 59 60 PSASTRO.GRID.NREF.MAX S32 1000 # max stars accepted for fitting 61 PSASTRO.GRID.NRAW.MAX S32 1000 # max stars accepted for fitting 62 63 PSASTRO.GRID.MIN.INST.MAG.RAW F32 -14 64 PSASTRO.GRID.MAX.INST.MAG.RAW F32 -9 65 38 66 # pmAstromMatchFit 39 PSASTRO.CHIP.ORDER S32 3# fit order67 PSASTRO.CHIP.ORDER S32 1 # fit order 40 68 PSASTRO.CHIP.NITER S32 3 # fit clipping iterations 41 69 PSASTRO.CHIP.NSIGMA F32 3 # fit clipping sigmas 42 70 43 71 # single-chip radius match in pixels 44 PSASTRO.MATCH.RADIUS.N0 F32 9045 PSASTRO.MATCH.RADIUS.N1 F32 6046 PSASTRO.MATCH.RADIUS.N2 F32 3047 PSASTRO.MATCH.RADIUS.N3 F32 2048 PSASTRO.MATCH.RADIUS.N4 F32 2049 PSASTRO.MATCH.RADIUS.N5 F32 1050 PSASTRO.MATCH.RADIUS.N6 F32 1051 PSASTRO.MATCH.RADIUS.N7 F32 552 PSASTRO.MATCH.FIT.NITER S32 872 PSASTRO.MATCH.RADIUS.N0 F32 30 73 PSASTRO.MATCH.RADIUS.N1 F32 20 74 PSASTRO.MATCH.RADIUS.N2 F32 20 75 PSASTRO.MATCH.RADIUS.N3 F32 10 76 PSASTRO.MATCH.RADIUS.N4 F32 10 77 PSASTRO.MATCH.RADIUS.N5 F32 8 # was 5 78 PSASTRO.MATCH.RADIUS.N6 F32 2 79 PSASTRO.MATCH.RADIUS.N7 F32 0 80 PSASTRO.MATCH.FIT.NITER S32 6 # was 7 53 81 82 # Mosaic Astrometry options 83 PSASTRO.MOSAIC.MODE BOOL TRUE 84 85 # for iterations >= N, require a single match per reference 86 PSASTRO.MOSAIC.CHIP.NITER S32 5 # fit clipping iterations (NOTE: last iteration is NITER, not NITER - 1) 87 PSASTRO.MOSAIC.CHIP.NSIGMA F32 3 # fit clipping sigmas 88 PSASTRO.MOSAIC.UNIQ.ITER S32 3 # for iterations >= N, require a single match per reference 89 90 PSASTRO.MOSAIC.MAX.ERROR.N0 F32 0.00 # max allow error for valid solution (arcsec) 91 PSASTRO.MOSAIC.MAX.ERROR.N1 F32 0.00 # max allow error for valid solution (arcsec) 92 PSASTRO.MOSAIC.MAX.ERROR.N2 F32 0.00 # max allow error for valid solution (arcsec) 93 PSASTRO.MOSAIC.MAX.ERROR.N3 F32 0.00 # max allow error for valid solution (arcsec) 94 PSASTRO.MOSAIC.MAX.ERROR.N4 F32 0.00 # max allow error for valid solution (arcsec) 95 PSASTRO.MOSAIC.MAX.ERROR.N5 F32 0.30 # max allow error for valid solution (arcsec) 96 97 # mosaic radius match in pixels (do these make sense?) 98 PSASTRO.MOSAIC.RADIUS.N0 F32 15 99 PSASTRO.MOSAIC.RADIUS.N1 F32 10 100 PSASTRO.MOSAIC.RADIUS.N2 F32 10 101 PSASTRO.MOSAIC.RADIUS.N3 F32 5 102 PSASTRO.MOSAIC.RADIUS.N4 F32 5 103 PSASTRO.MOSAIC.RADIUS.N5 F32 3 104 105 PSASTRO.MOSAIC.CHIP.ORDER S32 1 # limit chip-fit order to 1 106 PSASTRO.MOSAIC.CHIP.ORDER.N0 S32 0 # fit order (-1 means use default) 107 PSASTRO.MOSAIC.CHIP.ORDER.N1 S32 0 # fit order (-1 means use default) 108 PSASTRO.MOSAIC.CHIP.ORDER.N2 S32 1 # fit order (-1 means use default) 109 PSASTRO.MOSAIC.CHIP.ORDER.N3 S32 1 # fit order (-1 means use default) 110 PSASTRO.MOSAIC.CHIP.ORDER.N4 S32 3 # fit order (-1 means use default) 111 PSASTRO.MOSAIC.CHIP.ORDER.N5 S32 3 # fit order (-1 means use default) 112 113 PSASTRO.MODEL.REF.CHIP STR x050 114 PSASTRO.MODEL.REF.CHIP.ANGLE F32 90.0 115 PSASTRO.MODEL.ROT.PARITY S32 -1 -
trunk/ippconfig/megacam/dvo.config
r20858 r39926 20 20 CCDNUM-KEYWORD EXTNAME 21 21 ST-KEYWORD NONE 22 OBSERVATORY-LATITUDE NONE23 OBSERVATORY-LONGITUDE NONE22 OBSERVATORY-LATITUDE 19.825237 23 OBSERVATORY-LONGITUDE 10.3645844667 24 24 SUBPIX_DATAFILE NONE 25 25 -
trunk/ippconfig/megacam/psastro.config
r35723 r39926 137 137 END 138 138 139 PSASTRO.CATDIR STR SYNTH.GRIZY 140 DVO.GETSTAR.MAX.RHO F32 3000.0 139 PSASTRO.CATDIR STR PS1.REF.20140713 140 # PSASTRO.CATDIR STR SYNTH.GRIZY 141 DVO.GETSTAR.MAX.RHO F32 30000.0 142 DVO.GETSTAR.OUTFORMAT STR PS1_DEV_0 141 143 DVO.GETSTAR.MIN.MAG F32 12.0 142 144 DVO.GETSTAR.MIN.MAG.INST F32 -15.0 -
trunk/ippconfig/recipes/nightly_science.config
- Property svn:mergeinfo deleted
-
trunk/ippconfig/recipes/psastro.config
r39503 r39926 22 22 # extra field for ref stars: 23 23 PSASTRO.FIELD.PADDING F32 0.25 24 25 # extra field for ref stars: 26 PSASTRO.PHOTOM.WINDOW.SIGMA F32 0.0 24 27 25 28 # pmAstromGridMatch: … … 233 236 234 237 PSASTRO.MODEL.REF.CHIP STR NONE 238 PSASTRO.MODEL.REF.CHIP.ANGLE F32 0.0 239 PSASTRO.MODEL.ROT.PARITY S32 +1 235 240 PSASTRO.MODEL.FIT.BORESITE BOOL FALSE 236 241 PSASTRO.MODEL.SET.BORESITE BOOL FALSE -
trunk/ippconfig/recipes/psphot.config
r39818 r39926 64 64 FOOTPRINT_GROW_RADIUS S32 3 # How much to grow bright footprints 65 65 FOOTPRINT_GROW_RADIUS_2 S32 5 # How much to grow faint footprints 66 FOOTPRINT_CULL_NSIGMA_DELTA F32 4 # Cull peaks that aren't nsigma above col lto neighbour67 FOOTPRINT_CULL_NSIGMA_MIN F32 1 # Minimum height of col ls in units of skyStdev66 FOOTPRINT_CULL_NSIGMA_DELTA F32 4 # Cull peaks that aren't nsigma above col to neighbour 67 FOOTPRINT_CULL_NSIGMA_MIN F32 1 # Minimum height of cols in units of skyStdev 68 68 FOOTPRINT_CULL_NSIGMA_PAD F32 0.01 # Fractional Padding for stdev 69 69 FOOTPRINT_USE_UNSUBTRACTED BOOL TRUE # find footprints without sources subtracted -
trunk/ppMerge/src/ppMergeLoop.c
r35687 r39926 398 398 399 399 psFree(fileGroups); 400 psFree(zeros);400 // psFree(zeros); 401 401 402 402 // XXX eventually need to keep both the shutter and the pattern, as we do with dark -
trunk/psLib/src/astro/psCoord.c
r19504 r39926 234 234 const psPlane* coords) 235 235 { 236 if (!transform) { 237 fprintf (stderr, "problem\n"); 238 } 236 239 PS_ASSERT_PTR_NON_NULL(transform, NULL); 237 240 PS_ASSERT_PTR_NON_NULL(transform->x, NULL); … … 305 308 void projectionFree(psProjection *p) 306 309 { 307 // There are no dynamically allocated items 310 if (!p) return; 311 if (!p->radial) return; 312 psFree (p->radial); 308 313 } 309 314 … … 321 326 p->Ys = Ys; 322 327 p->type = type; 328 p->radial = NULL; 323 329 324 330 psMemSetDeallocator(p, (psFreeFunc) projectionFree); … … 368 374 case PS_PROJ_ZEA: 369 375 case PS_PROJ_ZPL: 376 case PS_PROJ_ZPN: 370 377 class = PS_PROJECTION_CLASS_ZENITHAL; 371 378 break; … … 442 449 out->y = -zeta * cosPhiCT; 443 450 break; 451 452 case PS_PROJ_ZPN: { 453 // the forward projection is: 454 // theta = atan2(stht, ctht) 455 // gamma = (pi/2 - theta) : theta in radians 456 // Ro = sum (P_i gamma^i) 457 // R = (180/pi) Ro 458 459 // Ro = (pi/180)(90 - theta) 460 // R = (180/pi)sum (P_i R^i) 461 462 // is ZPN defined for Npolyterms = 0 or 1? 463 464 double cosTheta = hypot(sinPhiCT, cosPhiCT); 465 double theta = atan2 (sinTheta, cosTheta); 466 467 double gamma = M_PI_2 - theta; 468 469 // i = 0 .. N - 1 (1 <= Npolyterms <= 21) 470 double Ro = 0.0; 471 for (int i = projection->radial->n - 1; i > 0; i--) { 472 double Pi = projection->radial->data.F64[i]; 473 Ro = (Ro + Pi)*gamma; 474 } 475 Ro += projection->radial->data.F64[0]; 476 477 out->x = (cosTheta == 0.0) ? 0.0 : +Ro * sinPhiCT / cosTheta ; 478 out->y = (cosTheta == 0.0) ? 0.0 : -Ro * cosPhiCT / cosTheta ; 479 break; 480 } 481 444 482 default: 445 483 psAbort("invalid projection"); … … 525 563 case PS_PROJ_ZEA: 526 564 case PS_PROJ_ZPL: 565 case PS_PROJ_ZPN: 527 566 class = PS_PROJECTION_CLASS_ZENITHAL; 528 567 break; … … 574 613 case PS_PROJ_SIN: 575 614 // Orhtographic deprojection 615 cosTheta = R; 576 616 sinTheta = sqrt (1 - R*R); 577 cosTheta = R;578 617 break; 579 618 case PS_PROJ_STG: 580 psAbort("STG not defined"); 619 sinTheta = (4 - R) / (4 + R); 620 cosTheta = sqrt (1 - sinTheta*sinTheta); 581 621 break; 582 622 case PS_PROJ_ZEA: … … 587 627 cosTheta = sqrt (1 - PS_SQR(sinTheta)); 588 628 break; 629 630 case PS_PROJ_ZPN: 631 632 // the forward projection is: 633 // theta = atan2(stht, ctht) 634 // gamma = (pi/2 - theta) : theta in radians 635 // Ro = sum (P_i gamma^i) 636 // R = (180/pi) Ro 637 638 // given R, we need to find theta: 639 // Ro = R * (pi / 180) = sum (P_i gamma^i) 640 // solve sum (P_i gamma^i) - Ro = 0 using Newton-Raphson 641 642 // use Ro to get a guess for gamma and iterate 643 644 { 645 // find the roots of f(gamma) - R = 0 646 // starting guess for gamma is (R - P0) / P1 647 double gamma = (R - projection->radial->data.F64[0]) / projection->radial->data.F64[1]; 648 649 for (int iter = 0; iter < 5; iter++) { 650 651 double Rc = 0.0; // this will hold the ander 652 double dR = 0.0; 653 for (int i = projection->radial->n - 1; i > 1; i--) { 654 double Pi = projection->radial->data.F64[i]; 655 Rc = (Rc + Pi)*gamma; 656 dR = (dR + i*Pi)*gamma; 657 } 658 double P0 = projection->radial->data.F64[0]; 659 double P1 = projection->radial->data.F64[1]; 660 Rc = (Rc + P1)*gamma + P0; 661 dR = (dR + P1); 662 663 double gamma_new = gamma - (Rc - R) / dR; 664 gamma = gamma_new; 665 } 666 667 double theta = M_PI_2 - gamma ; 668 cosTheta = cos (theta); 669 sinTheta = sin (theta); 670 break; 671 } 672 589 673 default: 590 674 psAbort("invalid projection"); … … 949 1033 myPT = psPlaneTransformAlloc(order, order); 950 1034 } else { 1035 // the user has supplied a model with a specific order : fit that order 1036 myPT = psMemIncrRefCounter(out); // we need to return something which can be freed 1037 # if (0) 951 1038 if ((out->x->nX == order) && (out->x->nY == order) && 952 1039 (out->y->nX == order) && (out->y->nX == order)) { … … 956 1043 myPT = psPlaneTransformAlloc(order, order); 957 1044 } 1045 # endif 958 1046 } 959 1047 … … 1183 1271 1184 1272 switch (type) { 1185 case PS_PROJ_LIN: 1186 psStringAppend (&name, "%s-LIN", prefix); 1187 return name; 1188 case PS_PROJ_PLY: 1189 psStringAppend (&name, "%s-PLY", prefix); 1190 return name; 1191 case PS_PROJ_WRP: 1192 psStringAppend (&name, "%s-WRP", prefix); 1193 return name; 1194 case PS_PROJ_TAN: 1195 psStringAppend (&name, "%s-TAN", prefix); 1196 return name; 1197 case PS_PROJ_TNX: 1198 psStringAppend (&name, "%s-TNX", prefix); 1199 return name; 1200 case PS_PROJ_DIS: 1201 psStringAppend (&name, "%s-DIS", prefix); 1202 return name; 1203 case PS_PROJ_SIN: 1204 psStringAppend (&name, "%s-SIN", prefix); 1205 return name; 1206 case PS_PROJ_STG: 1207 psStringAppend (&name, "%s-STG", prefix); 1208 return name; 1209 case PS_PROJ_AIT: 1210 psStringAppend (&name, "%s-AIT", prefix); 1211 return name; 1212 case PS_PROJ_PAR: 1213 psStringAppend (&name, "%s-PAR", prefix); 1214 return name; 1215 case PS_PROJ_GLS: 1216 psStringAppend (&name, "%s-GLS", prefix); 1217 return name; 1218 case PS_PROJ_CAR: 1219 psStringAppend (&name, "%s-CAR", prefix); 1220 return name; 1221 case PS_PROJ_MER: 1222 psStringAppend (&name, "%s-MER", prefix); 1223 return name; 1273 case PS_PROJ_LIN: psStringAppend (&name, "%s-LIN", prefix); return name; 1274 case PS_PROJ_PLY: psStringAppend (&name, "%s-PLY", prefix); return name; 1275 case PS_PROJ_WRP: psStringAppend (&name, "%s-WRP", prefix); return name; 1276 case PS_PROJ_TAN: psStringAppend (&name, "%s-TAN", prefix); return name; 1277 1278 case PS_PROJ_DIS: psStringAppend (&name, "%s-DIS", prefix); return name; 1279 case PS_PROJ_SIN: psStringAppend (&name, "%s-SIN", prefix); return name; 1280 case PS_PROJ_STG: psStringAppend (&name, "%s-STG", prefix); return name; 1281 case PS_PROJ_TNX: psStringAppend (&name, "%s-TNX", prefix); return name; 1282 1283 case PS_PROJ_ZEA: psStringAppend (&name, "%s-ZEA", prefix); return name; 1284 case PS_PROJ_ZPL: psStringAppend (&name, "%s-ZPL", prefix); return name; 1285 case PS_PROJ_ZPN: psStringAppend (&name, "%s-ZPN", prefix); return name; 1286 case PS_PROJ_AIT: psStringAppend (&name, "%s-AIT", prefix); return name; 1287 1288 case PS_PROJ_PAR: psStringAppend (&name, "%s-PAR", prefix); return name; 1289 case PS_PROJ_GLS: psStringAppend (&name, "%s-GLS", prefix); return name; 1290 case PS_PROJ_CAR: psStringAppend (&name, "%s-CAR", prefix); return name; 1291 case PS_PROJ_MER: psStringAppend (&name, "%s-MER", prefix); return name; 1224 1292 1225 1293 default: … … 1238 1306 if (!strcmp (&name[4], "-WRP")) return PS_PROJ_WRP; 1239 1307 if (!strcmp (&name[4], "-TAN")) return PS_PROJ_TAN; 1240 if (!strcmp (&name[4], "-TNX")) return PS_PROJ_TNX;1241 1308 if (!strcmp (&name[4], "-DIS")) return PS_PROJ_DIS; 1242 1309 if (!strcmp (&name[4], "-SIN")) return PS_PROJ_SIN; 1243 1310 if (!strcmp (&name[4], "-STG")) return PS_PROJ_STG; 1311 if (!strcmp (&name[4], "-TNX")) return PS_PROJ_TNX; 1312 if (!strcmp (&name[4], "-ZEA")) return PS_PROJ_ZEA; 1313 if (!strcmp (&name[4], "-ZPL")) return PS_PROJ_ZPL; 1314 if (!strcmp (&name[4], "-ZPN")) return PS_PROJ_ZPN; 1244 1315 if (!strcmp (&name[4], "-AIT")) return PS_PROJ_AIT; 1245 1316 if (!strcmp (&name[4], "-PAR")) return PS_PROJ_PAR; -
trunk/psLib/src/astro/psCoord.h
r14452 r39926 130 130 PS_PROJ_ZEA, ///< Sine projection 131 131 PS_PROJ_ZPL, ///< Sine projection 132 PS_PROJ_ZPN, ///< Sine projection 132 133 PS_PROJ_AIT, ///< Aitoff projection 133 134 PS_PROJ_PAR, ///< Par projection … … 150 151 double Ys; ///< plate-scale in Y direction 151 152 psProjectionType type; ///< Projection type 152 } 153 psProjection;153 psVector *radial; ///< radial distortion terms 154 } psProjection; 154 155 155 156 /** Allocates a psPlane -
trunk/psLib/src/fits/psFitsScale.c
r39509 r39926 189 189 // Desperate retry 190 190 mean = psStatsGetValue(stats, DESPERATE_MEAN_STAT); 191 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 191 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 192 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); 193 } 194 else { 195 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 196 } 192 197 } 193 198 } else { 194 199 // Retry with all available pixels 195 200 mean = psStatsGetValue(stats, MEAN_STAT); 196 stdev = psStatsGetValue(stats, STDEV_STAT); 201 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 202 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); 203 } 204 else { 205 stdev = psStatsGetValue(stats, STDEV_STAT); 206 } 197 207 } 198 208 } else { 199 209 // First attempt 200 210 mean = psStatsGetValue(stats, MEAN_STAT); 201 stdev = psStatsGetValue(stats, STDEV_STAT); 211 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 212 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); 213 } 214 else { 215 stdev = psStatsGetValue(stats, STDEV_STAT); 216 } 202 217 } 203 218 psFree(rng); … … 554 569 // Desperate retry 555 570 mean = psStatsGetValue(stats, DESPERATE_MEAN_STAT); 556 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 557 } 571 if ((DESPERATE_STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(DESPERATE_STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 572 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 573 } 574 else { 575 576 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 577 } 578 } 558 579 } else { 559 580 // Retry with all available pixels 560 581 mean = psStatsGetValue(stats, MEAN_STAT); 561 stdev = psStatsGetValue(stats, STDEV_STAT); 582 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 583 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 584 } 585 else { 586 stdev = psStatsGetValue(stats, STDEV_STAT); 587 } 562 588 } 563 589 } else { 564 590 // First attempt 565 591 mean = psStatsGetValue(stats, MEAN_STAT); 566 stdev = psStatsGetValue(stats, STDEV_STAT); 592 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 593 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 594 } 595 else { 596 stdev = psStatsGetValue(stats, STDEV_STAT); 597 } 567 598 } 568 599 psFree(rng); … … 723 754 // Desperate retry 724 755 mean = psStatsGetValue(stats, DESPERATE_MEAN_STAT); 725 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 756 if ((DESPERATE_STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(DESPERATE_STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 757 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 758 } 759 else { 760 stdev = psStatsGetValue(stats, DESPERATE_STDEV_STAT); 761 } 726 762 } 727 763 } else { 728 764 // Retry with all available pixels 729 765 mean = psStatsGetValue(stats, MEAN_STAT); 730 stdev = psStatsGetValue(stats, STDEV_STAT); 766 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 767 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 768 } 769 else { 770 stdev = psStatsGetValue(stats, STDEV_STAT); 771 } 731 772 } 732 773 } else { 733 774 // First attempt 734 775 mean = psStatsGetValue(stats, MEAN_STAT); 735 stdev = psStatsGetValue(stats, STDEV_STAT); 776 if ((STDEV_STAT == PS_STAT_SAMPLE_QUARTILE)||(STDEV_STAT == PS_STAT_ROBUST_QUARTILE)) { 777 stdev = 0.7415 * (stats->sampleUQ - stats->sampleLQ); // Calculate a "sigma" based on the interquartile distance. 778 } 779 else { 780 stdev = psStatsGetValue(stats, STDEV_STAT); 781 } 736 782 } 737 783 psFree(rng); -
trunk/psLib/src/types/psMetadata.c
r39598 r39926 1390 1390 break; 1391 1391 case PS_DATA_F64: 1392 fprintf(fd, "% f\n", item->data.F64);1392 fprintf(fd, "%g\n", item->data.F64); 1393 1393 break; 1394 1394 case PS_DATA_METADATA: -
trunk/psModules/src/astrom/pmAstrometryDistortion.c
r23989 r39926 335 335 336 336 psFree (fpa->fromTPA); 337 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, *region, 50); 337 psPlaneTransform *myPT = psPlaneTransformAlloc(fpa->toTPA->x->nX+4, fpa->toTPA->x->nY+4); 338 fpa->fromTPA = psPlaneTransformInvert(myPT, fpa->toTPA, *region, 50); 339 psFree (myPT); 338 340 psFree (region); 339 341 -
trunk/psModules/src/astrom/pmAstrometryModel.c
r36834 r39926 320 320 // the PosZero is the offset between the reported and actual POSANGLE values 321 321 float PosZero = psMetadataLookupF32 (&status, file->fpa->concepts, "FPA.POS_ZERO"); /// XXX be consistent with degrees v radians 322 // Indicate which direction the position angle goes 323 int rotParity = psMetadataLookupS32 (&status, file->fpa->concepts, "FPA.ROT_PARITY"); 322 324 char *refChip = psMetadataLookupStr (&status, file->fpa->concepts, "FPA.REF.CHIP"); 323 325 … … 349 351 350 352 psMetadataAddF32(row, PS_LIST_TAIL, "POS_ZERO", PS_META_REPLACE, "POSANGLE offset (degrees)", PosZero); 353 psMetadataAddS32(row, PS_LIST_TAIL, "ROT_PARITY", PS_META_REPLACE, "rotator parity", rotParity); 351 354 psMetadataAddStr(row, PS_LIST_TAIL, "REF_CHIP", PS_META_REPLACE, "reference chip for model", refChip); 352 355 … … 624 627 TRANSFER (file->fpa->concepts, row, "BORE_P0"); 625 628 TRANSFER (file->fpa->concepts, row, "POS_ZERO"); 629 TRANSFER (file->fpa->concepts, row, "ROT_PARITY"); 626 630 TRANSFER (file->fpa->concepts, row, "REF_CHIP"); 627 631 … … 687 691 char *refChip = psMetadataLookupStr(&status, file->fpa->concepts, "REF_CHIP"); REQUIRE (status, "missing REF_CHIP"); 688 692 693 int rotatorParity = psMetadataLookupS32(&status, file->fpa->concepts, "ROT_PARITY"); REQUIRE (status, "missing ROT_PARITY"); 694 689 695 // XXX we've swapped the sign and parity of POS (add to model) 690 696 // apply true posangle = -(POS - POS_ZERO) 691 697 psLogMsg ("psModules.astrom", 4, "Position Angle: %f, Model Position Angle Zero Point: %f\n", POS, PosZero); 692 psPlaneTransform *fromTPA = psPlaneTransformRotate (NULL, file->fpa->fromTPA, (PosZero - POS));698 psPlaneTransform *fromTPA = psPlaneTransformRotate (NULL, file->fpa->fromTPA, rotatorParity * (PosZero - POS)); 693 699 psFree (file->fpa->fromTPA); 694 700 file->fpa->fromTPA = fromTPA; -
trunk/psModules/src/astrom/pmAstrometryObjects.c
r36834 r39926 225 225 psArray *ref, 226 226 psArray *match, 227 psStats *stats) 227 psStats *stats, 228 const psMetadata *config) 228 229 { 229 230 PS_ASSERT_PTR_NON_NULL(map, NULL); … … 232 233 PS_ASSERT_PTR_NON_NULL(match, NULL); 233 234 PS_ASSERT_PTR_NON_NULL(stats, NULL); 235 PS_ASSERT_PTR_NON_NULL(config, NULL); 236 237 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 238 bool status; 239 double photomWindowSigma = psMetadataLookupF32 (&status, config, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 240 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 241 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 234 242 235 243 // reassign values for clip fit … … 252 260 y->data.F32[i] = refStar->FP->y; 253 261 254 wt->data.F32[i] = 1.0; 262 // wt is used as an error (sqrt(variance)) in the fit. the 1.01 prevents the weight from going to 0.0 for perfect matches 263 wt->data.F32[i] = 1.01 - exp(photomWindowFactor*PS_SQR(refStar->magCal - rawStar->magCal)); 255 264 } 256 265 … … 657 666 obj->Color= 0; 658 667 obj->dMag = 0; 668 obj->magCal = 0; 659 669 660 670 return (obj); … … 685 695 obj->Color = old->Color; 686 696 obj->dMag = old->dMag; 697 obj->magCal = old->magCal; 687 698 688 699 return(obj); … … 774 785 double gridOffset = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.OFFSET"); 775 786 776 // sampling scale of the grid 777 double gridScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.SCALE"); 787 // sampling scale of the grid 788 double gridScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.SCALE"); 789 790 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 791 double photomWindowSigma = psMetadataLookupF32 (&status, config, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 792 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 793 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 778 794 779 795 // set the static scaling factors … … 816 832 } 817 833 834 // XXX should I make the scale factor in front a recipe value? 835 int Npts = 10 * exp(photomWindowFactor*PS_SQR(ob1->magCal - ob2->magCal)); 836 818 837 // accumulate bin stats 819 NP[iY][iX] + +;820 DX[iY][iX] += dX ;821 DY[iY][iX] += dY ;822 D2[iY][iX] += PS_SQR(dX ) + PS_SQR(dY);838 NP[iY][iX] += Npts; 839 DX[iY][iX] += dX*Npts; 840 DY[iY][iX] += dY*Npts; 841 D2[iY][iX] += PS_SQR(dX*Npts) + PS_SQR(dY*Npts); 823 842 } 824 843 } … … 1053 1072 double tweakNsigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.TWEAK.NSIGMA"); 1054 1073 1074 // sigma of gaussian window to down-weight photometric outliers (ignored if NAN or 0.0) 1075 double photomWindowSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.PHOTOM.WINDOW.SIGMA"); 1076 bool photomWindowApply = !(isnan(photomWindowSigma) || (fabs(photomWindowSigma) < 0.01)); 1077 double photomWindowFactor = photomWindowApply ? -0.5/PS_SQR(photomWindowSigma) : 0.0; 1078 1055 1079 nBin = 2*tweakRange / tweakScale; 1056 1080 psVector *xHist = psVectorAlloc (nBin, PS_TYPE_F32); … … 1079 1103 continue; 1080 1104 1081 xHist->data.F32[xBin] += 1.0; 1082 yHist->data.F32[yBin] += 1.0; 1105 // XXX should I make the scale factor in front a recipe value? 1106 int Npts = 10 * exp(photomWindowFactor*PS_SQR(ob1->magCal - ob2->magCal)); // sigma = 0.22 mag 1107 1108 xHist->data.F32[xBin] += Npts; 1109 yHist->data.F32[yBin] += Npts; 1083 1110 } 1084 1111 } -
trunk/psModules/src/astrom/pmAstrometryObjects.h
r36834 r39926 43 43 float dMag; ///< error on object magnitude 44 44 float SBinst; ///< surface brightness, used for Koppenhoefer correction 45 float magCal; ///< object calibrated magnitude in extracted filter 45 46 } 46 47 pmAstromObj; … … 347 348 psArray *ref, 348 349 psArray *match, 349 psStats *stats 350 psStats *stats, 351 const psMetadata *config 350 352 ); 351 353 -
trunk/psModules/src/astrom/pmAstrometryWCS.c
r36492 r39926 43 43 pmAstromWCS *wcs = pmAstromWCSfromHeader (header); 44 44 if (!wcs) { 45 return false;45 return false; 46 46 } 47 47 … … 70 70 pmAstromWCS *wcs = pmAstromWCSfromHeader (header); 71 71 if (!wcs) { 72 return false;72 return false; 73 73 } 74 74 … … 86 86 pmAstromWCS *wcs = pmAstromWCSfromHeader (header); 87 87 if (!wcs) { 88 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from header");89 return false;88 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from header"); 89 return false; 90 90 } 91 91 … … 96 96 97 97 if (!status1 || !status2) { 98 Nx = psMetadataLookupS32 (&status1, header, "IMNAXIS1");99 Ny = psMetadataLookupS32 (&status2, header, "IMNAXIS2");98 Nx = psMetadataLookupS32 (&status1, header, "IMNAXIS1"); 99 Ny = psMetadataLookupS32 (&status2, header, "IMNAXIS2"); 100 100 } 101 101 102 102 if (!status1 || !status2) { 103 Nx = psMetadataLookupS32 (&status1, header, "ZNAXIS1");104 Ny = psMetadataLookupS32 (&status2, header, "ZNAXIS2");103 Nx = psMetadataLookupS32 (&status1, header, "ZNAXIS1"); 104 Ny = psMetadataLookupS32 (&status2, header, "ZNAXIS2"); 105 105 } 106 106 107 107 if (!status1 || !status2) { 108 psFree (wcs);109 psError(PS_ERR_UNKNOWN, false, "missing required FPA size in header");110 return false;108 psFree (wcs); 109 psError(PS_ERR_UNKNOWN, false, "missing required FPA size in header"); 110 return false; 111 111 } 112 112 … … 123 123 pmAstromWCS *wcs = pmAstromWCSBilevelChipFromFPA (chip, tol); 124 124 if (!wcs) { 125 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from fpa");126 return false;125 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from fpa"); 126 return false; 127 127 } 128 128 … … 139 139 pmAstromWCS *wcs = pmAstromWCSBilevelMosaicFromFPA (fpa, tol); 140 140 if (!wcs) { 141 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from fpa");142 return false;141 psError(PS_ERR_UNKNOWN, false, "failure to determine WCS terms from fpa"); 142 return false; 143 143 } 144 144 … … 163 163 164 164 if (chip == NULL) 165 return false;165 return false; 166 166 if (sky == NULL) 167 return false;167 return false; 168 168 if (wcs == NULL) 169 return false;169 return false; 170 170 171 171 psPlane *Chip = psPlaneAlloc(); … … 188 188 189 189 if (chip == NULL) 190 return false;190 return false; 191 191 if (sky == NULL) 192 return false;192 return false; 193 193 if (wcs == NULL) 194 return false;194 return false; 195 195 196 196 psError(PS_ERR_UNKNOWN, true, "not yet implemented: needs to invert the transformation"); … … 223 223 char *ctype = psMetadataLookupPtr (&status, header, "CTYPE2"); 224 224 if (!status) { 225 psLogMsg ("psastro", 5, "warning: no WCS metadata in header\n");226 return NULL;225 psLogMsg ("psastro", 5, "warning: no WCS metadata in header\n"); 226 return NULL; 227 227 } 228 228 … … 232 232 type = psProjectTypeFromString (ctype); 233 233 if (type == PS_PROJ_NTYPE) { 234 psLogMsg ("psastro", 2, "warning: unknown projection type %s\n", ctype);235 return NULL;234 psLogMsg ("psastro", 2, "warning: unknown projection type %s\n", ctype); 235 return NULL; 236 236 } 237 237 … … 243 243 244 244 if (cdKeys && pcKeys) { 245 // XXX make this an option246 psLogMsg ("psastro", 5, "warning: both CDi_j and PC00i00j defined in headers, using PC00i00j terms\n");245 // XXX make this an option 246 psLogMsg ("psastro", 5, "warning: both CDi_j and PC00i00j defined in headers, using PC00i00j terms\n"); 247 247 } 248 248 if (!cdKeys && !pcKeys) { 249 psError(PS_ERR_UNKNOWN, true, "missing both CDi_j and PC00i00j WCS terms");250 // XXX we could default here to RA, DEC, ROTANGLE251 return NULL;249 psError(PS_ERR_UNKNOWN, true, "missing both CDi_j and PC00i00j WCS terms"); 250 // XXX we could default here to RA, DEC, ROTANGLE 251 return NULL; 252 252 } 253 253 if (isPoly) { 254 if (!pcKeys) {255 psError(PS_ERR_UNKNOWN, true, "polynomial terms defined, but missing PC00i00j WCS terms");256 return NULL;257 }258 if (fitOrder == 0)259 fitOrder = 1;260 if ((fitOrder > 3) || (fitOrder < 1)) {261 psError(PS_ERR_UNKNOWN, true, "NPLYTERM value undefined: %d", fitOrder);262 return NULL;263 }254 if (!pcKeys) { 255 psError(PS_ERR_UNKNOWN, true, "polynomial terms defined, but missing PC00i00j WCS terms"); 256 return NULL; 257 } 258 if (fitOrder == 0) 259 fitOrder = 1; 260 if ((fitOrder > 3) || (fitOrder < 1)) { 261 psError(PS_ERR_UNKNOWN, true, "NPLYTERM value undefined: %d", fitOrder); 262 return NULL; 263 } 264 264 } else { 265 fitOrder = 1;265 fitOrder = 1; 266 266 } 267 267 … … 277 277 wcs->crpix2 = psMetadataLookupF64 (&status, header, "CRPIX2"); 278 278 wcs->toSky = psProjectionAlloc (wcs->crval1*PM_RAD_DEG, wcs->crval2*PM_RAD_DEG, PM_RAD_DEG, PM_RAD_DEG, type); 279 280 // XXX if type == ZPN, look for PV2_%d elements: 281 if (type == PS_PROJ_ZPN) { 282 psVector *maxRadial = psVectorAlloc (21, PS_TYPE_F64); 283 for (int i = 0; i <= 20; i++) { 284 char name[64]; 285 snprintf (name, 64, "PV2_%d", i); 286 287 maxRadial->data.F64[i] = 0.0; 288 double value = psMetadataLookupF64 (&status, header, name); 289 290 if (status) { 291 maxRadial->data.F64[i] = value; 292 maxRadial->n = i; 293 } 294 295 // PV2_1 is implicit if not present 296 if ((i == 1) && !status) { 297 maxRadial->data.F64[i] = 1.0; 298 continue; 299 } 300 } 301 maxRadial->n ++; 302 wcs->toSky->radial = maxRadial; 303 } 279 304 280 305 // These aren't needed but having them empty is disconcerting … … 289 314 // test the CDELTi varient 290 315 if (pcKeys) { 291 wcs->wcsCDkeys = 0;292 wcs->cdelt1 = psMetadataLookupF64 (&status, header, "CDELT1");293 wcs->cdelt2 = psMetadataLookupF64 (&status, header, "CDELT2");294 295 // test the CROTAi varient:296 // XXX double check lambda..297 double rotate = psMetadataLookupF64 (&status, header, "CROTA2");298 if (status) {299 wcs->trans->x->coeff[1][0] = +wcs->cdelt1 * cos(rotate*PM_RAD_DEG); // == PC1_1300 wcs->trans->x->coeff[0][1] = -wcs->cdelt2 * sin(rotate*PM_RAD_DEG); // == PC1_2301 wcs->trans->y->coeff[1][0] = +wcs->cdelt1 * sin(rotate*PM_RAD_DEG); // == PC2_1302 wcs->trans->y->coeff[0][1] = +wcs->cdelt2 * cos(rotate*PM_RAD_DEG); // == PC2_2303 return wcs;304 }305 306 // FITS WCS PCi,j has units of unity307 // wcs->trans has units of degrees/pixel308 wcs->trans->x->coeff[1][0] = wcs->cdelt1 * psMetadataLookupF64 (&status, header, "PC001001"); // == PC1_1309 wcs->trans->x->coeff[0][1] = wcs->cdelt2 * psMetadataLookupF64 (&status, header, "PC001002"); // == PC1_2310 wcs->trans->y->coeff[1][0] = wcs->cdelt1 * psMetadataLookupF64 (&status, header, "PC002001"); // == PC2_1311 wcs->trans->y->coeff[0][1] = wcs->cdelt2 * psMetadataLookupF64 (&status, header, "PC002002"); // == PC2_2312 313 if (isPoly) {314 // Elixir-style polynomial terms315 // XXX currently, Elixir/DVO cannot accept mixed orders316 for (int i = 0; i <= fitOrder; i++) {317 for (int j = 0; j <= fitOrder; j++) {318 if (i + j < 2)319 continue;320 if (i + j > fitOrder) {321 wcs->trans->x->coeffMask[i][j] = PS_POLY_MASK_SET;322 wcs->trans->y->coeffMask[i][j] = PS_POLY_MASK_SET;323 continue;324 }325 sprintf (name, "PCA1X%1dY%1d", i, j);326 wcs->trans->x->coeff[i][j] = pow(wcs->cdelt1, i) * pow(wcs->cdelt2, j) * psMetadataLookupF64 (&status, header, name);327 sprintf (name, "PCA2X%1dY%1d", i, j);328 wcs->trans->y->coeff[i][j] = pow(wcs->cdelt1, i) * pow(wcs->cdelt2, j) * psMetadataLookupF64 (&status, header, name);329 }330 }331 }332 return wcs;316 wcs->wcsCDkeys = 0; 317 wcs->cdelt1 = psMetadataLookupF64 (&status, header, "CDELT1"); 318 wcs->cdelt2 = psMetadataLookupF64 (&status, header, "CDELT2"); 319 320 // test the CROTAi varient: 321 // XXX double check lambda.. 322 double rotate = psMetadataLookupF64 (&status, header, "CROTA2"); 323 if (status) { 324 wcs->trans->x->coeff[1][0] = +wcs->cdelt1 * cos(rotate*PM_RAD_DEG); // == PC1_1 325 wcs->trans->x->coeff[0][1] = -wcs->cdelt2 * sin(rotate*PM_RAD_DEG); // == PC1_2 326 wcs->trans->y->coeff[1][0] = +wcs->cdelt1 * sin(rotate*PM_RAD_DEG); // == PC2_1 327 wcs->trans->y->coeff[0][1] = +wcs->cdelt2 * cos(rotate*PM_RAD_DEG); // == PC2_2 328 return wcs; 329 } 330 331 // FITS WCS PCi,j has units of unity 332 // wcs->trans has units of degrees/pixel 333 wcs->trans->x->coeff[1][0] = wcs->cdelt1 * psMetadataLookupF64 (&status, header, "PC001001"); // == PC1_1 334 wcs->trans->x->coeff[0][1] = wcs->cdelt2 * psMetadataLookupF64 (&status, header, "PC001002"); // == PC1_2 335 wcs->trans->y->coeff[1][0] = wcs->cdelt1 * psMetadataLookupF64 (&status, header, "PC002001"); // == PC2_1 336 wcs->trans->y->coeff[0][1] = wcs->cdelt2 * psMetadataLookupF64 (&status, header, "PC002002"); // == PC2_2 337 338 if (isPoly) { 339 // Elixir-style polynomial terms 340 // XXX currently, Elixir/DVO cannot accept mixed orders 341 for (int i = 0; i <= fitOrder; i++) { 342 for (int j = 0; j <= fitOrder; j++) { 343 if (i + j < 2) 344 continue; 345 if (i + j > fitOrder) { 346 wcs->trans->x->coeffMask[i][j] = PS_POLY_MASK_SET; 347 wcs->trans->y->coeffMask[i][j] = PS_POLY_MASK_SET; 348 continue; 349 } 350 sprintf (name, "PCA1X%1dY%1d", i, j); 351 wcs->trans->x->coeff[i][j] = pow(wcs->cdelt1, i) * pow(wcs->cdelt2, j) * psMetadataLookupF64 (&status, header, name); 352 sprintf (name, "PCA2X%1dY%1d", i, j); 353 wcs->trans->y->coeff[i][j] = pow(wcs->cdelt1, i) * pow(wcs->cdelt2, j) * psMetadataLookupF64 (&status, header, name); 354 } 355 } 356 } 357 return wcs; 333 358 } 334 359 335 360 // test the CDi_j varient 336 361 if (cdKeys) { 337 wcs->wcsCDkeys = 1;338 339 wcs->trans->x->coeff[1][0] = psMetadataLookupF64 (&status, header, "CD1_1"); // == PC1_1340 wcs->trans->x->coeff[0][1] = psMetadataLookupF64 (&status, header, "CD1_2"); // == PC1_2341 wcs->trans->y->coeff[1][0] = psMetadataLookupF64 (&status, header, "CD2_1"); // == PC2_1342 wcs->trans->y->coeff[0][1] = psMetadataLookupF64 (&status, header, "CD2_2"); // == PC2_2343 wcs->cdelt1 = hypot (wcs->trans->x->coeff[1][0], wcs->trans->x->coeff[0][1]);344 wcs->cdelt2 = hypot (wcs->trans->y->coeff[1][0], wcs->trans->y->coeff[0][1]);345 return wcs;362 wcs->wcsCDkeys = 1; 363 364 wcs->trans->x->coeff[1][0] = psMetadataLookupF64 (&status, header, "CD1_1"); // == PC1_1 365 wcs->trans->x->coeff[0][1] = psMetadataLookupF64 (&status, header, "CD1_2"); // == PC1_2 366 wcs->trans->y->coeff[1][0] = psMetadataLookupF64 (&status, header, "CD2_1"); // == PC2_1 367 wcs->trans->y->coeff[0][1] = psMetadataLookupF64 (&status, header, "CD2_2"); // == PC2_2 368 wcs->cdelt1 = hypot (wcs->trans->x->coeff[1][0], wcs->trans->x->coeff[0][1]); 369 wcs->cdelt2 = hypot (wcs->trans->y->coeff[1][0], wcs->trans->y->coeff[0][1]); 370 return wcs; 346 371 } 347 372 psLogMsg ("psastro", 2, "warning: missing rotation matrix?\n"); … … 376 401 psMetadataAddF64 (header, PS_LIST_TAIL, "CRPIX2", PS_META_REPLACE, "", wcs->crpix2); 377 402 403 if (wcs->toSky->type == PS_PROJ_ZPN) { 404 psAssert (wcs->toSky->radial, "missing radial vector"); 405 for (int i = 0; i < wcs->toSky->radial->n; i++) { 406 if (wcs->toSky->radial->data.F64[i] == 0.0) continue; 407 snprintf (name, 16, "PV2_%d", i); 408 psMetadataAddF64 (header, PS_LIST_TAIL, name, PS_META_REPLACE, "", wcs->toSky->radial->data.F64[i]); 409 } 410 } 411 378 412 // XXX make it optional to write out CDi_j terms, or other versions 379 413 // apply CDELT1,2 (degrees / pixel) to yield PCi,j terms of order unity 380 414 if (!wcs->wcsCDkeys) { 381 415 382 double cdelt1 = wcs->cdelt1;383 double cdelt2 = wcs->cdelt2;384 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT1", PS_META_REPLACE, "", cdelt1);385 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT2", PS_META_REPLACE, "", cdelt2);386 387 // test the PC00i00j varient:388 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001001", PS_META_REPLACE, "", wcs->trans->x->coeff[1][0] / cdelt1); // == PC1_1389 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001002", PS_META_REPLACE, "", wcs->trans->x->coeff[0][1] / cdelt2); // == PC1_2390 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002001", PS_META_REPLACE, "", wcs->trans->y->coeff[1][0] / cdelt1); // == PC2_1391 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002002", PS_META_REPLACE, "", wcs->trans->y->coeff[0][1] / cdelt2); // == PC2_2392 393 // Elixir-style polynomial terms394 // XXX currently, Elixir/DVO cannot accept mixed orders395 // XXX need to respect the masks396 // XXX is wcs->cdelt1,2 always consistent?397 int fitOrder = wcs->trans->x->nX;398 if (fitOrder > 1) {399 for (int i = 0; i <= fitOrder; i++) {400 for (int j = 0; j <= fitOrder; j++) {401 if (i + j < 2)402 continue;403 if (i + j > fitOrder)404 continue;405 sprintf (name, "PCA1X%1dY%1d", i, j);406 psMetadataAddF64 (header, PS_LIST_TAIL, name, PS_META_REPLACE, "", wcs->trans->x->coeff[i][j] / pow(cdelt1, i) / pow(cdelt2, j));407 sprintf (name, "PCA2X%1dY%1d", i, j);408 psMetadataAddF64 (header, PS_LIST_TAIL, name, PS_META_REPLACE, "", wcs->trans->y->coeff[i][j] / pow(cdelt1, i) / pow(cdelt2, j));409 }410 }411 psMetadataAddS32 (header, PS_LIST_TAIL, "NPLYTERM", PS_META_REPLACE, "", fitOrder);412 }413 414 // remove any existing 'CDi_j style' wcs keywords415 if (psMetadataLookup(header, "CD1_1")) {416 psMetadataRemoveKey(header, "CD1_1");417 psMetadataRemoveKey(header, "CD1_2");418 psMetadataRemoveKey(header, "CD2_1");419 psMetadataRemoveKey(header, "CD2_2");420 }421 422 // Remove 'CDi_jX' WCS keywords423 psString cd11 = psStringCopy("CD1_1 ");424 psString cd12 = psStringCopy("CD1_2 ");425 psString cd21 = psStringCopy("CD2_1 ");426 psString cd22 = psStringCopy("CD2_2 ");427 for (char extra = 'A'; extra <= 'Z'; extra++) {428 cd11[strlen(cd11)-1] = extra;429 if (psMetadataLookup(header, cd11)) {430 cd12[strlen(cd12)-1] = extra;431 cd21[strlen(cd21)-1] = extra;432 cd22[strlen(cd22)-1] = extra;433 psMetadataRemoveKey(header, cd11);434 psMetadataRemoveKey(header, cd12);435 psMetadataRemoveKey(header, cd21);436 psMetadataRemoveKey(header, cd22);437 }438 }439 psFree(cd11);440 psFree(cd12);441 psFree(cd21);442 psFree(cd22);416 double cdelt1 = wcs->cdelt1; 417 double cdelt2 = wcs->cdelt2; 418 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT1", PS_META_REPLACE, "", cdelt1); 419 psMetadataAddF64 (header, PS_LIST_TAIL, "CDELT2", PS_META_REPLACE, "", cdelt2); 420 421 // test the PC00i00j varient: 422 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001001", PS_META_REPLACE, "", wcs->trans->x->coeff[1][0] / cdelt1); // == PC1_1 423 psMetadataAddF64 (header, PS_LIST_TAIL, "PC001002", PS_META_REPLACE, "", wcs->trans->x->coeff[0][1] / cdelt2); // == PC1_2 424 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002001", PS_META_REPLACE, "", wcs->trans->y->coeff[1][0] / cdelt1); // == PC2_1 425 psMetadataAddF64 (header, PS_LIST_TAIL, "PC002002", PS_META_REPLACE, "", wcs->trans->y->coeff[0][1] / cdelt2); // == PC2_2 426 427 // Elixir-style polynomial terms 428 // XXX currently, Elixir/DVO cannot accept mixed orders 429 // XXX need to respect the masks 430 // XXX is wcs->cdelt1,2 always consistent? 431 int fitOrder = wcs->trans->x->nX; 432 if (fitOrder > 1) { 433 for (int i = 0; i <= fitOrder; i++) { 434 for (int j = 0; j <= fitOrder; j++) { 435 if (i + j < 2) 436 continue; 437 if (i + j > fitOrder) 438 continue; 439 sprintf (name, "PCA1X%1dY%1d", i, j); 440 psMetadataAddF64 (header, PS_LIST_TAIL, name, PS_META_REPLACE, "", wcs->trans->x->coeff[i][j] / pow(cdelt1, i) / pow(cdelt2, j)); 441 sprintf (name, "PCA2X%1dY%1d", i, j); 442 psMetadataAddF64 (header, PS_LIST_TAIL, name, PS_META_REPLACE, "", wcs->trans->y->coeff[i][j] / pow(cdelt1, i) / pow(cdelt2, j)); 443 } 444 } 445 psMetadataAddS32 (header, PS_LIST_TAIL, "NPLYTERM", PS_META_REPLACE, "", fitOrder); 446 } 447 448 // remove any existing 'CDi_j style' wcs keywords 449 if (psMetadataLookup(header, "CD1_1")) { 450 psMetadataRemoveKey(header, "CD1_1"); 451 psMetadataRemoveKey(header, "CD1_2"); 452 psMetadataRemoveKey(header, "CD2_1"); 453 psMetadataRemoveKey(header, "CD2_2"); 454 } 455 456 // Remove 'CDi_jX' WCS keywords 457 psString cd11 = psStringCopy("CD1_1 "); 458 psString cd12 = psStringCopy("CD1_2 "); 459 psString cd21 = psStringCopy("CD2_1 "); 460 psString cd22 = psStringCopy("CD2_2 "); 461 for (char extra = 'A'; extra <= 'Z'; extra++) { 462 cd11[strlen(cd11)-1] = extra; 463 if (psMetadataLookup(header, cd11)) { 464 cd12[strlen(cd12)-1] = extra; 465 cd21[strlen(cd21)-1] = extra; 466 cd22[strlen(cd22)-1] = extra; 467 psMetadataRemoveKey(header, cd11); 468 psMetadataRemoveKey(header, cd12); 469 psMetadataRemoveKey(header, cd21); 470 psMetadataRemoveKey(header, cd22); 471 } 472 } 473 psFree(cd11); 474 psFree(cd12); 475 psFree(cd21); 476 psFree(cd22); 443 477 444 478 445 479 } else { 446 480 447 psMetadataAddF64 (header, PS_LIST_TAIL, "CD1_1", PS_META_REPLACE, "", wcs->trans->x->coeff[1][0]);448 psMetadataAddF64 (header, PS_LIST_TAIL, "CD1_2", PS_META_REPLACE, "", wcs->trans->x->coeff[0][1]);449 psMetadataAddF64 (header, PS_LIST_TAIL, "CD2_1", PS_META_REPLACE, "", wcs->trans->y->coeff[1][0]);450 psMetadataAddF64 (header, PS_LIST_TAIL, "CD2_2", PS_META_REPLACE, "", wcs->trans->y->coeff[0][1]);451 452 if (psMetadataLookup(header, "PC001001")) {453 psMetadataRemoveKey(header, "PC001001");454 psMetadataRemoveKey(header, "PC001002");455 psMetadataRemoveKey(header, "PC002001");456 psMetadataRemoveKey(header, "PC002002");457 }481 psMetadataAddF64 (header, PS_LIST_TAIL, "CD1_1", PS_META_REPLACE, "", wcs->trans->x->coeff[1][0]); 482 psMetadataAddF64 (header, PS_LIST_TAIL, "CD1_2", PS_META_REPLACE, "", wcs->trans->x->coeff[0][1]); 483 psMetadataAddF64 (header, PS_LIST_TAIL, "CD2_1", PS_META_REPLACE, "", wcs->trans->y->coeff[1][0]); 484 psMetadataAddF64 (header, PS_LIST_TAIL, "CD2_2", PS_META_REPLACE, "", wcs->trans->y->coeff[0][1]); 485 486 if (psMetadataLookup(header, "PC001001")) { 487 psMetadataRemoveKey(header, "PC001001"); 488 psMetadataRemoveKey(header, "PC001002"); 489 psMetadataRemoveKey(header, "PC002001"); 490 psMetadataRemoveKey(header, "PC002002"); 491 } 458 492 } 459 493 … … 473 507 // cdelt1,2 has units of degree/pixel 474 508 for (int i = 0; i <= toFPA->x->nX; i++) { 475 for (int j = 0; j <= toFPA->x->nX; j++) {476 toFPA->x->coeff[i][j] *= pixelScale/wcs->cdelt1;477 toFPA->y->coeff[i][j] *= pixelScale/wcs->cdelt2;478 }509 for (int j = 0; j <= toFPA->x->nX; j++) { 510 toFPA->x->coeff[i][j] *= pixelScale/wcs->cdelt1; 511 toFPA->y->coeff[i][j] *= pixelScale/wcs->cdelt2; 512 } 479 513 } 480 514 … … 485 519 // projection from TPA (linear microns) to SKY (radians) 486 520 psProjection *toSky = psProjectionAlloc (wcs->toSky->R, wcs->toSky->D, PM_RAD_DEG*pdelt1, PM_RAD_DEG*pdelt2, wcs->toSky->type); 521 toSky->radial = psMemIncrRefCounter (wcs->toSky->radial); 487 522 488 523 if (fpa->toSky == NULL) { 489 524 psFree(fpa->toTPA); 490 525 psFree(fpa->fromTPA); 491 fpa->toTPA = psPlaneTransformIdentity (1);492 fpa->fromTPA = psPlaneTransformIdentity (1);493 fpa->toSky = toSky;526 fpa->toTPA = psPlaneTransformIdentity (1); 527 fpa->fromTPA = psPlaneTransformIdentity (1); 528 fpa->toSky = toSky; 494 529 } else { 495 530 496 // this section allows the loaded chip to be included in an fpa structure in which497 // other chips have already been loaded (ie, the fpa->toTPA, fpa->toSky components have498 // already been defined). we have to adjust to match the existing transformation.499 500 if (fpa->toTPA == NULL)501 psAbort("projection defined, tangent-plane not defined");502 if (fpa->fromTPA == NULL)503 psAbort("projection defined, tangent-plane not defined");504 505 // convert from pixels on this chip to pixels on reference chip506 // rX has units of refpixels / pixel507 double rX = toSky->Xs / fpa->toSky->Xs;508 double rY = toSky->Ys / fpa->toSky->Ys;509 510 for (int i = 0; i <= toFPA->x->nX; i++) {511 for (int j = 0; j <= toFPA->x->nY; j++) {512 toFPA->x->coeff[i][j] *= rX;513 toFPA->y->coeff[i][j] *= rY;514 }515 }516 517 // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter518 // XXX this only works if toTPA is at most a linear transformation519 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY);520 for (int i = 0; i <= toFPA->x->nX; i++) {521 for (int j = 0; j <= toFPA->x->nY; j++) {522 double f1 = toFPA->x->coeffMask[i][j] ? 0.0 : fpa->fromTPA->x->coeff[1][0]*toFPA->x->coeff[i][j];523 double f2 = toFPA->y->coeffMask[i][j] ? 0.0 : fpa->fromTPA->x->coeff[0][1]*toFPA->y->coeff[i][j];524 toFPAnew->x->coeff[i][j] = f1 + f2;525 526 double g1 = toFPA->x->coeffMask[i][j] ? 0.0 : fpa->fromTPA->y->coeff[1][0]*toFPA->x->coeff[i][j];527 double g2 = toFPA->y->coeffMask[i][j] ? 0.0 : fpa->fromTPA->y->coeff[0][1]*toFPA->y->coeff[i][j];528 toFPAnew->y->coeff[i][j] = g1 + g2;529 }530 }531 toFPAnew->x->coeff[0][0] += fpa->fromTPA->x->coeff[0][0];532 toFPAnew->y->coeff[0][0] += fpa->fromTPA->y->coeff[0][0];533 534 psFree (toFPA);535 toFPA = toFPAnew;536 537 // adjust reference pixel for new toSky reference coordinate538 // find the FPA coordinate of 0,0 for this chip.539 psPlane *fpOld = psPlaneAlloc();540 psPlane *fpNew = psPlaneAlloc();541 psPlane *tp = psPlaneAlloc();542 psSphere *sky = psSphereAlloc();543 544 sky->r = toSky->R;545 sky->d = toSky->D;546 psProject (tp, sky, fpa->toSky); // find the focal-plane coord of this RA,DEC coord using the ref chip projection547 psPlaneTransformApply (fpOld, fpa->fromTPA, tp);548 549 sky->r = fpa->toSky->R;550 sky->d = fpa->toSky->D;551 psProject (tp, sky, fpa->toSky); // find the focal-plane coord of this RA,DEC coord using the ref chip projection552 psPlaneTransformApply (fpNew, fpa->fromTPA, tp);553 554 toFPA->x->coeff[0][0] -= fpNew->x - fpOld->x;555 toFPA->y->coeff[0][0] -= fpNew->y - fpOld->y;556 557 psFree (sky);558 psFree (tp);559 psFree (fpOld);560 psFree (fpNew);561 562 psFree (toSky);531 // this section allows the loaded chip to be included in an fpa structure in which 532 // other chips have already been loaded (ie, the fpa->toTPA, fpa->toSky components have 533 // already been defined). we have to adjust to match the existing transformation. 534 535 if (fpa->toTPA == NULL) 536 psAbort("projection defined, tangent-plane not defined"); 537 if (fpa->fromTPA == NULL) 538 psAbort("projection defined, tangent-plane not defined"); 539 540 // convert from pixels on this chip to pixels on reference chip 541 // rX has units of refpixels / pixel 542 double rX = toSky->Xs / fpa->toSky->Xs; 543 double rY = toSky->Ys / fpa->toSky->Ys; 544 545 for (int i = 0; i <= toFPA->x->nX; i++) { 546 for (int j = 0; j <= toFPA->x->nY; j++) { 547 toFPA->x->coeff[i][j] *= rX; 548 toFPA->y->coeff[i][j] *= rY; 549 } 550 } 551 552 // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter 553 // XXX this only works if toTPA is at most a linear transformation 554 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY); 555 for (int i = 0; i <= toFPA->x->nX; i++) { 556 for (int j = 0; j <= toFPA->x->nY; j++) { 557 double f1 = toFPA->x->coeffMask[i][j] ? 0.0 : fpa->fromTPA->x->coeff[1][0]*toFPA->x->coeff[i][j]; 558 double f2 = toFPA->y->coeffMask[i][j] ? 0.0 : fpa->fromTPA->x->coeff[0][1]*toFPA->y->coeff[i][j]; 559 toFPAnew->x->coeff[i][j] = f1 + f2; 560 561 double g1 = toFPA->x->coeffMask[i][j] ? 0.0 : fpa->fromTPA->y->coeff[1][0]*toFPA->x->coeff[i][j]; 562 double g2 = toFPA->y->coeffMask[i][j] ? 0.0 : fpa->fromTPA->y->coeff[0][1]*toFPA->y->coeff[i][j]; 563 toFPAnew->y->coeff[i][j] = g1 + g2; 564 } 565 } 566 toFPAnew->x->coeff[0][0] += fpa->fromTPA->x->coeff[0][0]; 567 toFPAnew->y->coeff[0][0] += fpa->fromTPA->y->coeff[0][0]; 568 569 psFree (toFPA); 570 toFPA = toFPAnew; 571 572 // adjust reference pixel for new toSky reference coordinate 573 // find the FPA coordinate of 0,0 for this chip. 574 psPlane *fpOld = psPlaneAlloc(); 575 psPlane *fpNew = psPlaneAlloc(); 576 psPlane *tp = psPlaneAlloc(); 577 psSphere *sky = psSphereAlloc(); 578 579 sky->r = toSky->R; 580 sky->d = toSky->D; 581 psProject (tp, sky, fpa->toSky); // find the focal-plane coord of this RA,DEC coord using the ref chip projection 582 psPlaneTransformApply (fpOld, fpa->fromTPA, tp); 583 584 sky->r = fpa->toSky->R; 585 sky->d = fpa->toSky->D; 586 psProject (tp, sky, fpa->toSky); // find the focal-plane coord of this RA,DEC coord using the ref chip projection 587 psPlaneTransformApply (fpNew, fpa->fromTPA, tp); 588 589 toFPA->x->coeff[0][0] -= fpNew->x - fpOld->x; 590 toFPA->y->coeff[0][0] -= fpNew->y - fpOld->y; 591 592 psFree (sky); 593 psFree (tp); 594 psFree (fpOld); 595 psFree (fpNew); 596 597 psFree (toSky); 563 598 } 564 599 … … 578 613 // XXX if the inversion fails, we probably do not have a valid transform anyway 579 614 if (!chip->fromFPA) { 580 psWarning ("failed to find a valid transformation");581 psFree (chip->toFPA);582 return false;615 psWarning ("failed to find a valid transformation"); 616 psFree (chip->toFPA); 617 return false; 583 618 } 584 619 585 620 // this can take a very long time... 586 621 while (fpa->toSky->R < 0) 587 fpa->toSky->R += 2.0*M_PI;622 fpa->toSky->R += 2.0*M_PI; 588 623 while (fpa->toSky->R > 2.0*M_PI) 589 fpa->toSky->R -= 2.0*M_PI;624 fpa->toSky->R -= 2.0*M_PI; 590 625 591 626 fpa->wcsCDkeys = wcs->wcsCDkeys; 592 627 593 628 psTrace ("psastro", 5, "toFPA: %f %f (%f,%f),(%f,%f)\n", 594 chip->toFPA->x->coeff[0][0], chip->toFPA->y->coeff[0][0],595 chip->toFPA->x->coeff[1][0], chip->toFPA->x->coeff[0][1],596 chip->toFPA->y->coeff[1][0], chip->toFPA->y->coeff[0][1]);629 chip->toFPA->x->coeff[0][0], chip->toFPA->y->coeff[0][0], 630 chip->toFPA->x->coeff[1][0], chip->toFPA->x->coeff[0][1], 631 chip->toFPA->y->coeff[1][0], chip->toFPA->y->coeff[0][1]); 597 632 598 633 psTrace ("psastro", 5, "frFPA: %f %f (%f,%f),(%f,%f)\n", 599 chip->fromFPA->x->coeff[0][0], chip->fromFPA->y->coeff[0][0],600 chip->fromFPA->x->coeff[1][0], chip->fromFPA->x->coeff[0][1],601 chip->fromFPA->y->coeff[1][0], chip->fromFPA->y->coeff[0][1]);634 chip->fromFPA->x->coeff[0][0], chip->fromFPA->y->coeff[0][0], 635 chip->fromFPA->x->coeff[1][0], chip->fromFPA->x->coeff[0][1], 636 chip->fromFPA->y->coeff[1][0], chip->fromFPA->y->coeff[0][1]); 602 637 603 638 return true; … … 613 648 */ 614 649 615 // create transformation with 0,0 reference pixel and units of microns/pixel616 650 psFree (chip->toFPA); 617 chip->toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2); 651 chip->toFPA = psPlaneTransformAlloc(wcs->trans->x->nX, wcs->trans->x->nY); 652 653 // copy the toFPA x,y, transformations to the wcs version 654 chip->toFPA->x = psPolynomial2DCopy (chip->toFPA->x, wcs->trans->x); 655 chip->toFPA->y = psPolynomial2DCopy (chip->toFPA->y, wcs->trans->y); 656 657 // these need to be set based on crval1,2 658 chip->toFPA->x->coeff[0][0] = wcs->crval1; 659 chip->toFPA->y->coeff[0][0] = wcs->crval2; 618 660 619 661 // determine the inverse transformation: we need the chip pixels covered by this transform … … 633 675 // cdelt1,2 has units of degrees/micron 634 676 fpa->toSky = psProjectionAlloc (wcs->toSky->R, wcs->toSky->D, wcs->cdelt1*PM_RAD_DEG, wcs->cdelt2*PM_RAD_DEG, wcs->toSky->type); 677 fpa->toSky->radial = psMemIncrRefCounter (wcs->toSky->radial); 635 678 636 679 // create transformation with 0,0 reference pixel … … 639 682 // convert fpa->toTPA to units of unity (microns/micron) 640 683 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 641 for (int j = 0; j <= fpa->toTPA->x->nY; j++) {642 fpa->toTPA->x->coeff[i][j] /= wcs->cdelt1;643 fpa->toTPA->y->coeff[i][j] /= wcs->cdelt2;644 }684 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { 685 fpa->toTPA->x->coeff[i][j] /= wcs->cdelt1; 686 fpa->toTPA->y->coeff[i][j] /= wcs->cdelt2; 687 } 645 688 } 646 689 … … 648 691 // the region defines the FPA pixels covered by the tranformation 649 692 psFree (fpa->fromTPA); 650 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, region, 50); 693 psPlaneTransform *myPT = psPlaneTransformAlloc(fpa->toTPA->x->nX+4, fpa->toTPA->x->nY+4); 694 fpa->fromTPA = psPlaneTransformInvert(myPT, fpa->toTPA, region, 50); 695 psFree (myPT); 651 696 return true; 652 697 } … … 684 729 685 730 for (int i = 0; i <= toTPA->x->nX; i++) { 686 for (int j = 0; j <= toTPA->x->nY; j++) {687 double f1 = chip->toFPA->x->coeffMask[i][j] ? 0.0 : fpa->toTPA->x->coeff[1][0]*chip->toFPA->x->coeff[i][j];688 double f2 = chip->toFPA->y->coeffMask[i][j] ? 0.0 : fpa->toTPA->x->coeff[0][1]*chip->toFPA->y->coeff[i][j];689 toTPA->x->coeff[i][j] = f1 + f2;690 691 double g1 = chip->toFPA->x->coeffMask[i][j] ? 0.0 : fpa->toTPA->y->coeff[1][0]*chip->toFPA->x->coeff[i][j];692 double g2 = chip->toFPA->y->coeffMask[i][j] ? 0.0 : fpa->toTPA->y->coeff[0][1]*chip->toFPA->y->coeff[i][j];693 toTPA->y->coeff[i][j] = g1 + g2;694 }731 for (int j = 0; j <= toTPA->x->nY; j++) { 732 double f1 = chip->toFPA->x->coeffMask[i][j] ? 0.0 : fpa->toTPA->x->coeff[1][0]*chip->toFPA->x->coeff[i][j]; 733 double f2 = chip->toFPA->y->coeffMask[i][j] ? 0.0 : fpa->toTPA->x->coeff[0][1]*chip->toFPA->y->coeff[i][j]; 734 toTPA->x->coeff[i][j] = f1 + f2; 735 736 double g1 = chip->toFPA->x->coeffMask[i][j] ? 0.0 : fpa->toTPA->y->coeff[1][0]*chip->toFPA->x->coeff[i][j]; 737 double g2 = chip->toFPA->y->coeffMask[i][j] ? 0.0 : fpa->toTPA->y->coeff[0][1]*chip->toFPA->y->coeff[i][j]; 738 toTPA->y->coeff[i][j] = g1 + g2; 739 } 695 740 } 696 741 toTPA->x->coeff[0][0] += fpa->toTPA->x->coeff[0][0]; … … 701 746 // convert projection from FPA to SKY into wcs projection (degrees to radians) 702 747 wcs->toSky = psProjectionAlloc (fpa->toSky->R, fpa->toSky->D, PM_RAD_DEG, PM_RAD_DEG, fpa->toSky->type); 748 wcs->toSky->radial = psMemIncrRefCounter (fpa->toSky->radial); 749 703 750 wcs->crval1 = fpa->toSky->R*PS_DEG_RAD; 704 751 wcs->crval2 = fpa->toSky->D*PS_DEG_RAD; … … 714 761 psPlane *center = psPlaneTransformGetCenter (tpa1, tol); 715 762 if (!center) { 716 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center.");717 psFree (toTPA);718 psFree (tpa1);719 psFree (wcs);720 return NULL;763 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center."); 764 psFree (toTPA); 765 psFree (tpa1); 766 psFree (wcs); 767 return NULL; 721 768 } 722 769 … … 751 798 // convert wcs->trans to a matrix with units of degrees/pixel 752 799 for (int i = 0; i <= wcs->trans->x->nX; i++) { 753 for (int j = 0; j <= wcs->trans->x->nY; j++) {754 wcs->trans->x->coeff[i][j] *= pdelt1;755 wcs->trans->y->coeff[i][j] *= pdelt2;756 }800 for (int j = 0; j <= wcs->trans->x->nY; j++) { 801 wcs->trans->x->coeff[i][j] *= pdelt1; 802 wcs->trans->y->coeff[i][j] *= pdelt2; 803 } 757 804 } 758 805 … … 773 820 */ 774 821 775 // convert the chip-level toFPA to a wcs polynomial transformation 822 // convert the chip-level toFPA to a wcs polynomial transformation. the pmAstromWCS 823 // structure represents a single layer transformation (e.g., RA-TAN, RA-WRP). Here we are 824 // converting the chip-level to a WRP projection in the structure. Later, this will be 825 // converted to the WCS keywords 826 776 827 pmAstromWCS *pmAstromWCSBilevelChipFromFPA (const pmChip *chip, double tol) 777 828 { … … 784 835 pmAstromWCS *wcs = pmAstromWCSAlloc(chip->toFPA->x->nX, chip->toFPA->x->nY); 785 836 837 // copy the toFPA x,y, transformations to the wcs version 838 wcs->trans->x = psPolynomial2DCopy (wcs->trans->x, chip->toFPA->x); 839 wcs->trans->y = psPolynomial2DCopy (wcs->trans->y, chip->toFPA->y); 840 786 841 // Chip to FPA transformation is a Cartesian 'projection' 787 842 // reference pixel for FPA is 0.0, 0.0 788 843 wcs->toSky = psProjectionAlloc (0.0, 0.0, 1.0, 1.0, PS_PROJ_WRP); 789 wcs->crval1 = 0.0; 790 wcs->crval2 = 0.0; 791 792 // given transformation, solve for coordinates which yields output coordinates of 0,0 793 psPlane *center = psPlaneTransformGetCenter (chip->toFPA, tol); 794 if (!center) { 795 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center."); 796 psFree (wcs); 797 return NULL; 798 } 799 800 // adjust wcs transform to use center as reference coordinate 801 // resulting transformation has units of microns/pixel 802 psPlaneTransformSetCenter (wcs->trans, chip->toFPA, center->x, center->y); 803 804 // calculated center is crpix1,2 805 wcs->crpix1 = center->x; 806 wcs->crpix2 = center->y; 807 psFree (center); 808 844 845 // reference pixel (CRPIX1,2) is (0.0, 0.0): 846 wcs->crpix1 = 0.0; 847 wcs->crpix2 = 0.0; 848 849 // we need to set CRVAL1,2 for the 0,0 pixel: 850 wcs->crval1 = psPolynomial2DEval (chip->toFPA->x, 0.0, 0.0); 851 wcs->crval2 = psPolynomial2DEval (chip->toFPA->y, 0.0, 0.0); 852 853 wcs->toSky->R = wcs->crval1*PM_RAD_DEG; 854 wcs->toSky->D = wcs->crval2*PM_RAD_DEG; 855 856 // these need to be set to 0.0 since they have been moved to crpix1,crpix2 857 wcs->trans->x->coeff[0][0] = 0.0; 858 wcs->trans->y->coeff[0][0] = 0.0; 859 809 860 // output coordinates are in microns : CDELT1,2 has units of microns/pixel 810 861 wcs->cdelt1 = hypot (wcs->trans->x->coeff[1][0], wcs->trans->x->coeff[0][1]); … … 834 885 psPlane *center = psPlaneTransformGetCenter (fpa->toTPA, tol); 835 886 if (!center) { 836 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center.");837 psFree (wcs);838 return NULL;887 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center."); 888 psFree (wcs); 889 return NULL; 839 890 } 840 891 … … 854 905 // convert wcs->trans to units of degree/micron 855 906 for (int i = 0; i <= wcs->trans->x->nX; i++) { 856 for (int j = 0; j <= wcs->trans->x->nY; j++) {857 wcs->trans->x->coeff[i][j] *= pdelt1;858 wcs->trans->y->coeff[i][j] *= pdelt2;859 }907 for (int j = 0; j <= wcs->trans->x->nY; j++) { 908 wcs->trans->x->coeff[i][j] *= pdelt1; 909 wcs->trans->y->coeff[i][j] *= pdelt2; 910 } 860 911 } 861 912 … … 880 931 int k=0; 881 932 for (int j=0; j<nSamples; j++) { 882 double y = bounds->y0 + (j * deltaY / nSamples);883 for (int i=0; i<nSamples; i++) {884 psPlane *s = psPlaneAlloc();885 s->x = bounds->x0 + (i * deltaX / nSamples);886 s->y = y;887 psArraySet(src, k, s);888 psPlane *d = psPlaneTransformApply(NULL, trans, s);889 psArraySet(dst, k, d);890 psFree(s); // drop our refs to s and d891 psFree(d);892 ++k;893 }933 double y = bounds->y0 + (j * deltaY / nSamples); 934 for (int i=0; i<nSamples; i++) { 935 psPlane *s = psPlaneAlloc(); 936 s->x = bounds->x0 + (i * deltaX / nSamples); 937 s->y = y; 938 psArraySet(src, k, s); 939 psPlane *d = psPlaneTransformApply(NULL, trans, s); 940 psArraySet(dst, k, d); 941 psFree(s); // drop our refs to s and d 942 psFree(d); 943 ++k; 944 } 894 945 } 895 946 … … 897 948 898 949 if (!psPlaneTransformFit(newTrans, src, dst, 0, 0)) { 899 psError(PS_ERR_UNKNOWN, false, "linear fit to transform failed");900 return NULL;950 psError(PS_ERR_UNKNOWN, false, "linear fit to transform failed"); 951 return NULL; 901 952 } 902 953 … … 907 958 printf(" i chip_x tpa_x tpa_x_fit dx chip_y tpa_y tpa_y_fit dy dx > 0.5 || dy > 0.5\n"); 908 959 for (int i=0; i<psArrayLength(dst); i++) { 909 psPlane *d = (psPlane *) psArrayGet(dst, i);910 psPlane *s = (psPlane *) psArrayGet(src, i);911 912 new = psPlaneTransformApply(new, newTrans, s);913 914 double xerr = new->x - d->x;915 double yerr = new->y - d->y;916 bool bigerr = (fabs(xerr) > .5) || (fabs(yerr) > .5);917 printf("%4d %9.2f %9.2f %9.2f %9.4f %9.2f %9.2f %9.2f %9.4f %s\n"918 , i, s->x, new->x, d->x, xerr, s->y, new->y, d->y, yerr, bigerr ? "BIGERR" : "");960 psPlane *d = (psPlane *) psArrayGet(dst, i); 961 psPlane *s = (psPlane *) psArrayGet(src, i); 962 963 new = psPlaneTransformApply(new, newTrans, s); 964 965 double xerr = new->x - d->x; 966 double yerr = new->y - d->y; 967 bool bigerr = (fabs(xerr) > .5) || (fabs(yerr) > .5); 968 printf("%4d %9.2f %9.2f %9.2f %9.4f %9.2f %9.2f %9.2f %9.4f %s\n" 969 , i, s->x, new->x, d->x, xerr, s->y, new->y, d->y, yerr, bigerr ? "BIGERR" : ""); 919 970 } 920 971 psFree(new); … … 934 985 935 986 if (outFPA == NULL) { 936 outFPA = inFPA;987 outFPA = inFPA; 937 988 } 938 989 if (outChip == NULL) { 939 outChip = inChip;990 outChip = inChip; 940 991 } 941 992 if (outputBounds == NULL) { 942 outputBounds = pmChipPixels(outChip);993 outputBounds = pmChipPixels(outChip); 943 994 } 944 995 … … 946 997 psPlaneTransform *chipToTPA = psPlaneTransformCombine(NULL, inChip->toFPA, inFPA->toTPA, *outputBounds, 50); 947 998 if (!chipToTPA) { 948 psError(PS_ERR_UNKNOWN, false, "failed to create chipToTPA");949 return false;999 psError(PS_ERR_UNKNOWN, false, "failed to create chipToTPA"); 1000 return false; 950 1001 } 951 1002 … … 954 1005 psFree(chipToTPA); 955 1006 if (!chipToFPA) { 956 psError(PS_ERR_UNKNOWN, false, "linear fit of chip to TPA transform failed");957 return false;1007 psError(PS_ERR_UNKNOWN, false, "linear fit of chip to TPA transform failed"); 1008 return false; 958 1009 } 959 1010 … … 961 1012 psPlaneTransform *outToFPA; 962 1013 if (offset_x != 0. && offset_y != 0.) { 963 outToFPA = psPlaneTransformSetCenter(NULL, chipToFPA, offset_x, offset_y);964 psFree(chipToFPA);1014 outToFPA = psPlaneTransformSetCenter(NULL, chipToFPA, offset_x, offset_y); 1015 psFree(chipToFPA); 965 1016 } else { 966 outToFPA = chipToFPA;1017 outToFPA = chipToFPA; 967 1018 } 968 1019 969 1020 psPlaneTransform *outFromFPA = psPlaneTransformInvert(NULL, outToFPA, *outputBounds, 50); 970 1021 if (!outFromFPA) { 971 psFree(outToFPA);972 psError(PS_ERR_UNKNOWN, false, "inversion of fit of output chip toFPA failed");973 return false;1022 psFree(outToFPA); 1023 psError(PS_ERR_UNKNOWN, false, "inversion of fit of output chip toFPA failed"); 1024 return false; 974 1025 } 975 1026 … … 1023 1074 1024 1075 for (int j = 0; j < nSamples; j++) { 1025 double y = bounds->y0 + (j * deltaY / nSamples);1026 for (int i = 0; i < nSamples; i++) {1027 1028 psSphere srcSky;1029 psPlane *srcChip = psPlaneAlloc();1030 psPlane *dstTP = psPlaneAlloc();1031 1032 srcChip->x = bounds->x0 + (i * deltaX / nSamples);1033 srcChip->y = y;1034 1035 psPlaneTransformApply (&srcFP, inChip->toFPA, srcChip);1036 psPlaneTransformApply (&srcTP, inFPA->toTPA, &srcFP);1037 psDeproject (&srcSky, &srcTP, inFPA->toSky);1038 1039 // fprintf (stderr, "%f %f | %f %f | %f %f | %f %f\n", srcChip->x, srcChip->y, srcFP.x, srcFP.y, srcTP.x, srcTP.y, srcSky.r*PS_DEG_RAD, srcSky.d*PS_DEG_RAD);1040 1041 psProject (dstTP, &srcSky, outFPA->toSky);1042 1043 srcChip->x -= bounds->x0;1044 srcChip->y -= bounds->y0;1045 psArrayAdd (src, 100, srcChip);1046 psArrayAdd (dst, 100, dstTP);1047 1048 psFree(srcChip); // drop our refs to s and d1049 psFree(dstTP);1050 }1076 double y = bounds->y0 + (j * deltaY / nSamples); 1077 for (int i = 0; i < nSamples; i++) { 1078 1079 psSphere srcSky; 1080 psPlane *srcChip = psPlaneAlloc(); 1081 psPlane *dstTP = psPlaneAlloc(); 1082 1083 srcChip->x = bounds->x0 + (i * deltaX / nSamples); 1084 srcChip->y = y; 1085 1086 psPlaneTransformApply (&srcFP, inChip->toFPA, srcChip); 1087 psPlaneTransformApply (&srcTP, inFPA->toTPA, &srcFP); 1088 psDeproject (&srcSky, &srcTP, inFPA->toSky); 1089 1090 // fprintf (stderr, "%f %f | %f %f | %f %f | %f %f\n", srcChip->x, srcChip->y, srcFP.x, srcFP.y, srcTP.x, srcTP.y, srcSky.r*PS_DEG_RAD, srcSky.d*PS_DEG_RAD); 1091 1092 psProject (dstTP, &srcSky, outFPA->toSky); 1093 1094 srcChip->x -= bounds->x0; 1095 srcChip->y -= bounds->y0; 1096 psArrayAdd (src, 100, srcChip); 1097 psArrayAdd (dst, 100, dstTP); 1098 1099 psFree(srcChip); // drop our refs to s and d 1100 psFree(dstTP); 1101 } 1051 1102 } 1052 1103 … … 1056 1107 1057 1108 if (!psPlaneTransformFit(newToFPA, src, dst, 0, 0)) { 1058 psError(PS_ERR_UNKNOWN, false, "linear fit to transform failed");1059 psFree(src);1060 psFree(dst);1061 return NULL;1109 psError(PS_ERR_UNKNOWN, false, "linear fit to transform failed"); 1110 psFree(src); 1111 psFree(dst); 1112 return NULL; 1062 1113 } 1063 1114 … … 1065 1116 for (int i = 0; i < src->n; i++) { 1066 1117 1067 psSphere srcSky, dstSky;1068 psPlane *srcChip = src->data[i];1069 psPlane *dstTP = dst->data[i];1070 1071 psPlaneTransformApply (&srcFP, newToFPA, srcChip);1072 psDeproject (&srcSky, &srcFP, outFPA->toSky);1073 psDeproject (&dstSky, dstTP, outFPA->toSky);1074 1075 double dX = (srcSky.r*PS_DEG_RAD - dstSky.r*PS_DEG_RAD)*3600.0;1076 double dY = (srcSky.d*PS_DEG_RAD - dstSky.d*PS_DEG_RAD)*3600.0;1077 fprintf (stderr, "%f %f | %f %f | %f %f | %f %f | %f %f | %f %f\n", dX, dY, srcChip->x, srcChip->y, srcFP.x, srcFP.y, dstTP->x, dstTP->y, srcSky.r*PS_DEG_RAD, srcSky.d*PS_DEG_RAD, dstSky.r*PS_DEG_RAD, dstSky.d*PS_DEG_RAD);1118 psSphere srcSky, dstSky; 1119 psPlane *srcChip = src->data[i]; 1120 psPlane *dstTP = dst->data[i]; 1121 1122 psPlaneTransformApply (&srcFP, newToFPA, srcChip); 1123 psDeproject (&srcSky, &srcFP, outFPA->toSky); 1124 psDeproject (&dstSky, dstTP, outFPA->toSky); 1125 1126 double dX = (srcSky.r*PS_DEG_RAD - dstSky.r*PS_DEG_RAD)*3600.0; 1127 double dY = (srcSky.d*PS_DEG_RAD - dstSky.d*PS_DEG_RAD)*3600.0; 1128 fprintf (stderr, "%f %f | %f %f | %f %f | %f %f | %f %f | %f %f\n", dX, dY, srcChip->x, srcChip->y, srcFP.x, srcFP.y, dstTP->x, dstTP->y, srcSky.r*PS_DEG_RAD, srcSky.d*PS_DEG_RAD, dstSky.r*PS_DEG_RAD, dstSky.d*PS_DEG_RAD); 1078 1129 1079 1130 } … … 1086 1137 psPlaneTransform *newFromFPA = psPlaneTransformInvert(NULL, newToFPA, *bounds, 1); 1087 1138 if (!newFromFPA) { 1088 psFree(newToFPA);1089 psError(PS_ERR_UNKNOWN, false, "inversion of fit of output chip toFPA failed");1090 return false;1139 psFree(newToFPA); 1140 psError(PS_ERR_UNKNOWN, false, "inversion of fit of output chip toFPA failed"); 1141 return false; 1091 1142 } 1092 1143 … … 1111 1162 1112 1163 if (!wcs) 1113 return;1164 return; 1114 1165 psFree (wcs->trans); 1115 1166 psFree (wcs->toSky); … … 1133 1184 /***** 1134 1185 1135 For mosaic astrometry, we need to have a starting set of projection terms in which the1136 chip-to-FPA terms result in a fixed physical unit on the focal plane (eg, pixels or1137 microns). This set of projections, coupled with an identity toTPA (ie, no distortion) will1138 result in substantial errors between the observed and predicted star positions on the focal1139 plane: this is the measurement of the optical distortion in the camera. At the same time,1140 we need to carry around the transformations which allow us to make an accurate calculation1141 of the position of the stars based on the input (per-chip) astrometry. These1142 transformations will allow us to match the raw and ref stars robustly. To convert the1143 per-chip astrometry (which may have been calculated with a different plate scale for each1144 chip) to a collection of astrometry terms for chips in a single mosaic, we need to adjust1145 the chip-to-FPA scaling (eg, pc11) to match the variations in the effective plate scale for1146 each chip (eg, cdelt1). Thus, we need to carry around both the1186 For mosaic astrometry, we need to have a starting set of projection terms in which the 1187 chip-to-FPA terms result in a fixed physical unit on the focal plane (eg, pixels or 1188 microns). This set of projections, coupled with an identity toTPA (ie, no distortion) will 1189 result in substantial errors between the observed and predicted star positions on the focal 1190 plane: this is the measurement of the optical distortion in the camera. At the same time, 1191 we need to carry around the transformations which allow us to make an accurate calculation 1192 of the position of the stars based on the input (per-chip) astrometry. These 1193 transformations will allow us to match the raw and ref stars robustly. To convert the 1194 per-chip astrometry (which may have been calculated with a different plate scale for each 1195 chip) to a collection of astrometry terms for chips in a single mosaic, we need to adjust 1196 the chip-to-FPA scaling (eg, pc11) to match the variations in the effective plate scale for 1197 each chip (eg, cdelt1). Thus, we need to carry around both the 1147 1198 1148 1199 *****/ -
trunk/psModules/src/detrend/pmFringeStats.c
r34085 r39926 336 336 dfPt[i] = 1.0 / medianSd->sampleStdev; 337 337 338 psTrace("psModules.detrend", 7, "[%d:%d,%d:%d]: %f %f : %s\n", (int)region.x0, (int)region.x1, 339 (int)region.y0, (int)region.y1, fPt[i], dfPt[i], readout->parent->hdu->extname); 338 if (readout->parent->hdu) { 339 psTrace("psModules.detrend", 7, "[%d:%d,%d:%d]: %f %f : %s\n", (int)region.x0, (int)region.x1, 340 (int)region.y0, (int)region.y1, fPt[i], dfPt[i], readout->parent->hdu->extname); 341 } 342 else { 343 psTrace("psModules.detrend", 7, "[%d:%d,%d:%d]: %f %f : THIS_IS_A_SPOOKY_GHOST_CELL\n", (int)region.x0, (int)region.x1, 344 (int)region.y0, (int)region.y1, fPt[i], dfPt[i]); 345 } 340 346 } 341 347 psFree(sky); -
trunk/psModules/src/objects/pmPCM_MinimizeChisq.c
r36859 r39926 480 480 # if (TESTCOPY) 481 481 psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 482 # else 482 # else // TESTCOPY 483 483 if (pcm->use1Dgauss) { 484 484 … … 496 496 psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT); 497 497 } 498 # endif 498 # endif // TESTCOPY 499 499 500 500 for (int n = 0; n < pcm->dmodelsFlux->n; n++) { … … 505 505 # if (TESTCOPY) 506 506 psImageCopy (dmodelConv, dmodel, dmodel->type.type); 507 # else 507 # else // TESTCOPY 508 508 if (pcm->use1Dgauss) { 509 509 if (USE_1D_CACHE) { … … 520 520 psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT); 521 521 } 522 # endif 523 } 524 # else 522 # endif // TESTCOPY 523 } 524 # else // PRE_CONVOLVE 525 525 // convolve model image and derivative images with psf via FFT 526 526 psImageConvolveFFT (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psf); … … 547 547 } 548 548 # endif // PRE-CONVOLVE 549 # else 549 # else // USE_FFT 550 550 // convolve model image and derivative images with psf direct 551 551 psImageConvolveDirect (pcm->modelConvFlux, pcm->modelFlux, pcm->psf); -
trunk/psModules/src/objects/pmSourceIO_MatchedRefs.c
r36856 r39926 119 119 psMetadataAdd (row, PS_LIST_TAIL, "RA_REF", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*ref->sky->r); 120 120 psMetadataAdd (row, PS_LIST_TAIL, "DEC_REF", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*ref->sky->d); 121 psMetadataAdd (row, PS_LIST_TAIL, "RA_RAW", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*raw->sky->r); 122 psMetadataAdd (row, PS_LIST_TAIL, "DEC_RAW", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*raw->sky->d); 121 123 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP_REF", PS_DATA_F32, "x fitted coord on chip", ref->chip->x); 122 124 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP_REF", PS_DATA_F32, "y fitted coord on chip", ref->chip->y); -
trunk/psastro/src/psastro.h
r38040 r39926 70 70 bool psastroCorrectKH (pmConfig *config, pmFPAview *view, pmReadout *readout, psMetadata *recipe, psArray *inStars); 71 71 72 psArray *pmSourceToAstromObj (psArray *sources );72 psArray *pmSourceToAstromObj (psArray *sources, float MagOffset); 73 73 bool psastroAstromGuess (int *nStars, pmConfig *config); 74 74 bool psastroAstromGuessCheck (pmConfig *config); -
trunk/psastro/src/psastroAstromGuess.c
r31333 r39926 75 75 pmFPA *fpa = input->fpa; 76 76 77 if (DEBUG) psastroDumpCorners ("corners.up.guess1.dat", "corners.dn.guess1.dat", fpa); 77 // this call only works if we have loaded a model : seg fault if not 78 if (DEBUG && useModel) psastroDumpCorners ("corners.up.guess1.dat", "corners.dn.guess1.dat", fpa); 78 79 79 80 // load mosaic-level astrometry? … … 91 92 if (!psastroAstromGuessSetChip (fpa, chip, view, pixelScale, bilevelAstrometry)) continue; 92 93 } 94 95 if (!chip->toFPA || !chip->fromFPA) { 96 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 97 fprintf (stderr, "no astrom model for %s, skipping\n", name); 98 continue; 99 } 93 100 94 101 if (newFPA) { … … 312 319 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 313 320 if (!chip->process || !chip->file_exists || !chip->data_exists) { continue; } 321 322 if (!chip->toFPA || !chip->fromFPA) { 323 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 324 fprintf (stderr, "no astrom model for %s, skipping\n", name); 325 continue; 326 } 314 327 315 328 // XXX we are currently inconsistent with marking the good vs the bad data -
trunk/psastro/src/psastroChipAstrom.c
r36914 r39926 85 85 for (int nn = 0; nn < refstars->n; nn++) { 86 86 pmAstromObj *ref = refstars->data[nn]; 87 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf \n",87 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf : %f %f\n", 88 88 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 89 89 ref->TP->x, ref->TP->y, 90 90 ref->FP->x, ref->FP->y, 91 ref->chip->x, ref->chip->y );91 ref->chip->x, ref->chip->y, ref->Mag, ref->magCal); 92 92 } 93 93 fclose (outfile); … … 101 101 for (int nn = 0; nn < gridrawstars->n; nn++) { 102 102 pmAstromObj *ref = gridrawstars->data[nn]; 103 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf \n",103 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf : %f %f\n", 104 104 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 105 105 ref->TP->x, ref->TP->y, 106 106 ref->FP->x, ref->FP->y, 107 ref->chip->x, ref->chip->y );107 ref->chip->x, ref->chip->y, ref->Mag, ref->magCal); 108 108 } 109 109 fclose (outfile); -
trunk/psastro/src/psastroConvert.c
r38040 r39926 51 51 bool status; 52 52 53 // XXX I want to make this optional 54 float MagOffset = 0.0; 55 if (1) { 56 // select the input data sources 57 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 58 if (!input) { 59 psError(PSASTRO_ERR_CONFIG, true, "failed to find PSASTRO.INPUT\n"); 60 return false; 61 } 62 pmFPA *fpa = input->fpa; 63 64 float zeropt, exptime; 65 66 // really error-out here? or just skip? 67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) { 68 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 69 zeropt = 0.0; 70 exptime = 1.0; 71 } 72 73 // recipe values are given in instrumental magnitudes 74 // use the zero point and exposure time to convert to apparent mags: M_ap = M_inst + C_0 + 2.5*log(exptime) 75 MagOffset = zeropt + 2.5*log10(exptime); 76 } 77 53 78 // PSPHOT.SOURCES carries the pmSource objects (from psphot analysis or loaded externally) 54 79 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 59 84 60 85 // convert the pmSource objects into pmAstromObj objects (drop !STAR and SATSTAR?) 61 psArray *inStars = pmSourceToAstromObj (sources );86 psArray *inStars = pmSourceToAstromObj (sources, MagOffset); 62 87 63 88 // apply Koppenhoefer correction if needed … … 175 200 176 201 // select a magnitude range? 177 psArray *pmSourceToAstromObj (psArray *sources ) {202 psArray *pmSourceToAstromObj (psArray *sources, float MagOffset) { 178 203 179 204 psArray *objects = psArrayAllocEmpty (sources->n); … … 211 236 obj->dMag = source->psfMagErr; 212 237 obj->SBinst = source->psfMag + 5.0*log10(axes.major); 238 obj->magCal = obj->Mag + MagOffset; 213 239 214 240 // XXX do we have the information giving the readout and cell offset? -
trunk/psastro/src/psastroDemoDump.c
r26259 r39926 234 234 if (!chip->process || !chip->file_exists || !chip->data_exists) { continue; } 235 235 236 if (!chip->toFPA || !chip->fromFPA) { 237 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 238 fprintf (stderr, "no astrom model for %s, skipping\n", name); 239 continue; 240 } 241 236 242 // XXX write out the four corners for a test 237 243 psRegion *region = pmChipPixels (chip); -
trunk/psastro/src/psastroFixChips.c
r27639 r39926 306 306 psRegion *region = pmChipPixels (obsChip); 307 307 obsChip->toFPA = toFPA; 308 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 308 309 obsChip->fromFPA = psPlaneTransformInvert(NULL, obsChip->toFPA, *region, 50); 309 310 psFree (region); -
trunk/psastro/src/psastroLoadRefstars.c
r34967 r39926 265 265 ref->Color = 0.0; 266 266 } 267 ref->magCal = ref->Mag; 267 268 268 269 // XXX VERY temporary hack to avoid M31 bulge … … 306 307 ref->Color = 0.0; 307 308 } 309 ref->magCal = ref->Mag; 308 310 309 311 // XXX VERY temporary hack to avoid M31 bulge -
trunk/psastro/src/psastroModelAdjust.c
r21409 r39926 28 28 } 29 29 30 31 30 32 // if we have not measured the boresite position, no adjustment is needed 31 33 bool fitBoresite = psMetadataLookupBool (&status, recipe, "PSASTRO.MODEL.FIT.BORESITE"); … … 52 54 return false; 53 55 } 54 56 float refChipAngleNominal = PS_RAD_DEG*psMetadataLookupF32 (&status, recipe, "PSASTRO.MODEL.REF.CHIP.ANGLE"); 57 if (!refChipName) { 58 psError(PS_ERR_IO, true, "reference chip is missing from recipe"); 59 return false; 60 } 61 62 int rotatorParity = psMetadataLookupS32(&status, recipe, "PSASTRO.MODEL.ROT.PARITY"); 63 if (!status) psAbort ("Can't find recipe option PSASTRO.MODEL.ROT.PARITY"); 64 psMetadataAddS32 (output->fpa->concepts, PS_LIST_TAIL, "FPA.ROT_PARITY", PS_META_REPLACE, "rotator parity parameter", rotatorParity); 65 55 66 // get reference chip from name 56 67 pmChip *refChip = pmConceptsChipFromName (output->fpa, refChipName); … … 81 92 psFree (PT); 82 93 } 83 94 84 95 // rotate the chip-to-FPA transforms to have 0.0 posangle for refChip; 85 96 // compensate by rotating fpa to TPA transform 86 97 87 98 // get the current posangle of the ref chip 88 float chipAngle = atan2 (refChip->toFPA->y->coeff[1][0], refChip->toFPA->x->coeff[1][0]); 89 fprintf (stderr, "chipAngle: %f\n", chipAngle*PS_DEG_RAD); 99 // this should have a negative sign : chipAngle = -atan2 (dM/dy, dM/dx) 100 float chipAngle = -atan2 (refChip->toFPA->y->coeff[1][0], refChip->toFPA->x->coeff[1][0]); 101 102 // chipAngle should be refChipAngleNominal @ POSANGLE = 0.0 103 float posAngleOffset = rotatorParity * (chipAngle - refChipAngleNominal); 104 105 fprintf (stderr, "chipAngle is: %f, at PA = 0.0, it should be %f, rotating model by %f (parity %d)\n", 106 chipAngle*PS_DEG_RAD, refChipAngleNominal*PS_DEG_RAD, posAngleOffset*PS_DEG_RAD, rotatorParity); 107 90 108 // psMetadataAddF32 (output->fpa->concepts, PS_LIST_TAIL, "FPA.POSANGLE", PS_META_REPLACE, "boresite parameter", posangle); 91 109 … … 99 117 psRegion *region = pmChipPixels (chip); 100 118 101 psPlaneTransform *toFPA = psPlaneTransformRotate (NULL, chip->toFPA, chipAngle); 119 // this should ALSO have a negative sign: this rotates by +posAngleOffset 120 psPlaneTransform *toFPA = psPlaneTransformRotate (NULL, chip->toFPA, posAngleOffset); 102 121 psFree (chip->toFPA); 103 122 chip->toFPA = toFPA; 104 123 105 124 // invert the new fromFPA transform to get the new toFPA transform 125 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 106 126 psPlaneTransform *fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50); 107 127 psFree (chip->fromFPA); … … 125 145 126 146 psFree (output->fpa->fromTPA); 147 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 127 148 output->fpa->fromTPA = psPlaneTransformInvert(NULL, output->fpa->toTPA, *fpaRegion, 50); 128 149 … … 131 152 132 153 psMetadata *header = output->fpa->hdu->header; 154 133 155 pmAstromWriteBilevelMosaic (header, output->fpa, NONLIN_TOL); 134 156 … … 172 194 // invert the new fromFPA transform to get the new toFPA transform 173 195 // the region used here is the region covered by the chip in the FPA 196 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 174 197 psPlaneTransform *fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50); 175 198 psFree (chip->fromFPA); -
trunk/psastro/src/psastroMosaicAstrom.c
r27558 r39926 15 15 16 16 bool psastroMosaicFit (pmFPA *fpa, psMetadata *recipe, const char *rootname, int pass); 17 bool psastroProjectionRefit (pmFPA *fpa, psMetadata *recipe); 17 18 18 19 // XXX require this fpa to have multiple chip extensions and a PHU? … … 43 44 if (!status) psAbort ("missing config value"); 44 45 46 // if projection is not TAN, fit the measured projection here and combine toTPA/fromTPA functions 47 bool fitMosaicDistortion = true; 48 if ((fpa->toSky->type != PS_PROJ_TAN) && (fpa->toSky->type != PS_PROJ_DIS)) { 49 if (!psastroProjectionRefit (fpa, recipe)) psAbort ("failed to refit distortion"); 50 fitMosaicDistortion = false; 51 } 52 45 53 // this should be in a loop with nIter = 46 for (int iter = 0; iter < nIter; iter++) {54 for (int iter = 0; fitMosaicDistortion && (iter < nIter); iter++) { 47 55 if (!psastroMosaicFit (fpa, recipe, outroot, iter)) return false; 48 56 } 49 57 50 // now fit the chips under the common distortion with higher-order terms 51 // first, re-perform the match with a slightly tighter circle 52 if (!psastroMosaicSetMatch (fpa, recipe, nIter)) { 53 psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (4th pass)"); 54 return false; 55 } 56 if (!psastroMosaicChipAstrom (fpa, recipe, nIter)) { 57 psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (4th pass)"); 58 return false; 59 } 60 61 if (psTraceGetLevel("psastro.dump") > 0) { 58 for (int iter = 0; (iter < nIter); iter++) { 59 // now fit the chips under the common distortion with higher-order terms 60 // first, re-perform the match with a slightly tighter circle 61 if (!psastroMosaicSetMatch (fpa, recipe, iter)) { 62 psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (4th pass %d)", iter); 63 return false; 64 } 65 if (!psastroMosaicChipAstrom (fpa, recipe, iter)) { 66 psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (pass %d)", iter); 67 return false; 68 } 69 70 if (psTraceGetLevel("psastro.dump") > 0) { 62 71 // the last filename (see filenames in psastroMosaicFit) 63 72 char filename[256]; 64 73 snprintf (filename, 256, "%s.%d.dat", outroot, 2*nIter + 2); 65 74 psastroDumpMatches (fpa, filename); 66 } 67 75 } 76 } 77 68 78 // save WCS and analysis metadata in update header. 69 79 // (pull or create local view to entry on readout->analysis) … … 154 164 return true; 155 165 } 166 167 // we have a fpa->toSky projection which is NOT of type TAN along with a toTPA which is 168 // the Identity transform. we want to convert this to TAN projection plus a non-identity 169 // transformation to take the non-TAN components. 170 171 // we are going to generate a set of FP->(x,y) using the current projection + fromTPA 172 // transformations along with a set of TP->(x,y) values using the desired TAN projection, 173 // then we will fit TP vs FP 174 175 bool psastroProjectionRefit (pmFPA *fpa, psMetadata *recipe) { 176 177 bool status; 178 179 // allocate mosaic-level polynomial transformation and set masks needed by DVO 180 int order = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.ORDER"); 181 if (!status) { 182 psError(PSASTRO_ERR_UNKNOWN, false, "failed to find mosaic distortion fit order\n"); 183 return false; 184 } 185 186 pmChip *chip = NULL; 187 pmCell *cell = NULL; 188 pmReadout *readout = NULL; 189 pmFPAview *view = pmFPAviewAlloc (0); 190 191 psVector *L = psVectorAllocEmpty (1000, PS_TYPE_F32); 192 psVector *M = psVectorAllocEmpty (1000, PS_TYPE_F32); 193 194 psVector *P = psVectorAllocEmpty (1000, PS_TYPE_F32); 195 psVector *Q = psVectorAllocEmpty (1000, PS_TYPE_F32); 196 197 psProjection *toSkyTan = psProjectionAlloc (fpa->toSky->R, fpa->toSky->D, fpa->toSky->Xs, fpa->toSky->Ys, PS_PROJ_TAN); 198 199 float xMin = NAN; 200 float xMax = NAN; 201 float yMin = NAN; 202 float yMax = NAN; 203 204 bool firstObject = true; 205 206 // this loop selects the matched stars for all chips 207 while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) { 208 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 209 if (!chip->process || !chip->file_exists) continue; 210 211 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 212 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 213 if (!cell->process || !cell->file_exists) continue; 214 215 // process each of the readouts 216 // XXX there can only be one readout per chip, right? 217 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) { 218 if (! readout->data_exists) continue; 219 220 // select the raw objects for this readout 221 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET"); 222 if (refstars == NULL) continue; 223 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 224 225 psArray *matches = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH"); 226 if (matches == NULL) continue; 227 228 // we are looking over the matched refstars only to be sure we are 229 // covering the valid space of the projection + transformation, and not 230 // beyond 231 232 for (int i = 0; i < matches->n; i++) { 233 pmAstromMatch *match = matches->data[i]; 234 pmAstromObj *ref = refstars->data[match->ref]; 235 236 psPlane fpOld, tpNew, tpOld; 237 238 psProject (&tpOld, ref->sky, fpa->toSky); // find the focal-plane coord of this RA,DEC coord using the ref chip projection 239 psPlaneTransformApply (&fpOld, fpa->fromTPA, &tpOld); 240 241 psProject (&tpNew, ref->sky, toSkyTan); // find the focal-plane coord of this RA,DEC coord using the ref chip projection 242 243 psVectorAppend (L, fpOld.x); 244 psVectorAppend (M, fpOld.y); 245 246 psVectorAppend (P, tpNew.x); 247 psVectorAppend (Q, tpNew.y); 248 249 if (firstObject) { 250 xMin = xMax = fpOld.x; 251 yMin = yMax = fpOld.y; 252 firstObject = false; 253 } 254 255 xMin = PS_MIN (xMin, fpOld.x); 256 xMax = PS_MAX (xMax, fpOld.x); 257 yMin = PS_MIN (yMin, fpOld.y); 258 yMax = PS_MAX (yMax, fpOld.y); 259 } 260 } 261 } 262 } 263 264 // the original transforms are (1, 1), but we will need higher order to fit the distortions 265 psFree (fpa->toTPA); 266 267 // the original transforms are (1, 1), but we will need higher order to fit the distortions 268 fpa->toTPA = psPlaneTransformAlloc (order, order); 269 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 270 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { 271 if (i + j > order) { 272 fpa->toTPA->x->coeffMask[i][j] = PS_POLY_MASK_SET; 273 fpa->toTPA->y->coeffMask[i][j] = PS_POLY_MASK_SET; 274 } 275 } 276 } 277 278 psVectorFitPolynomial2D (fpa->toTPA->x, NULL, 0, P, NULL, L, M); 279 psVectorFitPolynomial2D (fpa->toTPA->y, NULL, 0, Q, NULL, L, M); 280 281 psRegion fitRegion = psRegionSet (xMin, xMax, yMin, yMax); 282 283 // psPlaneTransformInvert will generate a new fromTPA with order to match toTPA 284 psFree (fpa->fromTPA); 285 psPlaneTransform *myPT = psPlaneTransformAlloc(fpa->toTPA->x->nX+4, fpa->toTPA->x->nY+4); 286 fpa->fromTPA = psPlaneTransformInvert (myPT, fpa->toTPA, fitRegion, 100); 287 psFree (myPT); 288 289 psFree (fpa->toSky); 290 fpa->toSky = toSkyTan; 291 292 psFree (L); 293 psFree (M); 294 psFree (P); 295 psFree (Q); 296 297 psFree (view); 298 299 if (!psastroMosaicSetAstrom (fpa)) { 300 psError(PSASTRO_ERR_UNKNOWN, false, "failed to apply mosaic distortion terms\n"); 301 return false; 302 } 303 304 return true; 305 } 306 -
trunk/psastro/src/psastroMosaicCorrectDistortion.c
r21409 r39926 62 62 63 63 psFree (fpa->fromTPA); 64 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, *region, 50); 64 psPlaneTransform *myPT = psPlaneTransformAlloc(fpa->toTPA->x->nX+4, fpa->toTPA->x->nY+4); 65 fpa->fromTPA = psPlaneTransformInvert(myPT, fpa->toTPA, *region, 50); 66 psFree (myPT); 65 67 psFree (region); 66 68 -
trunk/psastro/src/psastroMosaicGradients.c
r26259 r39926 79 79 int order = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.ORDER"); 80 80 if (!status) { 81 psError(PSASTRO_ERR_UNKNOWN, false, "failed to find single-chipfit order\n");81 psError(PSASTRO_ERR_UNKNOWN, false, "failed to find mosaic distortion fit order\n"); 82 82 psFree (gradients); 83 83 psFree (view); -
trunk/psastro/src/psastroMosaicOneChip.c
r26259 r39926 100 100 } 101 101 102 // XXX allow stati tic to be set by the user102 // XXX allow statistic to be set by the user 103 103 // only clip if we are fitting the chip parameters. 104 104 psStats *fitStats = NULL; 105 // if (order == 0) {106 //fitStats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);107 //fitStats->clipSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NSIGMA");108 //fitStats->clipIter = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NITER");109 //} else {110 fitStats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);111 fitStats->clipSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NSIGMA");112 fitStats->clipIter = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NITER");113 //}105 if (FALSE && (order == 0)) { 106 fitStats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 107 fitStats->clipSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NSIGMA"); 108 fitStats->clipIter = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NITER"); 109 } else { 110 fitStats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 111 fitStats->clipSigma = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NSIGMA"); 112 fitStats->clipIter = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.CHIP.NITER"); 113 } 114 114 115 115 // need to pass in an update header, sent in from above 116 pmAstromFitResults *results = pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, fitStats );116 pmAstromFitResults *results = pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, fitStats, recipe); 117 117 if (!results) { 118 118 psError(PSASTRO_ERR_DATA, false, "failed to perform the matched fit\n"); -
trunk/psastro/src/psastroOneChipFit.c
r36914 r39926 124 124 125 125 // improved fit for astrometric terms 126 results = pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, fitStats );126 results = pmAstromMatchFit (chip->toFPA, rawstars, refstars, match, fitStats, recipe); 127 127 if (!results) { 128 128 psLogMsg ("psastro", 3, "failed to perform the matched fit\n"); -
trunk/psphot/src/psphotSourceStats.c
r37766 r39926 560 560 } 561 561 562 if (psTraceGetLevel("psphot.moments.save")) { 563 char name[64]; 564 sprintf (name, "moments.v%d.dat", i); 565 FILE *fout = fopen (name, "w"); 566 for (int j = 0; j < sources->n; j++) { 567 pmSource *source = sources->data[j]; 568 psAssert (source->moments, "force moments to exist"); 569 source->moments->nPixels = 0; 570 status = pmSourceMoments (source, 20, sigma[i], 0.0, 0.0, maskVal); 571 fprintf (fout, "%f %f | %f %f %f | %f\n", source->moments->Mx, source->moments->My, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, source->moments->Sum); 572 } 573 fclose (fout); 574 } 575 562 576 // choose a grid scale that is a fixed fraction of the psf sigma^2 563 577 float PSF_CLUMP_GRID_SCALE = 0.1*PS_SQR(sigma[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
