-
-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line absorption rate estimator #595
Changes from 2 commits
6f95494
6ff58aa
467c23a
733b694
e0c5a1d
b39cae9
598abc0
c863f78
3457c7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,10 @@ | |
#define LOG_VPACKETS 0 | ||
#endif | ||
|
||
#define RESONANCE 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could this be an enum? |
||
#define DOWNBRANCH 1 | ||
#define MACROATOM 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather work with enums and not use preprocessor statements. |
||
|
||
typedef void (*montecarlo_event_handler_t) (rpacket_t *packet, | ||
storage_model_t *storage, | ||
double distance, rk_state *mt_state); | ||
|
@@ -67,6 +71,10 @@ void increment_j_blue_estimator (const rpacket_t * packet, | |
storage_model_t * storage, | ||
double d_line, int64_t j_blue_idx); | ||
|
||
void increment_Edotlu_estimator (const rpacket_t * packet, | ||
storage_model_t * storage, | ||
int64_t j_blue_idx); | ||
|
||
int64_t montecarlo_one_packet (storage_model_t * storage, rpacket_t * packet, | ||
int64_t virtual_mode, rk_state *mt_state); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ class StorageModel(Structure): | |
('line_lists_tau_sobolevs_nd', c_int64), | ||
('line_lists_j_blues', POINTER(c_double)), | ||
('line_lists_j_blues_nd', c_int64), | ||
('line_lists_Edotlu', POINTER(c_double)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think here's your bug.
|
||
('no_of_lines', c_int64), | ||
('no_of_edges', c_int64), | ||
('line_interaction_id', c_int64), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not yet the final estimator, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all that we said is needed in the montecarlo code. There is a factor$1 - e^{\tau_{lu}}$ and some normalization needed after the run to get the complete estimator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no - the factor 1 - exp(-tau_s) is not global. Instead it is different for each line interaction. As the subscribed lu suggests, it is a quantity which depends on the line transition. In fact, this is the Sobolev line optical depth. It will be different in each shell and for each line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify: the factor (1 - exp(-tau_s)) describes the interaction probability, i.e. the probability of a packet which comes into resonance with the line to interact with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it depends on the transition, I just meant to say that the tau for each line is added to the estimator(s, the code above is also for each transition and each shell) once all monte carlo steps have finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tobychev - hmm, I guess you could do that. But I think it should be easier to add the factor already during the increment. This way you avoid looping over all entries at the end again.