Skip to content

Commit

Permalink
Merge pull request #85 from kateharborne/dev-SFR
Browse files Browse the repository at this point in the history
dev-SFR
  • Loading branch information
kateharborne committed Jun 9, 2023
2 parents fb904cd + 043266b commit e1a6dd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SimSpin
Type: Package
Title: SimSpin - A package for the kinematic analysis of galaxy simulations
Version: 2.4.7
Version: 2.4.8
Author: Katherine Harborne
Co-author: Alice Serene
Maintainer: <katherine.harborne@icrar.org>
Expand Down
7 changes: 4 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SimSpin v2.4.7 News
# SimSpin v2.4.8 News

### Last edit: 26/04/23
### Last edit: 09/06/23

Below is a table containing a summary of all changes made to SimSpin, since the date this file was created on 26/08/2021.

Expand All @@ -16,7 +16,8 @@ All changes are noted in the changelog table below.

| Date | Summary of change | Version | Commit | Author |
|---------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |--------- |------------------------------------------ | ----------------- |
| 26/04/23 | Inverse variance cubes have large values that do not save to FITS successfully. Dividing by 1e40 to remove this issue and incorporating this with the units. Also modifying S/N description to give the MINIMUM S/N in the image, not the maximum. | 2.4.7 | Kate Harborne |
| 09/06/23 | Fixing the SFR maps produced in method = `gas` or `sf gas` mode. Previous values returned were mass-weighted mean SFR along the line-of-sight, now adjusted to give the sum of spawned fraction SFR along the LOS. | 2.4.8 | | Kate Harborne |
| 26/04/23 | Inverse variance cubes have large values that do not save to FITS successfully. Dividing by 1e40 to remove this issue and incorporating this with the units. Also modifying S/N description to give the MINIMUM S/N in the image, not the maximum. | 2.4.7 | fb904cd302cc6b8edda2032bb68fa8cd6b233f8a | Kate Harborne |
| 23/04/23 | Fixing the noise implementation in methods spectral and velocity. Adding inverse variance cubes to the output when a S/N value is specified. Incorporating tests to check proper incorporation and behaviour. | 2.4.6 | 8eef4e6dea8f9901b83ced8f2b43cee1438fe034 | Kate Harborne |
| 18/04/23 | Updating the methodology for method = "velocity" (details below) and fixing dependencies (resolving the Rfits and ProFit versions clash). Added header information to the SimSpin file made such that the whole file can be recreated using the information in the file rather than having to retain the code used to build the file. | 2.4.5 | cdf5522fb6040b7a5fdcf5ea4a54df7e576f57d5 | Kate Harborne |
| | 1. Modified the Gauss-Hermite fitting function to use the mean and standard deviation of the LOSVD as priors on the fit, but reporting the observed velocity and dispersion as those returned by the fit Gauss-Hermite along with h3 and h4. | | | |
Expand Down
11 changes: 7 additions & 4 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
mass_map[part_in_spaxel$pixel_pos[i]] = sum(galaxy_sample$Mass)
vel_los[part_in_spaxel$pixel_pos[i]] = .meanwt(galaxy_sample$vy, galaxy_sample$Mass)
dis_los[part_in_spaxel$pixel_pos[i]] = sqrt(.varwt(galaxy_sample$vy, galaxy_sample$Mass))
SFR_map[part_in_spaxel$pixel_pos[i]] = .meanwt(galaxy_sample$SFR, galaxy_sample$Mass)
SFR_map[part_in_spaxel$pixel_pos[i]] = sum(galaxy_sample$SFR)
Z_map[part_in_spaxel$pixel_pos[i]] = log10(mean(galaxy_sample$Metallicity)/0.0127)
OH_map[part_in_spaxel$pixel_pos[i]] = log10(mean(galaxy_sample$Oxygen/galaxy_sample$Hydrogen))+12

Expand Down Expand Up @@ -1822,7 +1822,7 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
mass_map = sum(galaxy_sample$Mass)
vel_los = .meanwt(galaxy_sample$vy, galaxy_sample$Mass)
dis_los = sqrt(.varwt(galaxy_sample$vy, galaxy_sample$Mass))
SFR_map = .meanwt(galaxy_sample$SFR, galaxy_sample$Mass)
SFR_map = sum(galaxy_sample$SFR)
Z_map = log10(mean(galaxy_sample$Metallicity)/0.0127)
OH_map = log10(mean(galaxy_sample$Oxygen/galaxy_sample$Hydrogen))+12

Expand Down Expand Up @@ -1871,6 +1871,7 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
new_gas_part[ind1:ind2, y := part$y+new_xyz[,2],]
new_gas_part[ind1:ind2, z := part$z+new_xyz[,3],]
new_gas_part[ind1:ind2, Mass := part$Mass*rand_pos$weight,]
new_gas_part[ind1:ind2, SFR := part$SFR*rand_pos$weight,]
# in the new data.frame of particle properties, assign their
# new positions and masses scaled by the kernel weight.
}
Expand All @@ -1890,7 +1891,7 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
i = integer()

output = foreach(i = 1:no_gas, .combine='.comb', .multicombine=TRUE,
.init=list(list(), list(), list(), list())) %dopar% {
.init=list(list(), list(), list(), list(), list())) %dopar% {

part = gas_part[i,]

Expand All @@ -1902,8 +1903,9 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
y = part$y+new_xyz[,2]
z = part$z+new_xyz[,3]
Mass = part$Mass*rand_pos$weight
SFR = part$SFR*rand_pos$weight

return(list(x, y, z, Mass))
return(list(x, y, z, Mass, SFR))
closeAllConnections()
}

Expand All @@ -1912,6 +1914,7 @@ globalVariables(c(".N", ":=", "Age", "Carbon", "CellSize", "Density", "Hydrogen"
new_gas_part[, y := as.numeric(unlist(output[[2]])),]
new_gas_part[, z := as.numeric(unlist(output[[3]])),]
new_gas_part[, Mass := as.numeric(unlist(output[[4]])),]
new_gas_part[, SFR := as.numeric(unlist(output[[5]])),]

return(new_gas_part)
}

0 comments on commit e1a6dd4

Please sign in to comment.