Skip to content
Commits on Source (27)
......@@ -8,21 +8,21 @@ version = "1.0.1"
[[Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "ffcfa2d345aaee0ef3d8346a073d5dd03c983ebe"
git-tree-sha1 = "f1b523983a58802c4695851926203b36e28f09db"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.2.0"
version = "3.3.0"
[[ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
[[ArrayInterface]]
deps = ["IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"]
git-tree-sha1 = "e7edcc1ac140cce87b7442ff0fa88b5f19fb71fa"
git-tree-sha1 = "af516010f3d8c690d2207b12445aaa45da63e9fb"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "3.1.3"
version = "3.1.14"
[[Artifacts]]
deps = ["Pkg"]
git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744"
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.3.0"
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
......@@ -34,22 +34,22 @@ uuid = "3b1b4be9-1499-4b22-8d78-7db3344d1961"
version = "1.1.1"
[[CFITSIO_jll]]
deps = ["LibCURL_jll", "Libdl", "Pkg"]
git-tree-sha1 = "262a3a9ab0b4f03efb57f58b20cbca8b47ab6af9"
deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg"]
git-tree-sha1 = "fefc33edbecf70e452179622f548050f1899fb47"
uuid = "b3e40c51-02ae-5482-8a39-3ace5868dcf4"
version = "3.48.0+0"
version = "3.49.0+0"
[[CMPFit]]
deps = ["Pkg", "Printf", "Test"]
git-tree-sha1 = "ba5a54f45f6420449b3bfbbedcb7be1c5129e1cc"
git-tree-sha1 = "e3faebce409211daebcb69caceb018f553180ecf"
uuid = "a5944310-3432-5d93-8bb2-e3b5eb62a58f"
version = "0.3.1"
version = "0.3.3"
[[ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3"
git-tree-sha1 = "b391f22252b8754f4440de1f37ece49d8a7314bb"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "0.9.29"
version = "0.9.44"
[[CodeTracking]]
deps = ["InteractiveUtils", "UUIDs"]
......@@ -65,21 +65,21 @@ version = "0.7.0"
[[ColorSchemes]]
deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"]
git-tree-sha1 = "3141757b5832ee7a0386db87997ee5a23ff20f4d"
git-tree-sha1 = "c8fd01e4b736013bc61b704871d20503b33ea402"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.10.2"
version = "3.12.1"
[[ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "5e9769a17f17b587c951d57ba4319782b40c3513"
git-tree-sha1 = "024fe24d83e4a5bf5fc80501a314ce0d1aa35597"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.10.10"
version = "0.11.0"
[[Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"]
git-tree-sha1 = "ac5f2213e56ed8a34a3dd2f681f4df1166b34929"
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.6"
version = "0.12.8"
[[CommonSubexpressions]]
deps = ["MacroTools", "Test"]
......@@ -89,21 +89,19 @@ version = "0.3.0"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b"
git-tree-sha1 = "e4e2b39db08f967cc1360951f01e8a75ec441cab"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.25.0"
version = "3.30.0"
[[CompilerSupportLibraries_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "8e695f735fca77e9708e795eda62afdb869cbb70"
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "0.3.4+0"
[[ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "48920211c95a6da1914a06c44ec94be70e84ffff"
git-tree-sha1 = "1dc43957fb9a1574fa1b7a449e101bd1fd3a9fb7"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.1.0"
version = "1.2.1"
[[Cosmology]]
deps = ["QuadGK", "Unitful", "UnitfulAstro"]
......@@ -128,10 +126,10 @@ uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.6.0"
[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "88d48e133e6d3dd68183309877eac74393daa7eb"
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.20"
version = "0.18.9"
[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
......@@ -182,15 +180,25 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[Distributions]]
deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"]
git-tree-sha1 = "e64debe8cd174cc52d7dd617ebc5492c6f8b698c"
git-tree-sha1 = "a837fdf80f333415b69684ba8e8ae6ba76de6aaa"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.24.15"
version = "0.24.18"
[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "9d4f64f79012636741cf01133158a54b24924c32"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.4"
[[DoubleFloats]]
deps = ["GenericSVD", "GenericSchur", "LinearAlgebra", "Polynomials", "Printf", "Quadmath", "Random", "Requires", "SpecialFunctions"]
git-tree-sha1 = "1eeb98d95e7b57f6150d2571e3bdc327c9b8114d"
deps = ["LinearAlgebra", "Polynomials", "Printf", "Quadmath", "Random", "Requires", "SpecialFunctions"]
git-tree-sha1 = "dd08915924e0869440a1b2db627b4195c5237485"
uuid = "497a8b3b-efae-58df-a0af-a86822472b78"
version = "1.1.16"
version = "1.1.21"
[[Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
[[ExprTools]]
git-tree-sha1 = "10407a39b87f29d47ebaca8edbc75d7c302ff93e"
......@@ -204,10 +212,10 @@ uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
version = "1.1.0"
[[FFTW]]
deps = ["AbstractFFTs", "FFTW_jll", "IntelOpenMP_jll", "Libdl", "LinearAlgebra", "MKL_jll", "Reexport"]
git-tree-sha1 = "1b48dbde42f307e48685fa9213d8b9f8c0d87594"
deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"]
git-tree-sha1 = "746f68839306977040653ebbd249e39c15420b8a"
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
version = "1.3.2"
version = "1.4.1"
[[FFTW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
......@@ -226,9 +234,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays"]
git-tree-sha1 = "4705cc4e212c3c978c60b1b18118ec49b4d731fd"
git-tree-sha1 = "31939159aeb8ffad1d4d8ee44d07f8558273120a"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "0.11.5"
version = "0.11.7"
[[FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays"]
......@@ -249,44 +257,28 @@ uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"
[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "d48a40c0f54f29a5c8748cfb3225719accc72b77"
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "NaNMath", "Printf", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "e2af66012e08966366a43251e1fd421522908be6"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.16"
version = "0.10.18"
[[GFit]]
deps = ["CMPFit", "DataStructures", "Distributions", "ExprTools", "LsqFit", "PrettyTables", "Printf", "Random", "Statistics"]
git-tree-sha1 = "4693d5e59c2c57c99a3d99ae7109aa146ea06a9c"
repo-rev = "master"
repo-url = "https://github.com/gcalderone/GFit.jl"
deps = ["CMPFit", "DataStructures", "Dates", "Distributions", "ExprTools", "LsqFit", "PrettyTables", "Printf", "Random", "Statistics"]
path = "/home/gcalderone/.julia/dev/GFit"
uuid = "ac42e6ba-c0bf-4fcf-827d-deea44b16255"
version = "0.1.0"
[[GFitViewer]]
deps = ["DataStructures", "DefaultApplication", "GFit", "JSON"]
git-tree-sha1 = "8ff84bba27537466d2dabcced232c1c5eaa650a1"
repo-rev = "master"
repo-url = "https://github.com/lnicastro/GFitViewer.jl"
deps = ["DataStructures", "DefaultApplication", "GFit", "JSON", "Pkg", "Statistics"]
path = "/home/gcalderone/.julia/dev/GFitViewer"
uuid = "5d93b50e-5cc7-4feb-a740-ec85257caa01"
version = "0.1.0"
[[GenericSVD]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "62909c3eda8a25b5673a367d1ad2392ebb265211"
uuid = "01680d73-4ee2-5a08-a1aa-533608c188bb"
version = "0.3.0"
[[GenericSchur]]
deps = ["LinearAlgebra", "Printf"]
git-tree-sha1 = "c6b383b8d005e6487b41ade2051e3410ec60af8a"
uuid = "c145ed77-6b09-5dd9-b285-bf645a82121e"
version = "0.4.1"
[[Gnuplot]]
deps = ["ColorSchemes", "ColorTypes", "Colors", "DataStructures", "REPL", "ReplMaker", "StatsBase", "StructC14N", "Test"]
git-tree-sha1 = "ec89a32beb38219a3206a99f1ada554b14adca2e"
git-tree-sha1 = "637ee67f78c4adb222ee11c590bd1d0a1a50ba88"
uuid = "dc211083-a33a-5b79-959f-2ff34033469d"
version = "1.3.0"
version = "1.4.0"
[[IfElse]]
git-tree-sha1 = "28e837ff3e7a6c3cdb252ce49fb412c8eb3caeef"
......@@ -320,9 +312,10 @@ uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"
[[JLLWrappers]]
git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0"
deps = ["Preferences"]
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.2.0"
version = "1.3.0"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
......@@ -332,53 +325,57 @@ version = "0.21.1"
[[JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "86439cef50a24fa981583476f48b197b7dea691e"
git-tree-sha1 = "ece3091e3cfd35cdda08629a3755983962942f6d"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.8.9"
version = "0.8.16"
[[LazyArtifacts]]
deps = ["Pkg"]
git-tree-sha1 = "4bb5499a1fc437342ea9ab7e319ede5a457c0968"
deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
version = "1.3.0"
[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
[[LibCURL_jll]]
deps = ["LibSSH2_jll", "Libdl", "MbedTLS_jll", "Pkg", "Zlib_jll", "nghttp2_jll"]
git-tree-sha1 = "897d962c20031e6012bba7b3dcb7a667170dad17"
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "7.70.0+2"
[[LibGit2]]
deps = ["Printf"]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[LibSSH2_jll]]
deps = ["Libdl", "MbedTLS_jll", "Pkg"]
git-tree-sha1 = "717705533148132e5466f2924b9a3657b16158e8"
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.9.0+3"
[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[Libiconv_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f"
git-tree-sha1 = "8d22e127ea9a0917bc98ebd3755c8bd31989381e"
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
version = "1.16.0+7"
version = "1.16.1+0"
[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[LogExpFunctions]]
deps = ["DocStringExtensions", "LinearAlgebra"]
git-tree-sha1 = "1ba664552f1ef15325e68dc4c05c3ef8c2d5d885"
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
version = "0.2.4"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "8c96709706ce27471655247ad9a931447d16dd62"
git-tree-sha1 = "4bfb8b57df913f3b28a6bd3bdbebe9a50538e689"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "1.2.9"
version = "2.1.0"
[[LsqFit]]
deps = ["Distributions", "ForwardDiff", "LinearAlgebra", "NLSolversBase", "OptimBase", "Random", "StatsBase"]
......@@ -403,16 +400,14 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6"
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.16.8+1"
[[Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "f8c673ccc215eb50fcadb285f522420e29e69e1c"
git-tree-sha1 = "4ea90bd5d3985ae1f9a908bd4500ae88921c5ce7"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.4.5"
version = "1.0.0"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
......@@ -423,17 +418,23 @@ git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed"
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
version = "0.7.1"
[[MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
[[NLSolversBase]]
deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"]
git-tree-sha1 = "39d6bc45e99c96e6995cbddac02877f9b61a1dd1"
git-tree-sha1 = "50608f411a1e178e0129eab4110bd56efd08816f"
uuid = "d41bc354-129a-5804-8e4c-c37616107c6c"
version = "7.7.1"
version = "7.8.0"
[[NaNMath]]
git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.5"
[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
[[Nullables]]
git-tree-sha1 = "8f87854cc8f3685a60689d8edecaa29d2251979b"
uuid = "4d1e1d77-625e-5b40-9113-a560ec7a8ecd"
......@@ -441,15 +442,15 @@ version = "1.0.0"
[[OffsetArrays]]
deps = ["Adapt"]
git-tree-sha1 = "b3dfef5f2be7d7eb0e782ba9146a5271ee426e90"
git-tree-sha1 = "47b443d2ccc8297a4c538f55f8fd828ad58599ab"
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
version = "1.6.2"
version = "1.8.0"
[[OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3"
git-tree-sha1 = "b9b8b8ed236998f91143938a760c2112dceeb2b4"
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.3+4"
version = "0.5.4+0"
[[OptimBase]]
deps = ["NLSolversBase", "Printf", "Reexport"]
......@@ -458,9 +459,9 @@ uuid = "87e2bd06-a317-5318-96d9-3ecbac512eee"
version = "2.0.1"
[[OrderedCollections]]
git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf"
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.4.0"
version = "1.4.1"
[[PDMats]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
......@@ -470,35 +471,39 @@ version = "0.11.0"
[[Parsers]]
deps = ["Dates"]
git-tree-sha1 = "223a825cccef2228f3fdbf2ecc7ca93363059073"
git-tree-sha1 = "c8abc88faa3f7a3950832ac5d6e690881590d6dc"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.0.16"
version = "1.1.0"
[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[Polynomials]]
deps = ["Intervals", "LinearAlgebra", "OffsetArrays", "RecipesBase"]
git-tree-sha1 = "1c6c5b0c3713738d6b987903c529d80622c37e07"
git-tree-sha1 = "0b15f3597b01eb76764dd03c3c23d6679a3c32c8"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
version = "1.2.0"
version = "1.2.1"
[[Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.2.2"
[[PrettyTables]]
deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"]
git-tree-sha1 = "574a6b3ea95f04e8757c0280bb9c29f1a5e35138"
git-tree-sha1 = "b60494adf99652d220cdef46f8a32232182cc22d"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "0.11.1"
version = "1.0.1"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[QSFit]]
deps = ["CMPFit", "Cosmology", "DSP", "DataStructures", "DelimitedFiles", "Dierckx", "FITSIO", "GFit", "Pkg", "Printf", "QuadGK", "Statistics", "Unitful", "UnitfulAstro"]
git-tree-sha1 = "f2dd1977f8cd6bbec6cd99274c456cc70085d507"
repo-rev = "master"
repo-url = "https://github.com/gcalderone/QSFit.jl"
deps = ["CMPFit", "Cosmology", "DSP", "DataStructures", "Dates", "DelimitedFiles", "Dierckx", "FITSIO", "GFit", "GFitViewer", "Pkg", "Printf", "QuadGK", "Statistics", "Unitful", "UnitfulAstro"]
path = "/home/gcalderone/.julia/dev/QSFit"
uuid = "fea25315-b951-4667-83c9-50e53efab241"
version = "0.1.0"
......@@ -515,7 +520,7 @@ uuid = "be4d8f0f-7fa4-5f49-b795-2f01399ab2dd"
version = "0.5.5"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
......@@ -535,33 +540,33 @@ version = "0.2.0"
[[ReplMaker]]
deps = ["REPL", "Unicode"]
git-tree-sha1 = "18bf7b1b917fb7c0eca7e273c3f97ab3e7e717c2"
git-tree-sha1 = "76098218397ec93b925b70ce355144d539b1a8b4"
uuid = "b873ce64-0db9-51f5-a568-4457d8e49576"
version = "0.2.4"
version = "0.2.5"
[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "cfbac6c1ed70c002ec6361e7fd334f02820d6419"
git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.1.2"
version = "1.1.3"
[[Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "b72fa706920b1421d581525de9f4e442b95ba254"
git-tree-sha1 = "2b95c41e53c8f429ef56de5c3718f01831141751"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.1.14"
version = "3.1.16"
[[Rmath]]
deps = ["Random", "Rmath_jll"]
git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370"
git-tree-sha1 = "bf3188feca147ce108c76ad82c2792c57abe7b1f"
uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa"
version = "0.6.1"
version = "0.7.0"
[[Rmath_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0"
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "68db32dff12bb6127bac73c209881191bf0efbb7"
uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f"
version = "0.2.2+1"
version = "0.3.0+0"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
......@@ -577,48 +582,53 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[SortingAlgorithms]]
deps = ["DataStructures", "Random", "Test"]
git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd"
deps = ["DataStructures"]
git-tree-sha1 = "2ec1962eba973f383239da22e75218565c390a96"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "0.3.1"
version = "1.0.0"
[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[[SpecialFunctions]]
deps = ["ChainRulesCore", "OpenSpecFun_jll"]
git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902"
deps = ["ChainRulesCore", "LogExpFunctions", "OpenSpecFun_jll"]
git-tree-sha1 = "c467f25b6ec4167ea3a9a4351c66c2e1cba5da33"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "1.3.0"
version = "1.4.1"
[[Static]]
deps = ["IfElse"]
git-tree-sha1 = "1b0fdbbc15c5b13dcf52343ac681a3060ddb8ee4"
git-tree-sha1 = "ddec5466a1d2d7e58adf9a427ba69763661aacf6"
uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
version = "0.2.1"
version = "0.2.4"
[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "9da72ed50e94dbff92036da395275ed114e04d49"
git-tree-sha1 = "c635017268fd51ed944ec429bcc4ad010bcea900"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.0.1"
version = "1.2.0"
[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StatsAPI]]
git-tree-sha1 = "1958272568dc176a1d881acb797beb909c785510"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
version = "1.0.0"
[[StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
git-tree-sha1 = "400aa43f7de43aeccc5b2e39a76a79d262202b76"
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "2f6792d523d7448bbe2fec99eca9218f06cc746d"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.33.3"
version = "0.33.8"
[[StatsFuns]]
deps = ["Rmath", "SpecialFunctions"]
git-tree-sha1 = "3b9f665c70712af3264b61c27a7e1d62055dafd1"
deps = ["LogExpFunctions", "Rmath", "SpecialFunctions"]
git-tree-sha1 = "30cd8c360c54081f806b1ee14d2eecbef3c04c49"
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "0.9.6"
version = "0.9.8"
[[StructC14N]]
deps = ["Test"]
......@@ -630,20 +640,28 @@ version = "0.3.0"
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
[[TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
[[TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e"
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.0"
version = "1.0.1"
[[Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "a716dde43d57fa537a19058d044b495301ba6565"
git-tree-sha1 = "c9d2d262e9a327be1f35844df25fe4561d258dc9"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.3.2"
version = "1.4.2"
[[Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[TextParse]]
......@@ -653,10 +671,10 @@ uuid = "e0df1984-e451-5cb5-8b61-797a481e67e3"
version = "1.0.1"
[[TimeZones]]
deps = ["Dates", "EzXML", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"]
git-tree-sha1 = "4ba8a9579a243400db412b50300cd61d7447e583"
deps = ["Dates", "EzXML", "LazyArtifacts", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"]
git-tree-sha1 = "960099aed321e05ac649c90d583d59c9309faee1"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "1.5.3"
version = "1.5.5"
[[TranscodingStreams]]
deps = ["Random", "Test"]
......@@ -672,10 +690,10 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[Unitful]]
deps = ["ConstructionBase", "LinearAlgebra", "Random"]
git-tree-sha1 = "fdfbea79b5b9a305bf226eb4730321f603281290"
deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"]
git-tree-sha1 = "c6bbc170505c5ea36593a0072b61d3be8bf868ae"
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
version = "1.6.0"
version = "1.7.0"
[[UnitfulAngles]]
deps = ["Dates", "Unitful"]
......@@ -697,18 +715,18 @@ version = "0.6.2"
[[XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "be0db24f70aae7e2b89f2f3092e93b8606d659a6"
git-tree-sha1 = "1acf5bdf07aa0907e0a37d3718bb88d4b687b74a"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.9.10+3"
version = "2.9.12+0"
[[Zlib_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6"
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.11+18"
[[nghttp2_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "8e2c44ab4d49ad9518f359ed8b62f83ba8beede4"
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
version = "1.40.0+2"
[[p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
......@@ -4,6 +4,7 @@ authors = ["Giorgio Calderone <giorgio.calderone@gmail.com>"]
version = "0.1.0"
[deps]
CMPFit = "a5944310-3432-5d93-8bb2-e3b5eb62a58f"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
GFit = "ac42e6ba-c0bf-4fcf-827d-deea44b16255"
......
......@@ -77,7 +77,6 @@ chosen_epoch = 17
file = epochs[chosen_epoch]
source = QSO{q1927p654}("1ES 1927+654 ($chosen_epoch)", 0.019422, ebv=0.077);
source.options[:min_spectral_coverage][:OIII_5007] = 0.5
source.options[:norm_integrated] = false
# source.options[:host_template] = "/home/gcalderone/Mbi1.30Zm1.49T00.0700_iTp0.00_baseFe_linear_FWHM_2.51"
add_spec!(source, Spectrum(Val(:ASCII), file, columns=[1,2]));
source.data[1].val .*= 1e17;
......@@ -93,12 +92,12 @@ source.options[:min_spectral_coverage][:OIII_5007] = 0.5
add_spec!(source, Spectrum(Val(:ASCII), "AT2018zf/AT2018zf_optspec_20180716.dat", columns=[1,2]));
add_spec!(source, Spectrum(Val(:ASCII), "AT2018zf/AT2018zf_optspec_20180528.dat", columns=[1,2]));
add_spec!(source, Spectrum(Val(:ASCII), "AT2018zf/AT2018zf_optspec_20180812.dat", columns=[1,2]));
source.options[:norm_integrated] = false
add_spec!(source, Spectrum(Val(:ASCII), "AT2018zf/AT2018zf_optspec_20181113.dat", columns=[1,2]));
for id in 1:length(source.domain)
source.data[id].val .*= 1e17;
source.data[id].unc .= 0.05 .* source.data[id].val;
end
(model, bestfit) = multiepoch_fit(source);
(model, bestfit) = multi_fit(source);
viewer(model, source.data, bestfit, selcomps=[:qso_cont, :galaxy, :balmer])
```
......@@ -107,6 +106,6 @@ viewer(model, source.data, bestfit, selcomps=[:qso_cont, :galaxy, :balmer])
The default QSFit analysis recipes are implemented here:
- [single epoch](https://github.com/gcalderone/QSFit.jl/blob/master/src/DefaultRecipe.jl)
- [multi epoch](https://github.com/gcalderone/QSFit.jl/blob/master/src/DefaultRecipe_multiepoch.jl)
- [multi epoch](https://github.com/gcalderone/QSFit.jl/blob/master/src/DefaultRecipe_multi.jl)
This package implements a custom recipe named `q1927p654` whose code is available in `src/CL_1ES_1927p654.jl`.
using Pkg
Pkg.activate(".")
Z = 0.019422
EBV = 0.077
using Revise, Statistics, Serialization, Dierckx, DataFrames
using QSFit, GFit, Gnuplot, GFitViewer, MyAstroUtils
using CL_1ES_1927p654
using Dates
epoch_filenames = Vector{String}()
for (root, dirs, files) in walkdir("AT2018zf")
for file in files
if file[end-3:end] == ".dat"
push!(epoch_filenames, root * "/" * file)
end
end
end
function read_spec(epoch_id; kw...)
if epoch_id == "B03"
file = "boller2003.txt"
else
file = epoch_filenames[epoch_id]
end
println(file)
spec = Spectrum(Val(:ASCII), file, columns=[1,2]; kw...);
if isa(epoch_id, Number)
spec.flux ./= all_scale[epoch_id]
end
spec.err .= 0.05 .* spec.flux;
return spec
end
source = QSO{q1927p654}("1ES 1927+654 (Boller03)", Z, ebv=EBV);
source.options[:min_spectral_coverage][:OIII_5007] = 0.35
# source.options[:host_template] = "/home/gcalderone/Mbi1.30Zm1.49T00.0700_iTp0.00_baseFe_linear_FWHM_2.51"
#=
Resolution: from Sect 3 it is 6 / 5007 * 3e5 ~ 360 km/s
however with this value the [OIII] FWHM is 100 km/s (limit)
I tried 180, 200 and 250, and the [OIII] luminosity do not change
=#
spec = read_spec("B03", resolution=200.)
add_spec!(source, spec);
(model, bestfit) = fit(source);
viewer(model, source, bestfit, showcomps=[:qso_cont, :galaxy, :balmer])
println( bestfit[:OIII_5007].norm.val )
# 0.00029085925218136
println( bestfit[:OIII_5007].norm.val / bestfit[:galaxy].norm.val )
# 59.406476855719376
all_scale = fill(1., length(epoch_filenames))
all_fwhm = fill(NaN,length(epoch_filenames))
for id in 1:length(epoch_filenames)
spec = read_spec(id)
all_scale[id] *= median(spec.flux) / 25000
try
source = QSO{q1927p654}("1ES 1927+654 ($id)", Z, ebv=EBV);
source.options[:min_spectral_coverage][:OIII_5007] = 0.5
# source.options[:host_template] = "/home/gcalderone/Mbi1.30Zm1.49T00.0700_iTp0.00_baseFe_linear_FWHM_2.51"
spec = read_spec(id)
add_spec!(source, spec);
(model, bestfit) = fit(source);
viewer(model, source, bestfit, showcomps=[:qso_cont, :galaxy, :balmer],
filename="output/results_$(id).html")
# Update all_scale and store FWHM
@info bestfit[:OIII_5007].norm.val
all_scale[id] *= bestfit[:OIII_5007].norm.val
all_fwhm[ id] = bestfit[:OIII_5007].fwhm.val
catch
end
end
all_scale[.!isfinite.(all_fwhm)] .= NaN
serialize("output/scale_fwhm.dat", (all_scale, all_fwhm))
@gp :prenorm "set key bottom right" "set grid" xlab="Epoch" ylab="Value" :-
@gp :- :prenorm all_scale./1e-18 "w lp t '[OIII] norm.'" :-
@gp :- :prenorm all_fwhm./1000 "w lp t '[OIII] FWHM (x1000 km/s)"
save(:prenorm, term="png size 800,600", output="output/oiii_norm_fwhm.png")
w = 10 .^(2:0.01:log10(400));
r = sqrt.(400^2 .- w.^2) ./ 2.355;
@gp w r "w l t '400 km/s'"
w = 10 .^(2:0.01:log10(900));
r = sqrt.(900^2 .- w.^2) ./ 2.355;
@gp :- w r "w l t '900 km/s'"
@gp :- "set grid" xlab="Actual FWHM" ylab="Instr. resolution"
# Ensure no sample is negative
@gp :allepochs "set grid" xr=[3e3,1e4] cbr=[1,29] :-
@gp :- :allepochs cblabel="Epoch" xlab="Rest frame wavelength[A]" ylab="Flux density [arb.units]"
for id in 1:length(epoch_filenames)
s = read_spec(id)
x = s.λ;
y = s.flux;
y .-= median(y)
@gp :- :allepochs x./(1+Z) y "u 1:(\$2+$id):($id) w l notit lc pal" :-
end
@gp :- :allepochs yr=[1, 29]
save(:allepochs, term="png size 800,600", output="output/all_epochs.png")
@gp :- :allepochs xr=[4900, 5100]
save(:allepochs, term="png size 800,2000", output="output/all_epochs_zoom.png")
dict_chosen_epochs = Dict(
:vecchi => [17, 10, 21, 23],
:lowres => [8,9,10,11,12,14,15,16,18,21,22,23,24,25],
:highres => [5, 7, 13, 17, 20],
:all => collect(5:26))
#=
TODO:
- neglect 9 for limited spectral coverage (it lacks the blue part)?
- gli altri strani sono 3 e 16
=#
# Can't use resolution smaller than 150 km / s otherwise some line
# will be neglected because of spectral coverage
resolution = Dict(
:lowres => 350.,
:highres => 150.,
:all => NaN)
for job in [:highres, :lowres]
chosen_epochs = dict_chosen_epochs[job]
source = QSO{q1927p654}("1ES 1927+654", Z, ebv=EBV);
source.options[:min_spectral_coverage][:OIII_5007] = 0.5
@gp :zoom "set grid" :-
for id in 1:length(chosen_epochs)
spec = read_spec(chosen_epochs[id], resolution=get(resolution, job, NaN))
add_spec!(source, spec);
@gp :- :zoom xr=[4750,5150] spec.λ ./ (1 + source.z) spec.flux "w l t '$(chosen_epochs[id])'"
end
(model, bestfit) = multi_fit(source);
viewer(model, source, bestfit, showcomps=[:qso_cont, :galaxy, :balmer],
filename="output/results_$(job).html")
viewer(model, source, bestfit, showcomps=[:qso_cont, :galaxy, :balmer],
filename="output/results_$(job)_rebin4.html", rebin=4)
models = Dict()
for id in 1:length(chosen_epochs)
models[(id, :x)] = domain(model[id])[:]
models[(id, :y)] = model[id]()
models[(id, :l5100)] = 5100 .* Spline1D(domain(model[id])[:], model[id]())(5100.)
for cname in [:qso_cont, :OIII_5007,
:br_Ha, :na_Ha, :bb_Ha,
:br_Hb, :na_Hb, :bb_Hb]
models[(id, cname)] = model[id](cname)
end
end
serialize("output/results_$(job).dat", (models, bestfit))
end
function cont_at(bestfit, λ)
A1 = bestfit[:qso_cont].norm.val - bestfit[:qso_cont].norm.unc
A = bestfit[:qso_cont].norm.val
A2 = bestfit[:qso_cont].norm.val + bestfit[:qso_cont].norm.unc
if A1 > A2
A1, A2 = A2, A1
end
@assert A1 <= A2
B1 = (λ / bestfit[:qso_cont].x0.val)^(bestfit[:qso_cont].alpha.val - bestfit[:qso_cont].alpha.unc)
B = (λ / bestfit[:qso_cont].x0.val)^(bestfit[:qso_cont].alpha.val)
B2 = (λ / bestfit[:qso_cont].x0.val)^(bestfit[:qso_cont].alpha.val + bestfit[:qso_cont].alpha.unc)
if B1 > B2
B1, B2 = B2, B1
end
@assert B1 <= B2
dd = extrema([A1*B1, A1*B2, A2*B1, A2*B2])
return λ * A * B, λ * (dd[2]-dd[1])
end
tabellone = DataFrame(epoch=Int[], date=String[], galaxy=Float64[],
contslope=Float64[], cont5100=Float64[], l5100=Float64[],
bb_Ha_norm=Float64[], bb_Ha_fwhm=Float64[], bb_Ha_voff=Float64[],
br_Ha_norm=Float64[], br_Ha_fwhm=Float64[], br_Ha_voff=Float64[],
na_Ha_norm=Float64[], na_Ha_fwhm=Float64[], na_Ha_voff=Float64[],
bb_Hb_norm=Float64[], bb_Hb_fwhm=Float64[], bb_Hb_voff=Float64[],
br_Hb_norm=Float64[], br_Hb_fwhm=Float64[], br_Hb_voff=Float64[],
na_Hb_norm=Float64[], na_Hb_fwhm=Float64[], na_Hb_voff=Float64[],
oiii_fwhm=Float64[], oiii_voff=Float64[])
for id in 1:length(bestfit.preds)
push!(tabellone,
(id, epoch_filenames[id][27:end-4],
bestfit[id][:galaxy].norm.val,
bestfit[id][:qso_cont].alpha.val, cont_at(bestfit[id], 4000)[1], 5100 * models[(id,:l5100)],
bestfit[id][:bb_Ha].norm.patched, bestfit[id][:bb_Ha].fwhm.patched, bestfit[id][:bb_Ha].voff.patched,
bestfit[id][:br_Ha].norm.patched, bestfit[id][:br_Ha].fwhm.patched, bestfit[id][:br_Ha].voff.patched,
bestfit[id][:na_Ha].norm.patched, bestfit[id][:na_Ha].fwhm.patched, bestfit[id][:na_Ha].voff.patched,
bestfit[id][:bb_Hb].norm.patched, bestfit[id][:bb_Hb].fwhm.patched, bestfit[id][:bb_Hb].voff.patched,
bestfit[id][:br_Hb].norm.patched, bestfit[id][:br_Hb].fwhm.patched, bestfit[id][:br_Hb].voff.patched,
bestfit[id][:na_Hb].norm.patched, bestfit[id][:na_Hb].fwhm.patched, bestfit[id][:na_Hb].voff.patched,
bestfit[id][:OIII_5007].fwhm.patched, bestfit[id][:OIII_5007].voff.patched))
end
dd = Date.(tabellone.date, Ref("yyyymmdd"))
tabellone[!, :day] .= getproperty.(dd - dd[1], :value)
f = FITS("1ES_1927p654_results_$(job).fits", "w")
write(f, tabellone)
close(f)
@gp( [bestfit[id][:qso_cont].alpha.val for id in 1:length(chosen_epochs)],
[bestfit[id][:br_Ha].norm.patched for id in 1:length(chosen_epochs)],
"w l")
@gp(:-,
[bestfit[id][:qso_cont].alpha.val for id in 1:length(chosen_epochs)],
[bestfit[id][:br_Hb].norm.patched for id in 1:length(chosen_epochs)],
"w l")
@gp( [bestfit[id][:qso_cont].alpha.val for id in 1:length(chosen_epochs)],
[cont_at(bestfit[id], 5100)[1] for id in 1:length(chosen_epochs)],
"w l")
@gp( [cont_at(bestfit[id], 5100)[1] for id in 1:length(chosen_epochs)],
[bestfit[id][:br_Ha].norm.patched for id in 1:length(chosen_epochs)],
"w l")
@gp( [models[(id, :l5100)] for id in 1:length(chosen_epochs)],
[bestfit[id][:br_Ha].norm.patched for id in 1:length(chosen_epochs)],
"w l")
@gp tabellone.day [cont_at(bestfit[id], 5100)[1] for id in 1:length(chosen_epochs)] "w l" ylog=true
@gp :- tabellone.day [bestfit[id][:br_Ha].norm.patched for id in 1:length(chosen_epochs)] .* 1e2 "w l"
@gp :- tabellone.day [bestfit[id][:br_Hb].norm.patched for id in 1:length(chosen_epochs)] .* 1e2 "w l"
@gp :- tabellone.day [models[(id, :l5100)] for id in 1:length(chosen_epochs)] "w l"
@gp tabellone.day -3 .+ 1e-3 .*[cont_at(bestfit[id], 5100)[1] for id in 1:length(chosen_epochs)] "w lp"
@gp :- tabellone.day [bestfit[id][:qso_cont].alpha.val for id in 1:length(chosen_epochs)] "w lp"
@gp "set grid"
for id in 1:length(chosen_epochs)
#@gp :- models[(id, :x)] models[(id, :y)] "w l t '$id' lw 3"
@gp :- models[(id, :x)] models[(id, :qso_cont)] "w l t '$id' lw 2"
end
save(:prenorm, term="png size 800,600", output="output/evolution.png")
@gp "set grid"
for id in 1:length(chosen_epochs)
println(bestfit[id][:OIII_5007])
x = models[(id, :x)]
y = models[(id, :y)]
y0 = y .- models[(id, :OIII_5007)]
#@gp :- x y0 .- Spline1D(x, y0)(5007.) "w l t '$id'"
@gp :- x y .- Spline1D(x, y0)(5007.) "w l t '$id'"
end
save(:prenorm, term="png size 800,600", output="output/evolution_oiii_norm.png")
......@@ -2,7 +2,7 @@ module CL_1ES_1927p654
using QSFit, DataStructures, GFit, Statistics, Dierckx
import QSFit: AbstractSpectralLine, DefaultRecipe, CombinedLine, NarrowLine, BroadLine, BroadBaseLine, ComboBroadLine,
default_options, qso_cont_component, line_component, line_group_name, known_spectral_lines, fit, multiepoch_fit, spectral_coverage
default_options, qso_cont_component, line_component, line_group_name, known_spectral_lines, fit, multi_fit, spectral_coverage
abstract type q1927p654 <: DefaultRecipe end
......@@ -59,11 +59,11 @@ function known_spectral_lines(::Type{T}) where T <: q1927p654
list[:NeIII_3869 ] = NarrowLine( 3869.81 )
#list[:Hd ] = BroadLine( 4102.89 )
list[:Hg ] = CombinedLine( 4341.68 )
list[:Hg_base ] = BroadBaseLine( 4341.68 )
#list[:OIII_4363 ] = NarrowLine( 4363.00 ) # TODO: Check wavelength is correct
list[:bb_Hg ] = BroadBaseLine( 4341.68 )
list[:OIII_4363 ] = NarrowLine( 4363.00 ) # TODO: Check wavelength is correct
list[:HeII ] = BroadLine( 4686. )
list[:Hb ] = CombinedLine( 4862.68 )
list[:Hb_base ] = BroadBaseLine( 4862.68 )
list[:bb_Hb ] = BroadBaseLine( 4862.68 )
list[:OIII_4959 ] = NarrowLine( 4960.295)
list[:OIII_5007 ] = NarrowLine( 5008.240) # AsymmNarrowLine
#list[:OIII_5007_bw] = NarrowLine( 5008.240)
......@@ -72,7 +72,7 @@ function known_spectral_lines(::Type{T}) where T <: q1927p654
list[:OI_6364 ] = NarrowLine( 6364.00 ) # TODO: Check wavelength is correct
list[:NII_6549 ] = NarrowLine( 6549.86 )
list[:Ha ] = CombinedLine( 6564.61 )
list[:Ha_base ] = BroadBaseLine( 6564.61 )
list[:bb_Ha ] = BroadBaseLine( 6564.61 )
list[:NII_6583 ] = NarrowLine( 6585.27 )
list[:SII_6716 ] = NarrowLine( 6718.29 )
list[:SII_6731 ] = NarrowLine( 6732.67 )
......
calibsum(calib, args...) = calib .* (.+(args...))
function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p654
function multi_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p654
Nspec = length(source.domain)
elapsed = time()
mzer = GFit.cmpfit()
mzer.config.ftol = mzer.config.gtol = mzer.config.xtol = 1.e-6
# Arrays containing best fit values to be constrained across epochs
galaxy_best = Vector{Float64}()
galaxy_unc = Vector{Float64}()
OIII_best = Vector{Float64}()
OIII_unc = Vector{Float64}()
# Initialize components and guess initial values
println(source.log, "\nFit continuum components...")
preds = Vector{Prediction}()
......@@ -37,10 +28,17 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
λ = source.domain[id][:]
# Host galaxy template
if source.options[:use_host_template]
if source.options[:use_host_template] &&
(minimum(λ) .< 5500 .< maximum(λ))
add!(model[id], :Continuum => Reducer(sum, [:qso_cont, :galaxy]),
:galaxy => QSFit.hostgalaxy(source.options[:host_template]))
model[id][:galaxy].norm.val = Spline1D(λ, source.data[id].val, k=1, bc="error")(5500.)
if id != ref_id
model[id][:galaxy].norm.fixed = true
patch!(model) do m
m[id][:galaxy].norm = m[ref_id][:galaxy].norm
end
end
end
# Balmer continuum and pseudo-continuum
......@@ -55,29 +53,26 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
c.norm.high = 0.5
c.ratio.val = 0.5
c.ratio.fixed = false
c.ratio.low = 0.3
c.ratio.low = 0.1
c.ratio.high = 1
patch!(model) do m
m[id][:balmer].norm *= m[id][:qso_cont].norm
end
end
end
for id in 1:Nspec
bestfit = GFit.fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
push!(galaxy_best, bestfit[id][:galaxy].norm.val)
push!(galaxy_unc , bestfit[id][:galaxy].norm.unc)
end
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
# QSO continuum renormalization
for id in 1:Nspec
freeze(model[id], :qso_cont)
c = model[id][:qso_cont]
initialnorm = c.norm.val
if c.norm.val > 0
println(source.log, "$id: Cont. norm. (before): ", c.norm.val)
while true
residuals = (model[id]() - source.data[id].val) ./ source.data[id].unc
(count(residuals .< 0) / length(residuals) > 0.9) && break
(c.norm.val < initialnorm / 5) && break # give up
c.norm.val *= 0.99
evaluate!(model)
end
......@@ -105,7 +100,7 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
threshold = get(source.options[:min_spectral_coverage], :ironuv, source.options[:min_spectral_coverage][:default])
if coverage >= threshold
add!(model[id], :ironuv => comp)
model[:ironuv].norm.val = 0.5
model[id][:ironuv].norm.val = 0.5
push!(iron_components, :ironuv)
else
println(source.log, "Ignoring ironuv component on prediction $id (threshold: $threshold)")
......@@ -136,7 +131,7 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
add!(model[id], :Iron => Reducer(sum, iron_components))
add!(model[id], :main => Reducer(sum, [:Continuum, :Iron]))
evaluate!(model)
bestfit = GFit.fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
else
add!(model[id], :Iron => Reducer(() -> [0.], Symbol[]))
add!(model[id], :main => Reducer(sum, [:Continuum, :Iron]))
......@@ -223,16 +218,37 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
end
end
if haskey(model[id], :br_Hb) &&
haskey(model[id], :bb_Hb)
# Ensure luminosity at peak of the broad base component is
# smaller than the associated broad component:
model[id][:bb_Hb].norm.high = 1
model[id][:bb_Hb].norm.val = 0.5
patch!(model) do m
m[id][:Ha_base].fwhm += m[id][:br_Ha].fwhm
m[id][:bb_Hb].norm *= m[id][:br_Hb].norm / m[id][:br_Hb].fwhm * m[id][:bb_Hb].fwhm
end
end
if haskey(model[id], :br_Ha) &&
haskey(model[id], :bb_Ha)
# Ensure luminosity at peak of the broad base component is
# smaller than the associated broad component:
model[id][:bb_Ha].norm.high = 1
model[id][:bb_Ha].norm.val = 0.5
patch!(model) do m
m[id][:bb_Ha].norm *= m[id][:br_Ha].norm / m[id][:br_Ha].fwhm * m[id][:bb_Ha].fwhm
end
end
# Avoid division by zero
model[id][:br_Ha].norm.low = 1.e-10
model[id][:na_Hg].norm.fixed = 1
model[id][:na_Hg].fwhm.fixed = 1
model[id][:na_Hg].voff.fixed = 1
model[id][:Hg_base].norm.fixed = 1
model[id][:Hg_base].fwhm.fixed = 1
model[id][:Hg_base].voff.fixed = 1
model[id][:bb_Hg].norm.fixed = 1
model[id][:bb_Hg].fwhm.fixed = 1
model[id][:bb_Hg].voff.fixed = 1
model[id][:br_Hg].fwhm.fixed = 1
model[id][:br_Hg].voff.fixed = 1
patch!(model) do m
......@@ -240,9 +256,9 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
m[id][:na_Hg].voff = m[id][:na_Ha].voff
m[id][:na_Hg].fwhm = m[id][:na_Ha].fwhm
m[id][:Hg_base].norm = m[id][:br_Hg].norm * (m[id][:Ha_base].norm / m[id][:br_Ha].norm)
m[id][:Hg_base].voff = m[id][:Ha_base].voff
m[id][:Hg_base].fwhm = m[id][:Ha_base].fwhm
m[id][:bb_Hg].norm = m[id][:br_Hg].norm * (m[id][:bb_Ha].norm / m[id][:br_Ha].norm)
m[id][:bb_Hg].voff = m[id][:bb_Ha].voff
m[id][:bb_Hg].fwhm = m[id][:bb_Ha].fwhm
m[id][:br_Hg].voff = m[id][:br_Ha].voff
m[id][:br_Hg].fwhm = m[id][:br_Ha].fwhm
......@@ -251,9 +267,9 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
model[id][:na_Hb].norm.fixed = 1
model[id][:na_Hb].fwhm.fixed = 1
model[id][:na_Hb].voff.fixed = 1
model[id][:Hb_base].norm.fixed = 1
model[id][:Hb_base].fwhm.fixed = 1
model[id][:Hb_base].voff.fixed = 1
model[id][:bb_Hb].norm.fixed = 1
model[id][:bb_Hb].fwhm.fixed = 1
model[id][:bb_Hb].voff.fixed = 1
model[id][:br_Hb].fwhm.fixed = 1
model[id][:br_Hb].voff.fixed = 1
patch!(model) do m
......@@ -261,17 +277,18 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
m[id][:na_Hb].voff = m[id][:na_Ha].voff
m[id][:na_Hb].fwhm = m[id][:na_Ha].fwhm
m[id][:Hb_base].norm = m[id][:br_Hb].norm * (m[id][:Ha_base].norm / m[id][:br_Ha].norm)
m[id][:Hb_base].voff = m[id][:Ha_base].voff
m[id][:Hb_base].fwhm = m[id][:Ha_base].fwhm
m[id][:bb_Hb].norm = m[id][:br_Hb].norm * (m[id][:bb_Ha].norm / m[id][:br_Ha].norm)
m[id][:bb_Hb].voff = m[id][:bb_Ha].voff
m[id][:bb_Hb].fwhm = m[id][:bb_Ha].fwhm
m[id][:br_Hb].voff = m[id][:br_Ha].voff
m[id][:br_Hb].fwhm = m[id][:br_Ha].fwhm
end
bestfit = GFit.fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
push!(OIII_best, bestfit[id][:OIII_5007].norm.val)
push!(OIII_unc , bestfit[id][:OIII_5007].norm.unc)
model[id][:OIII_5007].norm.fixed = 1
model[id][:OIII_5007].norm.val = 1.
bestfit = fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
for lname in line_names[id]
freeze(model[id], lname)
......@@ -282,9 +299,9 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
println(source.log, "\nFit unknown emission lines...")
if source.options[:n_unk] > 0
for id in 1:Nspec
tmp = OrderedDict{Symbol, AbstractComponent}()
tmp = OrderedDict{Symbol, GFit.AbstractComponent}()
for j in 1:source.options[:n_unk]
tmp[Symbol(:unk, j)] = line_component(TRecipe, UnkLine(5e3))
tmp[Symbol(:unk, j)] = line_component(TRecipe, QSFit.UnkLine(5e3))
tmp[Symbol(:unk, j)].norm_integrated = source.options[:norm_integrated]
end
add!(model[id], :UnkLines => Reducer(sum, collect(keys(tmp))), tmp)
......@@ -298,7 +315,7 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
# Here we need a :UnkLines reducer, even when n_unk is 0
for id in 1:Nspec
add!(model[id], :UnkLines => Reducer(() -> [0.], Symbol[]))
add!(model[id], :main => Reducer(sum, [:Continuum, :Iron, line_groups[id]..., :UnkLines]))
add!(model[id], :main => Reducer(sum, [:Continuum, :Iron, line_groups[id]...]))
end
end
evaluate!(model)
......@@ -337,56 +354,14 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
model[id][cname].center.low = λ[iadd] - λ[iadd]/10. # allow to shift 10%
model[id][cname].center.high = λ[iadd] + λ[iadd]/10.
thaw(model, cname)
bestfit = GFit.fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
freeze(model, cname)
thaw(model[id], cname)
bestfit = fit!(model, only_id=id, source.data, minimizer=mzer); show(source.log, bestfit)
freeze(model[id], cname)
end
end
evaluate!(model)
# ----------------------------------------------------------------
# Constrain component normalization across epochs. Note:
# reference spectrum must have reliable estimation of all common
# components
rval = [galaxy_best[ref_id], OIII_best[ref_id]]
runc = [galaxy_unc[ ref_id], OIII_unc[ ref_id]]
@assert count((rval .!= 0) .& (runc .!= 0)) == 2
# Estimate calibration in all epochs w.r.t. reference epoch
for id in 1:Nspec
if id != ref_id
val = [galaxy_best[id], OIII_best[id]]
unc = [galaxy_unc[ id], OIII_unc[ id]]
j = findall((val .!= 0) .& (unc .!= 0))
R = val[j] ./ rval[j]
R_unc = (unc[j] ./ val[j] .+ runc[j] ./ rval[j]) .* R
ratio = sum(R ./ R_unc) ./ sum(1 ./ R_unc)
for cname in keys(preds[id].cevals)
if :norm in propertynames(model[cname])
model[cname].norm.val /= ratio
end
end
model[id][:galaxy].norm.fixed = true
model[id][:OIII_5007].norm.fixed = true
add!(model[id],
:main => Reducer(calibsum, [:calib, :Continuum, :Iron, line_groups[id]..., :UnkLines]),
:calib => ratio)
end
end
evaluate!(model)
for id in 1:Nspec
if id != ref_id
patch!(model) do m
m[id][ :galaxy].norm = m[ref_id][ :galaxy].norm
m[id][:OIII_5007].norm = m[ref_id][:OIII_5007].norm
end
end
end
evaluate!(model)
# Last run with all parameters free
println(source.log, "\nLast run with all parameters free...")
for id in 1:Nspec
......@@ -408,11 +383,8 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
freeze(model[id], cname)
end
end
if id != ref_id
thaw(model[id], :calib) # parameter is fixed in preds[ref_id]
end
end
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
# Disable "unknown" lines whose normalization uncertainty is larger
# than 3 times the normalization
......@@ -435,7 +407,7 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
end
if needs_fitting
println(source.log, "\nRe-run fit...")
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
end
println(source.log, "\nFinal model and bestfit:")
......@@ -447,6 +419,5 @@ function multiepoch_fit(source::QSO{TRecipe}; ref_id=1) where TRecipe <: q1927p6
println(source.log, "\nElapsed time: $elapsed s")
QSFit.close_log(source)
QSFit.populate_metadata!(source, model)
return (model, bestfit)
end
......@@ -18,7 +18,8 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
c.norm.val = Spline1D(λ, source.data[id].val, k=1, bc="error")(c.x0.val)
# Host galaxy template
if source.options[:use_host_template]
if source.options[:use_host_template] &&
(minimum(λ) .< 5500 .< maximum(λ))
add!(model, :Continuum => Reducer(sum, [:qso_cont, :galaxy]),
:galaxy => QSFit.hostgalaxy(source.options[:host_template]))
model[:galaxy].norm.val = Spline1D(λ, source.data[id].val, k=1, bc="error")(5500.)
......@@ -36,23 +37,25 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
c.norm.high = 0.5
c.ratio.val = 0.5
c.ratio.fixed = false
c.ratio.low = 0.3
c.ratio.low = 0.1
c.ratio.high = 1
patch!(model) do m
m[:balmer].norm *= m[:qso_cont].norm
end
end
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
# QSO continuum renormalization
freeze(model, :qso_cont)
c = model[:qso_cont]
if c.norm.val > 0
println(source.log, "Cont. norm. (before): ", c.norm.val)
initialnorm = c.norm.val
while true
residuals = (model() - source.data[id].val) ./ source.data[id].unc
(count(residuals .< 0) / length(residuals) > 0.9) && break
(c.norm.val < initialnorm / 5) && break # give up
c.norm.val *= 0.99
evaluate!(model)
end
......@@ -107,7 +110,7 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
add!(model, :Iron => Reducer(sum, iron_components))
add!(model, :main => Reducer(sum, [:Continuum, :Iron]))
evaluate!(model)
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
else
add!(model, :Iron => Reducer(() -> [0.], Symbol[]))
add!(model, :main => Reducer(sum, [:Continuum, :Iron]))
......@@ -191,16 +194,37 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
end
end
if haskey(model, :br_Hb) &&
haskey(model, :bb_Hb)
# Ensure luminosity at peak of the broad base component is
# smaller than the associated broad component:
model[:bb_Hb].norm.high = 1
model[:bb_Hb].norm.val = 0.5
patch!(model) do m
m[:Ha_base].fwhm += m[:br_Ha].fwhm
m[:bb_Hb].norm *= m[:br_Hb].norm / m[:br_Hb].fwhm * m[:bb_Hb].fwhm
end
end
if haskey(model, :br_Ha) &&
haskey(model, :bb_Ha)
# Ensure luminosity at peak of the broad base component is
# smaller than the associated broad component:
model[:bb_Ha].norm.high = 1
model[:bb_Ha].norm.val = 0.5
patch!(model) do m
m[:bb_Ha].norm *= m[:br_Ha].norm / m[:br_Ha].fwhm * m[:bb_Ha].fwhm
end
end
# Avoid division by zero
model[:br_Ha].norm.low = 1.e-10
model[:na_Hg].norm.fixed = 1
model[:na_Hg].fwhm.fixed = 1
model[:na_Hg].voff.fixed = 1
model[:Hg_base].norm.fixed = 1
model[:Hg_base].fwhm.fixed = 1
model[:Hg_base].voff.fixed = 1
model[:bb_Hg].norm.fixed = 1
model[:bb_Hg].fwhm.fixed = 1
model[:bb_Hg].voff.fixed = 1
model[:br_Hg].fwhm.fixed = 1
model[:br_Hg].voff.fixed = 1
patch!(model) do m
......@@ -208,9 +232,9 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
m[:na_Hg].voff = m[:na_Ha].voff
m[:na_Hg].fwhm = m[:na_Ha].fwhm
m[:Hg_base].norm = m[:br_Hg].norm * (m[:Ha_base].norm / m[:br_Ha].norm)
m[:Hg_base].voff = m[:Ha_base].voff
m[:Hg_base].fwhm = m[:Ha_base].fwhm
m[:bb_Hg].norm = m[:br_Hg].norm * (m[:bb_Ha].norm / m[:br_Ha].norm)
m[:bb_Hg].voff = m[:bb_Ha].voff
m[:bb_Hg].fwhm = m[:bb_Ha].fwhm
m[:br_Hg].voff = m[:br_Ha].voff
m[:br_Hg].fwhm = m[:br_Ha].fwhm
......@@ -219,9 +243,9 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
model[:na_Hb].norm.fixed = 1
model[:na_Hb].fwhm.fixed = 1
model[:na_Hb].voff.fixed = 1
model[:Hb_base].norm.fixed = 1
model[:Hb_base].fwhm.fixed = 1
model[:Hb_base].voff.fixed = 1
model[:bb_Hb].norm.fixed = 1
model[:bb_Hb].fwhm.fixed = 1
model[:bb_Hb].voff.fixed = 1
model[:br_Hb].fwhm.fixed = 1
model[:br_Hb].voff.fixed = 1
patch!(model) do m
......@@ -229,15 +253,15 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
m[:na_Hb].voff = m[:na_Ha].voff
m[:na_Hb].fwhm = m[:na_Ha].fwhm
m[:Hb_base].norm = m[:br_Hb].norm * (m[:Ha_base].norm / m[:br_Ha].norm)
m[:Hb_base].voff = m[:Ha_base].voff
m[:Hb_base].fwhm = m[:Ha_base].fwhm
m[:bb_Hb].norm = m[:br_Hb].norm * (m[:bb_Ha].norm / m[:br_Ha].norm)
m[:bb_Hb].voff = m[:bb_Ha].voff
m[:bb_Hb].fwhm = m[:bb_Ha].fwhm
m[:br_Hb].voff = m[:br_Ha].voff
m[:br_Hb].fwhm = m[:br_Ha].fwhm
end
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
for lname in line_names
freeze(model, lname)
end
......@@ -245,9 +269,9 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
# Add unknown lines
println(source.log, "\nFit unknown emission lines...")
if source.options[:n_unk] > 0
tmp = OrderedDict{Symbol, AbstractComponent}()
tmp = OrderedDict{Symbol, GFit.AbstractComponent}()
for j in 1:source.options[:n_unk]
tmp[Symbol(:unk, j)] = line_component(TRecipe, UnkLine(5e3))
tmp[Symbol(:unk, j)] = line_component(TRecipe, QSFit.UnkLine(5e3))
tmp[Symbol(:unk, j)].norm_integrated = source.options[:norm_integrated]
end
add!(model, :UnkLines => Reducer(sum, collect(keys(tmp))), tmp)
......@@ -291,7 +315,7 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
model[cname].center.high = λ[iadd] + λ[iadd]/10.
thaw(model, cname)
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
freeze(model, cname)
end
end
......@@ -317,7 +341,7 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
freeze(model, cname)
end
end
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
# Disable "unknown" lines whose normalization uncertainty is larger
# than 3 times the normalization
......@@ -338,7 +362,7 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
end
if needs_fitting
println(source.log, "\nRe-run fit...")
bestfit = GFit.fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
bestfit = fit!(model, source.data, minimizer=mzer); show(source.log, bestfit)
end
println(source.log, "\nFinal model and bestfit:")
......@@ -350,6 +374,5 @@ function fit(source::QSO{TRecipe}; id=1) where TRecipe <: q1927p654
println(source.log, "\nElapsed time: $elapsed s")
QSFit.close_log(source)
QSFit.populate_metadata!(source, model)
return (model, bestfit)
end