Morisset / pySSN

Pythonic Spectral Synthesis for Nebulae
Other
4 stars 2 forks source link

Check velocity for profiles #29

Closed Morisset closed 5 years ago

Morisset commented 5 years ago

It seems that there is hard coded a value of 20 for profile number 1. But it is 1.0 in the default profile file.

mvfcopetti commented 5 years ago

In the procedure 'do_profile_dict', spectrum.py, emis_profiles['1'] = {'T4': 1e4, 'vel':0.0, 'params': [['G', '1.00', '0.0', '20.0']]}

The procedure 'profil_emis' in profiles.py is not in use.

Did I understand the problem correctly?

Em qui, 31 de jan de 2019 às 13:25, Christophe Morisset < notifications@github.com> escreveu:

It seems that there is hard coded a value of 20 for profile number 1. But it is 1.0 in the default profile file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Morisset/pySSN/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/AWS_5VEQwTeGg19MkbNwy2U8tow2jQWgks5vIuDVgaJpZM4acNHn .

-- Saudações, Marcus Copetti

Morisset commented 5 years ago

The hard coded value of emis_profiles['1'] is used in case a user-defined profile is defined in a file (specified with "fic_profile" in init) but no value is given for the '1' profile. In this case, the data/default_profiles.dat is not read and no value is defined for '1' keyword in the emis_profiles dictionnary. We are checking that this is actually the behaviour, and we will see if this is what we want. BTW: the "fic_profile" parameter was not defined in init_defaults, I added it (set to None).

mvfcopetti commented 5 years ago

There is a bug in the procedure 'do_profile_dict'. The last key is never added to emis_profiles. As data/default_profiles.dat has only one key, it is being ignored. The simplest solution is to add the last key after the block. ... with open(self.fic_profs) as f: .... if prof_params is not None: emis_profiles[key] = {'T4': T4, 'vel': vel, 'params' : prof_params}

Em qui, 31 de jan de 2019 às 16:36, Christophe Morisset < notifications@github.com> escreveu:

The hard coded value of emis_profiles['1'] is used in case a user-defined profile is defined in a file (specified with "fic_profile" in init) but no value is given for the '1' profile. In this case, the data/default_profiles.dat is not read and no value is defined for '1' keyword in the emis_profiles dictionnary. We are checking that this is actually the behaviour, and we will see if this is what we want. BTW: the "fic_profile" parameter was not saved defined in init_defaults, I added it (set to None).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Morisset/pySSN/issues/29#issuecomment-459389129, or mute the thread https://github.com/notifications/unsubscribe-auth/AWS_5UEDzDbX54q24xVa-tGXYeN97jeqks5vIw1qgaJpZM4acNHn .

-- Saudações, Marcus Copetti

Morisset commented 5 years ago

I do not see the bug in action. I changed the data/default_profiles.dat values and saw the profile actually changed. There is actually the last key added after the block. You may have an older version.

mvfcopetti commented 5 years ago

Ok, I am wrong again. By the way, emis_profiles['1'] = {'T4': 1e4, 'vel':0.0, 'params': [['G', '1.00', '0.0','20.0']]} should be changed to emis_profiles['1'] = {'T4': 1.0, 'vel':0.0, 'params': [['G', 1.0, 0.0, 1.0]]} ^^^ ^^^^^^^^^^ (numbers)

Morisset commented 5 years ago

Done ;-)