Skip to content
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

Refactoring __init__ #970

Merged
merged 3 commits into from
Aug 10, 2024
Merged

Refactoring __init__ #970

merged 3 commits into from
Aug 10, 2024

Conversation

xandrd
Copy link
Collaborator

@xandrd xandrd commented Aug 10, 2024

Addressing #946. All poes tests are ok

@xandrd xandrd changed the title Refactoring __init__ for poes Refactoring __init__ for poes and lanl Aug 10, 2024
@xandrd
Copy link
Collaborator Author

xandrd commented Aug 10, 2024

Also added lanl

@xandrd xandrd changed the title Refactoring __init__ for poes and lanl Refactoring __init__ Aug 10, 2024
@xandrd
Copy link
Collaborator Author

xandrd commented Aug 10, 2024

Swarm is added as well. However, there are few notes

  1. Swarm request data from HAPI, so, there are no obvious force_download option. Nevertheless, it is introduced as follows:
"""
    force_download : bool, default=False
        Swarm data is requested via HAPI. This parameter always ignored and reserved for compatibility.
"""
  1. load function modifies prefix.
    for this_probe in probe:
        prefix = 'swarm' + this_probe.lower() + '_'
        if instrument == 'mag':
            dataset = 'SW_OPER_MAG' + this_probe.upper() + '_' + datatype.upper() + '_' + level[1:].upper()
            tvars = hapi(trange=tr, 
                         server=server, 
                         dataset=dataset, 
                         parameters=varnames,
                         suffix=suffix,
                         prefix=prefix)

Since prefix is passed as a parameter, new code is (see implementation of prefix2):

    if prefix:
        prefix2 = prefix
    else:
        prefix2 = ''

    for this_probe in probe:
        prefix = prefix2 + 'swarm' + this_probe.lower() + '_'
        if instrument == 'mag':
            dataset = 'SW_OPER_MAG' + this_probe.upper() + '_' + datatype.upper() + '_' + level[1:].upper()
            tvars = hapi(trange=tr, 
                         server=server, 
                         dataset=dataset, 
                         parameters=varnames,
                         suffix=suffix,
                         prefix=prefix)

@jameswilburlewis jameswilburlewis merged commit c52b46c into master Aug 10, 2024
4 checks passed
@jameswilburlewis
Copy link
Contributor

It all looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants