diff -Nru "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/_compile and zip the 64bit and 32bit version and copy to the webpage.bat" "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/_compile and zip the 64bit and 32bit version and copy to the webpage.bat" --- "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/_compile and zip the 64bit and 32bit version and copy to the webpage.bat" 2022-12-10 01:38:10.000000000 +0000 +++ "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/_compile and zip the 64bit and 32bit version and copy to the webpage.bat" 2024-01-17 22:20:03.000000000 +0000 @@ -1,12 +1,12 @@ -\lazarus\lazbuild astap_command_line_w64.lpi +d:\lazarus\lazbuild astap_command_line_w64.lpi pkzip25 -add astap_command-line_version_win64 .\astap_cli.exe copy astap_command-line_version_win64.zip C:\webpage\webpage\homepage_hnsky /y -\lazarus\lazbuild astap_command_line_w32.lpi +d:\lazarus\lazbuild astap_command_line_w32.lpi pkzip25 -add astap_command-line_version_win32 .\astap_cli.exe copy astap_command-line_version_win32.zip C:\webpage\webpage\homepage_hnsky /y - +copy .\astap_cli.exe \astap.fpc pause diff -Nru astap-cli-2022.12.09/_compile_all.sh astap-cli-2024.01.17/_compile_all.sh --- astap-cli-2022.12.09/_compile_all.sh 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/_compile_all.sh 2024-01-17 22:20:03.000000000 +0000 @@ -1,41 +1,91 @@ rm astap_cli -/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_linux_arm64.lpi -zip astap_command-line_version_Linux_arm64.zip astap_cli +/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_linux_aarch64.lpi +zip astap_command-line_version_Linux_aarch64.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Linux_aarch64 file does not exist, aborting!!' + exit +fi rm astap_cli + /home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_linux_armhf.lpi zip astap_command-line_version_Linux_armhf.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Linux_armhf file does not exist, aborting!!' + exit +fi rm astap_cli /home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_darwin_M1.lpi zip astap_command-line_version_macOS_M1.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'macOS_M1 file does not exist, aborting!!' + exit +fi rm astap_cli /home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_darwin_X86_64.lpi -zip astap_command-line_version_macOS_X86_64.zip astap_cli +zip astap_command-line_version_macOS_x86_64.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'macOS_x86_64 file does not exist, aborting!!' + exit +fi rm astap_cli /home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_android_armhf.lpi zip astap_command-line_version_Android_armhf.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Android_armhf file does not exist, aborting!!' + exit +fi rm astap_cli -/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_android_arm64.lpi +/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_android_aarch64.lpi zip astap_command-line_version_Android_aarch64.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Android_armhf file does not exist, aborting!!' + exit +fi +rm astap_cli + +/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_android_x86.lpi +zip astap_command-line_version_Android_x86.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Android_armhf file does not exist, aborting!!' + exit +fi +rm astap_cli + +/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_android_x86_64.lpi +zip astap_command-line_version_Android_x86_64.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Android_x86_64 file does not exist, aborting!!' + exit +fi rm astap_cli /home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_linux.lpi zip astap_command-line_version_Linux_amd64.zip astap_cli +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli ]] ; then + echo 'Linux_amd64 file does not exist, aborting!!' + exit +fi rm astap_cli -/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_Win11_arm64.lpi -zip astap_command-line_version_Win11_arm64 astap_cli.exe +/home/h/fpcupdeluxe/lazarus/lazbuild astap_command_line_win11_aarch64.lpi +zip astap_command-line_version_win11_aarch64 astap_cli.exe +if [[ ! -f ~/astap.fpc/command-line_version/astap_cli.exe ]] ; then + echo 'Win11_aarch64 file does not exist, aborting!!' + exit +fi rm astap_cli.exe + diff -Nru astap-cli-2022.12.09/astap_command_line.lpi astap-cli-2024.01.17/astap_command_line.lpi --- astap-cli-2022.12.09/astap_command_line.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -18,7 +18,8 @@ - + + @@ -57,7 +58,6 @@ - diff -Nru astap-cli-2022.12.09/astap_command_line.lpr astap-cli-2024.01.17/astap_command_line.lpr --- astap-cli-2022.12.09/astap_command_line.lpr 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line.lpr 2024-01-17 22:20:03.000000000 +0000 @@ -1,4 +1,10 @@ program astap_command_line; +{Copyright (C) 2017, 2024 by Han Kleijn, www.hnsky.org + email: han.k.. at...hnsky.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at https://mozilla.org/MPL/2.0/. } {$mode objfpc}{$H+} @@ -55,21 +61,22 @@ begin writeln( 'ASTAP astrometric solver version CLI-'+astap_version+#10+ - '(C) 2018, 2022 by Han Kleijn. License MPL 2.0, Webpage: www.hnsky.org'+#10+ + '(C) 2018, 2023 by Han Kleijn. License MPL 2.0, Webpage: www.hnsky.org'+#10+ 'Usage:'+#10+ '-f filename {fits, tiff, png, jpg files}'+#10+ '-r radius_area_to_search[degrees]'+#10+ {changed} '-z downsample_factor[0,1,2,3,4] {Downsample prior to solving. 0 is auto}'+#10+ - '-fov diameter_field[degrees]'+#10+ {changed} - '-ra center_right ascension[hours]'+#10+ + '-fov diameter_field[degrees] {enter zero for auto}'+#10+ {changed} + '-ra center_right_ascension[hours]'+#10+ '-spd center_south_pole_distance[degrees]'+#10+ - '-s max_number_of_stars {default 500, 0 is auto}'+#10+ + '-s max_number_of_stars {default 500}'+#10+ '-t tolerance {default 0.007}'+#10+ '-m minimum_star_size["] {default 1.5}'+#10+ '-check apply[y/n] {Apply check pattern filter prior to solving. Use for raw OSC images only when binning is 1x1}' +#10+ '-speed mode[auto/slow] {Slow is forcing reading a larger area from the star database (more overlap) to improve detection}'+#10+ '-o file {Name the output files with this base path & file name}'+#10+ '-d path {specify a path to the star database}'+#10+ + '-D abbreviation {Specify a star database [d80,d50,..]}'+#10+ '-analyse snr_min {Analyse only and report median HFD and number of stars used}'+#10+ '-extract snr_min {As -analyse but additionally write a .csv file with the detected stars info}'+#10+ '-log {Write the solver log to file}'+#10+ @@ -149,7 +156,11 @@ end;{analyse fits and report HFD value} if hasoption('d') then - database_path:=GetOptionValue('d')+DirectorySeparator; {specify a different database path} + database_path:=GetOptionValue('d')+DirectorySeparator; {specify a different database path} + if hasoption('D') then + star_database1:=GetOptionValue('D'); {specify a different database} + + if ((file_loaded) and (solve_image(img_loaded ))) then {find plate solution, filename2 extension will change to .fit} begin @@ -237,6 +248,8 @@ //{$R *.res} +{$R *.res} + begin Application:=Tastap.Create(nil); Application.Run; Binary files /tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/astap_command_line.res and /tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/astap_command_line.res differ diff -Nru astap-cli-2022.12.09/astap_command_line_Win11_arm64.lpi astap-cli-2024.01.17/astap_command_line_Win11_arm64.lpi --- astap-cli-2022.12.09/astap_command_line_Win11_arm64.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_Win11_arm64.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - <UseAppBundle Value="False"/> - <ResourceType Value="res"/> - </General> - <VersionInfo> - <UseVersionInfo Value="True"/> - <MajorVersionNr Value="1"/> - <StringTable CompanyName="www.hnsky.org" FileDescription="astap command line astrometric solver" LegalCopyright="Han Kleijn" OriginalFilename="astap_cli" ProductName="astap_cli"/> - </VersionInfo> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - <UseFileFilters Value="True"/> - </PublishOptions> - <RunParams> - <FormatVersion Value="2"/> - </RunParams> - <Units Count="3"> - <Unit0> - <Filename Value="astap_command_line.lpr"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="unit_command_line_solving.pas"/> - <IsPartOfProject Value="True"/> - </Unit1> - <Unit2> - <Filename Value="unit_command_line_general.pas"/> - <IsPartOfProject Value="True"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="astap_cli"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <TargetCPU Value="aarch64"/> - <TargetOS Value="win64"/> - </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="False"/> - </Debugging> - </Linking> - <Other> - <CustomOptions Value="-XX --Si --vh"/> - </Other> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_android_aarch64.lpi astap-cli-2024.01.17/astap_command_line_android_aarch64.lpi --- astap-cli-2022.12.09/astap_command_line_android_aarch64.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_android_aarch64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="aarch64"/> + <TargetOS Value="android"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_android_arm64.lpi astap-cli-2024.01.17/astap_command_line_android_arm64.lpi --- astap-cli-2022.12.09/astap_command_line_android_arm64.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_android_arm64.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CONFIG> - <ProjectOptions> - <Version Value="12"/> - <PathDelim Value="\"/> - <General> - <Flags> - <MainUnitHasCreateFormStatements Value="False"/> - <MainUnitHasTitleStatement Value="False"/> - <MainUnitHasScaledStatement Value="False"/> - <CompatibilityMode Value="True"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <Title Value="astap"/> - <UseAppBundle Value="False"/> - <ResourceType Value="res"/> - </General> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - <UseFileFilters Value="True"/> - </PublishOptions> - <RunParams> - <FormatVersion Value="2"/> - </RunParams> - <Units Count="3"> - <Unit0> - <Filename Value="astap_command_line.lpr"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="unit_command_line_solving.pas"/> - <IsPartOfProject Value="True"/> - </Unit1> - <Unit2> - <Filename Value="unit_command_line_general.pas"/> - <IsPartOfProject Value="True"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="astap_cli"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <TargetCPU Value="aarch64"/> - <TargetOS Value="android"/> - </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="False"/> - </Debugging> - </Linking> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_android_x86.lpi astap-cli-2024.01.17/astap_command_line_android_x86.lpi --- astap-cli-2022.12.09/astap_command_line_android_x86.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_android_x86.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="i386"/> + <TargetOS Value="android"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_android_x86_64.lpi astap-cli-2024.01.17/astap_command_line_android_x86_64.lpi --- astap-cli-2022.12.09/astap_command_line_android_x86_64.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_android_x86_64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="x86_64"/> + <TargetOS Value="android"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/astap_command_line_darwin M1.lpi" "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/astap_command_line_darwin M1.lpi" --- "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/astap_command_line_darwin M1.lpi" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/astap_command_line_darwin M1.lpi" 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="arm"/> + <TargetOS Value="android"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/astap_command_line_darwin X86_64.lpi" "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/astap_command_line_darwin X86_64.lpi" --- "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/astap_command_line_darwin X86_64.lpi" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/astap_command_line_darwin X86_64.lpi" 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="x86_64"/> + <TargetOS Value="darwin"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_iOS_aarch64.lpi astap-cli-2024.01.17/astap_command_line_iOS_aarch64.lpi --- astap-cli-2022.12.09/astap_command_line_iOS_aarch64.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_iOS_aarch64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="aarch64"/> + <TargetOS Value="ios"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_linux_aarch64.lpi astap-cli-2024.01.17/astap_command_line_linux_aarch64.lpi --- astap-cli-2022.12.09/astap_command_line_linux_aarch64.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_linux_aarch64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="aarch64"/> + <TargetOS Value="linux"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + <Other> + <CustomOptions Value="-XX +-Si +-vh"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_linux_arm64.lpi astap-cli-2024.01.17/astap_command_line_linux_arm64.lpi --- astap-cli-2022.12.09/astap_command_line_linux_arm64.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_linux_arm64.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CONFIG> - <ProjectOptions> - <Version Value="12"/> - <PathDelim Value="\"/> - <General> - <Flags> - <MainUnitHasCreateFormStatements Value="False"/> - <MainUnitHasTitleStatement Value="False"/> - <MainUnitHasScaledStatement Value="False"/> - <CompatibilityMode Value="True"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <Title Value="astap"/> - <UseAppBundle Value="False"/> - <ResourceType Value="res"/> - </General> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - <UseFileFilters Value="True"/> - </PublishOptions> - <RunParams> - <FormatVersion Value="2"/> - </RunParams> - <Units Count="3"> - <Unit0> - <Filename Value="astap_command_line.lpr"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="unit_command_line_solving.pas"/> - <IsPartOfProject Value="True"/> - </Unit1> - <Unit2> - <Filename Value="unit_command_line_general.pas"/> - <IsPartOfProject Value="True"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="astap_cli"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <TargetCPU Value="aarch64"/> - <TargetOS Value="linux"/> - </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="False"/> - </Debugging> - </Linking> - <Other> - <CustomOptions Value="-XX --Si --vh"/> - </Other> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_w32.lpi astap-cli-2024.01.17/astap_command_line_w32.lpi --- astap-cli-2022.12.09/astap_command_line_w32.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_w32.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -1,23 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="11"/> + <Version Value="12"/> <PathDelim Value="\"/> <General> <Flags> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> </Flags> <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> <Title Value="astap"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> <VersionInfo> <UseVersionInfo Value="True"/> + <AutoIncrementBuild Value="True"/> <MajorVersionNr Value="1"/> + <Attributes pvaSpecialBuild="True"/> <StringTable CompanyName="www.hnsky.org" FileDescription="astap command line astrometric solver" LegalCopyright="Han Kleijn" OriginalFilename="astap_cli.exe" ProductName="astap_cli"/> </VersionInfo> <BuildModes Count="1"> @@ -29,7 +31,6 @@ </PublishOptions> <RunParams> <FormatVersion Value="2"/> - <Modes Count="0"/> </RunParams> <Units Count="3"> <Unit0> @@ -70,17 +71,4 @@ -vh"/> </Other> </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> </CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_w64.lpi astap-cli-2024.01.17/astap_command_line_w64.lpi --- astap-cli-2022.12.09/astap_command_line_w64.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_w64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -1,23 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="11"/> + <Version Value="12"/> <PathDelim Value="\"/> <General> <Flags> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> </Flags> <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> <Title Value="astap"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> <VersionInfo> <UseVersionInfo Value="True"/> + <AutoIncrementBuild Value="True"/> <MajorVersionNr Value="1"/> + <Attributes pvaSpecialBuild="True"/> <StringTable CompanyName="www.hnsky.org" FileDescription="astap command line astrometric solver" LegalCopyright="Han Kleijn" OriginalFilename="astap_cli.exe" ProductName="astap_cli"/> </VersionInfo> <BuildModes Count="1"> @@ -29,7 +31,6 @@ </PublishOptions> <RunParams> <FormatVersion Value="2"/> - <Modes Count="0"/> </RunParams> <Units Count="3"> <Unit0> @@ -67,17 +68,4 @@ -vh"/> </Other> </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> </CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_win10_arm32.lpi astap-cli-2024.01.17/astap_command_line_win10_arm32.lpi --- astap-cli-2022.12.09/astap_command_line_win10_arm32.lpi 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_win10_arm32.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CONFIG> - <ProjectOptions> - <Version Value="12"/> - <PathDelim Value="\"/> - <General> - <Flags> - <MainUnitHasCreateFormStatements Value="False"/> - <MainUnitHasTitleStatement Value="False"/> - <MainUnitHasScaledStatement Value="False"/> - <CompatibilityMode Value="True"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <Title Value="astap"/> - <UseAppBundle Value="False"/> - <ResourceType Value="res"/> - </General> - <VersionInfo> - <UseVersionInfo Value="True"/> - <MajorVersionNr Value="1"/> - <StringTable CompanyName="www.hnsky.org" FileDescription="astap command line astrometric solver" LegalCopyright="Han Kleijn" OriginalFilename="astap_cli" ProductName="astap_cli"/> - </VersionInfo> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - <UseFileFilters Value="True"/> - </PublishOptions> - <RunParams> - <FormatVersion Value="2"/> - </RunParams> - <Units Count="3"> - <Unit0> - <Filename Value="astap_command_line.lpr"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="unit_command_line_solving.pas"/> - <IsPartOfProject Value="True"/> - </Unit1> - <Unit2> - <Filename Value="unit_command_line_general.pas"/> - <IsPartOfProject Value="True"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="astap_cli"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <TargetCPU Value="arm"/> - <TargetOS Value="win32"/> - </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="False"/> - </Debugging> - </Linking> - <Other> - <CustomOptions Value="-XX --Si --vh"/> - </Other> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/astap_command_line_win11_aarch64.lpi astap-cli-2024.01.17/astap_command_line_win11_aarch64.lpi --- astap-cli-2022.12.09/astap_command_line_win11_aarch64.lpi 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/astap_command_line_win11_aarch64.lpi 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + <CompatibilityMode Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="astap"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <VersionInfo> + <UseVersionInfo Value="True"/> + <AutoIncrementBuild Value="True"/> + <MajorVersionNr Value="1"/> + <Attributes pvaSpecialBuild="True"/> + <StringTable CompanyName="www.hnsky.org" FileDescription="astap command line astrometric solver" LegalCopyright="Han Kleijn" OriginalFilename="astap_cli.exe" ProductName="astap_cli"/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units Count="3"> + <Unit0> + <Filename Value="astap_command_line.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit_command_line_solving.pas"/> + <IsPartOfProject Value="True"/> + </Unit1> + <Unit2> + <Filename Value="unit_command_line_general.pas"/> + <IsPartOfProject Value="True"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="astap_cli"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="aarch64"/> + <TargetOS Value="win64"/> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value="$(ProjOutDir)\fpclaz.cfg"/> + </ConfigFile> + <CustomOptions Value="-XX +-Si +-vh"/> + </Other> + </CompilerOptions> +</CONFIG> diff -Nru astap-cli-2022.12.09/debian/changelog astap-cli-2024.01.17/debian/changelog --- astap-cli-2022.12.09/debian/changelog 2022-12-09 22:30:51.000000000 +0000 +++ astap-cli-2024.01.17/debian/changelog 2024-01-17 21:30:51.000000000 +0000 @@ -1,3 +1,10 @@ +astap-cli (2024.01.17-1) unstable; urgency=medium + + * new upstream version + * debian/control: bump standard to 4.6.2 (no changes) + + -- Thorsten Alteholz <debian@alteholz.de> Wed, 17 Jan 2024 22:30:51 +0100 + astap-cli (2022.12.09-1) unstable; urgency=medium [ Debian Janitor ] diff -Nru astap-cli-2022.12.09/debian/control astap-cli-2024.01.17/debian/control --- astap-cli-2022.12.09/debian/control 2022-12-09 22:30:51.000000000 +0000 +++ astap-cli-2024.01.17/debian/control 2024-01-17 21:30:51.000000000 +0000 @@ -10,7 +10,7 @@ , lcl , lcl-utils , lcl-nogui -Standards-Version: 4.6.1 +Standards-Version: 4.6.2 Homepage: https://www.hnsky.org/astap.htm Rules-Requires-Root: binary-targets Vcs-Browser: https://salsa.debian.org/debian-astro-team/astap-cli diff -Nru astap-cli-2022.12.09/debian/copyright astap-cli-2024.01.17/debian/copyright --- astap-cli-2022.12.09/debian/copyright 2022-12-09 22:30:51.000000000 +0000 +++ astap-cli-2024.01.17/debian/copyright 2024-01-17 21:30:51.000000000 +0000 @@ -7,7 +7,7 @@ License: MPL-2.0 Files: debian/* -Copyright: 2021-2022 Thorsten Alteholz <debian@alteholz.de> +Copyright: 2021-2024 Thorsten Alteholz <debian@alteholz.de> License: MPL-2.0 License: MPL-2.0 diff -Nru astap-cli-2022.12.09/debian/patches/series astap-cli-2024.01.17/debian/patches/series --- astap-cli-2022.12.09/debian/patches/series 2022-12-09 22:30:51.000000000 +0000 +++ astap-cli-2024.01.17/debian/patches/series 2024-01-17 21:30:51.000000000 +0000 @@ -1 +1,2 @@ #spelling.patch +spelling.patch diff -Nru astap-cli-2022.12.09/debian/patches/spelling.patch astap-cli-2024.01.17/debian/patches/spelling.patch --- astap-cli-2022.12.09/debian/patches/spelling.patch 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/debian/patches/spelling.patch 2024-01-17 21:30:51.000000000 +0000 @@ -0,0 +1,15 @@ +Description: lintian detected spelling errors +Forwarded: yes +Index: astap-cli_2024.01.17.orig/unit_command_line_star_database.pas +=================================================================== +--- astap-cli_2024.01.17.orig.orig/unit_command_line_star_database.pas 2024-01-17 23:20:03.354145073 +0100 ++++ astap-cli_2024.01.17.orig/unit_command_line_star_database.pas 2024-01-17 23:35:12.913043269 +0100 +@@ -2763,7 +2763,7 @@ + begin + if fileexists( database_path+'w08_0101.001') then begin name_database:='w08';database_type:=001; exit; end + else +- memo2_message('Could not find the W08 star database for FOV>20 degrees. Will try with an other database.'); ++ memo2_message('Could not find the W08 star database for FOV>20 degrees. Will try with another database.'); + end; + + if ((fov>6) and (fileexists( database_path+'g05_0101.290'))) then begin name_database:='g05'; database_type:=290; end //preference for G05 for large FOV diff -Nru astap-cli-2022.12.09/linux_scripts/build_astap.sh astap-cli-2024.01.17/linux_scripts/build_astap.sh --- astap-cli-2022.12.09/linux_scripts/build_astap.sh 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/linux_scripts/build_astap.sh 2024-01-17 22:20:03.000000000 +0000 @@ -1,27 +1,115 @@ -/home/h/fpcupdeluxe/lazarus/lazbuild ~/astap.fpc/astap_linux.lpi -cp ~/astap.fpc/astap ~/astap_install/astap_amd64/opt/astap -cd ~/astap_install +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'AMD64 file does not exist, aborting!!' + exit +fi + +cp /home/h/astap.fpc/astap /home/h/astap_install/astap_amd64/opt/astap +cd /home/h/astap_install sudo rm *.rpm -sudo fakeroot dpkg-deb --build ~/astap_install/astap_amd64 -sudo ~/alien/alien-8.95/alien.pl -r -c -k ~/astap_install/astap_amd64.deb +sudo fakeroot dpkg-deb -Zxz --build /home/h/astap_install/astap_amd64 +sudo /home/h/alien/alien-8.95/alien.pl -r -c -k /home/h/astap_install/astap_amd64.deb cp *.rpm astap_amd64.rpm - +#unpack sudo dpkg -i ./astap_amd64.deb tar -czvf astap_amd64.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/astap.ico /opt/astap/copyright.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /usr/local/bin/astap /opt/astap/dcraw-astap /opt/astap/unprocessed_raw-astap +#build amd64 qt5 using stable version!! +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe_stable/lazarus/lazbuild /home/h/astap.fpc/astap_linux_qt5.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'AMD64 QT5 file does not exist, aborting!!' + exit +fi +sudo cp /home/h/astap.fpc/astap /opt/astap +tar -czvf astap_amd64_qt5.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/astap.ico /opt/astap/copyright.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /opt/astap/dcraw-astap /opt/astap/unprocessed_raw-astap + +#Build i386 +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux_gkt2_i386.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'I386 file does not exist, aborting!!' + exit +fi +cp /home/h/astap.fpc/astap /home/h/astap_install/astap_i386/opt/astap +cd /home/h/astap_install +sudo fakeroot dpkg-deb -Zxz --build /home/h/astap_install/astap_i386 + + + +#build aarch64 +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux_aarch64.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'aarch64 file does not exist, aborting!!' + exit +fi +cp /home/h/astap.fpc/astap /home/h/astap_install/astap_aarch64/opt/astap +cd /home/h/astap_install +sudo fakeroot dpkg-deb -Zxz --build /home/h/astap_install/astap_aarch64 +sudo cp /home/h/astap.fpc/astap /opt/astap +sudo cp /home/h/astap_install/astap_aarch64/opt/astap/unprocessed_raw-astap /opt/astap +tar -czvf astap_aarch64.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/*.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /opt/astap/unprocessed_raw-astap +#build aarch64 qt5 +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux_aarch64_qt5.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'aarch64 qt5 file does not exist, aborting!!' + exit +fi +sudo cp /home/h/astap.fpc/astap /opt/astap +tar -czvf astap_aarch64_qt5.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/*.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /opt/astap/unprocessed_raw-astap + + +# read -p "Press any key to resume ..." + +#build armhf +#use old compiler. New one has problems with triplets routine +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe_stable/lazarus/lazbuild /home/h/astap.fpc/astap_linux_armhf.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'armhf file does not exist, aborting!!' + exit +fi + +cp /home/h/astap.fpc/astap /home/h/astap_install/astap_armhf/opt/astap +cd /home/h/astap_install +sudo fakeroot dpkg-deb -Zxz --build /home/h/astap_install/astap_armhf +sudo cp /home/h/astap.fpc/astap /opt/astap +sudo cp /home/h/astap_install/astap_armhf/opt/astap/unprocessed_raw-astap /opt/astap +# not dcraw-astap +tar -czvf astap_armhf.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/*.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /opt/astap/unprocessed_raw-astap +#build armhf qt5 +#use old compiler. New one has problems with triplets routine +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe_stable/lazarus/lazbuild /home/h/astap.fpc/astap_linux_armhf_qt5.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'armhf qt5 file does not exist, aborting!!' + exit +fi +sudo cp /home/h/astap.fpc/astap /opt/astap +tar -czvf astap_armhf_qt5.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/*.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /opt/astap/unprocessed_raw-astap + + +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux_cross_compile_to_Darwin_M1.lpi +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'macos M1 file does not exist, aborting!!' + exit +fi +zip astap_mac_M1.zip /home/h/astap.fpc/astap + +rm ~/astap.fpc/astap +/home/h/fpcupdeluxe/lazarus/lazbuild /home/h/astap.fpc/astap_linux_cross_compile_to_Darwin_X86_64.lpi + +zip astap_mac_X86_64.zip /home/h/astap.fpc/astap +if [[ ! -f ~/astap.fpc/astap ]] ; then + echo 'macos file does not exist, aborting!!' + exit +fi +#restore amd64 installation +sudo dpkg -i ./astap_amd64.deb -/home/h/fpcupdeluxe/lazarus/lazbuild ~/astap.fpc/astap_linux_qt5.lpi -sudo cp ~/astap.fpc/astap /opt/astap -tar -czvf astap_amd64_qt5.tar.gz /opt/astap/astap /opt/astap/astap.ico /opt/astap/astap.ico /opt/astap/copyright.txt /opt/astap/deep_sky.csv /opt/astap/variable_stars.csv /usr/share/applications/ASTAP.desktop /usr/local/bin/astap /opt/astap/dcraw-astap /opt/astap/unprocessed_raw-astap - - -/home/h/fpcupdeluxe/lazarus/lazbuild ~/astap.fpc/astap_linux_cross_compile_to_Darwin_M1.lpi -sudo cp ~/astap.fpc/astap -zip astap_mac_M1.zip ~/astap.fpc/astap - - -/home/h/fpcupdeluxe/lazarus/lazbuild ~/astap.fpc/astap_linux_cross_compile_to_Darwin_X86_64.lpi -sudo cp ~/astap.fpc/astap -zip astap_mac_X86_64.zip ~/astap.fpc/astap diff -Nru astap-cli-2022.12.09/linux_scripts/build_database.sh astap-cli-2024.01.17/linux_scripts/build_database.sh --- astap-cli-2022.12.09/linux_scripts/build_database.sh 1970-01-01 00:00:00.000000000 +0000 +++ astap-cli-2024.01.17/linux_scripts/build_database.sh 2024-01-17 22:20:03.000000000 +0000 @@ -0,0 +1,19 @@ +cd ~/astap_install +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/w08_star_database_mag08_astap +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/v16_star_database_mag16_colour_hnsky +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/g17_star_database_mag17_astap +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/v17_star_database_mag17_colour_astap +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/g17_star_database_mag17_hnsky +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/v17_star_database_mag17_colour_hnsky +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/g18_star_database_mag18_hnsky +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/d05_star_database +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/d20_star_database +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/d50_star_database + +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/g05_star_database +#sudo fakeroot dpkg-deb -Zxz --build ~/astap_install/v50_star_database + +sudo fakeroot dpkg-deb -Zxz --build /home/h/astap_install/variable_star_database + + + diff -Nru "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/readme how to compile.txt" "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/readme how to compile.txt" --- "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/readme how to compile.txt" 2022-12-10 01:38:10.000000000 +0000 +++ "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/readme how to compile.txt" 2024-01-17 22:20:03.000000000 +0000 @@ -1,6 +1,6 @@ How to compile ASTAP: -1) Install Lazurus (this will also install Free Pascal Compiler) +1) Install Lazarus from https://sourceforge.net/projects/lazarus/ (this will also install Free Pascal Compiler) 2a) Start Lazarus GUI. Load astap.lpi or astap_linux.lip or astap_mac.lpi. Menu Run, Run or Compile Binary files /tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/star_database_creation/1476 areas.xls and /tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/star_database_creation/1476 areas.xls differ diff -Nru astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lpi astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lpi --- astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lpi 2021-07-22 13:56:06.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lpi 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CONFIG> - <ProjectOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <General> - <Flags> - <MainUnitHasUsesSectionForAllUnits Value="False"/> - <MainUnitHasCreateFormStatements Value="False"/> - <MainUnitHasTitleStatement Value="False"/> - </Flags> - <SessionStorage Value="InProjectDir"/> - <MainUnit Value="0"/> - <Title Value="Gaia_1476conversion"/> - <UseAppBundle Value="False"/> - <ResourceType Value="res"/> - </General> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - </PublishOptions> - <RunParams> - <FormatVersion Value="2"/> - <Modes Count="1"> - <Mode0 Name="default"/> - </Modes> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="LCL"/> - </Item1> - </RequiredPackages> - <Units Count="3"> - <Unit0> - <Filename Value="Gaia_1476conversion.pas"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="gaia_1476conv.pas"/> - <IsPartOfProject Value="True"/> - <ComponentName Value="Main_form"/> - <HasResources Value="True"/> - <ResourceBaseClass Value="Form"/> - <UnitName Value="Gaia_1476conv"/> - </Unit1> - <Unit2> - <Filename Value="unit_1476.pas"/> - <IsPartOfProject Value="True"/> - </Unit2> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <SyntaxMode Value="Delphi"/> - </SyntaxOptions> - </Parsing> - <Linking> - <Debugging> - <DebugInfoType Value="dsDwarf2Set"/> - <UseHeaptrc Value="True"/> - <TrashVariables Value="True"/> - <StripSymbols Value="True"/> - </Debugging> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> - <Other> - <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/> - </Other> - </CompilerOptions> - <Debugging> - <Exceptions Count="6"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - <Item4> - <Name Value="RunError(201)"/> - </Item4> - <Item5> - <Name Value="ERangeError"/> - </Item5> - <Item6> - <Name Value="EReadError"/> - </Item6> - </Exceptions> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lpr astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lpr --- astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lpr 2020-12-29 10:34:30.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lpr 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -program Gaia_290conversion; - -{$MODE Delphi} - -uses - Forms, Interfaces, - Gaia_1545conv in 'Gaia_290conv.pas' {Main_form}, - unit_1545 in 'Unit_290.pas'; - -{$R *.res} - -begin - Application.Initialize; - Application.CreateForm(TMain_form, Main_form); - Application.Run; -end. diff -Nru astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lps astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lps --- astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.lps 2021-07-22 13:47:54.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.lps 1970-01-01 00:00:00.000000000 +0000 @@ -1,327 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CONFIG> - <ProjectSession> - <PathDelim Value="\"/> - <Version Value="11"/> - <BuildModes Active="Default"/> - <Units Count="22"> - <Unit0> - <Filename Value="Gaia_1476conversion.pas"/> - <IsPartOfProject Value="True"/> - <CursorPos X="25" Y="8"/> - <UsageCount Value="200"/> - <Loaded Value="True"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit0> - <Unit1> - <Filename Value="gaia_1476conv.pas"/> - <IsPartOfProject Value="True"/> - <ComponentName Value="Main_form"/> - <HasResources Value="True"/> - <ResourceBaseClass Value="Form"/> - <UnitName Value="Gaia_1476conv"/> - <IsVisibleTab Value="True"/> - <EditorIndex Value="1"/> - <TopLine Value="1607"/> - <CursorPos X="17" Y="1633"/> - <UsageCount Value="200"/> - <Loaded Value="True"/> - <LoadedDesigner Value="True"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit1> - <Unit2> - <Filename Value="unit_1476.pas"/> - <IsPartOfProject Value="True"/> - <EditorIndex Value="-1"/> - <UsageCount Value="200"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit2> - <Unit3> - <Filename Value="backup\Gaia_290conv.pas"/> - <EditorIndex Value="-1"/> - <TopLine Value="1462"/> - <CursorPos Y="1517"/> - <UsageCount Value="2"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit3> - <Unit4> - <Filename Value="C:\lazarus\fpc\3.2.0\source\rtl\objpas\classes\classesh.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="407"/> - <CursorPos X="23" Y="429"/> - <UsageCount Value="27"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit4> - <Unit5> - <Filename Value="C:\lazarus\fpc\3.2.0\source\rtl\win64\classes.pp"/> - <UnitName Value="Classes"/> - <EditorIndex Value="-1"/> - <UsageCount Value="27"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit5> - <Unit6> - <Filename Value="Unit_290.pas"/> - <EditorIndex Value="-1"/> - <CursorPos X="24" Y="106"/> - <UsageCount Value="8"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit6> - <Unit7> - <Filename Value="c:\lazarus\lcl\lclrescache.pas"/> - <UnitName Value="LCLResCache"/> - <EditorIndex Value="-1"/> - <CursorPos X="17" Y="15"/> - <UsageCount Value="15"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit7> - <Unit8> - <Filename Value="C:\lazarus\lcl\include\customcheckbox.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="116"/> - <CursorPos Y="134"/> - <UsageCount Value="12"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit8> - <Unit9> - <Filename Value="c:\lazarus\lcl\include\customform.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="163"/> - <CursorPos X="53" Y="183"/> - <UsageCount Value="12"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit9> - <Unit10> - <Filename Value="C:\lazarus\components\lazutils\lazloggerbase.pas"/> - <UnitName Value="LazLoggerBase"/> - <EditorIndex Value="-1"/> - <TopLine Value="888"/> - <CursorPos X="29" Y="893"/> - <UsageCount Value="11"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit10> - <Unit11> - <Filename Value="d:\lazarus_trunk\lazarus\lcl\lclrescache.pas"/> - <UnitName Value="LCLResCache"/> - <EditorIndex Value="-1"/> - <TopLine Value="451"/> - <CursorPos X="92" Y="467"/> - <UsageCount Value="14"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit11> - <Unit12> - <Filename Value="c:\lazarus\lcl\include\font.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="1269"/> - <CursorPos Y="1288"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit12> - <Unit13> - <Filename Value="c:\lazarus\lcl\interfaces\win32\win32wscontrols.pp"/> - <UnitName Value="Win32WSControls"/> - <EditorIndex Value="-1"/> - <TopLine Value="244"/> - <CursorPos Y="260"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit13> - <Unit14> - <Filename Value="c:\lazarus\lcl\interfaces\win32\win32wsforms.pp"/> - <UnitName Value="Win32WSForms"/> - <EditorIndex Value="-1"/> - <TopLine Value="467"/> - <CursorPos Y="483"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit14> - <Unit15> - <Filename Value="c:\lazarus\lcl\include\wincontrol.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="7455"/> - <CursorPos Y="7473"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit15> - <Unit16> - <Filename Value="c:\lazarus\lcl\interfaces\win32\win32wsstdctrls.pp"/> - <UnitName Value="Win32WSStdCtrls"/> - <EditorIndex Value="-1"/> - <TopLine Value="2003"/> - <CursorPos Y="2035"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit16> - <Unit17> - <Filename Value="c:\lazarus\lcl\include\buttons.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="32"/> - <CursorPos Y="50"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit17> - <Unit18> - <Filename Value="c:\lazarus\lcl\include\pen.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="479"/> - <CursorPos Y="496"/> - <UsageCount Value="13"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit18> - <Unit19> - <Filename Value="C:\home\h\astap.fpc\unit_stack.pas"/> - <EditorIndex Value="-1"/> - <TopLine Value="7060"/> - <CursorPos X="8" Y="7072"/> - <UsageCount Value="10"/> - <DefaultSyntaxHighlighter Value="Delphi"/> - </Unit19> - <Unit20> - <Filename Value="C:\usr\lib\lazarus\2.0.6\lcl\include\customform.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="167"/> - <CursorPos X="124" Y="184"/> - <UsageCount Value="10"/> - </Unit20> - <Unit21> - <Filename Value="C:\usr\lib\lazarus\2.0.6\lcl\include\wincontrol.inc"/> - <EditorIndex Value="-1"/> - <TopLine Value="6495"/> - <CursorPos Y="6508"/> - <UsageCount Value="10"/> - </Unit21> - </Units> - <JumpHistory Count="30" HistoryIndex="29"> - <Position1> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="937" Column="83" TopLine="904"/> - </Position1> - <Position2> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1330" Column="41" TopLine="1297"/> - </Position2> - <Position3> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1360" Column="13" TopLine="1327"/> - </Position3> - <Position4> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1366" Column="80" TopLine="1333"/> - </Position4> - <Position5> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1384" Column="78" TopLine="1351"/> - </Position5> - <Position6> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1399" Column="94" TopLine="1366"/> - </Position6> - <Position7> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1400" Column="27" TopLine="1367"/> - </Position7> - <Position8> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1401" Column="19" TopLine="1368"/> - </Position8> - <Position9> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1529" Column="15" TopLine="1495"/> - </Position9> - <Position10> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1531" Column="15" TopLine="1497"/> - </Position10> - <Position11> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1565" Column="82" TopLine="1532"/> - </Position11> - <Position12> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1568" Column="80" TopLine="1535"/> - </Position12> - <Position13> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1572" Column="19" TopLine="1539"/> - </Position13> - <Position14> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1575" Column="82" TopLine="1542"/> - </Position14> - <Position15> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1584" Column="41" TopLine="1551"/> - </Position15> - <Position16> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1598" Column="38" TopLine="1565"/> - </Position16> - <Position17> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1603" Column="84" TopLine="1570"/> - </Position17> - <Position18> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1612" Column="43" TopLine="1579"/> - </Position18> - <Position19> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1629" Column="53" TopLine="1596"/> - </Position19> - <Position20> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1630" Column="53" TopLine="1597"/> - </Position20> - <Position21> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1638" Column="81" TopLine="1605"/> - </Position21> - <Position22> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1648" Column="40" TopLine="1615"/> - </Position22> - <Position23> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1660" Column="81" TopLine="1627"/> - </Position23> - <Position24> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1669" Column="40" TopLine="1636"/> - </Position24> - <Position25> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1683" Column="81" TopLine="1650"/> - </Position25> - <Position26> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1684" Column="27" TopLine="1651"/> - </Position26> - <Position27> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1685" Column="19" TopLine="1652"/> - </Position27> - <Position28> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="84" Column="21" TopLine="63"/> - </Position28> - <Position29> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="650" Column="31" TopLine="617"/> - </Position29> - <Position30> - <Filename Value="gaia_1476conv.pas"/> - <Caret Line="1360" Column="3" TopLine="1340"/> - </Position30> - </JumpHistory> - <RunParams> - <FormatVersion Value="2"/> - <Modes Count="0" ActiveMode="default"/> - </RunParams> - </ProjectSession> - <Debugging> - <Watches Count="1"> - <Item1> - <Expression Value="to_open"/> - </Item1> - </Watches> - </Debugging> -</CONFIG> diff -Nru astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.pas astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.pas --- astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.pas 2021-01-01 19:33:10.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -program Gaia_1476conversion; - -{$MODE Delphi} - -uses - Forms, Interfaces, - Gaia_1476conv in 'Gaia_1476conv.pas' {Main_form}, - Unit_290 in 'Unit_1476.pas'; - -{$R *.res} - -begin - Application.Initialize; - Application.CreateForm(TMain_form, Main_form); - Application.Run; -end. Binary files /tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/star_database_creation/Gaia_1476conversion.res and /tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/star_database_creation/Gaia_1476conversion.res differ diff -Nru astap-cli-2022.12.09/star_database_creation/Gaia_eDR3_missing_stars_upto_mag5.csv astap-cli-2024.01.17/star_database_creation/Gaia_eDR3_missing_stars_upto_mag5.csv --- astap-cli-2022.12.09/star_database_creation/Gaia_eDR3_missing_stars_upto_mag5.csv 2020-12-06 20:48:06.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/Gaia_eDR3_missing_stars_upto_mag5.csv 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -RA(epoch 1991.25),DE(epoch 1991.25),TYC1,TYC2,TYC3,pmRA,pmDE,BTmag,VTmag,HIP -101.2885411,-16.71314306,5949,2777,1,-546,-1223.1,,-1.088,32349 -95.98787763,-52.69571799,8534,2277,1,20,23.7,-0.417,-0.608,30438 -279.2341083,38.78299311,3105,2070,1,201,287.5,,0.087,91262 -219.9204103,-60.83514707,9007,5849,1,-3678.2,481.8,,0.137,71683 -213.9181151,19.18727298,1472,1436,1,-1093.4,-1999.4,,0.161,69673 -79.17206517,45.99902927,3358,3141,1,75.5,-427.1,,0.238,24608 -78.63446353,-8.20163919,5331,1752,1,1.9,-0.6,0.312,0.283,24436 -114.8272419,5.22750767,187,2184,1,-716.6,-1034.6,,0.461,37279 -24.42813204,-57.23666007,8478,1395,1,88,-40.1,0.458,0.522,7588 -210.956019,-60.3729784,9005,3919,1,-34,-25.1,,0.584,68702 -88.79287161,7.40703634,129,1873,1,27.3,10.9,2.849,0.769,27989 -297.6945086,8.86738491,1058,3399,1,536.8,385.5,1.248,0.955,97649 -201.2983523,-11.16124491,5547,1518,1,-42.5,-31.7,0.877,1.031,65474 -68.98000195,16.50976164,1266,1416,1,62.8,-189.4,2.937,1.16,21421 -219.9141283,-60.83947139,9007,5848,1,-3600.4,952.1,,1.243,71681 -186.6497559,-63.09905586,8979,3464,1,-35.4,-14.7,1.053,1.245,60718 -344.4117732,-29.62183701,6977,1267,1,329.2,-164.2,1.407,1.248,113368 -191.9304954,-59.68873246,8659,3107,1,-48.2,-12.8,1.102,1.281,62434 -247.351948,-26.43194608,6803,2158,1,-10.2,-23.2,3.494,1.287,80763 -116.3306826,28.02631031,1920,2194,1,-625.7,-46,2.455,1.325,37826 -310.3579727,45.28033423,3574,3347,1,1.6,1.5,1.471,1.343,102098 -152.0935808,11.96719513,833,1381,1,-249.4,4.9,1.36,1.399,49669 -104.6564445,-28.97208931,6535,3619,1,2.6,2.3,1.35,1.5,33579 -186.652071,-63.09950428,8979,3465,1,-42.5,-7.7,1.366,1.547,60718 -263.4021937,-37.10374835,7388,1093,1,-8.9,-30,1.446,1.607,85927 -81.28278416,6.34973451,113,1856,1,-8.8,-13.3,1.468,1.629,25336 -81.57290804,28.60787346,1859,1470,1,23.3,-174.2,1.605,1.67,25428 -138.3010033,-69.71747245,9200,2603,1,-157.7,108.9,1.746,1.675,45238 -84.05338572,-1.20191725,4766,2450,1,1.5,-1.1,1.553,1.692,26311 -122.3831473,-47.33661177,8140,6533,1,-5.9,9.9,1.627,1.793,39953 -276.0431097,-34.3843146,7401,3471,1,-39.6,-124.1,1.833,1.81,90185 -187.791372,-57.11256922,8654,3422,1,27.9,-264.3,3.653,1.832,61084 -51.08061889,49.86124281,3320,2808,1,24.1,-26,2.418,1.866,15863 -85.18968672,-1.94257841,4771,1188,1,4,2.5,1.767,1.884,26727 -306.4118735,-56.73488071,8785,1898,1,7.7,-86.2,1.762,1.898,100751 -89.88237261,44.94743492,2924,2742,1,-56.4,-0.9,1.989,1.904,28360 -264.3296907,-42.99782155,7892,7679,1,6.1,-0.9,2.374,1.904,86228 -107.0978586,-26.39320806,6532,5001,1,,,2.687,1.905,34444 -95.6749475,-17.95591658,5938,2918,1,-3.5,-0.5,1.747,1.933,30324 -131.1758221,-54.70856797,8573,3571,1,28.8,-104.1,,1.991,42913 -165.9326537,61.75111888,4146,1274,1,-136.5,-35.2,,2.023,54061 -99.42792641,16.39941482,1329,1746,1,-2,-66.9,,2.024,31681 -37.94661861,89.26413528,4628,237,1,,,2.708,2.038,11767 -283.8163196,-26.29659428,6868,1829,1,13.9,-52.7,1.888,2.044,92855 -2.09653333,29.09082805,1735,3180,1,135.7,-162.9,2.003,2.05,677 -252.1661142,-69.02764028,9275,3641,1,17.3,-32.7,3.79,2.052,82273 -47.04220716,40.9556512,2851,2168,1,2.4,-1.4,2.1,2.105,14576 -31.79289556,23.46276111,1758,2416,1,,,3.487,2.125,9884 -10.89682139,-17.98667833,5847,2333,1,,,3.343,2.139,3419 -141.8968839,-8.65867917,5460,1592,1,-14.4,33.3,3.879,2.14,46390 -177.2661598,14.57233687,870,988,1,-499,-113.8,2.3,2.143,57632 -211.6720767,-36.36875972,7293,2215,1,-519.7,-519.2,3.359,2.158,68933 -125.628603,-59.50953829,8579,2692,1,-25.3,22.7,,2.166,41037 -222.67663,74.15547611,4416,1799,1,,,3.998,2.215,72607 -17.43250583,35.62083028,2286,1329,1,175,-112.5,4.155,2.244,5447 -204.9719696,-53.46636269,8663,2929,1,-14.6,-12.8,2.051,2.247,66657 -240.0833811,-22.62162139,6779,2194,1,,,2.183,2.271,78401 -340.6664214,-46.88456694,8446,1644,1,134.5,-5.7,4.131,2.287,112122 -2.29214722,59.15019444,3664,1985,1,,,2.689,2.299,746 -218.8768816,-42.15774562,7814,3706,1,-35.3,-32.4,2.124,2.306,71352 -30.97467083,42.32984306,2837,2311,1,,,3.984,2.308,9640 -154.9923405,19.84186032,1423,1349,1,310.8,-152.9,3.792,2.366,50583 -136.9990669,-43.43262306,7689,2617,1,-23.4,14.4,4.412,2.379,44816 -269.1515722,51.48894944,3523,1684,1,,,4.246,2.381,87833 -208.8851454,-47.28826634,8267,3545,1,-57.1,-44.8,2.295,2.497,68002 -183.9519247,-17.54198194,6098,1754,1,,,2.458,2.532,59803 -326.0464219,9.87500917,1125,2186,1,,,4.391,2.533,107315 -89.93016694,37.21274722,2418,1573,1,,,2.552,2.602,28380 -262.6909947,-37.29574028,7387,1249,1,-5.3,-29.9,2.431,2.624,85696 -28.65979889,20.8082825,1212,1935,1,,,2.827,2.651,8903 -345.9430772,28.08247361,2243,1831,1,187.3,136,4.61,2.654,113881 -45.56991167,4.08992139,58,1618,1,-11.7,-77.7,4.687,2.716,14135 -250.3227706,31.60193694,2582,3158,1,,,3.666,2.952,81693 -258.6619283,14.39025889,990,2133,1,-17,47,5.077,3.48,84345 -213.918092,19.18720548,1472,1436,2,-1093.4,-1999.4,,3.487,69673 -275.2599428,72.73365667,4437,1491,1,,,4.15,3.614,89937 -154.9934571,19.84114183,1423,1349,2,306.4,-160.8,,3.644,50583 -85.1898703,-1.94322469,4771,1188,2,4,2.5,3.498,3.699,26727 -210.955625,-60.37312202,9005,3919,2,-34,-25.1,,3.95,68702 -125.6287928,-59.5096235,8579,2692,2,-25.3,22.7,,4.121,41037 -108.3843119,-44.64050083,7642,1461,1,109.4,325,6.316,4.767,34922 -165.9322591,61.7511176,4146,1274,2,-116.3,-100.6,,4.945,54061 \ No newline at end of file Binary files /tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/star_database_creation/Pascal source AAVSO retrieval.rar and /tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/star_database_creation/Pascal source AAVSO retrieval.rar differ diff -Nru astap-cli-2022.12.09/star_database_creation/gaia_1476conv.lfm astap-cli-2024.01.17/star_database_creation/gaia_1476conv.lfm --- astap-cli-2022.12.09/star_database_creation/gaia_1476conv.lfm 2021-07-22 13:56:06.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/gaia_1476conv.lfm 1970-01-01 00:00:00.000000000 +0000 @@ -1,424 +0,0 @@ -object Main_form: TMain_form - Left = 322 - Height = 516 - Top = 174 - Width = 777 - Caption = 'Gaia star catalog conversion to HNSKY 290 format' - ClientHeight = 516 - ClientWidth = 777 - Color = clBtnFace - DoubleBuffered = True - Font.Color = clWindowText - Font.Height = -10 - Font.Name = 'MS Sans Serif' - KeyPreview = True - OnCreate = FormCreate - OnDestroy = FormDestroy - OnKeyDown = FormKeyDown - ParentDoubleBuffered = False - LCLVersion = '2.0.12.0' - object Bevel4: TBevel - Left = 8 - Height = 252 - Top = 141 - Width = 494 - end - object Label11: TLabel - Left = 8 - Height = 20 - Top = 8 - Width = 386 - Caption = 'ASTAP, conversion program GAIA, version 1476' - Font.Color = clWindowText - Font.Height = -16 - Font.Name = 'MS Sans Serif' - Font.Style = [fsBold] - ParentColor = False - ParentFont = False - end - object Bevel1: TBevel - Left = 512 - Height = 382 - Top = 66 - Width = 251 - end - object Label15: TLabel - Left = 608 - Height = 13 - Top = 259 - Width = 107 - Caption = 'Hold F7 key to pauze' - Color = clBtnFace - Font.Color = clRed - Font.Height = -11 - Font.Name = 'MS Sans Serif' - ParentColor = False - ParentFont = False - Transparent = False - end - object Label3: TLabel - Left = 608 - Height = 13 - Top = 240 - Width = 98 - Caption = 'Hold F4 key to stop' - Color = clBtnFace - Font.Color = clRed - Font.Height = -11 - Font.Name = 'MS Sans Serif' - ParentColor = False - ParentFont = False - Transparent = False - end - object Label16: TLabel - Left = 608 - Height = 13 - Top = 278 - Width = 119 - Caption = 'Hold F8 key to continue' - Color = clBtnFace - Font.Color = clRed - Font.Height = -11 - Font.Name = 'MS Sans Serif' - ParentColor = False - ParentFont = False - Transparent = False - end - object Bevel2: TBevel - Left = 8 - Height = 69 - Top = 66 - Width = 494 - end - object Bevel3: TBevel - Left = 7 - Height = 110 - Top = 399 - Width = 495 - end - object Label7: TLabel - Left = 342 - Height = 13 - Top = 73 - Width = 78 - Caption = 'Up to magnitude' - ParentColor = False - end - object Label9: TLabel - Left = 528 - Height = 13 - Top = 72 - Width = 169 - Caption = 'Common part for step 1, 2 and 3 !!!' - ParentColor = False - WordWrap = True - end - object Label4: TLabel - Left = 19 - Height = 13 - Top = 421 - Width = 427 - Caption = 'Step 3) Convert 1476 files from A6 to 5 byte records. Or A7 to 6 byte for V-magnitude + B-R' - ParentColor = False - end - object Label10: TLabel - Left = 17 - Height = 13 - Top = 74 - Width = 37 - Caption = 'Step 1: ' - ParentColor = False - end - object Label13: TLabel - Left = 17 - Height = 13 - Top = 144 - Width = 37 - Caption = 'Step 2: ' - ParentColor = False - end - object Label5: TLabel - Left = 39 - Height = 13 - Top = 490 - Width = 198 - Caption = 'Source files will renamed to tmp_.....1476x' - ParentColor = False - end - object Label17: TLabel - Left = 39 - Height = 13 - Top = 119 - Width = 159 - Caption = 'Produces Gaia...sortedxx.csv files' - ParentColor = False - end - object Label1: TLabel - Left = 144 - Height = 13 - Top = 165 - Width = 342 - Caption = 'Maximum magnitude [0.1] So value 130 is equivalent to magnitude 13.0 .' - ParentColor = False - end - object Label_epoch: TLabel - Left = 128 - Height = 13 - Hint = 'Star proper motion is not included in this D32 database' - Top = 198 - Width = 435 - Caption = 'Epoch (take current or next year so star proper motion is compensated correctly for that year' - ParentColor = False - WordWrap = True - end - object Label14: TLabel - Left = 20 - Height = 13 - Top = 240 - Width = 122 - Caption = 'Add missing stars from list:' - ParentColor = False - end - object Label6: TLabel - Left = 59 - Height = 13 - Top = 332 - Width = 315 - Caption = 'Produces A6 byte records (or A7 (7) bytes for V magnitude + B-R) .' - ParentColor = False - end - object Label12: TLabel - Left = 59 - Height = 13 - Top = 370 - Width = 282 - Caption = 'After completion confirmation will be written to file "result.txt"' - ParentColor = False - end - object Label2: TLabel - Left = 19 - Height = 13 - Top = 332 - Width = 34 - Caption = 'Notes: ' - ParentColor = False - end - object Label18: TLabel - Left = 59 - Height = 13 - Top = 351 - Width = 156 - Caption = 'The Gaia files should be in .\gaia' - ParentColor = False - end - object Label8: TLabel - Left = 673 - Height = 13 - Top = 421 - Width = 54 - Caption = '2021-01-02' - ParentColor = False - end - object status1: TStaticText - Left = 547 - Height = 17 - Top = 259 - Width = 44 - Caption = 'Stopped' - TabOrder = 0 - end - object sort_magnitude1: TButton - Left = 22 - Height = 25 - Hint = 'Start the conversion' - Top = 93 - Width = 285 - Caption = 'Step 1) convert to magnitude sorted files' - OnClick = sort_magnitude1Click - ParentShowHint = False - ShowHint = True - TabOrder = 1 - end - object bp_magnitude1: TRadioButton - Left = 600 - Height = 19 - Top = 142 - Width = 86 - Caption = 'BP magnitude' - Checked = True - OnChange = bp_magnitude1Change - TabOrder = 2 - TabStop = True - end - object v_magnitude2: TRadioButton - Left = 600 - Height = 19 - Top = 165 - Width = 79 - Caption = 'V magnitude' - OnChange = bp_magnitude1Change - TabOrder = 3 - end - object convert_to_smaller_record1: TButton - Left = 128 - Height = 25 - Top = 456 - Width = 265 - Caption = 'Step 3) Convert A6 to 5 byte or A7 to 6 record' - OnClick = convert_to_smaller_record1Click - TabOrder = 4 - end - object abbreviation1: TEdit - Left = 80 - Height = 21 - Hint = 'Sort up to this magnitude' - Top = 456 - Width = 32 - MaxLength = 3 - ParentShowHint = False - ShowHint = True - TabOrder = 5 - Text = 'h18' - end - object step1_magnitude1: TEdit - Left = 344 - Height = 21 - Hint = 'Sort up to this magnitude' - Top = 92 - Width = 56 - ParentShowHint = False - ShowHint = True - TabOrder = 6 - Text = '180' - end - object step1_maxmagnitude1: TUpDown - Left = 400 - Height = 21 - Top = 92 - Width = 16 - Associate = step1_magnitude1 - Max = 1000 - Min = -1000 - Position = 180 - TabOrder = 7 - end - object powerdown_enabled: TCheckBox - Left = 547 - Height = 19 - Hint = 'If selected, shutdown computer after completion.' - Top = 352 - Width = 157 - Caption = 'Power down after completion' - ParentShowHint = False - ShowHint = True - TabOrder = 8 - end - object magedit: TEdit - Left = 20 - Height = 21 - Hint = 'Sort up to this magnitude' - Top = 163 - Width = 98 - ParentShowHint = False - ShowHint = True - TabOrder = 9 - Text = '180' - end - object epoch1: TEdit - Left = 20 - Height = 21 - Hint = 'Epoch will be used to calculate the star position for this year or part of the year.' - Top = 196 - Width = 98 - ParentShowHint = False - ShowHint = True - TabOrder = 10 - Text = '2025' - end - object UpDown1: TUpDown - Left = 118 - Height = 21 - Top = 163 - Width = 16 - Associate = magedit - Max = 234 - Min = 20 - Position = 180 - TabOrder = 11 - end - object gaia_missing_stars1: TEdit - Left = 20 - Height = 21 - Hint = 'From tycho2' - Top = 253 - Width = 301 - ParentShowHint = False - ShowHint = True - TabOrder = 12 - Text = 'Gaia_eDR3_missing_stars_upto_mag5.csv' - end - object make290files1: TButton - Left = 20 - Height = 25 - Hint = 'Start the conversion' - Top = 280 - Width = 287 - Caption = 'Step 2) Start conversion to 1476 files' - OnClick = make290files1Click - ParentShowHint = False - ShowHint = True - TabOrder = 13 - end - object V_magnitude_and_BR1: TRadioButton - Left = 600 - Height = 19 - Top = 188 - Width = 109 - Caption = 'V magnitude + B-R' - OnChange = bp_magnitude1Change - TabOrder = 14 - end - object thefile1: TLabel - Left = 8 - Height = 13 - Top = 40 - Width = 12 - Caption = '----' - ParentColor = False - end - object includemissing1: TCheckBox - Left = 328 - Height = 19 - Top = 253 - Width = 92 - Caption = 'Include missing' - Checked = True - State = cbChecked - TabOrder = 15 - end - object countstars1: TButton - Left = 600 - Height = 25 - Top = 472 - Width = 75 - Caption = 'Count stars' - OnClick = countstars1Click - TabOrder = 16 - end - object Label19: TLabel - Left = 556 - Height = 13 - Top = 96 - Width = 115 - Caption = 'Path to data: .\Gaia' - ParentColor = False - end - object Label20: TLabel - Left = 370 - Height = 13 - Top = 35 - Width = 323 - Caption = 'Use under Linux only. Window version exits with error in LCLrecache' - ParentColor = False - end -end diff -Nru astap-cli-2022.12.09/star_database_creation/gaia_1476conv.pas astap-cli-2024.01.17/star_database_creation/gaia_1476conv.pas --- astap-cli-2022.12.09/star_database_creation/gaia_1476conv.pas 2021-07-22 13:56:06.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/gaia_1476conv.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,1719 +0,0 @@ -unit Gaia_1476conv; - -{$MODE Delphi} - -{written for HNSKY quickly from some modules, Han K, 21-2-2015, update 2020} -interface - -uses - LCLIntf, LCLType, {LMessages, Messages,} SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, ComCtrls, ExtCtrls, - strutils, math, - {$ifdef mswindows} - windows {for shutdown} - {$else} {unix} - unix {for fpsystem} - {$endif} - ; - -type - - { TMain_form } - - TMain_form = class(TForm) - countstars1: TButton; - includemissing1: TCheckBox; - Label11: TLabel; - Bevel1: TBevel; - Label15: TLabel; - Label19: TLabel; - Label20: TLabel; - thefile1: TLabel; - Label3: TLabel; - Label16: TLabel; - status1: TStaticText; - sort_magnitude1: TButton; - Bevel2: TBevel; - bp_magnitude1: TRadioButton; - v_magnitude2: TRadioButton; - convert_to_smaller_record1: TButton; - abbreviation1: TEdit; - Bevel3: TBevel; - step1_magnitude1: TEdit; - step1_maxmagnitude1: TUpDown; - Label7: TLabel; - Label9: TLabel; - Label4: TLabel; - Label10: TLabel; - Bevel4: TBevel; - Label13: TLabel; - Label5: TLabel; - powerdown_enabled: TCheckBox; - Label17: TLabel; - magedit: TEdit; - Label1: TLabel; - epoch1: TEdit; - Label_epoch: TLabel; - UpDown1: TUpDown; - gaia_missing_stars1: TEdit; - Label14: TLabel; - make290files1: TButton; - Label6: TLabel; - Label12: TLabel; - Label2: TLabel; - V_magnitude_and_BR1: TRadioButton; - Label18: TLabel; - Label8: TLabel; - procedure bp_magnitude1Change(Sender: TObject); - procedure countstars1Click(Sender: TObject); - procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - procedure make290files1Click(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormDestroy(Sender: TObject); - procedure sort_magnitude1Click(Sender: TObject); - procedure convert_to_smaller_record1Click(Sender: TObject); - private - { Private declarations } - public - { Public declarations } - end; - - -var - Main_form: TMain_form; - maximum,mag_active : double; - bufferstring1,bufferstring2 : Tstrings; - file_counter : integer; - filen_out : string; {file namer to write} -implementation - -{$R *.lfm} -uses unit_1476; - -var - epoch2:double; - ra1,dec1:double; - mag1,b_r :integer; - leadname: string; - readposition1,readposition2,nr_of_straylight : integer; - ftext: textfile; - thepath, typ : string; - starcount, starcount2,starcount3 : array[-150..2000] of integer; - - - G_to_V_correctie : double=0.3; {V:=GP+0.3} - G_to_BP_correctie : double=0.5; {BP:=GP+0.5} - v_sort, BP_sort : boolean; - -const - keypressed :word=0; - -{$ifdef mswindows} -function ShutMeDown:string; -var - hToken : THandle; - tkp,p : TTokenPrivileges; - RetLen : DWord; - ExReply: LongBool; - Reply : DWord; -begin - if OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,hToken) then - begin - if LookupPrivilegeValue(nil,'SeShutdownPrivilege',tkp .Privileges[0].Luid) then - begin - tkp.PrivilegeCount := 1; - tkp.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED; - AdjustTokenPrivileges(hToken,False,tkp,SizeOf(TTokenPrivileges),p,RetLen); - Reply := GetLastError; - if Reply = ERROR_SUCCESS then - begin - ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_FORCE, 0); - if ExReply then Result:='Shutdown Initiated' - else - Result:='Shutdown failed with ' + IntToStr(GetLastError); - end; - end; - end; -end; -{$else} {unix} -{$endif} - - -function inttostr(inp:integer): string; -begin - str(inp,result); -end; -function doubletostr(inp:double): string; -begin - str(inp:0:5,result); -end; - -function strtostr_divide10(s1:string):string; {this give much smaller exe file then using strtofloat} -var - err:integer; r:double; -begin - val(s1,r,err); - if err=0 then - begin - r:=r/10; - str(r:0:1,result); - end; -end; - -function floattostr_one_digit(r:double):string; -begin - str(r:0:1,result); -end; -procedure writetextfile(new1:boolean; name, message1:string); -var F: TextFile; -begin - AssignFile(F,thepath+PathDelim+'Gaia'+PathDelim+name); - if new1 then Rewrite(F) {clear previous info} - else Append(f); - Writeln(F,formatdatetime('c', now)+'; '+message1); - Flush(f); { Ensures that the text was actually written to file. } - CloseFile(F); -end; - -procedure writeLONGREPORT; -var F: TextFile; - i : integer; -begin - AssignFile(F,thepath+PathDelim+'Gaia'+PathDelim+'result_sort_small_steps'+typ+'.txt'); - Rewrite(F); {clear previous info} - Writeln(F,'mag x 100; bp_stars; stars_without_bp; stars_effect_by_straylight'); - for i:=-150 to 2000 do - Writeln(F,inttostr(i)+';'+inttostr(starcount[i])+';'+inttostr(starcount2[i])+';'+inttostr(starcount3[i]) );{keep record in steps of 0.01 magnitude. first value stars with BP other without} - CloseFile(F); -end; - -procedure convert_A6to5; -var i,j:integer; - name1:string; - info1 : array[0..112] of ansichar; - fromf : file; - buf6: array[1..12] of byte; - buf5: array[1..12] of byte; - p5 : ^hnskyhdr1476_5; { pointer to hnskyrecord } - marker_record, mag2, rec_pos_start, rec_pos_stop, - filesizevalue : integer; - all_records : array of hnskyhdr1476_A6; - recordposition, nr_of_records :integer; -begin - writetextfile(true,'result6to5.txt','Started');{clear previous message} - nr_of_stars:=0; - - for i:=1 to 1476 do {create, reset output files} - begin - name1:= Main_form.abbreviation1.text+'_' +filenames1476(i); {use for destination TYC file names and not UCAC4 names} - main_form.caption:='Making 5 byte record database from: '+name1; - Application.ProcessMessages; {allow application to update form1 with above messages} - - assignfile(fromf,name1); - filemode:=0;{read} - reset(fromf,1); - Blockread(fromf,info1,110); - - if info1[109]=#$A6 then - info1[109]:=#5 {5 byte record} - else - begin - messagebox(main_form.handle,pchar('Error not $A6 byte record source file !'),pchar('Converting 6 to 5 bytes'),MB_ICONINFORMATION); - exit; - end; - - - filesizevalue:=FileSize(fromf); - nr_of_records:=round((filesizevalue-110)/SizeOf(hnskyhdr1476_A6)); - SetLength(all_records,nr_of_records+1); - Blockread(fromf,all_records[0],nr_of_records*SizeOf(hnskyhdr1476_A6));{read all records at once} - recordposition:=0; - - assignfile(tof,'tmp_' +filenames1476(i));{designation files} - filemode:=2;{read/write} - rewrite(tof,1); - Blockwrite(tof,info1,110,Numwritten);{header is 110 bytes } - if numwritten<>110 then - begin - messagebox(main_form.handle,pchar('ERROR !!! Can"t create file files. Close HNSKY'),pchar('Error'),MB_ICONERROR); - exit; - end; - - - rec_pos_start:=0;{skip header, start where the magnitude starts} - rec_pos_stop:=0;{skip header, start where the magnitude stops} - - repeat - marker_record:=-999; - for j:=0 to 255 do - begin - recordposition:=rec_pos_start; - p5:= @buf5[1]; { set pointer } - repeat {do all 255 dec9 values} - if ((all_records[recordposition].ra7=255) and (all_records[recordposition].ra8=255) and (all_records[recordposition].ra9=255)) then {special magnitude record is found} - begin {special 6 byte record} - if all_records[recordposition].dec9>-20 then mag2:=all_records[recordposition].dec9 else mag2:=256+all_records[recordposition].dec9;{new magn 12.8 is -12.8, 12.9 = -12.7} - {magnitude is stored in mag2 till new magnitude record is found} - rec_pos_stop:=recordposition;{where the magnitude starts} - end - else - begin {same magnitude} - - if all_records[recordposition].dec9+128=j then {within dec9 range} - begin - if all_records[recordposition].dec9+128<>marker_record then {compare highest shortint of Dec if already seen and written} - begin - marker_record:=j; {remember first marker record is written} - {Right accension===========================================} - p5.ra7 := $FF; - p5.ra8 := $FF; - p5.ra9 := $FF;{set marker for new magnitude in record} - {declination part===========================================} - {store 2 bytes for dec9 and mag0} - p5.dec7 := all_records[recordposition].dec9+128;{store dec9 shortint as byte} - p5.dec8 := mag2+16;{store mag0 shortint as byte with 16 offset for negative numbers} - blockwrite(tof,buf5, SizeOf(hnskyhdr1476_5),Numwritten); - end; - {now write real data,{dec9 and mag0 are stored ONCE in marker record} - {Right accension===========================================} - p5.ra7 :=all_records[recordposition].ra7; - p5.ra8 :=all_records[recordposition].ra8; - p5.ra9 :=all_records[recordposition].ra9; - {declination===========================================} - p5.dec7 := all_records[recordposition].dec7; - p5.dec8 := all_records[recordposition].dec8;{dec9 and mag0 are stored in marker record} - blockwrite(tof,buf5, SizeOf(hnskyhdr1476_5),Numwritten); - inc(nr_of_stars); - end;{withing dec9 range} - end;{do all 255 dec9 values} - inc(recordposition); - until ((rec_pos_stop>rec_pos_start+1) or (recordposition>=nr_of_records) );{where the magnitude starts} - if j<>255 then recordposition:=rec_pos_start;{go back to the beginning of the magnitude, but not at last cyclus to enable eof dectection} - - if keypressed=vk_F4 then begin closefile(tof); main_form.caption:='Stopped';exit; end;; - if keypressed=vk_F7 then - begin - repeat - main_form.status1.caption:='Paused'; - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - end; - main_form.caption:='Making 6 byte record database from: '+name1+', magn: '+inttostr(mag2)+', stars_done: '+inttostr(nr_of_stars);; - end;{for j loop} - rec_pos_start:=rec_pos_stop; {do next magnitude} - until recordposition>=nr_of_records; ;{all magnitudes done} - - writetextfile(false,'result6to5.txt',name1+ ' total stars_done:'+inttostr(nr_of_stars));{write result to file} - closefile(tof); - closefile(fromf); - end;{i loop} - -end; - -procedure convert_A7to6; -var i,j:integer; - name1:string; - info1 : array[0..112] of ansichar; - fromf : file; - buf6: array[1..12] of byte; - buf5: array[1..12] of byte; -// p5 : ^hnskyhdr1476_5; { pointer to hnskyrecord } - p6 : ^hnskyhdr1476_6; - marker_record, mag2, rec_pos_start, rec_pos_stop, - filesizevalue : integer; - all_records : array of hnskyhdr1476_A7; - recordposition, nr_of_records :integer; -begin - writetextfile(true,'result7to6.txt','Started');{clear previous message} - nr_of_stars:=0; - - for i:=1 to 1476 do {create, reset output files} - begin - name1:= Main_form.abbreviation1.text+'_' +filenames1476(i); {use for destination TYC file names and not UCAC4 names} - main_form.caption:='Making 5 byte record database from: '+name1; - Application.ProcessMessages; {allow application to update form1 with above messages} - - assignfile(fromf,name1); - filemode:=0;{read} - reset(fromf,1); - Blockread(fromf,info1,110); - - if info1[109]=#$A7 then - info1[109]:=#6 {6 byte record} - else - begin - messagebox(main_form.handle,pchar('Error not $A7 byte record source file !'),pchar('Converting 7 to 6 bytes'),MB_ICONINFORMATION); - exit; - end; - - - filesizevalue:=FileSize(fromf); - nr_of_records:=round((filesizevalue-110)/SizeOf(hnskyhdr1476_A7)); - SetLength(all_records,nr_of_records+1); - Blockread(fromf,all_records[0],nr_of_records*SizeOf(hnskyhdr1476_A7));{read all records at once} - recordposition:=0; - - assignfile(tof,'tmp_' +filenames1476(i));{designation files} - filemode:=2;{read/write} - rewrite(tof,1); - Blockwrite(tof,info1,110,Numwritten);{header is 110 bytes } - if numwritten<>110 then - begin - messagebox(main_form.handle,pchar('ERROR !!! Can"t create file files. Close HNSKY'),pchar('Error'),MB_ICONERROR); - exit; - end; - - - rec_pos_start:=0;{skip header, start where the magnitude starts} - rec_pos_stop:=0;{skip header, start where the magnitude stops} - - repeat - marker_record:=-999; - for j:=0 to 255 do - begin - recordposition:=rec_pos_start; - p6:= @buf6[1]; { set pointer } - - repeat {do all 255 dec9 values} - if ((all_records[recordposition].ra7=255) and (all_records[recordposition].ra8=255) and (all_records[recordposition].ra9=255)) then {special magnitude record is found} - begin {special 6 byte record} - if all_records[recordposition].dec9>-20 then mag2:=all_records[recordposition].dec9 else mag2:=256+all_records[recordposition].dec9;{new magn 12.8 is -12.8, 12.9 = -12.7} - {magnitude is stored in mag2 till new magnitude record is found} - rec_pos_stop:=recordposition;{where the magnitude starts} - end - else - begin {same magnitude} - - if all_records[recordposition].dec9+128=j then {within dec9 range} - begin - if all_records[recordposition].dec9+128<>marker_record then {compare highest shortint of Dec if already seen and written} - begin - marker_record:=j; {remember first marker record is written} - {Right accension===========================================} - p6.ra7 := $FF; - p6.ra8 := $FF; - p6.ra9 := $FF;{set marker for new magnitude in record} - - {declination part===========================================} - {store 2 bytes for dec9 and mag0} - p6.dec7 := all_records[recordposition].dec9+128;{store dec9 shortint as byte} - p6.dec8 := mag2+16;{store mag0 shortint as byte with 16 offset for negative numbers} - p6.bp_rp := 0; - blockwrite(tof,buf6, SizeOf(hnskyhdr1476_6),Numwritten); - end; - {now write real data,{dec9 and mag0 are stored ONCE in marker record} - {Right accension===========================================} - p6.ra7 :=all_records[recordposition].ra7; - p6.ra8 :=all_records[recordposition].ra8; - p6.ra9 :=all_records[recordposition].ra9; - {declination===========================================} - p6.dec7 := all_records[recordposition].dec7; - p6.dec8 := all_records[recordposition].dec8;{dec9 and mag0 are stored in marker record} - p6.bp_rp:=all_records[recordposition].bp_rp; - blockwrite(tof,buf6, SizeOf(hnskyhdr1476_6),Numwritten); - inc(nr_of_stars); - - end;{withing dec9 range} - end;{do all 255 dec9 values} - inc(recordposition); - until ((rec_pos_stop>rec_pos_start+1) or (recordposition>=nr_of_records) );{where the magnitude starts} - if j<>255 then recordposition:=rec_pos_start;{go back to the beginning of the magnitude, but not at last cyclus to enable eof dectection} - - if keypressed=vk_F4 then begin closefile(tof); main_form.caption:='Stopped';exit; end;; - if keypressed=vk_F7 then - begin - repeat - main_form.status1.caption:='Paused'; - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - end; - main_form.caption:='Making 5 byte record database from: '+name1+', magn: '+inttostr(mag2)+', stars_done: '+inttostr(nr_of_stars);; - end;{for j loop} - rec_pos_start:=rec_pos_stop; {do next magnitude} - until recordposition>=nr_of_records; ;{all magnitudes done} - - writetextfile(false,'result7to6.txt',name1+ ' total stars_done:'+inttostr(nr_of_stars));{write result to file} - closefile(tof); - closefile(fromf); - end;{i loop} - - -end; - -procedure TMain_form.convert_to_smaller_record1Click(Sender: TObject); -var - i : integer; - name1,name2,tempname : string; - fileDate : Integer; - newDateTime : TDateTime; - -begin - bp_sort:=main_form.bp_magnitude1.checked; - V_sort:=((main_form.v_magnitude2.checked) or (main_form.V_magnitude_and_BR1.checked)); - if v_sort then typ:='V' else typ:='B'; - - if ((main_form.v_magnitude2.checked=false) and (main_form.BP_magnitude1.checked=false) and (main_form.V_magnitude_and_BR1.checked=false)) then - begin - messagebox(main_form.handle,pchar('Selection missing. Specify magnitude type in step 1'),pchar('Error'),MB_ICONERROR); - exit; - end; - - if V_magnitude_and_BR1.checked=false then - convert_A6to5 - else - convert_A7to6; - for i:=1 to 1476 do - begin - - name1:= Main_form.abbreviation1.text+'_' +filenames1476(i); {source files} - tempname:='gxx_' +filenames1476(i); - renamefile(name1,tempname);{G16 source to gxx} - - name2:='tmp_' +filenames1476(i);{result file files} - renamefile(name2,name1);{tmp result to g16} - - renamefile(tempname,name2);{rename gxx to tmp} - - - newDateTime :=date; - FileSetDate(name1, DateTimeToFileDate(newDateTime));{set date to midnight} - end; - - if ((Main_form.powerdown_enabled.checked)and (nr_of_stars>100)) then - {$ifdef mswindows} - main_form.caption:= ShutMeDown - {$else} {unix} - fpSystem('/sbin/shutdown -P now') - {$endif} - else - messagebox(main_form.handle,pchar('Ready. Stars done:'+ inttostr(nr_of_stars)),pchar('Ready'),MB_ICONINFORMATION); - main_form.status1.caption:='Finished'; - - -end; - -procedure read_Tycho(epoch2:double; var ra1,dec1: double; var mag1, b_r: integer); -var - info : string; - error0,error1,error2, error_total,errorhip,komma1,oldkomma,tyc1,tyc2,tyc3,hip1:integer; - mag1R,magVT, magBT,pmRA, pmDEC, V,I : double; - star_ok: boolean; - -begin - repeat - if (readposition2>=bufferstring2.count) then - begin - RA1:=99999; - exit; - end; - if (length(bufferstring2.strings[readposition2])<2) then {empthy line} - begin - inc(readposition2); - RA1:=99999; - exit; - end; - error_total:=0; - - komma1:=posex(',',bufferstring2.strings[readposition2],1); - info:=copy(bufferstring2.strings[readposition2],1,komma1-1);{ra} - val(info,ra1,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{dec} - val(info,dec1,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{tyc1} - val(info,tyc1,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{tyc2} - val(info,tyc2,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{tyc3} - val(info,tyc3,error1); - oldkomma:=komma1+1; - - -// IF pos(',17,1398,',bufferstring2.strings[readposition2])>0 then -// beep; - -//_RAJ2000,_DEJ2000,TYC1,TYC2,TYC3,pmRA,pmDE,BTmag,VTmag,HIP,RA(ICRS),DE(ICRS) -//deg,deg, , , ,mas/yr,mas/yr,mag,mag, ,deg,deg - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{pmRA} - val(info,pmRA,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma); {pmdec} - val(info,pmDEC,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma);{magBT} - if pos(' ',info)>0 then error1:=1 else val(info,magBT,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma); {magVT} - if pos(' ',info)>0 then error2:=1 else val(info,magVT,error2); - oldkomma:=komma1+1; - - komma1:=posex(',',bufferstring2.strings[readposition2],oldkomma); - info:=copy(bufferstring2.strings[readposition2],oldkomma,komma1-oldkomma); {hip} - val(info,hip1,errorhip); - oldkomma:=komma1+1; - - - b_r:=-128; {unknown Bp-Rp value for Tycho stars, will be calculated later if within range} - - if ((error1=0) and (error2=0)) then - begin - if BP_sort then - mag1R := magVt -0.006739+0.2758*(magBt-magVt)-0.135*sqr(magBt-magVt) {Gaia BPg := Vt -0.006739+0.2758*(Bt-Vt)-0.135*(Bt-Vt)^2+0.01098(Bt-Vt)^3} - +0.01098*sqr(magBt-magVt)*(magBt-magVt) - else - if V_sort then - begin - mag1r:=magVT - 0.090 * (magBT - magVT); {V = VT - 0.090 * (BT - VT)} - if ((magBT-magVT>=-0.2) and (magBT-magVt<=2.0)) then {valid conversion range} - begin - b_r:=round(10*(0.03147 +1.456*(magBt-magVt) -0.6043*sqr(magBt-magVt)+0.1750*sqr(magBt-magVt)*(magBt-magVt) )); {Gaia GBP-GRP formula} - end; - - if ((tyc1= 129 ) and (tyc2= 1873 ) and (tyc3= 1 )) then begin b_r:=round(10*2.1);end; ;{M0, Betelgeuze} - if ((tyc1= 6803 ) and (tyc2= 2158 ) and (tyc3= 1 )) then begin b_r:=round(10*2.1);end; ;{M0, Antares} - - if ((tyc1= 7689 ) and (tyc2= 2617 ) and (tyc3= 1 )) then begin b_r:=round(10*1.5);end; ;{K5} - if ((tyc1= 7663 ) and (tyc2= 4093 ) and (tyc3= 1 )) then begin b_r:=round(10*-0.3);end; ;{03} - if ((tyc1= 1991 ) and (tyc2= 1895 ) and (tyc3= 1 )) then begin b_r:=round(10*1.5);end; ;{K0} - if ((tyc1= 1423 ) and (tyc2= 1349 ) and (tyc3= 2 )) then begin b_r:=round(10*1.5);end; ;{K0} - - - end - else - halt; - - end - else - if error1=0 then mag1R:=MagBT{no VT magnitude, use BT instead 25 stars only} - else - if error2=0 then - begin - mag1R:=MagVT; - - I:=-99; - if ((tyc1= 5949 ) and (tyc2= 2777 ) and (tyc3= 1 )) then begin mag1r:= -1.46;{A1} b_r:=round(10*0.3);end; ;{sirus, simbad reports for tyc an other magnitude then hip ??} - if ((tyc1= 3105 ) and (tyc2= 2070 ) and (tyc3= 1 )) then begin mag1r:= 0.03;{A0} b_r:=round(10*0.3); end; - if ((tyc1= 9007 ) and (tyc2= 5849 ) and (tyc3= 1 )) then begin mag1r:= 0.01;{G2}b_r:=round(10*0.9); end; - if ((tyc1= 1472 ) and (tyc2= 1436 ) and (tyc3= 1 )) then begin mag1r:= -0.05;{K1}b_r:=round(10*1.5); end; - if ((tyc1= 3358 ) and (tyc2= 3141 ) and (tyc3= 1 )) then begin mag1r:= 0.08;{G3}b_r:=round(10*0.9);end; - if ((tyc1= 187 ) and (tyc2= 2184 ) and (tyc3= 1 )) then begin mag1r:= 0.37;{F5}b_r:=round(10*0.7);end; - if ((tyc1= 9005 ) and (tyc2= 3919 ) and (tyc3= 1 )) then begin mag1r:= 0.6 ;{B1}b_r:=round(10*0.0);end; - if ((tyc1= 9007 ) and (tyc2= 5848 ) and (tyc3= 1 )) then begin mag1r:= 1.33;{K1};b_r:=round(10*1.5);end; {alpha Centauri 2} - if ((tyc1= 2457 ) and (tyc2= 2407 ) and (tyc3= 1 )) then begin mag1r:= 1.93;{A1}b_r:=round(10*0.3);end;{castor} - if ((tyc1= 8573 ) and (tyc2= 3571 ) and (tyc3= 1 )) then begin mag1r:= 1.99;{A0}b_r:=round(10*0.3); end; - if ((tyc1= 4146 ) and (tyc2= 1274 ) and (tyc3= 1 )) then begin mag1r:= 2 ;{G9/k0}b_r:=round(10*1.2);end; {dubhe} - if ((tyc1= 1329 ) and (tyc2= 1746 ) and (tyc3= 1 )) then begin mag1r:= 1.92;{A1}b_r:=round(10*0.3);end; {alhena} - if ((tyc1= 8579 ) and (tyc2= 2692 ) and (tyc3= 1 )) then begin mag1r:= 2.01;{K3}b_r:=round(10*1.5); end; {avior} - if ((tyc1= 4766 ) and (tyc2= 2445 ) and (tyc3= 1 )) then begin mag1r:= 2.41;{B0}b_r:=round(10*0.0);end; - if ((tyc1= 2457 ) and (tyc2= 2407 ) and (tyc3= 2 )) then begin mag1r:= 2.97;end; - if ((tyc1= 1472 ) and (tyc2= 1436 ) and (tyc3= 2 )) then begin mag1r:= 4.05;{}end; - if ((tyc1= 1423 ) and (tyc2= 1349 ) and (tyc3= 2 )) then begin mag1r:= 4.225;{o9} end; - if ((tyc1= 4766 ) and (tyc2= 2445 ) and (tyc3= 2 )) then begin mag1r:= 3.76;{} end; {some of these hip numbers are double used !!, so use tyc} - if ((tyc1= 9005 ) and (tyc2= 3919 ) and (tyc3= 2 )) then begin mag1r:= 4.58;end; {some of these hip numbers are double used !!, so use tyc} - if ((tyc1= 8579 ) and (tyc2= 2692 ) and (tyc3= 2 )) then begin mag1r:= 3.85;end; {some of these hip numbers are double used !!, so use tyc} - if ((tyc1= 4146 ) and (tyc2= 1274 ) and (tyc3= 2 )) then begin mag1r:= 4.91;end; {some of these hip numbers are double used !!, so use tyc} - if ((tyc1= 7892 ) and (tyc2= 7679 ) and (tyc3= 2 )) then begin mag1r:= 6.22;end; {some of these hip numbers are double used !!, so use tyc} - if ((tyc1= 8573 ) and (tyc2= 3571 ) and (tyc3= 2 )) then begin mag1r:= 5.57;end; {some of these hip numbers are double used !!, so use tyc} - - end - else - begin - mag1R:=9999; - error_total:=999; - end; - - mag1:=round(mag1r*10); - - if mag1<>round(mag_active*10) then error_total:=7; {not the correct magnitude} - - if error_total<>0 then mag1:=999 {ignore this star entry, try next } - else - begin - DEC1 {(epoch T)} := (DEC1 + pmDEC * (epoch2 - 1991.25)/(3600*1000))* (pi/180); {DEC first} - RA1 {(epoch T)} := (RA1 + pmRA / cos(dec1)*(epoch2 - 1991.25)/(3600*1000))*(pi/180); - end; - inc(readposition2); - until ((readposition2>=bufferstring2.count) or (error_total=0)); -end; - - -procedure read_gaia(epoch2:double;var ra1,dec1: double;var mag1, b_r: integer); -var - info ,regel : string; - error1,error2, error_total,komma1,oldkomma:integer; - magG,magBP, magRP,pmRA, pmDEC : double; - star_ok: boolean; - blink : boolean; - -begin - - repeat - error_total:=0; - regel:=bufferstring1.strings[readposition1]; - - - komma1:=posex(',',regel,1); - info:=copy(regel,1,komma1-1);{RA} - val(info,ra1,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); - info:=copy(regel,oldkomma,komma1-oldkomma);{DEC} - val(info,dec1,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); - info:=copy(regel,oldkomma,komma1-oldkomma);{pmRA} - val(info,pmRA,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); - info:=copy(regel,oldkomma,komma1-oldkomma); {pmdec} - val(info,pmDEC,error1); - oldkomma:=komma1+1; - -//main_form.caption:=inttostr(nr_of_stars); -// if nr_of_stars>=21861 then -// beep(100,1000); - - komma1:=posex(',',regel,oldkomma); {G magnitude} - info:=copy(regel,oldkomma,komma1-oldkomma);{G magnitude} - val(info,magG,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); {} - info:=copy(regel,oldkomma,komma1-oldkomma);{BP magnitude} - val(info,magBP,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); {} - if komma1=0 then komma1:=999;{last value without ending with a komma} - info:=copy(regel,oldkomma,komma1-oldkomma);{RP magnitude} - val(info,magRP,error1); - - -// if abs(dec1+3.68652760191)<0.0001 then -// if abs((ra1)-82.86754111476)<0.0001 then {tyc 4770-574} -// beep(100,800); - - if error_total<>0 then - mag1:=999 {ignore this star entry, try next } - else - begin {GAIA eDR3 2016 epoch !!!!!!} - DEC1 {(epoch T)} := (DEC1 + pmDEC * (epoch2 - 2016.0)/(3600*1000))* (pi/180); {DEC first} - RA1 {(epoch T)} := (RA1 + pmRA / cos(dec1)*(epoch2 - 2016.0)/(3600*1000))*(pi/180); - - b_r:=-128;{no info} - if ((magBP<>0) and (magRP<>0)) then {gaia color info} - begin - if abs(magBP-magRP)<=12.7 then - b_r:=round((magBP-magRP)*10); - end; - - mag1:=round(mag_active*10);{magnitude is already defined by sort, no need to read or calculate} - end; - - inc(readposition1); - - - until ((readposition1>bufferstring1.count-1) or (error_total=0)); - - if frac(nr_of_stars/1000)=0 then - begin - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Stars done: '+ inttostr(nr_of_stars)); - if keypressed=vk_F4 then halt; - if keypressed=vk_F then - repeat - main_form.status1.caption:='Paused'; - if blink then main_form.status1.color:=Clred else main_form.status1.color:=CLblack; - if blink then blink:=false else blink:=true;{blinker} - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - Application.ProcessMessages; {allow application to update form1 with above messages} - end; -end; - -procedure AppendToFile(s: TStrings; fn: TFileName);{append Tstring to file. To save memory} -var - i: Integer; - f: textfile; -begin - assign(f,fn); - append(f); - for i:=0 to s.Count-1 do - writeln(f,s.Strings[i]); - closefile(f); -end; - - -procedure Read_ftext(var st: TStrings);{read file to Tstring in pieces to save memory. Above 300 mbytes problems} -var - i: Integer; - line1 :string; -begin - i:=0; - st.clear;{clear tstrings} - repeat - readln(ftext,line1); - st.Add(line1); - inc(i); - until ((i>=20000) or (eof(ftext))); -end; - - - -procedure gaia_sort_magnitude(mag_active: double); {sort on magnitude} -var - info,filen,regel : string; - error1,error2, error_total,komma1,oldkomma:integer; - magG,magBP, magRP,pmRA, pmDEC,Gflux,BPflux,RPflux,C,magBPold,magRPold : double; - star_ok: boolean; - blink,straylight : boolean; - -begin - readposition1:=0;{skip first text line} - repeat - - error_total:=0; - regel:=bufferstring1.strings[readposition1]; - - komma1:=posex(',',regel,1); {ra} - oldkomma:=komma1+1; - - - - komma1:=posex(',',regel,oldkomma); {dec} - oldkomma:=komma1+1; - -// if pos('579900822252441',regel)<>0 then -// beep; - - komma1:=posex(',',regel,oldkomma);{pmra} - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma);{pmdec} - oldkomma:=komma1+1; - - - komma1:=posex(',',regel,oldkomma); {G magnitude} - info:=copy(regel,oldkomma,komma1-oldkomma);{G magnitude} - val(info,magG,error1); error_total:=error_total+error1; - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); {} - info:=copy(regel,oldkomma,komma1-oldkomma);{BP magnitude} - val(info,magBP,error1); - oldkomma:=komma1+1; - - komma1:=posex(',',regel,oldkomma); {} - if komma1=0 then komma1:=999;{last value without ending with a komma} - info:=copy(regel,oldkomma,komma1-oldkomma);{RP magnitude} - val(info,magRP,error1); - - - - {quality check by flux ratio} - magBPold:=magBP;{for debugging} - magRPold:=magRP; - //SELECT gaia_source.ra,gaia_source.dec, gaia_source.pmra, gaia_source.pmdec, gaia_source.phot_g_mean_mag, gaia_source.phot_bp_mean_mag, gaia_source.phot_rp_mean_mag, phot_g_mean_flux, phot_bp_mean_flux, phot_rp_mean_flux - //FROM gaiaedr3.gaia_source - //WHERE (gaiaedr3.gaia_source.phot_bp_mean_mag>=12.7 AND gaiaedr3.gaia_source.phot_bp_mean_mag<12.8) - // - //C:=(BPflux +RPflux)/Gflux is normally a little above 1 so about 1.15.. So chapter 6 "Gaia Early Data Release 3 Photometric content and validation" - //if flux is calculated from the magnitudes it is a little above 2} - - //De flux kan ik ook terugrekenen van de magnitude. Dat is gemakkelijker want de flux heb ik nog niet in de database. - //Het blijkt als je de flux uitrekend dan is de ratio (BPflux+RPflux)/Gflux meestal iets boven circa 2. Maar loopt voor de - //slechte waarden op tot wel 27. Het idee is nu wanneer deze ratio groter dan 4 en G>BP de G magnitude te gebruiken, anders BP. - //De conditie G>BP is nodig voor hele rode sterren om te voorkomen dat je een infrarood magnitude neemt. - straylight:=false; - if ((magBP<>0) and (magRP<>0)) then {do quality check} - begin - Gflux:=power(10,(20-magG)/2.5); - BPflux:=power(10,(20-magBP)/2.5); - RPflux:=power(10,(20-magRP)/2.5); - c:=(BPflux+RPflux)/Gflux; - if ((c>4) and (magG>magBP)) then {straylight do not rely on BP and RP. C is normally a little above 2} - begin - magBP:=0; - magRP:=0; - straylight:=true; - end; - end; - - - if BP_sort then - begin - if magBP<>0 {BP magn data available} then - mag1:=round(magBP*10) - else - mag1:=round((magG+G_to_BP_correctie)*10); {add half magnitude, average for mag 15. 0.51 for mag 15, 0.41 for mag 10.8 } - end - else - if V_sort then - begin {V magnitude} - if ((magBP<>0) and (magRP<>0)) then - begin - if ((magBP-magRP>=-0.5) and (magBP-magRP<=5.0)) then {formula valid edr3} - mag1:=round((magG + 0.02704 - 0.0124*(magBP-magRP) + 0.2156*sqr(magBP-magRP) -0.01426*sqr(magBP-magRP)*(magBP-magRP) )*10) {edr3} - else {1% of the stars} - mag1:=round((magBP-0.18)*10);{rough estimate -0.187 for mag 15} - end - else - mag1:=round((magG+G_to_V_correctie)*10); {rough estimate for 0.26 for mag 10.8, 0.33 for mag 15} - end; - - //Voor een fotografische sterren database gebaseerd op BPg kan ik de Tycho aanvullende sterren omrekenen - //Tycho -> BPg - //BPg := Vt -0.006739+0.2758*(Bt-Vt)-0.135*(Bt-Vt)^2+0.01098(Bt-Vt)^3 - //En voor de Gaia met de ontbrekende BPg magnitude zoiets als: - //BPg := G+0.5 - - //Voor een V magnitude database kan ik V bereken voor zowel Gaia als Tycho: - //Gaia -> V - //V := G + 0.01760 + 0.006860 * (BPg−RPg) + 0.1732 * (BPg−RPg)^2 - //En voor de ontbrekende BPg magnitudes zoiets als: - //V:= G+0.3 - //Tycho->V - //V := Vt - 0.090 * (Bt - Vt) {oude formule} - - -// if ((round(mag_active*10)=42) AND ('16.5209'=copy(regel,1,7))) then -// beep(200,600); - - - star_ok:=(mag1=round(mag_active*10)); {magnitude filter} - - if star_ok then - begin - inc(nr_of_stars); - if magBP<>0 {BP magn data available} then inc(starcount[round(magBP*100)],1){for checking if database is complete} - else inc(starcount2[round((magG+0.5)*100)],1);{for checking if database is complete} - - if straylight then - begin - inc(starcount3[round((magG+0.5)*100)],1);{stars effected by straylight} - inc(nr_of_straylight); - end; - - bufferstring2.Add(regel); - - end; - - if bufferstring2.count>=20000 then {interim save to save memory} - begin - AppendToFile(bufferstring2,filen_out);{write last part} - bufferstring2.Clear; - end; - - inc(readposition1); - if frac(readposition1/10000)=0 then - begin - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Stars done: '+ inttostr(nr_of_stars)); - if keypressed=vk_F4 then halt; - if keypressed=vk_F7 then - repeat - main_form.status1.caption:='Paused'; - if blink then main_form.status1.color:=Clred else main_form.status1.color:=CLblack; - if blink then blink:=false else blink:=true;{blinker} - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - Application.ProcessMessages; {allow application to update form1 with above messages} - end; - - until ((readposition1>=bufferstring1.count)); - - - if star_ok=false then mag1:=1000;{last star is not okay to include in this run} -end; - - -procedure write_new_magnitude_record6(magn:integer);{marker record indicating new magnitude step of 0.1 magn for 6 byte records} -var - buf2: array[1..12] of byte; - p6 : ^hnskyhdr1476_A6; { pointer to hnskyrecord } - decst : shortint; - -begin - p6:= @buf2[1]; { set pointer } - with p6^ do - begin - {Right accension===========================================} - ra7 := $FF; - ra8 := $FF; - ra9 := $FF;{set marker for new magnitude in record} - - {declination===========================================} - decst:=magn; - - {make 3 byte integer:} - dec7 := 0; - dec8 := 0; - dec9 := decst;{store magnitude in highest byte, allowing more digits later} - end; - blockwrite(tof,buf2, SizeOf(hnskyhdr1476_6),Numwritten); -end; - -procedure write_new_magnitude_recordA7(magn:integer);{marker record indicating new magnitude step of 0.1 magn for 6 byte records} -var - buf2: array[1..12] of byte; - pA7 : ^hnskyhdr1476_A7; { pointer to hnskyrecord } - decst : shortint; - -begin - pA7:= @buf2[1]; { set pointer } - with pA7^ do - begin - {Right accension===========================================} - ra7 := $FF; - ra8 := $FF; - ra9 := $FF;{set marker for new magnitude in record} - - {declination===========================================} - decst:=magn; - - {make 3 byte integer:} - dec7 := 0; - dec8 := 0; - dec9 := decst;{store magnitude in highest byte, allowing more digits later} - bp_rp:= 0; - - end; - blockwrite(tof,buf2, SizeOf(hnskyhdr1476_A7),Numwritten); -end; - - -PROCEDURE sortpartGAIA; {read file and find stars between magn_start and magn_start+step} -var nr_of_errors : longint; - rastart,decstart,filenr,error9, nr_regio,nr_star,nr_extra : integer; - - buf2: array[1..12] of byte; - p6 : ^hnskyhdr1476_A6; { pointer to hnskyrecord } - file_opened,to_open : string; - blink : boolean; - -BEGIN - file_opened:=''; {indicates of file is open} - - repeat - - if ((eof(ftext)=false) and (readposition1>=bufferstring1.count)) then - begin - readposition1:=0; - Read_ftext(bufferstring1);{load next part} - end; - - - if ((readposition2>=bufferstring2.count) and - (readposition1>=bufferstring1.count)) {Gaia} then {buffer processed} - begin - if file_opened<>'' then close(Tof);{close file already open} - if keypressed=vk_F4 then halt; - if keypressed=vk_F7 then - repeat - main_form.status1.caption:='Paused'; - if blink then main_form.status1.color:=Clred else main_form.status1.color:=CLblack; - if blink then blink:=false else blink:=true;{blinker} - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - Application.ProcessMessages; {allow application to update form1 with above messages} - exit; - end; - - nr_regio:=0; - nr_star:=0; - nr_extra:=0; - - if (readposition2>=bufferstring2.count)=false then - read_Tycho(epoch2, ra1,dec1, mag1,b_r) {magnitude filter is in read_tycho !!! for speed} - else - read_GAIA(epoch2,ra1,dec1, mag1,b_r);{read GAIA sorted files} - - - if mag1<999 then {999 check if last record is within} - begin - begin {6 byte record} - p6:= @buf2[1]; { set pointer } - with p6^ do - begin - {Right accension===========================================} - - rastart := round(((256*256*256)-1)*(limit_radialen(ra1))/(2*pi)); - if rastart>=$FFFFFF then rastart:=0; { $FFFFFF is used as marker and should never occur. This value equals 2*pi could happen sometimes due to rounding} - {make 3 byte word:} - ra7 := lo(word(rastart)); - ra8 := hi(word(rastart)); - ra9 := rastart shr 16;{make 3 byte word}; - - {declination===========================================} - decstart :=round(( ((256*256*128)-1)*(dec1)/(0.5*pi))); - - {make 3 byte integer:} - dec7 := lo(word(decstart)); - dec8 := hi(word(decstart)); - dec9 := decstart shr 16 ;{make 3 byte integer, important decstart must be longint}; - - {magnitude===========================================} - if (((mag1/10)>25.4-2) or ((mag1/10)<-2.0)) then inc(nr_of_errors) - else - begin - {no magnitude is written in record for 6 byte records} - {====write to 1476 files====} - to_open:=leadname+name1476(ra1,dec1); - - if file_opened<>to_open then {dump file not open yet} - begin {other dump file required, close and open other section} - if file_opened<>'' then close(Tof);{close file already open} - - assignfile(tof,to_open);{assign correct 1476 file} - filemode:=2;{read/write} - reset(tof,1); - seek(tof,filesize(tof)); - file_opened:=to_open;{remember file openened} - end; - {write special magnitude record if required} - val(copy(file_opened,5,4),filenr,error9);{which filenr to check} - if new_magnitude_record_written[filenr]<>mag1 then - begin - write_new_magnitude_record6(mag1);{write special header with magnitude} - new_magnitude_record_written[filenr]:=mag1; {store that here magnitude record is written} - end; - {end write special magnitude record if required} - - blockwrite(tof,buf2, SizeOf(hnskyhdr1476_6),Numwritten); - - - inc(nr_of_stars); - - - // close(tof); - // file_opened:=''; - // Application.ProcessMessages; {allow application to update form1 with above messages} - // if nr_of_stars>=3749 then - // begin - // beep(800,100); - // main_form.caption:=inttostr(nr_of_stars); - // end; - - end; - {====write to 1476 files end====} - end; - end;{6 byte records} - end;{mag1<999} - until false; -END; - -PROCEDURE sortpartGAIA_type_A7; {read file and find stars between magn_start and magn_start+step} -var nr_of_errors : longint; - rastart,decstart,filenr,error9, nr_regio,nr_star,nr_extra : integer; - - buf2: array[1..12] of byte; - pA7 : ^hnskyhdr1476_A7; { pointer to hnskyrecord } - file_opened,to_open : string; - blink : boolean; - -BEGIN - file_opened:=''; {indicates of file is open} - - repeat - - if ((eof(ftext)=false) and (readposition1>=bufferstring1.count)) then - begin - readposition1:=0; - Read_ftext(bufferstring1);{load next part} - end; - - - if ((readposition2>=bufferstring2.count) and - (readposition1>=bufferstring1.count)) {Gaia} then {buffer processed} - begin - if file_opened<>'' then close(Tof);{close file already open} - if keypressed=vk_F4 then halt; - if keypressed=vk_F7 then - repeat - main_form.status1.caption:='Paused'; - if blink then main_form.status1.color:=Clred else main_form.status1.color:=CLblack; - if blink then blink:=false else blink:=true;{blinker} - sleep(500); - Application.ProcessMessages; {allow application to update form1 with above messages} - until keypressed=vk_F8; - main_form.status1.caption:='Running'; - Application.ProcessMessages; {allow application to update form1 with above messages} - exit; - end; - - nr_regio:=0; - nr_star:=0; - nr_extra:=0; - - if (readposition2>=bufferstring2.count)=false then - read_Tycho(epoch2, ra1,dec1, mag1,b_r) {magnitude filter is in read_tycho !!! for speed} - else - read_GAIA(epoch2,ra1,dec1, mag1,b_r);{read GAIA sroted files} - - - if mag1<999 then {999 check if last record is within} - begin - begin {6 byte record} - pA7:= @buf2[1]; { set pointer } - with pA7^ do - begin - {Right accension===========================================} - rastart := round(((256*256*256)-1)*(limit_radialen(ra1))/(2*pi)); - if rastart>=$FFFFFF then rastart:=0; { $FFFFFF is used as marker and should never occur. This value equals 2*pi could happen sometimes due to rounding} - {make 3 byte word:} - ra7 := lo(word(rastart)); - ra8 := hi(word(rastart)); - ra9 := rastart shr 16;{make 3 byte word}; - - {declination===========================================} - decstart :=round(( ((256*256*128)-1)*(dec1)/(0.5*pi))); - - {make 3 byte integer:} - dec7 := lo(word(decstart)); - dec8 := hi(word(decstart)); - dec9 := decstart shr 16 ;{make 3 byte integer, important decstart must be longint}; - Bp_Rp := b_r; - {magnitude===========================================} - if (((mag1/10)>25.4-2) or ((mag1/10)<-2.0)) then inc(nr_of_errors) - else - begin - {no magnitude is written in record for 6 byte records} - {====write to 1476 files====} - to_open:=leadname+name1476(ra1,dec1); - - if file_opened<>to_open then {dump file not open yet} - begin {other dump file required, close and open other section} - if file_opened<>'' then close(Tof);{close file already open} - assignfile(tof,to_open);{assign correct 1476 file} - filemode:=2;{read/write} - reset(tof,1); - seek(tof,filesize(tof)); - file_opened:=to_open;{remember file openened} - end; - {write special magnitude record if required} - val(copy(file_opened,5,4),filenr,error9);{which filenr to check} - if new_magnitude_record_written[filenr]<>mag1 then - begin - write_new_magnitude_recordA7(mag1);{write special header with magnitude} - new_magnitude_record_written[filenr]:=mag1; {store that here magnitude record is written} - end; - {end write special magnitude record if required} - - blockwrite(tof,buf2, SizeOf(hnskyhdr1476_A7),Numwritten); - inc(nr_of_stars); - end; - {====write to 1476 files end====} - end; - end;{6 byte records} - end;{mag1<999} - until false; -END; - - -procedure loadbuffer2(naam1:string);{FOR missing tycho stars} -begin - with bufferstring2 do - begin - try - LoadFromFile(naam1); { load from file } - except; - {action none} - clear; - sysutils.beep; - main_form.caption:='Error reading file: '+naam1; - end; - end; - readposition2:=0; -end; - - -function floattostr2(x: double):string; -begin - str(x:0:1,result); -end; -procedure TMain_form.make290files1Click(Sender: TObject); -var - error2 : integer; - i,j : integer; - name1,filen,name2,tychofile : string; - info1 : array[0..112] of ansichar; - -begin - - bp_sort:=main_form.bp_magnitude1.checked; - V_sort:=((main_form.v_magnitude2.checked) or (main_form.V_magnitude_and_BR1.checked)); - if v_sort then typ:='V' else typ:='B'; - - writetextfile(true,'result1476'+typ+'.txt','Started');{clear previous message} - main_form.status1.caption:='Running'; - nr_of_stars:=0; - nr_of_skipped:=0; - - val(epoch1.text,epoch2,error2); - if error2<>0 then - begin - epoch1.color:=clred; - exit; - end - else - epoch1.color:=clwindow; - - maximum:=updown1.position/10; - - - if includemissing1.checked then - begin - tychofile:=thepath+PathDelim+'Gaia'+PathDelim+gaia_missing_stars1.text; - if fileexists(tychofile)=false then - begin - application.MessageBox(pchar('Does not exist :'+gaia_missing_stars1.text), 'Error', MB_OK) ; - exit; - end - else - loadbuffer2(tychofile); {load tycho file supplement in Tstrings} - readposition2:=0; - end - else - begin - bufferstring2.clear; - end; - - if bp_sort then leadname:='g'+copy(magedit.Text,1,2)+'_' {g17_} - else leadname:='v'+copy(magedit.Text,1,2)+'_'; {v17_} - - {make header begin===========================================================} - if main_form.v_magnitude2.checked then strpcopy(info1,copy('GAIA eDR3, stars up to V magnitude '+ strtostr_divide10(magedit.text) +', Epoch='+epoch1.text+'. Including '+inttostr(bufferstring2.count-1)+' bright Tycho2 stars. Magnitude is V ',1,112)){do not override length of info1, otherwise error at the end of program} - else - if main_form.BP_magnitude1.checked then strpcopy(info1,copy('GAIA eDR3, stars up to BP magnitude '+ strtostr_divide10(magedit.text) +', Epoch='+epoch1.text+'. Including '+inttostr(bufferstring2.count-1)+' bright Tycho2 stars. Magnitude is BP ',1,112)){do not override length of info1, otherwise error at the end of program} - else - if main_form.V_magnitude_and_BR1.checked then strpcopy(info1,copy('GAIA eDR3, stars up to V magnitude '+ strtostr_divide10(magedit.text) +', Epoch='+epoch1.text+'. + '+inttostr(bufferstring2.count-1)+' Tycho2 stars. Magnitude is V, Bp-Rp info included ',1,112)){do not override length of info1, otherwise error at the end of program} - else - begin - messagebox(main_form.handle,pchar('Selection missing. Specify magnitude type'),pchar('Error'),MB_ICONERROR); - exit; - end; - - - if main_form.V_magnitude_and_BR1.checked=false then info1[109]:=#$A6 {interim 6 byte record} - else info1[109]:=#$A7; {interim A7, 7 byte record with B_R included} - - info1[108]:=ansichar(round((mag_active)*10));{store maximum magnitude limit} - - - for i:=1 to 1476 do {create, reset output files. Note result is saved in pieces to save memory using Tstrings} - begin - name1:=leadname+filenames1476(i); {use for destination TYC file names and not UCAC4 names} - - if ((i=1) and (FileExists(name1)=true)) then {some pre checks} - begin - if Application.MessageBox('Destination files exist, overwrite ?','Attention !', MB_YESNO or MB_ICONEXCLAMATION) = IDNO then halt; - end; - - assignfile(tof,name1); - filemode:=2;{read/write} - rewrite(tof,1); - Blockwrite(tof,info1,110,Numwritten);{header is 110 bytes, was 111 bytes } - closefile(tof); - if numwritten<>110 then - begin - messagebox(main_form.handle,pchar('ERROR !!! Can"t create file files. Close HNSKY'),pchar('Error'),MB_ICONERROR); - exit; - end; - end; - {make header end===========================================================} - - for i:=1 {was 0}to 1801 do new_magnitude_record_written[i]:=-99;{6 byte records, clear step positions. Store here is magnitude record written} - - {sort file} - - - mag_active:=-1.5;{start magnitude} - - repeat - - file_counter:=0; - - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Stars done: '+ inttostr(nr_of_stars)); - - Application.ProcessMessages; {allow application to update form1 with above messages} - - {tap vizier instruction to download} - //SELECT TOP 250000000 "I/337/gaia".ra, "I/337/gaia".dec, "I/337/gaia".source_id, "I/337/gaia".ref_epoch, "I/337/gaia".pmRA, "I/337/gaia".pmDEC, "I/337/gaia". - //duplicated_source, "I/337/gaia".phot_g_mean_mag - //FROM "I/337/gaia" - //WHERE "I/337/gaia".phot_g_mean_mag<=13.6 and "I/337/gaia".phot_g_mean_mag>13.5 - - {Gaia_DR2_BP_10.1-10.0.csv will result in stars 10.0 and 10.1=round(10.077)} - - if BP_sort then name2:='gaia_dr3-BP_sorted' - else - if V_sort then name2:='gaia_dr3-V_sorted' - else - halt; - - filen:=thepath+PathDelim+'Gaia'+PathDelim+name2+inttostr(round(mag_active*10))+'.csv'; - main_form.thefile1.caption:=filen; {show which file is processed} - assignfile(ftext,filen); {assign Gaia file in Tstrings} - reset(ftext); - bufferstring1.Clear;{make empthy} - readposition1:=0;{No comments, so start with zero} - readposition2:=0; - - if Main_form.V_magnitude_and_BR1.checked=false then - sortpartGAIA {read buffer and find stars between magn_start and magn_start+step} - else - sortpartGAIA_type_A7;{include Bp-Rp info} - - closefile(ftext); - - writetextfile(false,'result1476'+typ+'.txt','Up_to_mag '+ floattostr_one_digit(mag_active)+' stars_done:'+inttostr(nr_of_stars));{write result to file} - mag_active:=mag_active+0.1;{0.1 magnitude step} - until mag_active+0.000001>=maximum+0.1; - writetextfile(false,'result1476'+typ+'.txt','Ready. Stars done:'+ inttostr(nr_of_stars));{write result to file} - if ((powerdown_enabled.checked)and (nr_of_stars>100)) then - {$ifdef mswindows} - main_form.caption:= ShutMeDown - {$else} {unix} - fpSystem('/sbin/shutdown -P now') - {$endif} - else - messagebox(main_form.handle,pchar('Ready. Stars done:'+ inttostr(nr_of_stars)),pchar('Ready'),MB_ICONINFORMATION); - -end; - -procedure TMain_form.countstars1Click(Sender: TObject); -var - bp_active_x10 : integer; - file_name,line1: string; -begin - nr_of_stars:=0; - for bp_active_x10:=100 to 180 do - begin - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_BP_'+floattostr2(bp_active_x10/10)+'.csv'; - main_form.caption:=('Counting stars: '); - main_form.thefile1.caption:=file_name; - application.processmessages; - if fileexists(file_name) then - begin - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - readln(ftext,line1); - nr_of_stars:=nr_of_stars+1; - until (eof(ftext)); - closefile(ftext); - nr_of_stars:=nr_of_stars-1;{remove comment} - end - else - application.MessageBox(pchar('Does not exist :'+file_name), 'Error', MB_OK); - end; - - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_BP_0.0-09.95.csv'; - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - readln(ftext,line1); - nr_of_stars:=nr_of_stars+1; - until (eof(ftext)); - closefile(ftext); - nr_of_stars:=nr_of_stars-1;{remove comment} - - - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_missing_BP_G_0.0-17.3.csv'; {will contain stars in GP range 0 ..17.35 equivalent to V 0.4 ..16.75 and BP 0.5 ..17.85.} - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - readln(ftext,line1); - nr_of_stars:=nr_of_stars+1; - until (eof(ftext)); - closefile(ftext); - nr_of_stars:=nr_of_stars-1;{remove comment} - - - - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_missing_BP_G_17.4-17.7.csv'; {will contain stars in GP range 17.35 ..17.75 equivalent to V 17.65 ..18.05 and BP 17.85 ..18.25/ So range required 17.65 ..18.25} - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - readln(ftext,line1); - nr_of_stars:=nr_of_stars+1; - until (eof(ftext)); - closefile(ftext); - nr_of_stars:=nr_of_stars-1;{remove comment} - - - messagebox(main_form.handle,pchar('Ready. Stars counted:'+ inttostr(nr_of_stars)),pchar('Ready'),MB_ICONINFORMATION); -end; - -procedure TMain_form.FormKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); -begin - keypressed:=key -end; - - -procedure TMain_form.bp_magnitude1Change(Sender: TObject); -begin - if bp_magnitude1.checked then Main_form.abbreviation1.text:=StringReplace(Main_form.abbreviation1.text, 'V', 'G',[rfReplaceAll]) - else - Main_form.abbreviation1.text:=StringReplace(Main_form.abbreviation1.text, 'G', 'V',[rfReplaceAll]); - -end; - - -function getinstalldir:string; -begin - result:=extractfiledir(paramstr(0)); -end; - -procedure TMain_form.sort_magnitude1Click(Sender: TObject); -var - i,j,overlap2,stars_without_bp, oldnrstars,bp_active_x10,gp_active_x10 : integer; - overlapfaint, overlapbright : double; - file_name : string; - name2 : string; - -begin - bp_sort:=main_form.bp_magnitude1.checked; - V_sort:=((main_form.v_magnitude2.checked) or (main_form.V_magnitude_and_BR1.checked)); - if v_sort then typ:='-V' else typ:='-BP'; - - writetextfile(true,'result_sort'+typ+'.txt','Up to magn; All stars cumulative; Stars without BP; stars_effect_by_straylight');{clear previous message} - - - for i:=-150 to 2000 do - begin - starcount[i]:=0;{keep record in steps of 0.01 magnitude} - starcount2[i]:=0;{keep record in steps of 0.01 magnitude} - starcount3[i]:=0;{straylight} - end; - - main_form.status1.caption:='Running'; - nr_of_stars:=0; - nr_of_skipped:=0; - nr_of_straylight:=0;{stars effected by straylight} - stars_without_bp:=0;{stars without bp magn} - -// mag_active:=1;{start magnitude} - -// mag_active:=8;{start magnitude} - - //mag_active:=17.7;{start magnitude} - - maximum:=main_form.step1_maxmagnitude1.position/10; {180} - - if BP_sort then - begin - name2:='gaia_dr3-BP_sorted'; - overlapbright:=5; {############## BP can be 5 magnitude brighter=lower then G due to straylight, then G will be selected. See quality section gaia_sort_magnitude} - overlapfaint:=0; - end - else - if V_sort then - begin - name2:='gaia_dr3-V_sorted'; - overlapbright:=5; {############## BP can be 5 magitude brighter=lower then V} - overlapfaint:=2;{############### BP can be 1.8 magnitudes fainter=higher then V. Probably some stars with errors} - end - else - begin - application.MessageBox(pchar('Select a magnitude type. Warning do not override existing results!'+file_name), 'Error', MB_ICONERROR); - exit; - end; - - for i:=-15 to 180 do {create, reset output files, just to be sure} - begin - assignfile(tof,thepath+PathDelim+'Gaia'+PathDelim+name2+inttostr(round(i))+'.csv'); - filemode:=2;{read/write} - rewrite(tof,1); - closefile(tof); - end; - - repeat - bufferstring2.Clear; {clear buffer2} - file_counter:=0; - filen_out:=thepath+PathDelim+'Gaia'+PathDelim+name2+inttostr(round(mag_active*10))+'.csv'; - - - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Stars done: '+ inttostr(nr_of_stars)); - Application.ProcessMessages; {allow application to update form1 with above messages} - - - if mag_active*10 - round(+overlapbright{-5}*10)<=100 then {below BP magnitude 10 (9.95)} - begin - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_BP_0.0-09.95.csv'; - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Overlap: '+floattostr_one_digit(overlap2/10)); - main_form.thefile1.caption:=file_name; - application.processmessages; - if fileexists(file_name) then - begin - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - Read_ftext(bufferstring1); - gaia_sort_magnitude(mag_active); ; {gaia sort on magnitude} - until (eof(ftext)); - closefile(ftext); - end - else - application.MessageBox(pchar('Does not exist :'+file_name), 'Error', MB_OK); - end; - - - //database BP search range V - //mag 10 5 to 11.5 - // 18 13 to 19.5 - for overlap2:=round(-overlapbright {-5}*10) to round(+overlapfaint{+0.5}*10) do {mag -5 to +0.5 search range to find magnitudeactive=V } - begin - bp_active_x10:=round(mag_active*10+overlap2);{calculate bp_active x 10} - - if ((bp_active_x10>=100 {mag 10}) and (bp_active_x10<=180 {mag 18.0})) then {magnitude range} - begin - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_BP_'+floattostr2(bp_active_x10/10)+'.csv'; - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Overlap: '+floattostr_one_digit(overlap2/10)); - main_form.thefile1.caption:=file_name; - application.processmessages; - if fileexists(file_name) then - begin - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - Read_ftext(bufferstring1); - gaia_sort_magnitude(mag_active); ; {gaia sort on magnitude} - until (eof(ftext)); - closefile(ftext); - end - else - application.MessageBox(pchar('Does not exist :'+file_name), 'Error', MB_OK); - - end; - - - - end; - // stringlist maximum size 134,217,728 - - //overlap2:=0; - oldnrstars:=nr_of_stars; - - if BP_sort then gp_active_x10:=round ((mag_active{BP or V}- G_to_BP_correctie{0.5})*10) {Assumed is GP:=V-0.3 / V:=GP+ 0.3 for magn 15 or GP:=BP-0.5} - else gp_active_x10:=round ((mag_active{BP or V}- G_to_V_correctie {0.3})*10) ;{Assumed is GP:=V-0.3 for magn 15 or GP:=BP-0.5} - - - {now do stars without BP magnitude file 1} - if ((gp_active_x10>=0) and (gp_active_x10<=173)) then {magnitude range.5} - begin - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_missing_BP_G_0.0-17.3.csv'; {will contain stars in GP range 0 ..17.35 equivalent to V 0.4 ..16.75 and BP 0.5 ..17.85.} - - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Overlap: '+floattostr_one_digit(overlap2/10)); - main_form.thefile1.caption:=file_name; - application.processmessages; - - if fileexists(file_name) then - begin - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - Read_ftext(bufferstring1); - gaia_sort_magnitude(mag_active); ; {gaia sort on magnitude} - until (eof(ftext)); - closefile(ftext); - end - else - application.MessageBox(pchar('Does not exist :'+file_name), 'Error', MB_OK); - end; - - {now do stars without BP magnitude file 2} - if ((gp_active_x10>=174) and (gp_active_x10<=177)) then {magnitude range.5} - begin - file_name:=thepath+PathDelim+'Gaia'+PathDelim+'Gaia_DR3_missing_BP_G_17.4-17.7.csv'; {will contain stars in GP range 17.35 ..17.75 equivalent to V 17.65 ..18.05 and BP 17.85 ..18.25/ So range required 17.65 ..18.25} - main_form.caption:=('Now doing magnitude: '+floattostr_one_digit(mag_active)+' Overlap: '+floattostr_one_digit(overlap2/10)); - main_form.thefile1.caption:=file_name; - application.processmessages; - if fileexists(file_name) then - begin - assignfile(ftext,file_name); {load file in Tstrings} - reset(ftext); - repeat - Read_ftext(bufferstring1); - gaia_sort_magnitude(mag_active); ; {gaia sort on magnitude} - until (eof(ftext)); - closefile(ftext); - end - else - application.MessageBox(pchar('Does not exist :'+file_name), 'Error', MB_OK); - end; - - stars_without_bp:=stars_without_bp+(nr_of_stars-oldnrstars);{how many stars where added without bp magnitude} - - - AppendToFile(bufferstring2,filen_out);{write last part} - - - writetextfile(false,'result_sort'+typ+'.txt',floattostr_one_digit(mag_active)+'; '+ inttostr(nr_of_stars)+'; '+inttostr(stars_without_bp)+'; '+inttostr(nr_of_straylight));{write result to file} - mag_active:=mag_active+0.1;{0.1 magnitude step} - until mag_active+0.000001>=maximum+0.1; - writetextfile(false,'result_sort'+typ+'.txt','Ready. Stars done:'+ inttostr(nr_of_stars));{write result to file} - - writelongreport;{write log file in steps of 0.01 magn} - - - - if ((powerdown_enabled.checked)and (nr_of_stars>100)) then - {$ifdef mswindows} - main_form.caption:= ShutMeDown - {$else} {unix} - fpSystem('/sbin/shutdown -P now') - {$endif} - else - messagebox(main_form.handle,pchar('Ready. Stars done:'+ inttostr(nr_of_stars)),pchar('Ready'),MB_ICONINFORMATION); - -end; - - -procedure TMain_form.FormCreate(Sender: TObject); -begin - bufferstring1 := Tstringlist.Create; - bufferstring2 := Tstringlist.Create; - - thepath:=getinstalldir; -end; - -procedure TMain_form.FormDestroy(Sender: TObject); -begin - bufferstring1.free;{free suppl1} - bufferstring2.free;{free suppl2} -end; - -end. - diff -Nru astap-cli-2022.12.09/star_database_creation/readme.txt astap-cli-2024.01.17/star_database_creation/readme.txt --- astap-cli-2022.12.09/star_database_creation/readme.txt 2021-07-22 14:20:10.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/readme.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -This is the sorting program used for creating the ASTAP Gaia type 1476 database. The program is only intended for programmers not for general use. - -Input files are extracted from http://vizier.u-strasbg.fr/, catalogue Gaia DR3, a total of 19.6 gbyte. The format of the extracted files was as follows: - - -RA_ICRS,DE_ICRS,pmRA,pmDE,Gmag,BPmag,RPmag -45.0343428347,0.23538959952,45.466,-6.834,8.0688,8.55408,7.42 -45.09499151005,0.47683613114,19.353,4.014,9.899,9.87338,9.9184 -45.50145386113,0.49769720375,25.169,-23.703,9.36566,9.6971,8.86944 -44.61949163493,0.43725302893,1.154,2.824,8.77361,9.27858,8.10795 -45.00799417062,0.88856215858,-59.652,-64.404,9.314,9.82925,8.63151 -45.19600499624,0.99329823081,17.735,-24.867,8.81278,9.0281,8.44315 -45.07279557246,0.96997078249,29.432,-93.78,7.47505,8.02509,6.77223 -45.96460083512,1.01956203826,-8.292,-9.872,7.89693,9.11274,6.80843 -45.35644683021,1.15617356008,18.885,-0.896,7.34472,7.43959,7.14348 -45.79434455067,1.36809155463,47.423,-19.006,7.40869,7.99858,6.67794 -45.87127884601,1.51224348242,48.359,12.431,8.91426,9.17856,8.47791 -44.81988701739,1.24455388355,12.404,-5.014,8.63183,8.64141,8.57615 -44.53332789932,1.37114804383,-1.178,-16.488,9.51966,9.80353,9.07019 - - -There is one special input file contaning the missing bright stars. This file was created with a seperate program by comparing the Gaia DR3 with Tycho 2 up to magnitude5 . The missing bright stars are contained in input file: - - Gaia_eDR3_missing_stars_upto_mag5.csv - -The following files where extracted from Vizier. The fainter magnitudes up to magnitude 18 are extracted in steps of 0.1 magnitude: - -03/12/2020 14:51 19,896,461 Gaia_DR3_BP_0.0-09.95.csv -03/12/2020 14:50 2,050,255 Gaia_DR3_BP_10.0.csv -03/12/2020 14:50 2,269,528 Gaia_DR3_BP_10.1.csv -03/12/2020 14:50 2,478,876 Gaia_DR3_BP_10.2.csv -03/12/2020 14:50 2,694,053 Gaia_DR3_BP_10.3.csv -03/12/2020 14:50 2,950,607 Gaia_DR3_BP_10.4.csv -03/12/2020 14:49 3,231,018 Gaia_DR3_BP_10.5.csv -03/12/2020 15:05 3,540,026 Gaia_DR3_BP_10.6.csv -03/12/2020 15:05 3,877,695 Gaia_DR3_BP_10.7.csv -03/12/2020 15:05 4,250,554 Gaia_DR3_BP_10.8.csv -03/12/2020 15:06 4,632,552 Gaia_DR3_BP_10.9.csv -03/12/2020 15:06 5,096,480 Gaia_DR3_BP_11.0.csv -03/12/2020 15:24 5,587,766 Gaia_DR3_BP_11.1.csv -03/12/2020 15:24 6,090,694 Gaia_DR3_BP_11.2.csv -03/12/2020 15:25 6,602,722 Gaia_DR3_BP_11.3.csv -03/12/2020 15:25 7,253,054 Gaia_DR3_BP_11.4.csv -03/12/2020 15:25 7,902,045 Gaia_DR3_BP_11.5.csv -03/12/2020 17:09 8,613,569 Gaia_DR3_BP_11.6.csv -03/12/2020 17:09 9,339,942 Gaia_DR3_BP_11.7.csv -03/12/2020 17:09 10,221,135 Gaia_DR3_BP_11.8.csv -03/12/2020 17:09 11,081,671 Gaia_DR3_BP_11.9.csv -03/12/2020 17:10 12,029,875 Gaia_DR3_BP_12.0.csv -03/12/2020 17:10 13,106,595 Gaia_DR3_BP_12.1.csv -03/12/2020 17:10 14,242,274 Gaia_DR3_BP_12.2.csv -03/12/2020 17:12 15,410,886 Gaia_DR3_BP_12.3.csv -03/12/2020 17:12 16,810,815 Gaia_DR3_BP_12.4.csv -03/12/2020 17:12 18,232,392 Gaia_DR3_BP_12.5.csv -03/12/2020 17:12 19,823,627 Gaia_DR3_BP_12.6.csv -03/12/2020 17:13 21,501,023 Gaia_DR3_BP_12.7.csv -03/12/2020 17:12 23,350,791 Gaia_DR3_BP_12.8.csv -03/12/2020 17:13 25,284,567 Gaia_DR3_BP_12.9.csv -03/12/2020 17:13 27,430,688 Gaia_DR3_BP_13.0.csv -03/12/2020 18:06 29,785,581 Gaia_DR3_BP_13.1.csv -03/12/2020 18:06 32,129,739 Gaia_DR3_BP_13.2.csv -03/12/2020 18:06 34,813,084 Gaia_DR3_BP_13.3.csv -03/12/2020 18:06 37,577,965 Gaia_DR3_BP_13.4.csv -03/12/2020 18:07 40,543,223 Gaia_DR3_BP_13.5.csv -03/12/2020 18:07 43,934,216 Gaia_DR3_BP_13.6.csv -03/12/2020 23:03 47,487,265 Gaia_DR3_BP_13.7.csv -03/12/2020 23:03 51,103,103 Gaia_DR3_BP_13.8.csv -04/12/2020 00:43 85,353,399 Gaia_DR3_BP_13.9.csv -04/12/2020 00:29 92,036,402 Gaia_DR3_BP_14.0.csv -04/12/2020 00:30 99,161,139 Gaia_DR3_BP_14.1.csv -04/12/2020 00:31 106,872,358 Gaia_DR3_BP_14.2.csv -04/12/2020 00:31 115,154,131 Gaia_DR3_BP_14.3.csv -04/12/2020 00:31 124,085,191 Gaia_DR3_BP_14.4.csv -04/12/2020 00:34 133,121,275 Gaia_DR3_BP_14.5.csv -04/12/2020 00:32 143,366,174 Gaia_DR3_BP_14.6.csv -04/12/2020 00:34 153,943,373 Gaia_DR3_BP_14.7.csv -04/12/2020 00:33 165,607,984 Gaia_DR3_BP_14.8.csv -04/12/2020 00:36 178,073,165 Gaia_DR3_BP_14.9.csv -04/12/2020 00:34 190,749,368 Gaia_DR3_BP_15.0.csv -04/12/2020 00:37 204,638,224 Gaia_DR3_BP_15.1.csv -04/12/2020 00:35 220,016,654 Gaia_DR3_BP_15.2.csv -04/12/2020 00:35 235,747,013 Gaia_DR3_BP_15.3.csv -04/12/2020 00:37 252,849,866 Gaia_DR3_BP_15.4.csv -04/12/2020 00:38 271,255,836 Gaia_DR3_BP_15.5.csv -04/12/2020 00:38 290,983,908 Gaia_DR3_BP_15.6.csv -04/12/2020 00:39 311,889,795 Gaia_DR3_BP_15.7.csv -04/12/2020 13:00 334,586,498 Gaia_DR3_BP_15.8.csv -04/12/2020 13:00 358,029,321 Gaia_DR3_BP_15.9.csv -04/12/2020 13:00 383,117,375 Gaia_DR3_BP_16.0.csv -04/12/2020 13:00 409,829,130 Gaia_DR3_BP_16.1.csv -04/12/2020 13:00 439,210,861 Gaia_DR3_BP_16.2.csv -04/12/2020 13:00 469,567,630 Gaia_DR3_BP_16.3.csv -04/12/2020 12:59 501,692,514 Gaia_DR3_BP_16.4.csv -04/12/2020 12:59 534,964,376 Gaia_DR3_BP_16.5.csv -04/12/2020 12:59 570,798,560 Gaia_DR3_BP_16.6.csv -04/12/2020 12:59 608,463,301 Gaia_DR3_BP_16.7.csv -04/12/2020 12:59 647,961,081 Gaia_DR3_BP_16.8.csv -04/12/2020 12:58 690,181,065 Gaia_DR3_BP_16.9.csv -04/12/2020 12:58 733,847,359 Gaia_DR3_BP_17.0.csv -04/12/2020 12:58 780,350,573 Gaia_DR3_BP_17.1.csv -04/12/2020 12:58 828,625,337 Gaia_DR3_BP_17.2.csv -04/12/2020 12:57 880,530,596 Gaia_DR3_BP_17.3.csv -05/12/2020 12:26 934,451,667 Gaia_DR3_BP_17.4.csv -04/12/2020 12:57 991,420,445 Gaia_DR3_BP_17.5.csv -04/12/2020 12:57 1,052,044,231 Gaia_DR3_BP_17.6.csv -04/12/2020 12:57 1,115,809,050 Gaia_DR3_BP_17.7.csv -04/12/2020 12:56 1,183,351,092 Gaia_DR3_BP_17.8.csv -04/12/2020 12:56 1,255,659,042 Gaia_DR3_BP_17.9.csv -04/12/2020 12:53 1,331,708,481 Gaia_DR3_BP_18.0.csv - -And these with missing BP magnitude: - -04/12/2020 15:50 202,546,380 Gaia_DR3_missing_BP_G_0.0-17.3.csv -04/12/2020 15:50 137,587,111 Gaia_DR3_missing_BP_G_17.4-17.7.csv - - -Conversion to the ASTAP database will take a huge time up to 24 hours or more. - -Han Kleijn -2021-7-22 - - diff -Nru "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/star_database_creation/tapvizierGaiaDR3 request.txt" "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/star_database_creation/tapvizierGaiaDR3 request.txt" --- "/tmp/tmpidt0eay9/AIObIDZmFc/astap-cli-2022.12.09/star_database_creation/tapvizierGaiaDR3 request.txt" 2021-07-22 13:48:52.000000000 +0000 +++ "/tmp/tmpidt0eay9/VMSbaJBXG_/astap-cli-2024.01.17/star_database_creation/tapvizierGaiaDR3 request.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - -Download in slices up to 3 mil records: - -https://gea.esac.esa.int/archive/ -SELECT gaia_source.ra,gaia_source.dec, gaia_source.pmra, gaia_source.pmdec, gaia_source.phot_g_mean_mag, gaia_source.phot_bp_mean_mag, gaia_source.phot_rp_mean_mag -FROM gaiaedr3.gaia_source -WHERE (gaiaedr3.gaia_source.phot_bp_mean_mag>=15.65 AND gaiaedr3.gaia_source.phot_bp_mean_mag<15.75) - -use copy demand to combine files: -copy /A Gaia_DR3_BP_17.4*.csv hGaia_DR3_BP_17.4.csv - - -Filter out stars without BP up to magnitude 17.75. Note V is 0.3 magnitudes above GP and BP 0.5 magnitude so up to magn 17.75 is enough - -SELECT gaia_source.ra,gaia_source.dec,gaia_source.pmra,gaia_source.pmdec,gaia_source.phot_g_mean_mag,gaia_source.phot_bp_mean_mag,gaia_source.phot_rp_mean_mag -FROM gaiaedr3.gaia_source -WHERE gaiaedr3.gaia_source.phot_g_mean_mag is not NULL AND gaiaedr3.gaia_source.phot_g_mean_mag>=-5 AND gaiaedr3.gaia_source.phot_g_mean_mag<17.35 AND gaiaedr3.gaia_source.phot_bp_mean_mag is NULL - -SELECT gaia_source.ra,gaia_source.dec,gaia_source.pmra,gaia_source.pmdec,gaia_source.phot_g_mean_mag,gaia_source.phot_bp_mean_mag,gaia_source.phot_rp_mean_mag -FROM gaiaedr3.gaia_source -WHERE gaiaedr3.gaia_source.phot_g_mean_mag is not NULL AND gaiaedr3.gaia_source.phot_g_mean_mag>=17.35 AND gaiaedr3.gaia_source.phot_g_mean_mag<17.75 AND gaiaedr3.gaia_source.phot_bp_mean_mag is NULL - - - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -=================================================================================================================== - --- output format : csv -SELECT TOP 990000000 "I/350/gaiaedr3".RA_ICRS, "I/350/gaiaedr3".DE_ICRS, "I/350/gaiaedr3".pmRA, "I/350/gaiaedr3".pmDE, "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag, "I/350/gaiaedr3".RPmag -FROM "I/350/gaiaedr3" -WHERE "I/350/gaiaedr3".Gmag is not NULL and "I/350/gaiaedr3".Gmag<=18.05 and "I/350/gaiaedr3".BPmag is NULL - --- output format : csv -SELECT TOP 990000000 "I/350/gaiaedr3".RA_ICRS, "I/350/gaiaedr3".DE_ICRS, "I/350/gaiaedr3".pmRA, "I/350/gaiaedr3".pmDE, "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag, "I/350/gaiaedr3".RPmag -FROM "I/350/gaiaedr3" -WHERE "I/350/gaiaedr3".BPmag>=11.55 and "I/350/gaiaedr3".BPmag<11.65 - -Gaia_DR3_BP_11.6.csv - - - --- output format : csv -SELECT TOP 990000000 "I/350/gaiaedr3".RA_ICRS, "I/350/gaiaedr3".DE_ICRS, "I/350/gaiaedr3".pmRA, "I/350/gaiaedr3".pmDE, "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".BPmag, "I/350/gaiaedr3".RPmag -FROM "I/350/gaiaedr3" -WHERE "I/350/gaiaedr3".Gmag>=-9.55 and "I/350/gaiaedr3".Gmag<9.00 -Gaia_DR3_G_upto_09.0.csv - - - - -- output format : csv - SELECT "I/350/gaiaedr3".RA_ICRS, "I/350/gaiaedr3".e_RA_ICRS, "I/350/gaiaedr3".DE_ICRS, "I/350/gaiaedr3".e_DE_ICRS, "I/350/gaiaedr3".Source, "I/350/gaiaedr3".Plx, "I/350/gaiaedr3".e_Plx, - "I/350/gaiaedr3".PM, "I/350/gaiaedr3".pmRA, "I/350/gaiaedr3".e_pmRA, "I/350/gaiaedr3".pmDE, "I/350/gaiaedr3".e_pmDE, "I/350/gaiaedr3".RUWE, "I/350/gaiaedr3".FG, "I/350/gaiaedr3".e_FG, - "I/350/gaiaedr3".Gmag, "I/350/gaiaedr3".e_Gmag, "I/350/gaiaedr3".FBP, "I/350/gaiaedr3".e_FBP, "I/350/gaiaedr3".BPmag, "I/350/gaiaedr3".e_BPmag, "I/350/gaiaedr3".FRP, "I/350/gaiaedr3".e_FRP, - "I/350/gaiaedr3".RPmag, "I/350/gaiaedr3".e_RPmag, "I/350/gaiaedr3"."BP-RP", "I/350/gaiaedr3".RVDR2, "I/350/gaiaedr3".e_RVDR2, "I/350/gaiaedr3".Tefftemp, "I/350/gaiaedr3".loggtemp, "I/350/gaiaedr3".PS1, - "I/350/gaiaedr3".SDSSDR13, "I/350/gaiaedr3".SkyMapper2, "I/350/gaiaedr3".URAT1, "I/350/gaiaedr3".GmagCorr, "I/350/gaiaedr3".e_GmagCorr, "I/350/gaiaedr3".FGCorr, "I/350/gaiaedr3".RAJ2000, "I/350/gaiaedr3".DEJ2000 - FROM "I/350/gaiaedr3" - - - - - -https://gaia.ari.uni-heidelberg.de/tap.html -SELECT -TOP 1811709771 - ra,dec, pmra,pmdec, phot_g_mean_mag,phot_bp_mean_mag,phot_rp_mean_mag -FROM -gaiaedr3.gaia_source -WHERE phot_bp_mean_mag>=17.95 and phot_bp_mean_mag<18.05 - - - - diff -Nru astap-cli-2022.12.09/star_database_creation/unit_1476.pas astap-cli-2024.01.17/star_database_creation/unit_1476.pas --- astap-cli-2022.12.09/star_database_creation/unit_1476.pas 2020-12-29 20:19:14.000000000 +0000 +++ astap-cli-2024.01.17/star_database_creation/unit_1476.pas 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ - -unit unit_1476; - -{$MODE Delphi} - -interface -var - tof : file; - nr_of_stars : longint; - nr_of_skipped : longint; - - -type -hnskyhdr1476_A7 = packed record {interim record} - ra7 : byte; - ra8 : byte; - ra9 : byte; - dec7: byte; - dec8: byte; {note with word and smallint, delphi makes longer records !!!} - dec9: shortint; - Bp_Rp: shortint;{blue minus red magnitude} - end; - -hnskyhdr1476_A6 = packed record {interim record} - ra7 : byte; - ra8 : byte; - ra9 : byte; - dec7: byte; - dec8: byte; {note with word and smallint, delphi makes longer records !!!} - dec9: shortint; - end; -hnskyhdr1476_5 = packed record - ra7 : byte; - ra8 : byte; - ra9 : byte; - dec7: byte; - dec8: byte; {note with word and smallint, delphi makes longer records !!!} - end; - -hnskyhdr1476_6 = packed record - ra7 : byte; - ra8 : byte; - ra9 : byte; - dec7: byte; - dec8: byte; {note with word and smallint, delphi makes longer records !!!} - Bp_Rp: shortint;{blue minus red magnitude} - end; - - - -var - Numwritten : integer; - new_magnitude_record_written : array[1..1801] of integer;{keep record if new magnitude step record is written to file for 6 byte records} - -function limit_radialen(z:double):double; - -function name1476(ra,dec:real): string; {give segment name} - - -function filenames1476(nr:integer): string; - - -implementation -uses sysutils; - -Const - -Stepsize=90/17.5;{5.142857143 degrees} - -rings1476: array[0..36] of real= -// (-90,-85.23224404, -75.66348756, -65.99286637, -56.14497387,-46.03163067,-35.54307745,-24.53348115,-12.79440589, 0.0 ,+12.79440589,+24.53348115,+35.54307745,+46.03163067,+56.14497387,+65.99286637,+75.66348756,+85.23224404,90); - (-90, { 90 } - -stepsize*17, { 87.42857143 } - -stepsize*16, { 82.28571429 } - -stepsize*15, { 77.14285714 } - -stepsize*14, { 72 } - -stepsize*13, { 66.85714286 } - -stepsize*12, { 61.71428571 } - -stepsize*11, { 56.57142857 } - -stepsize*10, { 51.42857143 } - -stepsize*9, { 46.28571429 } - -stepsize*8, { 41.14285714 } - -stepsize*7, { 36 } - -stepsize*6, { 30.85714286 } - -stepsize*5, { 25.71428571 } - -stepsize*4, { 20.57142857 } - -stepsize*3, { 15.42857143 } - -stepsize*2, { 10.28571429 } - -stepsize*1, { 5.142857143 } - stepsize*0, { 0 } - stepsize*1, { -5.142857143 } - stepsize*2, { -10.28571429 } - stepsize*3, { -15.42857143 } - stepsize*4, { -20.57142857 } - stepsize*5, { -25.71428571 } - stepsize*6, { -30.85714286 } - stepsize*7, { -36 } - stepsize*8, { -41.14285714 } - stepsize*9, { -46.28571429 } - stepsize*10, { -51.42857143 } - stepsize*11, { -56.57142857 } - stepsize*12, { -61.71428571 } - stepsize*13, { -66.85714286 } - stepsize*14, { -72 } - stepsize*15, { -77.14285714 } - stepsize*16, { -82.28571429 } - stepsize*17, { -87.42857143 } - 90); { -90 } - - - -seg_length=36; - -segments1476: array[1..seg_length] of integer= {number of division in each latitude ring} - {RA cells RA step distance north[degr] RA step distance south[degr] } - (1 , - 3 ,{ 5.383779642 , 16.1079919 } - 9 ,{ 5.369330633 , 8.900837358 } - 15 ,{ 5.340502415 , 7.416407865 } - 21 ,{ 5.297434189 , 6.737571971 } - 27 ,{ 5.240333755 , 6.318248833 } - 33 ,{ 5.169476318 , 6.009785252 } - 38 ,{ 5.219024035 , 5.906745491 } - 43 ,{ 5.21991462 , 5.785640782 } - 48 ,{ 5.182969867 , 5.648035995 } - 52 ,{ 5.213571688 , 5.600886884 } - 56 ,{ 5.200823535 , 5.518599387 } - 60 ,{ 5.150692762 , 5.405813207 } - 63 ,{ 5.148393531 , 5.349913547 } - 65 ,{ 5.185300822 , 5.338871228 } - 67 ,{ 5.179501938 , 5.286785849 } - 68 ,{ 5.209038998 , 5.272805086 } - 69 ,{ 5.196387621 , 5.217391304 } - - 69 ,{ 5.217391304 , 5.196387621 } - 68 ,{ 5.272805086 , 5.209038998 } - 67 ,{ 5.286785849 , 5.179501938 } - 65 ,{ 5.338871228 , 5.185300822 } - 63 ,{ 5.349913547 , 5.148393531 } - 60 ,{ 5.405813207 , 5.150692762 } - 56 ,{ 5.518599387 , 5.200823535 } - 52 ,{ 5.600886884 , 5.213571688 } - 48 ,{ 5.648035995 , 5.182969867 } - 43 ,{ 5.785640782 , 5.21991462 } - 38 ,{ 5.906745491 , 5.219024035 } - 33 ,{ 6.009785252 , 5.169476318 } - 27 ,{ 6.318248833 , 5.240333755 } - 21 ,{ 6.737571971 , 5.297434189 } - 15 ,{ 7.416407865 , 5.340502415 } - 9 ,{ 8.900837358 , 5.369330633 } - 3 ,{ 16.1079919 , 5.383779642 } - 1); - - - -function filenames1476(nr:integer): string; -var - la,lo,m,o : integer; - lat,seg : string; -begin - //const - //filenames1476 : array[1..1476] of string= {} - //(('0101.1476'), - - // ('0201.1476'), - // ('0202.1476'), - // ('0203.1476'), - - // ('0301.1476'), - // ('0302.1476'), - m:=0; - la:=1; - repeat - lo:=segments1476[la]; - m:=m+lo; - if nr<=m then - begin - str(la,lat); if length(lat)=1 then lat:='0' +lat; - str(nr-(m-lo),seg); if length(seg)=1 then seg:='0' +seg; - result:=lat+seg+'.1476'; - exit; - end; - inc(la); - until la>seg_length; {36} -end; - -function name1476(ra,dec:real): string; {give segment name} -var - r,d : integer; - found: boolean; - dum :string; -begin - found:=false; - d:=0; - - if dec>+pi/2 then dec:=PI/2; - if dec<-pi/2 then dec:=-PI/2; - repeat {find dec ring} - inc(d); - if dec*180/pi<rings1476[d] then begin found:=true; str(d,result); if length(result)=1 then result:='0' +result; end; - - until ((found=true) or (d>=seg_length)); - - {find ra segment} - if ra>=2*pi then ra:=0; - if ra<0 then ra:=0; - str( 1+trunc(segments1476[d]*ra/(2*pi)),dum); - if length(dum)=1 then dum:='0' +dum; - result:=result+dum+'.1476'; -end; - -PROCEDURE ang_sep(ra1,dec1,ra2,dec2 : real;var sep: real); { By Han Kleijn} -var cos_sep:real; -{caculates angular separation. according formula 9.1 old meeus} -Begin - cos_sep:=sin(dec1)*sin(dec2)+ cos(dec1)*cos(dec2)*cos(ra1-ra2); - if ABS(cos_sep)<1 then begin sep:=(PI/2-ARCTAN(cos_sep/(SQRT(1-SQR(cos_sep))))) end {arccos function} - else - begin if cos_sep>0 then sep:=0 {note bij x=1 klapt uitkomst net om} - else sep:=PI; - end; {arccos function} - -end; -function limit_radialen(z:double):double; -begin - while z<0 do z:=z+2*pi; - while z>=2*pi do z:=z-2*pi; {corrected 2019} - limit_radialen:=z; -end; - - -begin - -end. diff -Nru astap-cli-2022.12.09/unit_command_line_general.pas astap-cli-2024.01.17/unit_command_line_general.pas --- astap-cli-2022.12.09/unit_command_line_general.pas 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/unit_command_line_general.pas 2024-01-17 22:20:03.000000000 +0000 @@ -1,4 +1,10 @@ unit unit_command_line_general; +{Copyright (C) 2017, 2024 by Han Kleijn, www.hnsky.org + email: han.k.. at...hnsky.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at https://mozilla.org/MPL/2.0/. } {$mode objfpc}{$H+} @@ -15,7 +21,7 @@ var {################# initialised variables #########################} - astap_version: string='2022.11.11'; + astap_version: string='2024.01.04'; ra1 : string='0'; dec1 : string='0'; search_fov1 : string='0';{search FOV} @@ -54,11 +60,11 @@ var histogram : array[0..2,0..65535] of integer;{red,green,blue,count} - his_total_red, his_total_green,his_total_blue,r_aperture : integer; {histogram number of values} + r_aperture : integer; {histogram number of values} histo_peak_position : integer; his_mean,noise_level : array[0..2] of integer; esc_pressed, fov_specified {, last_extension }: boolean; - star_level : double; + star_level,star_level2 : double; exposure,focallen,equinox : double; cblack, cwhite, gain :double; {from FITS} @@ -143,10 +149,9 @@ function floattostrF2(const x:double; width1,decimals1 :word): string; procedure analyse_fits(img : image_array;snr_min:double;report:boolean;out star_counter : integer; out backgr, hfd_median : double); {find background, number of stars, median HFD} procedure HFD(img: image_array;x1,y1,rs {boxsize}: integer; out hfd1,star_fwhm,snr{peak/sigma noise}, flux,xc,yc:double);{calculate star HFD and FWHM, SNR, xc and yc are center of gravity. All x,y coordinates in array[0..] positions} -procedure get_background(colour: integer; img :image_array;calc_hist, calc_noise_level: boolean; out background, starlevel: double); {get background and star level from peek histogram} +procedure get_background(colour: integer; img :image_array;calc_hist, calc_noise_level: boolean; out background, star_level, star_level2: double); {get background and star level from peek histogram} function prepare_ra(rax:double; sep:string):string; {radialen to text, format 24: 00 00.0 } function prepare_dec(decx:double; sep:string):string; {radialen to text, format 90d 00 00} -procedure new_to_old_WCS;{convert new style FITsS to old style} procedure write_astronomy_wcs; procedure write_ini(solution:boolean);{write solution to ini file} function load_image2 : boolean; {load fits or PNG, BMP, TIF} @@ -345,60 +350,6 @@ end; -procedure new_to_old_WCS;{convert new style FITS to old style, revison 2022} -begin - // https://www.aanda.org/articles/aa/full/2002/45/aah3860/aah3860.right.html - // Representations of World Coordinates in FITS paper II aah3860 - - // formula 191 - if cd2_1>0 then crota1:=arctan2(-cd2_1,-cd1_1)*180/pi - else - if cd2_1<0 then crota1:=arctan2(+cd2_1,+cd1_1)*180/pi - else - crota1:=0; - - if cd1_2>0 then crota2:=arctan2(-cd1_2,cd2_2)*180/pi - else - if cd1_2<0 then crota2:=arctan2(cd1_2,-cd2_2)*180/pi - else - crota2:=0; - - // https://www.aanda.org/articles/aa/full/2002/45/aah3860/aah3860.right.html - // Representations of World Coordinates in FITS paper II aah3860 - // Formula 193 improved for crota close to or equal to +90 or -90 degrees - // Calculate cdelt1, cdelt2 values using the longest side of the triangle - if abs(cd1_1)>abs(cd2_1) then - begin - cdelt1:=+cd1_1/cos(crota1*pi/180); - cdelt2:=+cd2_2/cos(crota2*pi/180); - end - else - begin - cdelt1:=+cd2_1/sin(crota1*pi/180); - cdelt2:=-cd1_2/sin(crota2*pi/180); - end; - - //Solutions for CROTA2 come in pairs separated by 180degr. The other solution is obtained by subtracting 180 from CROTA2 and negating CDELT1 and CDELT2. - //While each solution is equally valid, if one makes CDELT1 < 0 and CDELT2 > 0 then it would normally be the one chosen. - if cdelt2<0 then //CDELT2 is always kept positive and if not the solution is flipped by negating both CDELT2, CDELT2 and shifting the angle 180 degrees. So if the image is flipped the solution is reporting "flipped horizontal" and not an equivalent "flipped vertical". - begin - if crota2<0 then - begin - crota2:=crota2+180; - crota1:=crota1+180; - end - else - begin - crota2:=crota2-180; - crota1:=crota1-180; - end; - - cdelt2:=-cdelt2; - cdelt1:=-cdelt1; - end;//make cdelt2 always positive -end; - - procedure write_astronomy_wcs; var TheFile4 : tfilestream; @@ -595,8 +546,8 @@ {get dimensions directly from array} naxis3_local:=length(img);{nr colours} - width5:=length(img[0]);{width} - height5:=length(img[0,0]);{length} + width5:=length(img[0,0]);{width} + height5:=length(img[0]);{length} if naxis3_local=1 then dimensions:=2 else dimensions:=3; {number of dimensions or colours} filename2:=filen2; @@ -648,7 +599,7 @@ begin for j:=0 to width5-1 do begin - dum:=round(img[k,j,i])-bzero2;{save all colors} + dum:=round(img[k,i,j])-bzero2;{save all colors} { value - bzero result shortint word ($0000 - $8000) and $FFFF = $8000 (-32768 32768 ) note $0000 - $8000 ==> $FFFF8000. Highest bits are skipped ($0001 - $8000) and $FFFF = $8001 (-32767 32769 ) note $0001 - $8000 ==> $FFFF8001. Highest bits are skipped @@ -1024,7 +975,7 @@ exit; end; - setlength(img_loaded2,naxis3,width2,height2); + setlength(img_loaded2,naxis3,height2,width2); if nrbits=16 then for k:=0 to naxis3-1 do {do all colors} @@ -1036,7 +987,7 @@ begin word16:=swap(fitsbuffer2[i]);{move data to wo and therefore sign_int} col_float:=int_16*bscale + bzero; {save in col_float for measuring measured_max} - img_loaded2[k,i,j]:=col_float; + img_loaded2[k,j,i]:=col_float; if col_float>measured_max then measured_max:=col_float;{find max value for image. For for images with 0..1 scale or for debayer} end; end; @@ -1053,7 +1004,7 @@ x_longword:=swapendian(fitsbuffer4[i]);{conversion 32 bit "big-endian" data, x_single : single absolute x_longword; } col_float:=x_single*bscale+bzero; {int_IEEE, swap four bytes and the read as floating point} if isNan(col_float) then col_float:=measured_max;{not a number prevent errors, can happen in PS1 images with very high floating point values} - img_loaded2[k,i,j]:=col_float;{store in memory array} + img_loaded2[k,j,i]:=col_float;{store in memory array} if col_float>measured_max then measured_max:=col_float;{find max value for image. For for images with 0..1 scale or for debayer} end; end; @@ -1067,7 +1018,7 @@ try reader.read(fitsbuffer,width2);except; end; {read file info} for i:=0 to width2-1 do begin - img_loaded2[k,i,j]:=(fitsbuffer[i]*bscale + bzero); + img_loaded2[k,j,i]:=(fitsbuffer[i]*bscale + bzero); end; end; end {colors naxis3 times} @@ -1079,9 +1030,9 @@ for i:=0 to width2-1 do begin rgbdummy:=fitsbufferRGB[i];{RGB fits with naxis1=3, treated as 24 bits coded pixels in 2 dimensions} - img_loaded2[0,i,j]:=rgbdummy[0];{store in memory array} - img_loaded2[1,i,j]:=rgbdummy[1];{store in memory array} - img_loaded2[2,i,j]:=rgbdummy[2];{store in memory array} + img_loaded2[0,j,i]:=rgbdummy[0];{store in memory array} + img_loaded2[1,j,i]:=rgbdummy[1];{store in memory array} + img_loaded2[2,j,i]:=rgbdummy[2];{store in memory array} end; end else @@ -1095,7 +1046,7 @@ begin col_float:=(swapendian(fitsbuffer4[i])*bscale+bzero)/(65535);{scale to 0..64535 or 0..1 float} {Tricky do not use int64 for BZERO, maxim DL writes BZERO value -2147483647 as +2147483648 !!} - img_loaded2[k,i,j]:=col_float;{store in memory array} + img_loaded2[k,j,i]:=col_float;{store in memory array} if col_float>measured_max then measured_max:=col_float;{find max value for image. For for images with 0..1 scale or for debayer} end; end; @@ -1111,7 +1062,7 @@ begin x_qword:=swapendian(fitsbuffer8[i]);{conversion 64 bit "big-endian" data, x_double : double absolute x_int64;} col_float:=x_double*bscale + bzero; {int_IEEE, swap four bytes and the read as floating point} - img_loaded2[k,i,j]:=col_float;{store in memory array} + img_loaded2[k,j,i]:=col_float;{store in memory array} if col_float>measured_max then measured_max:=col_float;{find max value for image. For for images with 0..1 scale or for debayer} end; end; @@ -1128,7 +1079,7 @@ for k:=0 to naxis3-1 do {do all colors} for j:=0 to height2-1 do for i:=0 to width2-1 do - img_loaded2[k,i,j]:= img_loaded2[k,i,j]*scalefactor; + img_loaded2[k,j,i]:= img_loaded2[k,j,i]*scalefactor; datamax_org:=65535; end else datamax_org:=measured_max; @@ -1689,7 +1640,7 @@ end else begin {not too large} - setlength(img_loaded2,naxis3,width2,height2); + setlength(img_loaded2,naxis3,height2,width2); begin For i:=0 to height2-1 do begin @@ -1700,19 +1651,19 @@ if color7=false then {gray scale without bayer matrix applied} begin if nrbits=8 then {8 BITS, mono 1x8bits} - img_loaded2[0,j,i]:=fitsbuffer[j]{RGB fits with naxis1=3, treated as 48 bits coded pixels} + img_loaded2[0,i,j]:=fitsbuffer[j]{RGB fits with naxis1=3, treated as 48 bits coded pixels} else if nrbits=16 then {big endian integer} - img_loaded2[0,j,i]:=swap(fitsbuffer2[j]) + img_loaded2[0,i,j]:=swap(fitsbuffer2[j]) else {PFM 32 bits grayscale} if pfm then begin if range<0 then {little endian floats} - img_loaded2[0,j,i]:=fitsbuffersingle[j]*65535/(-range) {PFM little endian float format. if nrbits=-1 then range 0..1. If nrbits=+1 then big endian with range 0..1 } + img_loaded2[0,i,j]:=fitsbuffersingle[j]*65535/(-range) {PFM little endian float format. if nrbits=-1 then range 0..1. If nrbits=+1 then big endian with range 0..1 } else begin {big endian floats} x_longword:=swapendian(fitsbuffer4[j]);{conversion 32 bit "big-endian" data, x_single : single absolute x_longword; } - img_loaded2[0,j,i]:=x_single*65535/range; + img_loaded2[0,i,j]:=x_single*65535/range; end; end; end @@ -1721,17 +1672,17 @@ if nrbits=8 then {24 BITS, colour 3x8bits} begin rgbdummy:=fitsbufferRGB[j];{RGB fits with naxis1=3, treated as 48 bits coded pixels} - img_loaded2[0,j,i]:=rgbdummy[0];{store in memory array} - img_loaded2[1,j,i]:=rgbdummy[1];{store in memory array} - img_loaded2[2,j,i]:=rgbdummy[2];{store in memory array} + img_loaded2[0,i,j]:=rgbdummy[0];{store in memory array} + img_loaded2[1,i,j]:=rgbdummy[1];{store in memory array} + img_loaded2[2,i,j]:=rgbdummy[2];{store in memory array} end else if nrbits=16 then {48 BITS colour, 3x16 big endian} begin {48 bits} rgb16dummy:=fitsbufferRGB16[j];{RGB fits with naxis1=3, treated as 48 bits coded pixels} - img_loaded2[0,j,i]:=swap(rgb16dummy[0]);{store in memory array} - img_loaded2[1,j,i]:=swap(rgb16dummy[1]);{store in memory array} - img_loaded2[2,j,i]:=swap(rgb16dummy[2]);{store in memory array} + img_loaded2[0,i,j]:=swap(rgb16dummy[0]);{store in memory array} + img_loaded2[1,i,j]:=swap(rgb16dummy[1]);{store in memory array} + img_loaded2[2,i,j]:=swap(rgb16dummy[2]);{store in memory array} end else if pfm then @@ -1739,18 +1690,18 @@ if range<0 then {little endian} begin rgb32dummy:=fitsbufferRGB32[j];{RGB fits with naxis1=3, treated as 96 bits coded pixels} - img_loaded2[0,j,i]:=(rgb32dummy[0])*65535/(-range);{store in memory array} - img_loaded2[1,j,i]:=(rgb32dummy[1])*65535/(-range);{store in memory array} - img_loaded2[2,j,i]:=(rgb32dummy[2])*65535/(-range);{store in memory array} + img_loaded2[0,i,j]:=(rgb32dummy[0])*65535/(-range);{store in memory array} + img_loaded2[1,i,j]:=(rgb32dummy[1])*65535/(-range);{store in memory array} + img_loaded2[2,i,j]:=(rgb32dummy[2])*65535/(-range);{store in memory array} end else begin {PFM big-endian float 32 bit colour} x_longword:=swapendian(fitsbuffer4[j*3]); - img_loaded2[0,j,i]:=x_single*65535/(range); + img_loaded2[0,i,j]:=x_single*65535/(range); x_longword:=swapendian(fitsbuffer4[j*3+1]); - img_loaded2[1,j,i]:=x_single*65535/(range); + img_loaded2[1,i,j]:=x_single*65535/(range); x_longword:=swapendian(fitsbuffer4[j*3+2]); - img_loaded2[2,j,i]:=x_single*65535/(range); + img_loaded2[2,i,j]:=x_single*65535/(range); end; end; end; @@ -1894,23 +1845,23 @@ width2:=image.width; height2:=image.height; - setlength(img_loaded2,naxis3,width2,height2); + setlength(img_loaded2,naxis3,height2,width2); if naxis3=3 then begin For i:=0 to height2-1 do for j:=0 to width2-1 do begin - img_loaded2[0,j,height2-1-i]:=image.Colors[j,i].red; - img_loaded2[1,j,height2-1-i]:=image.Colors[j,i].green; - img_loaded2[2,j,height2-1-i]:=image.Colors[j,i].blue; + img_loaded2[0,height2-1-i,j]:=image.Colors[j,i].red; + img_loaded2[1,height2-1-i,j]:=image.Colors[j,i].green; + img_loaded2[2,height2-1-i,j]:=image.Colors[j,i].blue; end; end else begin For i:=0 to height2-1 do for j:=0 to width2-1 do - img_loaded2[0,j,height2-1-i]:=image.Colors[j,i].red; + img_loaded2[0,height2-1-i,j]:=image.Colors[j,i].red; end; if tiff then @@ -2009,8 +1960,8 @@ his_total:=0; total_value:=0; count:=1;{prevent divide by zero} - width5:=Length(img[0]); {width} - height5:=Length(img[0][0]); {height} + width5:=Length(img[0,0]); {width} + height5:=Length(img[0]); {height} offsetW:=trunc(width5*0.042); {if Libraw is used, ignored unused sensor areas up to 4.2%} offsetH:=trunc(height5*0.015); {if Libraw is used, ignored unused sensor areas up to 1.5%} @@ -2020,7 +1971,7 @@ begin for j:=0+offsetW to width5-1-offsetW do begin - col:=round(img[colour,j,i]);{red} + col:=round(img[colour,i,j]);{red} if ((col>=1) and (col<65000)) then {ignore black overlap areas and bright stars} begin inc(histogram[colour,col],1);{calculate histogram} @@ -2031,21 +1982,14 @@ end;{j} end; {i} - if colour=0 then his_total_red:=his_total - else - if colour=1 then his_total_green:=his_total - else - his_total_blue:=his_total; - his_mean[colour]:=round(total_value/count); - end; -procedure get_background(colour: integer; img :image_array;calc_hist, calc_noise_level: boolean; out background, starlevel: double); {get background and star level from peek histogram} +procedure get_background(colour: integer; img :image_array;calc_hist, calc_noise_level: boolean; out background, star_level, star_level2: double); {get background and star level from peek histogram} var - i, pixels,max_range,above,his_total, fitsX, fitsY,counter,stepsize,width5,height5, iterations : integer; - value,sd, sd_old : double; + i, pixels,max_range,above, fitsX, fitsY,counter,stepsize,width5,height5, iterations : integer; + value,sd, sd_old,factor,factor2 : double; begin if calc_hist then get_hist(colour,img);{get histogram of img_loaded and his_total} @@ -2071,34 +2015,12 @@ if calc_noise_level then {find star level and background noise level} begin - {calculate star level} - if ((nrbits=8) or (nrbits=24)) then max_range:= 255 else max_range:=65001 {histogram runs from 65000};{8 or 16 / -32 bit file} - i:=max_range; - starlevel:=0; - above:=0; - - if colour=1 then his_total:=his_total_green - else - if colour=2 then his_total:=his_total_blue - else - his_total:=his_total_red; - - while ((starlevel=0) and (i>background+1)) do {find star level 0.003 of values} - begin - dec(i); - above:=above+histogram[colour,i]; - if above>0.001*his_total then starlevel:=i; - end; - if starlevel<= background then starlevel:=background+1 {no or very few stars} - else - starlevel:=starlevel-background-1;{star level above background. Important subtract 1 for saturated images. Otherwise no stars are detected} - {calculate noise level} stepsize:=round(height2/71);{get about 71x71=5000 samples. So use only a fraction of the pixels} if odd(stepsize)=false then stepsize:=stepsize+1;{prevent problems with even raw OSC images} - width5:=Length(img[0]); {width} - height5:=Length(img[0][0]); {height} + width5:=Length(img[0,0]); {width} + height5:=Length(img[0]); {height} sd:=99999; iterations:=0; @@ -2111,7 +2033,7 @@ fitsY:=15; while fitsY<=height5-1-15 do begin - value:=img[colour,fitsX,fitsY]; + value:=img[colour,fitsY,fitsX]; if ((value<background*2) and (value<>0)) then {not an outlier, noise should be symmetrical so should be less then twice background} begin if ((iterations=0) or (abs(value-background)<=3*sd_old)) then {ignore outliers after first run} @@ -2128,6 +2050,38 @@ inc(iterations); until (((sd_old-sd)<0.05*sd) or (iterations>=7));{repeat until sd is stable or 7 iterations} noise_level[colour]:= round(sd); {this noise level is too high for long exposures and if no flat is applied. So for images where center is brighter then the corners.} + + + {calculate star level} + if ((nrbits=8) or (nrbits=24)) then max_range:= 255 else max_range:=65001 {histogram runs from 65000};{8 or 16 / -32 bit file} + i:=max_range; + star_level:=0; + star_level2:=0; + above:=0; + + factor:=6*max_stars;//emperical. Number of pixels to test. This produces about 700 stars at hfd=2.25. + factor2:=24*max_stars;//emperical. Number of pixels to test. This produces about 700 stars at hfd=4.5. + + while ((star_level=0) and (i>background+1)) do {Find star level. 0.001 of the flux is above star level. If there a no stars this should be all pixels with a value 3.09 * sigma (SD noise) above background} + begin + dec(i); + above:=above+histogram[colour,i];//sum pixels above pixel level i + if above>factor then star_level:=i; + end; + while ((star_level2=0) and (i>background+1)) do {Find star level. 0.001 of the flux is above star level. If there a no stars this should be all pixels with a value 3.09 * sigma (SD noise) above background} + begin + dec(i); + above:=above+histogram[colour,i];//sum pixels above pixel level i + if above>factor2 then star_level2:=i; + end; + + + // Clip calculated star level: + // 1) above 3.5*noise minimum, but also above background value when there is no noise so minimum is 1 + // 2) Below saturated level. So subtract 1 for saturated images. Otherwise no stars are detected} + star_level:=max(max(3.5*sd,1 {1}), star_level-background-1 {2) below saturation});//star_level is relative to background + star_level2:=max(max(3.5*sd,1 {1}), star_level2-background-1 {2) below saturation});//star_level is relative to background + end; end; @@ -2153,10 +2107,10 @@ x_frac :=frac(x1); y_frac :=frac(y1); try - result:= (img[0,x_trunc ,y_trunc ]) * (1-x_frac)*(1-y_frac);{pixel left top, 1} - result:=result + (img[0,x_trunc+1,y_trunc ]) * ( x_frac)*(1-y_frac);{pixel right top, 2} - result:=result + (img[0,x_trunc ,y_trunc+1]) * (1-x_frac)*( y_frac);{pixel left bottom, 3} - result:=result + (img[0,x_trunc+1,y_trunc+1]) * ( x_frac)*( y_frac);{pixel right bottom, 4} + result:= (img[0,y_trunc, x_trunc ]) * (1-x_frac)*(1-y_frac);{pixel left top, 1} + result:=result + (img[0,y_trunc+1,x_trunc ]) * ( x_frac)*(1-y_frac);{pixel right top, 2} + result:=result + (img[0,y_trunc ,x_trunc+1]) * (1-x_frac)*( y_frac);{pixel left bottom, 3} + result:=result + (img[0,y_trunc+1,x_trunc+1]) * ( x_frac)*( y_frac);{pixel right bottom, 4} except end; end; @@ -2182,7 +2136,7 @@ distance:=i*i+j*j; {working with sqr(distance) is faster then applying sqrt} if ((distance>r1_square) and (distance<=r2_square)) then {annulus, circular area outside rs, typical one pixel wide} begin - background[counter]:=img[0,x1+i,y1+j]; + background[counter]:=img[0,y1+j,x1+i]; //for testing: mainwindow.image1.canvas.pixels[x1+i,y1+j]:=$AAAAAA; inc(counter); end; @@ -2205,7 +2159,7 @@ for i:=-rs to rs do for j:=-rs to rs do begin - val:=(img[0,x1+i,y1+j])- bg; + val:=(img[0,y1+j,x1+i])- bg; if val>3.0*sd_bg then begin SumVal:=SumVal+val; @@ -2361,7 +2315,7 @@ procedure analyse_fits(img : image_array;snr_min:double;report:boolean;out star_counter : integer;out backgr, hfd_median : double); {find background, number of stars, median HFD} var - fitsX,fitsY,diam,i,j,retries,max_stars,m,n,xci,yci,sqr_diam : integer; + fitsX,fitsY,diam,i,j,retries,m,n,xci,yci,sqr_diam : integer; hfd1,star_fwhm,snr,flux,xc,yc,detection_level : double; hfd_list : array of double; img_sa : image_array; @@ -2370,17 +2324,24 @@ const len: integer=1000; begin - max_stars:=500; SetLength(hfd_list,len);{set array length to len} - get_background(0,img,true,true {calculate background and also star level end noise level},{var}backgr,star_level); + get_background(0,img,true,true {calculate background and also star level end noise level},{var}backgr,star_level,star_level2); - detection_level:=max(3.5*noise_level[0],star_level); {level above background. Start with a high value} - retries:=2; {try up to three times to get enough stars from the image} + retries:=3; {try up to four times to get enough stars from the image} if ((backgr<60000) and (backgr>8)) then {not an abnormal file} begin repeat {try three time to find enough stars} + if retries=3 then + begin if star_level >30*noise_level[0] then detection_level:=star_level else retries:=2;{skip} end;//stars are dominant + if retries=2 then + begin if star_level2>30*noise_level[0] then detection_level:=star_level2 else retries:=1;{skip} end;//stars are dominant + if retries=1 then + begin detection_level:=30*noise_level[0]; end; + if retries=0 then + begin detection_level:= 7*noise_level[0]; end; + star_counter:=0; if report then {write values to file} @@ -2390,16 +2351,16 @@ writeln(f,'x,y,hfd,snr,flux'); end; - setlength(img_sa,1,width2,height2);{set length of image array} + setlength(img_sa,1,height2,width2);{set length of image array} for fitsY:=0 to height2-1 do for fitsX:=0 to width2-1 do - img_sa[0,fitsX,fitsY]:=0;{mark as star free urveyed area} + img_sa[0,fitsY,fitsX]:=0;{mark as star free urveyed area} for fitsY:=0 to height2-1 do begin for fitsX:=0 to width2-1 do begin - if (( img_sa[0,fitsX,fitsY]<=0){star free area} and (img[0,fitsX,fitsY]-backgr>detection_level)) then {new star. For analyse used sigma is 5, so not too low.} + if (( img_sa[0,fitsY,fitsX]<=0){star free area} and (img[0,fitsY,fitsX]-backgr>detection_level)) then {new star. For analyse used sigma is 5, so not too low.} begin HFD(img,fitsX,fitsY,14{box size}, hfd1,star_fwhm,snr,flux,xc,yc);{star HFD and FWHM} if ((hfd1<=30) and (snr>snr_min) and (hfd1>0.8) {two pixels minimum} ) then @@ -2418,7 +2379,7 @@ j:=n+yci; i:=m+xci; if ((j>=0) and (i>=0) and (j<height2) and (i<width2) and ( (sqr(m)+sqr(n))<=sqr_diam)) then - img_sa[0,i,j]:=1; + img_sa[0,j,i]:=1; end; @@ -2434,10 +2395,7 @@ end; end; - dec(retries);{In principle not required. Try again with lower detection level} - if detection_level<=7*noise_level[0] then retries:= -1 {stop} - else - detection_level:=max(6.999*noise_level[0],min(30*noise_level[0],detection_level*6.999/30)); {very high -> 30 -> 7 -> stop. Or 60 -> 14 -> 7.0. Or for very short exposures 3.5 -> stop} + dec(retries);{Try again with lower detection level} if report then closefile(f); diff -Nru astap-cli-2022.12.09/unit_command_line_solving.pas astap-cli-2024.01.17/unit_command_line_solving.pas --- astap-cli-2022.12.09/unit_command_line_solving.pas 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/unit_command_line_solving.pas 2024-01-17 22:20:03.000000000 +0000 @@ -1,4 +1,101 @@ unit unit_command_line_solving; +{Copyright (C) 2017, 2024 by Han Kleijn, www.hnsky.org +email: han.k.. at...hnsky.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at https://mozilla.org/MPL/2.0/. } + + +{ASTAP is using a linear astrometric solution for both stacking and solving. The method is based on what traditionally is called "reducing the plate measurements. +First step is to find star matches between a test image and a reference image. The reference image is either created from a star database or a reference image. +The star positions x, y are to be calculated in standard coordinates which is equivalent to the x,y pixel position. The x,y position are measured relative to the image center. + +The test image center, size and orientation position will be different compared with the reference image. The required conversion from test image [x,y] star positions to the +same stars on the test images can be written as: + +Xref : = a*xtest + b*ytest + c +Yref:= d*xtest + e*ytest + f + +The factors, a,b,c,d,e,f are called the six plate constants and will be slightly different different for each star. They describe the conversion of the test image standard coordinates +to the reference image standard coordinates. Using a least square routine the best solution fit can calculated if at least three matching star positions are found since there are three unknowns. + +With the solution and the equatorial center position of the reference image the test image center equatorial position, α and δ can be calculated. + +Make from the test image center small one pixel steps in x, y and use the differences in α, δ to calculate the image scale and orientation. + +For astrometric solving (plate solving), this "reducing the plate measurement" is done against star positions extracted from a database. The resulting absolute astrometric solution +will allow specification of the α, δ equatorial positions of each pixel. For star alignment this "reducing the plate measurement" is done against a reference image. The resulting +six plate constants are a relative astrometric solution. The position of the reference image is not required. Pixels of the solved image can be stacked with reference image using +the six plate constants only. + +To automate this process rather then using reference stars the matching reference objects are the center positions of quads made of four close stars. Comparing the length ratios +of the sides of the quads allows automated matching. + +Below a brief flowchart of the ASTAP astrometric solving process: +} + +// =>ASTAP astronomical plate solving method by Han Kleijn <= +// +// => Image <= | => Star database <= +//1) Find background, noise and star level | +// | +//2) Find stars and their CCD x, y position (standard coordinates) | Extract the same amount of stars (area corrected) from the area of interest +// | Convert the α, δ equatorial coordinates into standard coordinates +// | (CCD pixel x,y coordinates for optical projection), rigid method +// +//3) Use the extracted stars to construct the smallest irregular tetrahedrons | Use the extracted stars to construct the smallest irregular tetrahedrons +// figures of four star called quads. Calculate the six distance between | figures of four star called quads. Calculate the six distance between +// the four stars and the mean x,y position of the quad | the four stars and the mean x,y position of the quad +// | +//4) For each quad sort the six quad distances. | For each quad sort the six quad distances. +// Label them all where d1 is the longest and d6 the shortest distance. | Label them all where d1 is the longest and d6 the shortest distance. +// | +//5) Scale the six quad star distances as (d1, d2/d1,d3/d1,d4/d1,d5/d1,d6/d1) | Scale the six quad star distances as (d1, d2/d1,d3/d1,d4/d1,d5/d1,d6/d1) +// These are the image hash codes. | These are the database hash codes. +// +// => matching process <= +//6) Find quad hash code matches where the five ratios d2/d1 to d6/d1 match within a small tolerance. +// +//7) For matching quad hash codes, calculate the longest side ratios d1_found/d1_reference. Calculate the median ratio. +// Compare the quads longest side ratios with the median value and remove quads outside a small tolerance. +// +//8) From the remaining matching quads, prepare the "A" matrix/array containing the x,y center positions of the test image quads in standard coordinates +// and the array X_ref, Y_ref containing the x, y center positions of the reference imagete trahedrons in standard coordinates. +// +// A: Sx: X_ref: +// [x1 y1 1] [a1] [X1] +// [x2 y2 1] * [b1] = [X2] +// [x3 y3 1] [c1] [X3] +// [x4 y4 1] [X4] +// [.. .. ..] [..] +// [xn yn 1] [Xn] +// +// +// A: Sx: Y_ref: +// [x1 y1 1] [a2] [Y1] +// [x2 y2 1] * [b2] = [Y2] +// [x3 y3 1] [c2] [Y3] +// [x4 y4 1] [Y4] +// [.. .. ..] [..] +// [xn yn 1] [Yn] +// +// Find the solution matrices Sx and Sy of this overdetermined system of linear equations. (LSQ_FIT) +// +// The solutions Sx and Sy describe the six parameter solution, X_ref:=a1*x + b1*y + c1 and Y_ref:=a2*x + b2*y +c2. +// +// +// With the solution calculate the test image center equatorial position α (crval1), δ (crval2). +// +// Calculate from the solution the pixel size in x (cdelt1) an y (cdelt2) and at the image center position the rotation of the x-axis (crota1) +// and y-axis (crota2) relative to the celestial north using goniometric formulas. Convert these to cd1_1,cd1_2,cd_2_1, cd2_2. +// +// This is the final solution. The solution vector (for position, scale, rotation) can be stored as the FITS keywords crval1, crval2, cd1_1,cd1_2,cd_2_1, cd2_2. +// +// Notes: +// For a low faint star count (<30) the star patterns can be slightly different between image and database due to small magnitude differences. +// For these cases it can be beneficial to extract triples (three stars patterns) from the found quads (four star patterns) but stricter tolerances are required to avoid false detections. + {$mode objfpc}{$H+} interface @@ -111,68 +208,73 @@ { Find the solution vector of an overdetermined system of linear equations according to the method of least squares using GIVENS rotations } { } { Solve x of A x = b with the least-squares method } -{ In matrix calculations, b_matrix[0..nr_equations-1,0..nr_columns-1]:=solution_vector[0..2] * A_XYpositions[0..nr_equations-1,0..nr_columns-1]} +{ In matrix calculations, b_matrix[0..nr_columns-1,0..nr_equations-1]:=solution_vector[0..2] * A_XYpositions[0..nr_columns-1,0..nr_equations-1]} { } { see also Montenbruck & Pfleger, Astronomy on the personal computer} -procedure lsq_fit( A_matrix: star_list; {[0..nr_equations-1, 0..3]} - b_matrix : array of double;{equations result, b=A*s} - var x_matrix: array of double ); +procedure lsq_fit( A_matrix: star_list; {[, 0..3,0..nr_equations-1]} b_matrix : array of double;{equations result, b=A*s} out x_matrix: solution_vector ); const tiny = 1E-10; {accuracy} var i,j,k, nr_equations,nr_columns : integer; p,q,h : double; temp_matrix : star_list; begin - nr_equations:=length(A_matrix); - nr_columns:=length(A_matrix[nr_equations-1]);{should be 3 for this application} + nr_equations:=length(A_matrix[0]); + nr_columns:=length(A_matrix);{should be 3 for this application} temp_matrix:=A_matrix; {In dynamic arrays, the assignment statement duplicates only the reference to the array, while SetLength does the job of physically copying/duplicating it, leaving two separate, independent dynamic arrays.} - setlength(temp_matrix,nr_equations,nr_columns);{duplicate A_matrix to protect data in A_matrix} + setlength(temp_matrix,nr_columns,nr_equations);{duplicate A_matrix to protect data in A_matrix} for j:=0 to nr_columns-1 do {loop over columns of temp_matrix} {eliminate matrix elements A[i,j] with i>j from column j} for i:=j+1 to nr_equations-1 do - if temp_matrix[i,j]<>0 then - begin{calculate p, q and new temp_matrix[j,j]; set temp_matrix[i,j]=0} - if abs(temp_matrix[j,j])<tiny*abs(temp_matrix[i,j]) then + if temp_matrix[j,i]<>0 then + begin{calculate p, q and new temp_matrix[j,j]; set temp_matrix[j,i]=0} + if abs(temp_matrix[j,j])<tiny*abs(temp_matrix[j,i]) then begin p:=0; q:=1; - temp_matrix[j,j]:=-temp_matrix[i,j]; + temp_matrix[j,j]:=-temp_matrix[j,i]; temp_matrix[i,i]:=0; + end else begin - h:=sqrt(temp_matrix[j,j]*temp_matrix[j,j]+temp_matrix[i,j]*temp_matrix[i,j]); + h:=sqrt(temp_matrix[j,j]*temp_matrix[j,j]+temp_matrix[j,i]*temp_matrix[j,i]); if temp_matrix[j,j]<0 then h:=-h; p:=temp_matrix[j,j]/h; - q:=-temp_matrix[i,j]/h; + q:=-temp_matrix[j,i]/h; temp_matrix[j,j]:=h; - temp_matrix[i,j]:=0; + temp_matrix[j,i]:=0; + end; {calculate the rest of the line} for k:=j+1 to nr_columns-1 do begin - h:= p*temp_matrix[j,k] - q*temp_matrix[i,k]; - temp_matrix[i,k] := q*temp_matrix[j,k] + p*temp_matrix[i,k]; - temp_matrix[j,k] := h; + h:= p*temp_matrix[k,j] - q*temp_matrix[k,i]; + temp_matrix[k,i] := q*temp_matrix[k,j] + p*temp_matrix[k,i]; + temp_matrix[k,j] := h; end; h:= p*b_matrix[j] - q*b_matrix[i]; b_matrix[i] := q*b_matrix[j] + p*b_matrix[i]; b_matrix[j] := h; end; + for i:=0 to nr_columns-1 do x_matrix[i]:=0; //2022, extra precaution to zero x_matrix + for i:= nr_columns-1 downto 0 do {back substitution} begin H:=b_matrix[i]; - for k:=i+1 to nr_columns-1 do h:=h-temp_matrix[i,k]*x_matrix[k]; - x_matrix[i] := h/temp_matrix[i,i]; + for k:=i+1 to nr_columns-1 do + h:=h-temp_matrix[k,i]*x_matrix[k]; + if temp_matrix[i,i]<>0 then x_matrix[i] := h/temp_matrix[i,i] + else + x_matrix[i]:=9999999999999999; //v2022. Prevent runtime error dividing by zero. Should normally not happen. In case of zero due to wrong double star detection by using triples force a failure + {solution vector x:=x_matrix[0]x+x_matrix[1]y+x_matrix[2]} end; end; {lsq_fit} - procedure QuickSort_starlist(var A: star_list; iLo, iHi: Integer) ;{ Fast quick sort. Sorts elements in the array list with indices between lo and hi, sort in X only} var Lo, Hi : integer; @@ -434,21 +536,21 @@ if (nr_references>=3) then {use 3 quads center position} begin {fill equations} - setlength(A_XYpositions,nr_references,3); + setlength(A_XYpositions,3,nr_references); setlength(b_Xrefpositions,nr_references); setlength(b_Yrefpositions,nr_references); for k:=0 to nr_references-1 do begin - A_XYpositions[k,0]:=quad_star_distances2[6,matchlist1[1,k]]; {average x position of quad} - A_XYpositions[k,1]:=quad_star_distances2[7,matchlist1[1,k]]; {average y position of quad} - A_XYpositions[k,2]:=1; + A_XYpositions[0,k]:=quad_star_distances2[6,matchlist1[1,k]]; {average x position of quad} + A_XYpositions[1,k]:=quad_star_distances2[7,matchlist1[1,k]]; {average y position of quad} + A_XYpositions[2,k]:=1; b_Xrefpositions[k]:=quad_star_distances1[6,matchlist1[0,k]]; {x position of ref quad} b_Yrefpositions[k]:=quad_star_distances1[7,matchlist1[0,k]]; {Y position of ref quad} - {in matrix calculations, b_refpositionX[0..nr_equations-1,0..2]:=solution_vectorX[0..2] * A_XYpositions[0..nr_equations-1,0..2]} - { b_refpositionY[0..nr_equations-1,0..2]:=solution_matrixY[0..2] * A_XYpositions[0..nr_equations-1,0..2]} + {in matrix calculations, b_refpositionX[0..2,0..nr_equations-1]:=solution_vectorX[0..2] * A_XYpositions[0..2,0..nr_equations-1]} + { b_refpositionY[0..2,0..nr_equations-1]:=solution_matrixY[0..2] * A_XYpositions[0..2,0..nr_equations-1]} end; result:=true;{3 or more references} end; @@ -510,73 +612,43 @@ hfd1,star_fwhm,snr,xc,yc,highest_snr,flux, detection_level : double; img_sa : image_array; snr_list : array of double; - -// flip_vertical,flip_horizontal : boolean; -// starX,starY :integer; startTick2 : qword;{for timing/speed purposes} const buffersize=5000;{5000} begin - {for testing} -// mainwindow.image1.Canvas.Pen.Mode := pmMerge; -// mainwindow.image1.Canvas.Pen.width := round(1+height2/mainwindow.image1.height);{thickness lines} -// mainwindow.image1.Canvas.brush.Style:=bsClear; -// mainwindow.image1.Canvas.font.color:=$FF; -// mainwindow.image1.Canvas.font.size:=10; -// mainwindow.image1.Canvas.Pen.Color := $FF; -// flip_vertical:=mainwindow.flip_vertical1.Checked; -// flip_horizontal:=mainwindow.Flip_horizontal1.Checked; - - // hfd_min:=4; - - -// max_stars:=strtoint(stackmenu1.max_stars1.text);{maximum star to process, if so filter out brightest stars later} -// solve_show_log:=stackmenu1.solve_show_log1.Checked;{show details, global variable} -// if solve_show_log then begin memo2_message('Start finding stars'); startTick2 := gettickcount64;end; - -// max_stars:=strtoint(max_stars1);{maximum star to process, if so filter out brightest stars later} if solve_show_log then begin memo2_message('Start finding stars'); startTick2 := gettickcount64;end; SetLength(starlist1,2,buffersize);{set array length} setlength(snr_list,buffersize);{set array length} + setlength(img_sa,1,height2,width2);{set length of image array} - -// SetLength(starlist1,2,buffersize);{set array length} -// setlength(snr_list,buffersize);{set array length} - - setlength(img_sa,1,width2,height2);{set length of image array} - - detection_level:=max(3.5*noise_level[0],star_level); {level above background. Start with a high value} - retries:=2; {try up to three times to get enough stars from the image} + retries:=3; {try up to four times to get enough stars from the image} repeat + if retries=3 then + begin if star_level >30*noise_level[0] then detection_level:=star_level else retries:=2;{skip} end;//stars are dominant + if retries=2 then + begin if star_level2>30*noise_level[0] then detection_level:=star_level2 else retries:=1;{skip} end;//stars are dominant + if retries=1 then + begin detection_level:=30*noise_level[0]; end; + if retries=0 then + begin detection_level:= 7*noise_level[0]; end; + highest_snr:=0; nrstars:=0;{set counters at zero} for fitsY:=0 to height2-1 do for fitsX:=0 to width2-1 do - img_sa[0,fitsX,fitsY]:=-1;{mark as star free area} + img_sa[0,fitsY,fitsX]:=-1;{mark as star free area} for fitsY:=0 to height2-1-1 do begin for fitsX:=0 to width2-1-1 do begin - if (( img_sa[0,fitsX,fitsY]<=0){star free area} and (img[0,fitsX,fitsY]-cblack>detection_level){star}) then {new star, at least 3.5 * sigma above noise level} + if (( img_sa[0,fitsY,fitsX]<=0){star free area} and (img[0,fitsY,fitsX]-cblack>detection_level){star}) then {new star, at least 3.5 * sigma above noise level} begin HFD(img,fitsX,fitsY,14{annulus radius}, hfd1,star_fwhm,snr,flux,xc,yc);{star HFD and FWHM} if ((hfd1<=10) and (snr>10) and (hfd1>hfd_min) {0.8 is two pixels minimum} ) then - -// HFD(img,fitsX,fitsY,14{box size}, hfd1,star_fwhm,snr,flux,xc,yc);{star HFD and FWHM} -// if ((hfd1<=10) and (snr>10) and (hfd1>hfd_min) {0.8 is two pixels minimum} ) then - begin - {for testing} - // if flip_vertical=false then starY:=round(height2-yc) else starY:=round(yc); - // if flip_horizontal=true then starX:=round(width2-xc) else starX:=round(xc); - // size:=round(5*hfd1); - // mainwindow.image1.Canvas.Rectangle(starX-size,starY-size, starX+size, starY+size);{indicate hfd with rectangle} - // mainwindow.image1.Canvas.textout(starX+size,starY+size,floattostrf(hfd1, ffgeneral, 2,1));{add hfd as text} - // mainwindow.image1.Canvas.textout(starX+size,starY+size,floattostrf(snr, ffgeneral, 2,1));{add hfd as text} - radius:=round(3.0*hfd1);{for marking star area. A value between 2.5*hfd and 3.5*hfd gives same performance. Note in practice a star PSF has larger wings then predicted by a Gaussian function} sqr_radius:=sqr(radius); xci:=round(xc);{star center as integer} @@ -587,7 +659,7 @@ j:=n+yci; i:=m+xci; if ((j>=0) and (i>=0) and (j<height2) and (i<width2) and (sqr(m)+sqr(n)<=sqr_radius)) then - img_sa[0,i,j]:=1; + img_sa[0,j,i]:=1; end; {store values} @@ -610,11 +682,7 @@ if solve_show_log then memo2_message(inttostr(nrstars)+' stars found of the requested '+inttostr(max_stars)+'. Background value is '+inttostr(round(cblack))+ '. Detection level used '+inttostr( round(detection_level)) +' above background. Star level is '+inttostr(round(star_level))+' above background. Noise level is '+floattostrF(noise_level[0],ffFixed,0,0)); - dec(retries);{In principle not required. Try again with lower detection level} - if detection_level<=7*noise_level[0] then retries:= -1 {stop} - else - detection_level:=max(6.999*noise_level[0],min(30*noise_level[0],detection_level*6.999/30)); {very high -> 30 -> 7 -> stop. Or 60 -> 14 -> 7.0. Or for very short exposures 3.5 -> stop} - + dec(retries);{Try again with lower detection level} until ((nrstars>=max_stars) or (retries<0));{reduce dection level till enough stars are found. Note that faint stars have less positional accuracy} img_sa:=nil;{free mem} @@ -654,17 +722,16 @@ end; result:=true;{2 quads are required giving 8 star references or 3 quads giving 3 center quad references} - {in matrix calculations, b_refpositionX[0..nr_equations-1,0..2]:=solution_vectorX[0..2] * A_XYpositions[0..nr_equations-1,0..2]} - { b_refpositionY[0..nr_equations-1,0..2]:=solution_vectorY[0..2] * A_XYpositions[0..nr_equations-1,0..2]} + {in matrix calculations, b_refpositionX[0..2,0..nr_equations-1]:=solution_vectorX[0..2] * A_XYpositions[0..2,0..nr_equations-1]} + { b_refpositionY[0..2,0..nr_equations-1]:=solution_matrixY[0..2] * A_XYpositions[0..2,0..nr_equations-1]} {find solution vector for X:=ax+by+c / b_Xref:=solution[0]x+solution[1]y+solution[2]} - lsq_fit( A_XYpositions {[0..nr_equations-1, 0..2]},b_Xrefpositions, solution_vectorX {[0..2]} ); + lsq_fit( A_XYpositions {[0..2,0..nr_equations-1]},b_Xrefpositions, solution_vectorX {[0..2]} ); {find solution vector for Y:=ax+by+c / b_Yref:=solution[0]x+solution[1]y+solution[2]} - lsq_fit( A_XYpositions {[0..nr_equations-1, 0..2]},b_Yrefpositions, solution_vectorY {[0..2]} ); + lsq_fit( A_XYpositions {0..2,[0..nr_equations-1]},b_Yrefpositions, solution_vectorY {[0..2]}); - - xy_sqr_ratio:=(sqr(solution_vectorX[0])+sqr(solution_vectorX[1]) ) / (0.00000001+ sqr(solution_vectorY[0])+sqr(solution_vectorY[1]) ); + xy_sqr_ratio:=(sqr(solution_vectorX[0])+sqr(solution_vectorX[1]) ) / (0.00000001+ sqr(solution_vectorY[0])+sqr(solution_vectorY[1]) ); if ((xy_sqr_ratio<0.9) or (xy_sqr_ratio>1.1)) then {dimensions x, y are not the same, something wrong.} begin @@ -702,6 +769,30 @@ result:= floattostrF2(inp*180/pi,0,1)+'d'; end; + +function position_angle(ra1,dec1,ra0,dec0 : double): double;//Position angle between a line from ra0,dec0 to ra1,dec1 and a line from ra0, dec0 to the celestial north . Rigorous method +//See book Meeus, Astronomical Algorithms, formula 46.5 edition 1991 or 48.5 edition 1998, angle of moon limb or page 116 edition 1998. +//See also https://astronomy.stackexchange.com/questions/25306/measuring-misalignment-between-two-positions-on-sky +// PA=arctan2(cos(δ0)sin(α1−α0), sin(δ1)cos(δ0)−sin(δ0)cos(δ1)cos(α1−α0)) In lazarus the function is arctan2(y/x) +// is seen at point α0,δ0. This means you are calculating the angle at point α0,δ0 (the reference point) towards point α1,δ1 (the target point). +// To clarify: +// Point α0,δ0 (Reference Point): This is where the observation is made from, or the point of reference. +// Point α1,δ1 (Target Point): This is the point towards which the position angle is being measured. +// Position Angle (PA): This is the angle measured at the reference point α0,δ0, going from the direction of the North Celestial Pole towards the target point α1,δ1, measured eastward (or counter-clockwise). +// So in your observational scenario, if you were at point α0,δ0 and wanted to determine the direction to point α1,δ1, the PA would tell you the angle to rotate from the north, moving eastward, to align with the target point. + +var + sinDeltaRa,cosDeltaRa, + sinDec0,cosDec0, + sinDec1,cosDec1 : double; +begin + sincos(ra1-ra0,sinDeltaRa,cosDeltaRa); + sincos(dec0,sinDec0,cosDec0); + sincos(dec1,sinDec1,cosDec1); + result:=arctan2(cosDec1*sinDeltaRa,sinDec1*cosDec0 - cosDec1*sinDec0*cosDeltaRa); +end; + + {transformation of equatorial coordinates into CCD pixel coordinates for optical projection, rigid method} {ra0,dec0: right ascension and declination of the optical axis} {ra,dec: right ascension and declination} @@ -872,8 +963,8 @@ oddx, oddy :boolean; begin col:=length(img);{the real number of colours} - h:=length(img[0,0]);{height} - w:=length(img[0]);{width} + h:=length(img[0]);{height} + w:=length(img[0,0]);{width} if col>1 then begin @@ -891,10 +982,10 @@ begin oddX:=odd(fitsX); oddY:=odd(fitsY); - if ((oddX=false) and (oddY=false)) then begin value1:=value1+img[0,fitsX,fitsY]; inc(counter1) end else {separate counters for case odd() dimensions are used} - if ((oddX=true) and (oddY=false)) then begin value2:=value2+img[0,fitsX,fitsY]; inc(counter2) end else - if ((oddX=false) and (oddY=true)) then begin value3:=value3+img[0,fitsX,fitsY]; inc(counter3) end else - if ((oddX=true) and (oddY=true)) then begin value4:=value4+img[0,fitsX,fitsY]; inc(counter4) end; + if ((oddX=false) and (oddY=false)) then begin value1:=value1+img[0,fitsY,fitsX]; inc(counter1) end else {separate counters for case odd() dimensions are used} + if ((oddX=true) and (oddY=false)) then begin value2:=value2+img[0,fitsY,fitsX]; inc(counter2) end else + if ((oddX=false) and (oddY=true)) then begin value3:=value3+img[0,fitsY,fitsX]; inc(counter3) end else + if ((oddX=true) and (oddY=true)) then begin value4:=value4+img[0,fitsY,fitsX]; inc(counter4) end; end; {now normalise the bayer pattern pixels} @@ -913,10 +1004,10 @@ begin oddX:=odd(fitsX); oddY:=odd(fitsY); - if ((value1<>1) and (oddX=false) and (oddY=false)) then img[0,fitsX,fitsY]:=round(img[0,fitsX,fitsY]*value1) else - if ((value2<>1) and (oddX=true) and (oddY=false)) then img[0,fitsX,fitsY]:=round(img[0,fitsX,fitsY]*value2) else - if ((value3<>1) and (oddX=false) and (oddY=true)) then img[0,fitsX,fitsY]:=round(img[0,fitsX,fitsY]*value3) else - if ((value4<>1) and (oddX=true) and (oddY=true)) then img[0,fitsX,fitsY]:=round(img[0,fitsX,fitsY]*value4); + if ((value1<>1) and (oddX=false) and (oddY=false)) then img[0,fitsY,fitsX]:=round(img[0,fitsY,fitsX]*value1) else + if ((value2<>1) and (oddX=true) and (oddY=false)) then img[0,fitsY,fitsX]:=round(img[0,fitsY,fitsX]*value2) else + if ((value3<>1) and (oddX=false) and (oddY=true)) then img[0,fitsY,fitsX]:=round(img[0,fitsY,fitsX]*value3) else + if ((value4<>1) and (oddX=true) and (oddY=true)) then img[0,fitsY,fitsX]:=round(img[0,fitsY,fitsX]*value4); end; end; @@ -928,7 +1019,7 @@ w:=trunc(crop*width2); {cropped} h:=trunc(crop*height2); - setlength(img2,1,w,h); {set length of image array} + setlength(img2,1,h,w); {set length of image array} shiftX:=round(width2*(1-crop)/2); {crop is 0.9, shift is 0.05*width2} shiftY:=round(height2*(1-crop)/2); {crop is 0.9, start at 0.05*height2} @@ -938,8 +1029,8 @@ begin val:=0; for k:=0 to naxis3-1 do {all colors and make mono} - val:=val + img[k,shiftX+fitsx ,shiftY+fitsY]; - img2[0,fitsX,fitsY]:=val/naxis3; + val:=val + img[k,shiftY+fitsY ,shiftX+fitsX]; + img2[0,fitsY,fitsX]:=val/naxis3; end; width2:=w; height2:=h; @@ -952,13 +1043,13 @@ val : single; begin nrcolors:=Length(img); - width5:=Length(img[0]); {width} - height5:=Length(img[0][0]); {height} + width5:=Length(img[0,0]); {width} + height5:=Length(img[0]); {height} w:=trunc(crop*width5/2); {half size & cropped. Use trunc for image 1391 pixels wide like M27 test image. Otherwise exception error} h:=trunc(crop*height5/2); - setlength(img2,1,w,h); {set length of image array} + setlength(img2,1,h,w);{set length of image array} shiftX:=round(width5*(1-crop)/2); {crop is 0.9, shift is 0.05*width2} shiftY:=round(height5*(1-crop)/2); {crop is 0.9, start at 0.05*height2} @@ -968,11 +1059,11 @@ begin val:=0; for k:=0 to nrcolors-1 do {all colors} - val:=val+(img[k,shiftX+fitsx*2 ,shiftY+fitsY*2]+ - img[k,shiftX+fitsx*2 +1,shiftY+fitsY*2]+ - img[k,shiftX+fitsx*2 ,shiftY+fitsY*2+1]+ - img[k,shiftX+fitsx*2 +1,shiftY+fitsY*2+1])/4; - img2[0,fitsX,fitsY]:=val/nrcolors; + val:=val+(img[k,shiftY+fitsY*2 ,shiftX+fitsX*2]+ + img[k,shiftY+fitsy*2 +1,shiftX+fitsX*2]+ + img[k,shiftY+fitsy*2 ,shiftX+fitsX*2+1]+ + img[k,shiftY+fitsy*2 +1,shiftX+fitsX*2+1])/4; + img2[0,fitsY,fitsX]:=val/nrcolors; end; width2:=w; @@ -985,13 +1076,13 @@ val : single; begin nrcolors:=Length(img); - width5:=Length(img[0]); {width} - height5:=Length(img[0][0]); {height} + width5:=Length(img[0,0]); {width} + height5:=Length(img[0]); {height} w:=trunc(crop*width5/3); {1/3 size and cropped} h:=trunc(crop*height5/3); - setlength(img2,1,w,h); {set length of image array} + setlength(img2,1,h,w); {set length of image array} shiftX:=round(width5*(1-crop)/2); {crop is 0.9, shift is 0.05*width2} shiftY:=round(height5*(1-crop)/2); {crop is 0.9, start at 0.05*height2} @@ -1001,16 +1092,16 @@ begin val:=0; for k:=0 to nrcolors-1 do {all colors} - val:=val+(img[k,shiftX+fitsX*3 ,shiftY+fitsY*3 ]+ - img[k,shiftX+fitsX*3 ,shiftY+fitsY*3+1]+ - img[k,shiftX+fitsX*3 ,shiftY+fitsY*3+2]+ - img[k,shiftX+fitsX*3 +1,shiftY+fitsY*3 ]+ - img[k,shiftX+fitsX*3 +1,shiftY+fitsY*3+1]+ - img[k,shiftX+fitsX*3 +1,shiftY+fitsY*3+2]+ - img[k,shiftX+fitsX*3 +2,shiftY+fitsY*3 ]+ - img[k,shiftX+fitsX*3 +2,shiftY+fitsY*3+1]+ - img[k,shiftX+fitsX*3 +2,shiftY+fitsY*3+2])/9; - img2[0,fitsX,fitsY]:=val/nrcolors; + val:=val+(img[k,shiftY+fitsY*3 ,shiftX+fitsX*3 ]+ + img[k,shiftY+fitsY*3 ,shiftX+fitsX*3+1]+ + img[k,shiftY+fitsY*3 ,shiftX+fitsX*3+2]+ + img[k,shiftY+fitsY*3 +1,shiftX+fitsX*3 ]+ + img[k,shiftY+fitsY*3 +1,shiftX+fitsX*3+1]+ + img[k,shiftY+fitsY*3 +1,shiftX+fitsX*3+2]+ + img[k,shiftY+fitsY*3 +2,shiftX+fitsX*3 ]+ + img[k,shiftY+fitsY*3 +2,shiftX+fitsX*3+1]+ + img[k,shiftY+fitsY*3 +2,shiftX+fitsX*3+2])/9; + img2[0,fitsY,fitsX]:=val/nrcolors; end; width2:=w; height2:=h; @@ -1023,13 +1114,13 @@ val : single; begin nrcolors:=Length(img); - width5:=Length(img[0]); {width} - height5:=Length(img[0][0]); {height} + width5:=Length(img[0,0]); {width} + height5:=Length(img[0]); {height} w:=trunc(crop*width5/4); {1/4 size and cropped} h:=trunc(crop*height5/4); - setlength(img2,1,w,h); {set length of image array} + setlength(img2,1,h,w); {set length of image array} shiftX:=round(width5*(1-crop)/2); {crop is 0.9, shift is 0.05*width2} shiftY:=round(height5*(1-crop)/2); {crop is 0.9, start at 0.05*height2} @@ -1039,23 +1130,23 @@ begin val:=0; for k:=0 to nrcolors-1 do {all colors} - val:=val+(img[k,shiftX+fitsX*4 ,shiftY+fitsY*4 ]+ - img[k,shiftX+fitsX*4 ,shiftY+fitsY*4+1]+ - img[k,shiftX+fitsX*4 ,shiftY+fitsY*4+2]+ - img[k,shiftX+fitsX*4 ,shiftY+fitsY*4+3]+ - img[k,shiftX+fitsX*4 +1,shiftY+fitsY*4 ]+ - img[k,shiftX+fitsX*4 +1,shiftY+fitsY*4+1]+ - img[k,shiftX+fitsX*4 +1,shiftY+fitsY*4+2]+ - img[k,shiftX+fitsX*4 +1,shiftY+fitsY*4+3]+ - img[k,shiftX+fitsX*4 +2,shiftY+fitsY*4 ]+ - img[k,shiftX+fitsX*4 +2,shiftY+fitsY*4+1]+ - img[k,shiftX+fitsX*4 +2,shiftY+fitsY*4+2]+ - img[k,shiftX+fitsX*4 +2,shiftY+fitsY*4+3]+ - img[k,shiftX+fitsX*4 +3,shiftY+fitsY*4 ]+ - img[k,shiftX+fitsX*4 +3,shiftY+fitsY*4+1]+ - img[k,shiftX+fitsX*4 +3,shiftY+fitsY*4+2]+ - img[k,shiftX+fitsX*4 +3,shiftY+fitsY*4+3])/16; - img2[0,fitsX,fitsY]:=val/nrcolors; + val:=val+(img[k,shiftY+fitsY*4 ,shiftX+fitsX*4 ]+ + img[k,shiftY+fitsY*4 ,shiftX+fitsX*4+1]+ + img[k,shiftY+fitsY*4 ,shiftX+fitsX*4+2]+ + img[k,shiftY+fitsY*4 ,shiftX+fitsX*4+3]+ + img[k,shiftY+fitsY*4 +1,shiftX+fitsX*4 ]+ + img[k,shiftY+fitsY*4 +1,shiftX+fitsX*4+1]+ + img[k,shiftY+fitsY*4 +1,shiftX+fitsX*4+2]+ + img[k,shiftY+fitsY*4 +1,shiftX+fitsX*4+3]+ + img[k,shiftY+fitsY*4 +2,shiftX+fitsX*4 ]+ + img[k,shiftY+fitsY*4 +2,shiftX+fitsX*4+1]+ + img[k,shiftY+fitsY*4 +2,shiftX+fitsX*4+2]+ + img[k,shiftY+fitsY*4 +2,shiftX+fitsX*4+3]+ + img[k,shiftY+fitsY*4 +3,shiftX+fitsX*4 ]+ + img[k,shiftY+fitsY*4 +3,shiftX+fitsX*4+1]+ + img[k,shiftY+fitsY*4 +3,shiftX+fitsX*4+2]+ + img[k,shiftY+fitsY*4 +3,shiftX+fitsX*4+3])/16; + img2[0,fitsY,fitsX]:=val/nrcolors; end; width2:=w; height2:=h; @@ -1093,7 +1184,7 @@ // plot_fits(mainwindow.image1,true);{plot real} // exit; - get_background(0,img_binned,true {load hist},true {calculate also standard deviation background},{var}cblack,star_level );{get back ground} + get_background(0,img_binned,true {load hist},true {calculate also standard deviation background},{var}cblack,star_level,star_level2 );{get back ground} find_stars(img_binned,hfd_min,starlist3); {find stars of the image and put them in a list} img_binned:=nil; nrstars:=Length(starlist3[0]); @@ -1128,7 +1219,7 @@ memo2_message('█ █ █ █ █ █ Warning, small image dimensions!!'); end; - get_background(0,img,get_hist {load hist},true {calculate also standard deviation background}, {var} cblack,star_level);{get back ground} + get_background(0,img,get_hist {load hist},true {calculate also standard deviation background}, {var} cblack,star_level,star_level2);{get back ground} find_stars(img,hfd_min,starlist3); {find stars of the image and put them in a list} end; end; @@ -1149,11 +1240,11 @@ function solve_image(img :image_array) : boolean;{find match between image and star database} var nrstars,nrstars_required,count,max_distance,nr_quads, minimum_quads,database_stars,binning,match_nr, - spiral_x, spiral_y, spiral_dx, spiral_dy,spiral_t : integer; - search_field,step_size,telescope_ra,telescope_dec,telescope_ra_offset,radius,fov2,fov_org, max_fov,fov_min, + spiral_x, spiral_y, spiral_dx, spiral_dy,spiral_t,database_density,limit,err : integer; + search_field,step_size,ra_database,dec_database,telescope_ra_offset,radius,fov2,fov_org, max_fov,fov_min, oversize,sep_search,seperation,ra7,dec7,centerX,centerY,cropping, min_star_size_arcsec,hfd_min,delta_ra,current_dist, - quad_tolerance,dummy, extrastars,flip,extra,distance : double; - solution, go_ahead ,autoFOV,autoMaxstars : boolean; + quad_tolerance,dummy, extrastars,flip,extra,distance,flipped_image : double; + solution, go_ahead ,autoFOV : boolean; startTick : qword;{for timing/speed purposes} distancestr,oversize_mess,mess,suggest_str, warning_downsample, solved_in, offset_found,ra_offset,dec_offset,mount_info,mount_offset : string; @@ -1172,7 +1263,7 @@ if select_star_database(star_database1,fov_org)=false then {select database prior to cropping selection} begin result:=false; - memo2_message('Error, no star database found at '+database_path+' ! Download the h18 (or h17, v17) and install.'); + memo2_message('Error, no star database found at '+database_path+' ! Download and install a star database.'); errorlevel:=32;{no star database} exit; end @@ -1185,7 +1276,7 @@ warning_str:=warning_str+'Wide field image, use W08 database! ' else if ((fov_org>6) and (database_type=1476)) then - warning_str:=warning_str+'Large FOV, use V17 or G17 database! '; + warning_str:=warning_str+'Large FOV, use G05 database! '; if warning_str<>'' then memo2_message(warning_str); end; @@ -1207,220 +1298,222 @@ min_star_size_arcsec:=strtofloat2(min_star_size1); {arc sec}; autoFOV:=(fov_org=0);{specified auto FOV} - if max_stars=0 then - begin - autoMaxstars:=true;{try several values of max stars} - max_stars:=30; {will be doubled to 60 in the beginning} - end - else autoMaxstars:=false; + if max_stars=0 then max_stars:=500;// temporary. Remove in 2024; - repeat {auto max star loop} - if autoMaxstars then + val(copy(name_database,2,2),database_density,err); + if ((err<>0) or + (database_density=17) or (database_density=18)) then //old databases V17, G17, G18, H17, H18 + database_density:=9999 + else + database_density:=database_density*100; + + repeat {autoFOV loop} + if autoFOV then begin - max_stars:=max_stars*2;{try with 60, 120, 240, 480 stars max} - memo2_message('Solving with '+inttostr(max_stars)+' stars maximum.'); - end; - repeat {autoFOV loop} - if autoFOV then + if fov_org=0 then begin - if fov_org=0 then + if database_type<>001 then begin - if database_type<>001 then - begin - fov_org:=9.5; - fov_min:=0.38; - end - else - begin - fov_org:=90; - fov_min:=12; - end + fov_org:=9.5; + fov_min:=0.38; + end + else + begin + fov_org:=90; + fov_min:=12; end - else fov_org:=fov_org/1.5; - memo2_message('Trying FOV: '+floattostrF(fov_org,ffFixed,0,1)); - end; - if fov_org>max_fov then - begin - cropping:=max_fov/fov_org; - fov2:=max_fov; {temporary cropped image, adjust FOV to adapt} end - else - begin - cropping:=1; - fov2:=fov_org; - end; + else fov_org:=fov_org/1.5; + memo2_message('Trying FOV: '+floattostrF(fov_org,ffFixed,0,1)); + end; + if fov_org>max_fov then + begin + cropping:=max_fov/fov_org; + fov2:=max_fov; {temporary cropped image, adjust FOV to adapt} + end + else + begin + cropping:=1; + fov2:=fov_org; + end; + + limit:=round(database_density*sqr(fov2)*width2/height2);//limit in stars per square degree. limit=density*surface_full_image + if limit<max_stars then + begin + max_stars:=limit;//reduce the number of stars to use. + memo2_message('Database limit for this FOV is '+inttostr(max_stars)+' stars.'); + end; - binning:=report_binning(height2*max_fov/max(fov_org{could be zero},max_fov)); {select binning on dimensions of cropped image only} - hfd_min:=max(0.8,min_star_size_arcsec/(binning*fov_org*3600/height2) );{to ignore hot pixels which are too small} - bin_and_find_stars(img,binning,cropping,hfd_min,true{update hist}, starlist2, warning_downsample);{bin, measure background, find stars. Do this every repeat since hfd_min is adapted} - nrstars:=Length(starlist2[0]); - - {prepare popupnotifier1 text} - if force_oversize1=false then mess:=' normal' else mess:=' slow'; - memo2_message('ASTAP solver version CLI-'+astap_version+#10+ - 'Search radius: '+ radius_search1+' degrees, '+#10+ - 'Start position: '+prepare_ra(ra0,': ')+', '+prepare_dec(dec0,'d ')+#10+ - 'Image height: '+floattostrf2(fov_org,0,2)+' degrees'+#10+ - 'Binning: '+inttostr(binning)+'x'+inttostr(binning)+#10+ - 'Image dimensions: '+inttostr(width2)+'x'+inttostr(height2)+#10+ - 'Quad tolerance: '+quad_tolerance1+#10+ - 'Minimum star size: '+min_star_size1+'"' +#10+ - 'Speed:'+mess); + binning:=report_binning(height2*max_fov/max(fov_org{could be zero},max_fov)); {select binning on dimensions of cropped image only} + hfd_min:=max(0.8,min_star_size_arcsec/(binning*fov_org*3600/height2) );{to ignore hot pixels which are too small} + bin_and_find_stars(img,binning,cropping,hfd_min,true{update hist}, starlist2, warning_downsample);{bin, measure background, find stars. Do this every repeat since hfd_min is adapted} + nrstars:=Length(starlist2[0]); - nrstars_required:=round(nrstars*(height2/width2));{square search field based on height.} + {prepare popupnotifier1 text} + if force_oversize1=false then mess:=' normal' else mess:=' slow'; + memo2_message('ASTAP solver version CLI-'+astap_version+#10+ + 'Search radius: '+ radius_search1+' degrees, '+#10+ + 'Start position: '+prepare_ra(ra0,': ')+', '+prepare_dec(dec0,'d ')+#10+ + 'Image height: '+floattostrf2(fov_org,0,2)+' degrees'+#10+ + 'Binning: '+inttostr(binning)+'x'+inttostr(binning)+#10+ + 'Image dimensions: '+inttostr(width2)+'x'+inttostr(height2)+#10+ + 'Quad tolerance: '+quad_tolerance1+#10+ + 'Minimum star size: '+min_star_size1+'"' +#10+ + 'Speed:'+mess); - solution:=false; {assume no match is found} - go_ahead:=(nrstars>=6); {bare minimum for three quads} + nrstars_required:=round(nrstars*(height2/width2));{square search field based on height.} - if go_ahead then {enough stars, lets find quads} - begin - find_quads(starlist2,0 {min length}, quad_smallest,quad_star_distances2);{find star quads for new image. Quads and quad_smallest are binning independend} - nr_quads:=Length(quad_star_distances2[0]); - go_ahead:=nr_quads>=3; {enough quads?} + solution:=false; {assume no match is found} + go_ahead:=(nrstars>=6); {bare minimum for three quads} - {The step size is fixed. If a low amount of quads are detected, the search window (so the database read area) is increased up to 200% guaranteeing that all quads of the image are compared with the database quads while stepping through the sky} - if nr_quads<25 then oversize:=2 {make dimensions of square search window twice then the image height} - else - if nr_quads>100 then oversize:=1 {make dimensions of square search window equal to the image height} - else - oversize:=2*sqrt(25/nr_quads);{calculate between 25 th=2 and 100 th=1, quads are area related so take sqrt to get oversize} + if go_ahead then {enough stars, lets find quads} + begin + find_quads(starlist2,0 {min length}, quad_smallest,quad_star_distances2);{find star quads for new image. Quads and quad_smallest are binning independend} + nr_quads:=Length(quad_star_distances2[0]); + go_ahead:=nr_quads>=3; {enough quads?} - if force_oversize1 then - begin - oversize:=2; - oversize_mess:='Search window at 200%' - end - else - oversize_mess:='Search window at '+ inttostr(round((oversize)*100)) +'% based on the number of quads. Step size at 100% of image height'; + {The step size is fixed. If a low amount of quads are detected, the search window (so the database read area) is increased up to 200% guaranteeing that all quads of the image are compared with the database quads while stepping through the sky} + if nr_quads<25 then oversize:=2 {make dimensions of square search window twice then the image height} + else + if nr_quads>100 then oversize:=1 {make dimensions of square search window equal to the image height} + else + oversize:=2*sqrt(25/nr_quads);{calculate between 25 th=2 and 100 th=1, quads are area related so take sqrt to get oversize} - radius:=strtofloat2(radius_search1);{radius search field} - memo2_message(inttostr(nrstars)+' stars, '+inttostr(nr_quads)+' quads selected in the image. '+inttostr(nrstars_required)+' database stars, '+inttostr(round(nr_quads*nrstars_required/nrstars))+' database quads required for the square search field of '+floattostrF2(fov2,0,1)+'d. '+oversize_mess ); + if force_oversize1 then + begin + oversize:=2; + oversize_mess:='Search window at 200%' + end + else + oversize_mess:='Search window at '+ inttostr(round((oversize)*100)) +'% based on the number of quads. Step size at 100% of image height'; - minimum_quads:=3 + nr_quads div 100; {prevent false detections for star rich images, 3 quads give the 3 center quad references and is the bare minimum. It possible to use one quad and four star positions but it in not reliable} + radius:=strtofloat2(radius_search1);{radius search field} + memo2_message(inttostr(nrstars)+' stars, '+inttostr(nr_quads)+' quads selected in the image. '+inttostr(nrstars_required)+' database stars, '+inttostr(round(nr_quads*nrstars_required/nrstars))+' database quads required for the square search field of '+floattostrF2(fov2,0,1)+'d. '+oversize_mess ); + + minimum_quads:=3 + nr_quads div 100; {prevent false detections for star rich images, 3 quads give the 3 center quad references and is the bare minimum. It possible to use one quad and four star positions but it in not reliable} + end + else + begin + memo2_message('Only '+inttostr(nrstars)+' stars found in image. Abort'); + errorlevel:=2; + end; + + if go_ahead then + begin + search_field:=fov2*(pi/180); + STEP_SIZE:=search_field;{fixed step size search spiral. Prior to version 0.9.211 this was reduced for small star counts} + if database_type=1 then + begin {make smal steps for wide field images. Much more reliable} + step_size:=step_size*0.1; + max_distance:=round(radius/(0.1*fov2+0.00001)); {expressed in steps} + memo2_message('Wide field, making small steps for reliable solving.'); end else - begin - memo2_message('Only '+inttostr(nrstars)+' stars found in image. Abort'); - errorlevel:=2; - end; + max_distance:=round(radius/(fov2+0.00001));{expressed in steps} - if go_ahead then - begin - search_field:=fov2*(pi/180); - STEP_SIZE:=search_field;{fixed step size search spiral. Prior to version 0.9.211 this was reduced for small star counts} - if database_type=1 then - begin {make smal steps for wide field images. Much more reliable} - step_size:=step_size*0.25; - max_distance:=round(radius/(0.25*fov2+0.00001)); {expressed in steps} - memo2_message('Wide field, making small steps for reliable solving.'); - end - else - max_distance:=round(radius/(fov2+0.00001));{expressed in steps} + match_nr:=0; + repeat {Maximum accuracy loop. In case math is found on a corner, do a second solve. Result will be more accurate using all stars of the image} + count:=0;{search field counter} + distance:=0; {required for reporting no too often} + {spiral variables} + spiral_x :=0; + spiral_y :=0; + spiral_dx := 0;{first step size x} + spiral_dy := -1;{first step size y} + + repeat {search in squared spiral} + {begin spiral routine, find a new squared spiral position position} + if count<>0 then {first do nothing, start with [0 0] then start with [1 0],[1 1],[0 1],[-1 1],[-1 0],[-1 -1],[0 -1],[1 -1],[2 -1].[2 0] ..............} + begin {start spiral around [0 0]} + if ( (spiral_x = spiral_y) or ((spiral_x < 0) and (spiral_x = -spiral_y)) or ((spiral_x > 0) and (spiral_x = 1-spiral_y))) then {turning point} + begin {swap dx by negative dy and dy by negative dx} + spiral_t:=spiral_dx; + spiral_dx := -spiral_dy; + spiral_dy := spiral_t; + end; + spiral_x :=spiral_x+ spiral_dx;{walk through square} + spiral_y :=spiral_y+ spiral_dy;{walk through square} + end;{end spiral around [0 0]} + + {adapt search field to matrix position, +0+0/+1+0,+1+1,+0+1,-1+1,-1+0,-1-1,+0-1,+1-1..} + dec_database:=STEP_SIZE*spiral_y+dec_radians; + flip:=0; + if dec_database>+pi/2 then begin dec_database:=pi-dec_database; flip:=pi; end {crossed the pole} + else + if dec_database<-pi/2 then begin dec_database:=-pi-dec_database; flip:=pi; end; - match_nr:=0; - repeat {Maximum accuracy loop. In case math is found on a corner, do a second solve. Result will be more accurate using all stars of the image} - count:=0;{search field counter} - distance:=0; {required for reporting no too often} - {spiral variables} - spiral_x :=0; - spiral_y :=0; - spiral_dx := 0;{first step size x} - spiral_dy := -1;{first step size y} - - repeat {search in squared spiral} - {begin spiral routine, find a new squared spiral position position} - if count<>0 then {first do nothing, start with [0 0] then start with [1 0],[1 1],[0 1],[-1 1],[-1 0],[-1 -1],[0 -1],[1 -1],[2 -1].[2 0] ..............} - begin {start spiral around [0 0]} - if ( (spiral_x = spiral_y) or ((spiral_x < 0) and (spiral_x = -spiral_y)) or ((spiral_x > 0) and (spiral_x = 1-spiral_y))) then {turning point} - begin {swap dx by negative dy and dy by negative dx} - spiral_t:=spiral_dx; - spiral_dx := -spiral_dy; - spiral_dy := spiral_t; - end; - spiral_x :=spiral_x+ spiral_dx;{walk through square} - spiral_y :=spiral_y+ spiral_dy;{walk through square} - end;{end spiral around [0 0]} - - {adapt search field to matrix position, +0+0/+1+0,+1+1,+0+1,-1+1,-1+0,-1-1,+0-1,+1-1..} - telescope_dec:=STEP_SIZE*spiral_y+dec_radians; - flip:=0; - if telescope_dec>+pi/2 then begin telescope_dec:=pi-telescope_dec; flip:=pi; end {crossed the pole} - else - if telescope_dec<-pi/2 then begin telescope_dec:=-pi-telescope_dec; flip:=pi; end; + if dec_database>0 then extra:=step_size/2 else extra:=-step_size/2;{use the distance furthest away from the pole} - if telescope_dec>0 then extra:=step_size/2 else extra:=-step_size/2;{use the distance furthest away from the pole} + telescope_ra_offset:= (STEP_SIZE*spiral_x/cos(dec_database-extra));{step larger near pole. This ra_database is an offsett from zero} + if ((telescope_ra_offset<=+pi/2+step_size/2) and (telescope_ra_offset>=-pi/2)) then {step_size for overlap} + begin + ra_database:=fnmodulo(flip+ra_radians+telescope_ra_offset,2*pi);{add offset to ra after the if statement! Otherwise no symmetrical search} - telescope_ra_offset:= (STEP_SIZE*spiral_x/cos(telescope_dec-extra));{step larger near pole. This telescope_ra is an offsett from zero} - if ((telescope_ra_offset<=+pi/2+step_size/2) and (telescope_ra_offset>=-pi/2)) then {step_size for overlap} + ang_sep(ra_database,dec_database,ra_radians,dec_radians, {out}seperation);{calculates angular separation. according formula 9.1 old Meeus or 16.1 new Meeus, version 2018-5-23} + if seperation<=radius*pi/180+step_size/2 then {Use only the circular area withing the square area} begin - telescope_ra:=fnmodulo(flip+ra_radians+telescope_ra_offset,2*pi);{add offset to ra after the if statement! Otherwise no symmetrical search} - ang_sep(telescope_ra,telescope_dec,ra_radians,dec_radians, {out}seperation);{calculates angular separation. according formula 9.1 old Meeus or 16.1 new Meeus, version 2018-5-23} - if seperation<=radius*pi/180+step_size/2 then {Use only the circular area withing the square area} + {info reporting} + //stackmenu1.field1.caption:= '['+inttostr(spiral_x)+','+inttostr(spiral_y)+']';{show on stackmenu what's happening} + if seperation*180/pi>distance+fov_org then {new distance reached. Update once in the square spiral, so not too often since it cost CPU time} begin - - {info reporting} - //stackmenu1.field1.caption:= '['+inttostr(spiral_x)+','+inttostr(spiral_y)+']';{show on stackmenu what's happening} - if seperation*180/pi>distance+fov_org then {new distance reached. Update once in the square spiral, so not too often since it cost CPU time} + distance:=seperation*180/pi; + distancestr:=inttostr(round(seperation*180/pi))+'d,';{show on stackmenu what's happening} + write(distancestr); + end; {info reporting} + + {If a low amount of quads are detected, the search window (so the database read area) is increased up to 200% guaranteeing that all quads of the image are compared with the database quads while stepping through the sky} + {read nrstars_required stars from database. If search field is oversized, number of required stars increases with the power of the oversize factor. So the star density will be the same as in the image to solve} + extrastars:=1/1.1;{star with a factor of one} + repeat {loop to add extra stars if too many too small quads are excluding. Note the database is made by a space telescope with a resolution exceeding all earth telescopes} + extrastars:=extrastars*1.1; + if read_stars(ra_database,dec_database,search_field*oversize,round(nrstars_required*oversize*oversize*extrastars) ,{var}database_stars)= false then begin - distance:=seperation*180/pi; - distancestr:=inttostr(round(seperation*180/pi))+'d,';{show on stackmenu what's happening} - write(distancestr); - end; {info reporting} - - {If a low amount of quads are detected, the search window (so the database read area) is increased up to 200% guaranteeing that all quads of the image are compared with the database quads while stepping through the sky} - {read nrstars_required stars from database. If search field is oversized, number of required stars increases with the power of the oversize factor. So the star density will be the same as in the image to solve} - extrastars:=1/1.1;{star with a factor of one} - repeat {loop to add extra stars if too many too small quads are excluding. Note the database is made by a space telescope with a resolution exceeding all earth telescopes} - extrastars:=extrastars*1.1; - if read_stars(telescope_ra,telescope_dec,search_field*oversize,round(nrstars_required*oversize*oversize*extrastars) ,{var}database_stars)= false then - begin - memo2_message('Error, no star database found at '+database_path+' ! Download the h18 (or h17, v17) and install.'); - errorlevel:=33;{read error star database} - exit; {no stars} - end; - find_quads(starlist1,quad_smallest*(fov_org*3600/height2 {pixelsize in"})*0.99 {filter value to exclude too small quads, convert pixels to arcsec as in database}, dummy,quad_star_distances1);{find quads for reference image/database. Filter out too small quads for Earth based telescopes} - {Note quad_smallest is binning independent value. Don't use cdelt2 for pixelsize calculation since fov_specified could be true making cdelt2 unreliable or fov=auto} - until ((nrstars_required>database_stars) {No more stars available in the database} - or (nr_quads<1.1*Length(quad_star_distances1[0])*nrstars/nrstars_required) {Enough quads found. The amount quads could be too low because due to filtering out too small database quads (center m13, M16)in routine find_quads} - or (extrastars>15)) {Go up this factor maximum}; - - if ((solve_show_log) and (extrastars>1)) then memo2_message('Too many small quads excluded due to higher resolution database, increased the number of stars with '+inttostr(round((extrastars-1)*100))+'%'); - - if solve_show_log then {global variable set in find stars} - memo2_message('Search '+ inttostr(count)+', ['+inttostr(spiral_x)+','+inttostr(spiral_y)+'], position: '+ prepare_ra(telescope_ra,': ')+prepare_dec(telescope_dec,'d ')+#9+' Down to magn '+ floattostrF2(mag2/10,0,1) +#9+' '+inttostr(database_stars)+' database stars' +#9+' '+inttostr(length(quad_star_distances1[0]))+' database quads to compare.'); - - // for testing purposes - // create supplement lines for sky coverage testing and write to log using -log - // memo2.add(floattostr(telescope_ra*12/pi)+',,,'+floattostr(telescope_dec*180/pi)+',,,,'+inttostr(count)+',,-99'); {create hnsky supplement to test sky coverage} - - solution:=find_offset_and_rotation(minimum_quads {>=3},quad_tolerance);{find an solution} - end; {within search circle. Otherwise the search is within a kind of square} - end;{ra in range} - inc(count);{step further in spiral} - until ((solution) or (spiral_x>max_distance));{squared spiral search} + memo2_message('Error, no star database found at '+database_path+' ! Download and install a star database.'); + errorlevel:=33;{read error star database} + exit; {no stars} + end; + find_quads(starlist1,quad_smallest*(fov_org*3600/height2 {pixelsize in"})*0.99 {filter value to exclude too small quads, convert pixels to arcsec as in database}, dummy,quad_star_distances1);{find quads for reference image/database. Filter out too small quads for Earth based telescopes} + {Note quad_smallest is binning independent value. Don't use cdelt2 for pixelsize calculation since fov_specified could be true making cdelt2 unreliable or fov=auto} + until ((nrstars_required>database_stars) {No more stars available in the database} + or (nr_quads<1.1*Length(quad_star_distances1[0])*nrstars/nrstars_required) {Enough quads found. The amount quads could be too low because due to filtering out too small database quads (center m13, M16)in routine find_quads} + or (extrastars>15)) {Go up this factor maximum}; + + if ((solve_show_log) and (extrastars>1)) then memo2_message('Too many small quads excluded due to higher resolution database, increased the number of stars with '+inttostr(round((extrastars-1)*100))+'%'); + + if solve_show_log then {global variable set in find stars} + memo2_message('Search '+ inttostr(count)+', ['+inttostr(spiral_x)+','+inttostr(spiral_y)+'], position: '+ prepare_ra(ra_database,': ')+prepare_dec(dec_database,'d ')+#9+' Down to magn '+ floattostrF2(mag2/10,0,1) +#9+' '+inttostr(database_stars)+' database stars' +#9+' '+inttostr(length(quad_star_distances1[0]))+' database quads to compare.'); + + // for testing purposes + // create supplement lines for sky coverage testing and write to log using -log + // memo2.add(floattostr(ra_database*12/pi)+',,,'+floattostr(dec_database*180/pi)+',,,,'+inttostr(count)+',,-99'); {create hnsky supplement to test sky coverage} + + solution:=find_offset_and_rotation(minimum_quads {>=3},quad_tolerance);{find an solution} + end; {within search circle. Otherwise the search is within a kind of square} + end;{ra in range} + inc(count);{step further in spiral} + until ((solution) or (spiral_x>max_distance));{squared spiral search} - if solution then - begin - centerX:=(width2-1)/2 ;{center image in 0..width2-1 range} - centerY:=(height2-1)/2;{center image in 0..height2-1 range} - crpix1:=centerX+1;{center image in fits coordinate range 1..width2} - crpix2:=centery+1; - - standard_equatorial( telescope_ra,telescope_dec, - (solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY) +solution_vectorX[2]), {x} - (solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY) +solution_vectorY[2]), {y} - 1, {CCD scale} - ra_radians ,dec_radians {center equatorial position}); - current_dist:=sqrt(sqr(solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY) +solution_vectorX[2]) + sqr(solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY) +solution_vectorY[2]))/3600; {current distance telescope and image center in degrees} - inc(match_nr); - end; - until ((solution=false) or (current_dist<fov2*0.05){within 5% if image height from center} or (match_nr>=2));{Maximum accurcy loop. After match possible on a corner do a second solve using the found ra0,dec0 for maximum accuracy USING ALL STARS} + if solution then + begin + centerX:=(width2-1)/2 ;{center image in 0..width2-1 range} + centerY:=(height2-1)/2;{center image in 0..height2-1 range} + crpix1:=centerX+1;{center image in fits coordinate range 1..width2} + crpix2:=centery+1; + + standard_equatorial( ra_database,dec_database, + (solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY) +solution_vectorX[2]), {x} + (solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY) +solution_vectorY[2]), {y} + 1, {CCD scale} + ra_radians ,dec_radians {center equatorial position}); + current_dist:=sqrt(sqr(solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY) +solution_vectorX[2]) + sqr(solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY) +solution_vectorY[2]))/3600; {current distance telescope and image center in degrees} + inc(match_nr); + end; + until ((solution=false) or (current_dist<fov2*0.05){within 5% if image height from center} or (match_nr>=2));{Maximum accurcy loop. After match possible on a corner do a second solve using the found ra0,dec0 for maximum accuracy USING ALL STARS} - end; {enough quads in image} - until ((autoFOV=false) or (solution) or (fov2<=fov_min)); {loop for autoFOV from 9.5 to 0.37 degrees. Will lock between 9.5*1.25 downto 0.37/1.25 or 11.9 downto 0.3 degrees} - until ((autoMaxstars=false) or (solution) or (max_stars>=480) or (max_stars-5>nrstars){no more stars to find});{auto max star loop} + end; {enough quads in image} + until ((autoFOV=false) or (solution) or (fov2<=fov_min)); {loop for autoFOV from 9.5 to 0.37 degrees. Will lock between 9.5*1.25 downto 0.37/1.25 or 11.9 downto 0.3 degrees} if solution then @@ -1438,34 +1531,47 @@ // cd2_1:= + solution_vectorY[0]/3600; // cd2_2:= + solution_vectorY[1]/3600; - // rather then using the solution vector directly, for maximum accuracy find the vector for the center of the image. - //make 1 step in direction crpix1 - standard_equatorial( telescope_ra,telescope_dec, - (solution_vectorX[0]*(centerX+1) + solution_vectorX[1]*(centerY) +solution_vectorX[2]), {x} - (solution_vectorY[0]*(centerX+1) + solution_vectorY[1]*(centerY) +solution_vectorY[2]), {y} - 1, {CCD scale} - ra7 ,dec7{center equatorial position}); - - delta_ra:=ra7-ra0; - if delta_ra>+pi then delta_ra:=2*pi-delta_ra; {359-> 1, +2:=360 - (359- 1)} - if delta_ra<-pi then delta_ra:=delta_ra-2*pi; {1 -> 359, -2:=(1-359) -360 } - cd1_1:=(delta_ra)*cos(dec0)*(180/pi); - cd2_1:=(dec7-dec0)*(180/pi); - - //make 1 step in direction crpix2 - standard_equatorial( telescope_ra,telescope_dec, - (solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY+1) +solution_vectorX[2]), {x} - (solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY+1) +solution_vectorY[2]), {y} - 1, {CCD scale} - ra7 ,dec7{center equatorial position}); - - delta_ra:=ra7-ra0; - if delta_ra>+pi then delta_ra:=2*pi-delta_ra; {359-> 1, +2:=360 - (359- 1)} - if delta_ra<-pi then delta_ra:=delta_ra-2*pi; {1 -> 359, -2:=(1-359) -360 } - cd1_2:=(delta_ra)*cos(dec0)*(180/pi); - cd2_2:=(dec7-dec0)*(180/pi); + //New 2023 method for correct rotation angle/annotation near to the celestial pole. + if solution_vectorX[0]*solution_vectorY[1] - solution_vectorX[1]*solution_vectorY[0] >0 then // flipped? + flipped_image:=-1 //change rotation for flipped image, {Flipped image. Either flipped vertical or horizontal but not both. Flipped both horizontal and vertical is equal to 180 degrees rotation and is not seen as flipped} + else + flipped_image:=+1;//not flipped + + // position +1 pixels in direction hd.crpix2 + standard_equatorial( ra_database,dec_database, (solution_vectorX[0]*(centerX) + solution_vectorX[1]*(centerY+1) +solution_vectorX[2]), {x} + (solution_vectorY[0]*(centerX) + solution_vectorY[1]*(centerY+1) +solution_vectorY[2]), {y} + 1, {CCD scale} ra7 ,dec7{equatorial position}); // the position 10 pixels away + + //See book Meeus, Astronomical Algorithms, formula 46.5, angle of moon limb. See also https://astronomy.stackexchange.com/questions/25306/measuring-misalignment-between-two-positions-on-sky +// crota2:=-arctan2(cos(dec7)*sin(ra7-ra_radians),sin(dec7)*cos(dec_radians) - cos(dec7)*sin(dec_radians)*cos(ra7-ra_radians));//Accurate formula. Angle between line between the two positions and north as seen at hd.ra0, hd.dec0 + crota2:=-position_angle(ra7,dec7,ra_radians,dec_radians);//Position angle between a line from ra0,dec0 to ra1,dec1 and a line from ra0, dec0 to the celestial north . Rigorous method + + + // position 1*flipped_image pixels in direction hd.crpix1 + standard_equatorial( ra_database,dec_database,(solution_vectorX[0]*(centerX+flipped_image) + solution_vectorX[1]*(centerY) +solution_vectorX[2]), {x} //A pixel_aspect_ratio unequal of 1 is very rare, none square pixels + (solution_vectorY[0]*(centerX+flipped_image) + solution_vectorY[1]*(centerY) +solution_vectorY[2]), {y} + 1, {CCD scale} ra7 ,dec7{equatorial position}); + + //See book Meeus, Astronomical Algorithms, formula 46.5, angle of moon limb. See also https://astronomy.stackexchange.com/questions/25306/measuring-misalignment-between-two-positions-on-sky +// crota1:=+arctan2(sin(dec7)*cos(dec_radians) - cos(dec7)*sin(dec_radians)*cos(ra7-ra_radians),cos(dec7)*sin(ra7-ra_radians));//Accurate formula. See calculation hd.crota2, arguments arctan swapped + crota1:=pi/2-position_angle(ra7,dec7,ra_radians,dec_radians);//Position angle between a line from ra0,dec0 to ra1,dec1 and a line from ra0, dec0 to the celestial north . Rigorous method + if crota1>pi then crota1:=crota1-2*pi;//keep within range -pi to +pi + + cdelt1:=flipped_image*sqrt(sqr(solution_vectorX[0])+sqr(solution_vectorX[1]))/3600; // from unit arcsec to degrees + cdelt2:=sqrt(sqr(solution_vectorY[0])+sqr(solution_vectorY[1]))/3600; + + + + cd1_1:=+cdelt1*cos(crota1); + cd1_2:=-cdelt1*sin(crota1)*flipped_image; + cd2_1:=+cdelt2*sin(crota2)*flipped_image; + cd2_2:=+cdelt2*cos(crota2); + + crota2:=crota2*180/pi;//convert to degrees + crota1:=crota1*180/pi; + //end new 2023 method + - new_to_old_WCS; solved_in:='Solved in '+ floattostr(round((GetTickCount64 - startTick)/100)/10)+' sec';{make string to report in FITS header.} offset_found:=distance_to_string(sep_search ,sep_search)+'.'; @@ -1528,11 +1634,12 @@ warning_str:=warning_str + warning_downsample; {add the last warning from loop autoFOV} - if nrstars_required>database_stars+4 then - begin - memo2_message('Warning, reached maximum magnitude of star database!'); - warning_str:=warning_str+' Star database limit was reached!'; - end; +//No longer required for the new D50.. databases +// if nrstars_required>database_stars+4 then +// begin +// memo2_message('Warning, reached the limit of the star database!'); +// warning_str:=warning_str+' Star database limit was reached!'; +// end; if warning_str<>'' then begin diff -Nru astap-cli-2022.12.09/unit_command_line_star_database.pas astap-cli-2024.01.17/unit_command_line_star_database.pas --- astap-cli-2022.12.09/unit_command_line_star_database.pas 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/unit_command_line_star_database.pas 2024-01-17 22:20:03.000000000 +0000 @@ -1,5 +1,5 @@ unit unit_command_line_star_database; {Reads star databases type .290 and 1476} -{Copyright (C) 2017, 2021 by Han Kleijn, www.hnsky.org +{Copyright (C) 2017, 2024 by Han Kleijn, www.hnsky.org email: han.k.. at...hnsky.org This Source Code Form is subject to the terms of the Mozilla Public @@ -2046,8 +2046,8 @@ -const {1476 boundaries} - Stepsize=90/17.5;{5.142857143 degrees} +//const {1476 boundaries} +// Stepsize=90/17.5;{5.142857143 degrees} var {################# initialised variables #########################} dec_boundaries1476 : array[0..36] of double= (-90*pi/180, @@ -2733,8 +2733,10 @@ function select_star_database(database:string;fov:double): boolean; {select a star database, report false if none is found} var typ : ansichar; + warning : boolean; begin result:=true; + warning:=false; //warning for old database database_type:=1476;{type .1476 database} database:=lowercase(database); @@ -2747,12 +2749,11 @@ if fileexists( database_path+database+'_0101.001') then begin name_database:=database; {try preference}database_type:=001;exit; end end else - if typ='h' then + if typ in ['d','v','h'] then //d80,v50, h18 begin if fileexists( database_path+database+'_0101.1476') then begin name_database:=database; {try preference} exit; end; - end - else - if typ in ['v','g'] then + end;// no else since there is a v50 and v17!! + if typ in ['v','g'] then //v17, g18 begin if fileexists( database_path+database+'_0101.290') then begin name_database:=database; {try preference}database_type:=290;exit; end end; @@ -2762,20 +2763,40 @@ begin if fileexists( database_path+'w08_0101.001') then begin name_database:='w08';database_type:=001; exit; end else - memo2_message('Could not find w08 star database. Will try with an other database.'); + memo2_message('Could not find the W08 star database for FOV>20 degrees. Will try with an other database.'); end; - if fileexists( database_path+'h18_0101.1476') then begin name_database:='h18'; end + if ((fov>6) and (fileexists( database_path+'g05_0101.290'))) then begin name_database:='g05'; database_type:=290; end //preference for G05 for large FOV + else + if ((fov>6) and (fileexists( database_path+'v17_0101.290'))) then begin name_database:='v17'; database_type:=290; warning:=true; end //preference for V17 for large FOV + else + if ((fov<=0.5) and (fileexists( database_path+'d80_0101.1476'))) then begin name_database:='d80'; end //for tiny field of view + else + if fileexists( database_path+'v50_0101.1476') then begin name_database:='v50'; end //photometry database + else + if fileexists( database_path+'d50_0101.1476') then begin name_database:='d50'; end else - if fileexists( database_path+'g18_0101.290') then begin name_database:='g18'; database_type:=290; end + if fileexists( database_path+'d20_0101.1476') then begin name_database:='d20'; end else - if fileexists( database_path+'h17_0101.1476') then begin name_database:='h17'; end + if fileexists( database_path+'d05_0101.1476') then begin name_database:='d05'; end else - if fileexists( database_path+'g17_0101.290') then begin name_database:='g17'; database_type:=290; end + if fileexists( database_path+'d80_0101.1476') then begin name_database:='d80'; end //for somebody wo installs the d80 for large FOV, >0.5 degrees else - if fileexists( database_path+'v17_0101.290') then begin name_database:='v17'; database_type:=290; end + if fileexists( database_path+'g05_0101.290') then begin name_database:='g05'; database_type:=290; end + else + if fileexists( database_path+'h18_0101.1476') then begin name_database:='h18';warning:=true; end //old database sorted on magnitude + else + if fileexists( database_path+'g18_0101.290') then begin name_database:='g18';warning:=true; database_type:=290; end //old database sorted on magnitude + else + if fileexists( database_path+'h17_0101.1476') then begin name_database:='h17'; warning:=true;end // old database sorted on magnitude + else + if fileexists( database_path+'v17_0101.290') then begin name_database:='v17'; database_type:=290;warning:=true; end //old database sorted on magnitude + else + if fileexists( database_path+'g17_0101.290') then begin name_database:='g17'; database_type:=290;warning:=true; end //old database sorted on magnitude else result:=false; + + if warning then warning_str:='Old database!'; //first potential warning. No add required end; diff -Nru astap-cli-2022.12.09/unit_command_line_stars_wide_field.pas astap-cli-2024.01.17/unit_command_line_stars_wide_field.pas --- astap-cli-2022.12.09/unit_command_line_stars_wide_field.pas 2022-12-10 01:38:10.000000000 +0000 +++ astap-cli-2024.01.17/unit_command_line_stars_wide_field.pas 2024-01-17 22:20:03.000000000 +0000 @@ -1,4 +1,10 @@ unit unit_command_line_stars_wide_field; +{Copyright (C) 2017, 2024 by Han Kleijn, www.hnsky.org + email: han.k.. at...hnsky.org + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at https://mozilla.org/MPL/2.0/. } {$mode delphi}