8000 Add support for GONG Magnetograms to Map · Issue #8006 · sunpy/sunpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for GONG Magnetograms to Map #8006

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

Closed
samaloney opened this issue Jan 10, 2025 · 0 comments · Fixed by #8007
Closed

Add support for GONG Magnetograms to Map #8006

samaloney opened this issue Jan 10, 2025 · 0 comments · Fixed by #8007
Labels
Effort Medium Requires a moderate time investment. Feature Request New feature wanted. map Affects the map submodule Package Novice Requires little technical knowledge of the package. Priority Medium Non-urgent action required. Source Metadata Issues with a file's metadata

Comments

@samaloney
Copy link
Contributor
samaloney commented Jan 10, 2025

Describe the feature

GONG Magnetograms are available via the VSO but currently don't work in map due to non-standard keywords.

q = Fido.search(a.Time('2025-01-09T00:00', '2025-01-09T10:00'), a.Source.gong, a.Physobs.los_magnetic_field)
q[0][0].fileurl
 'ftp://gong2.nso.edu/oQR/bqa/202501/lebqa250109/lebqa250109t0134.fits.gz' # I just happen to know can change to http and still works
gmag = Map('https://gong2.nso.edu/oQR/bqa/202501/lebqa250109/lebqa250109t0134.fits.gz')
Files Downloaded: 100%|█████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.31s/file]
---------------------------------------------------------------------------
MapMetaValidationError                    Traceback (most recent call last)
Cell In[51], line 1
----> 1 gmag = Map('https://gong2.nso.edu/oQR/bqa/202501/lebqa250109/lebqa250109t0134.fits.gz')

File ~/.virtualenvs/sunpy-dev/lib/python3.11/site-packages/astropy/utils/decorators.py:604, in deprecated_renamed_argument.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    601             msg += f"\n        Use {alternative} instead."
    602         warnings.warn(msg, warning_type, stacklevel=2)
--> 604 return function(*args, **kwargs)

File ~/Projects/sunpy-dev/sunpy/map/map_factory.py:305, in MapFactory.__call__(self, composite, sequence, silence_errors, allow_errors, *args, **kwargs)
    302 meta = MetaDict(header)
    304 try:
--> 305     new_map = self._check_registered_widgets(data, meta, **kwargs)
    306     new_maps.append(new_map)
    307 except (NoMatchError, MultipleMatchError, ValidationFunctionError, MapMetaValidationError) as e:

File ~/Projects/sunpy-dev/sunpy/map/map_factory.py:354, in MapFactory._check_registered_widgets(self, data, meta, **kwargs)
    351 # Only one is found
    352 WidgetType = candidate_widget_types[0]
--> 354 return WidgetType(data, meta, **kwargs)

File ~/Projects/sunpy-dev/sunpy/map/mapbase.py:268, in GenericMap.__init__(self, data, header, plot_settings, **kwargs)
    264 self._default_heliographic_longitude = None
    266 # Validate header
    267 # TODO: This should be a function of the header, not of the map
--> 268 self._validate_meta()
    269 self.plot_settings = {'cmap': 'gray',
    270                     'interpolation': 'nearest',
    271                     'origin': 'lower'
    272                     }
    273 if self.dtype != np.uint8:
    274     # Put import here to reduce sunpy.map import time

File ~/Projects/sunpy-dev/sunpy/map/mapbase.py:1572, in GenericMap._validate_meta(self)
   1569 if err_message:
   1570     err_message.append(
   1571         f'See {_META_FIX_URL} for instructions on how to add missing metadata.')
-> 1572     raise MapMetaValidationError('\n'.join(err_message))
   1574 for meta_property in ('waveunit', ):
   1575     if (self.meta.get(meta_property) and
   1576         u.Unit(self.meta.get(meta_property),
   1577                parse_strict='silent').physical_type == 'unknown'):

MapMetaValidationError: Image coordinate units for axis 1 not present in metadata.
Image coordinate units for axis 2 not present in metadata.
See https://docs.sunpy.org/en/stable/how_to/fix_map_metadata.html for instructions on how to add missing metadata.

Proposed solution

Add GONG Magnegtogram specific map source to account for these - might be able to share a lot with the current GONG H-alpha map source (need to confirm this)

@nabobalis nabobalis added map Affects the map submodule Feature Request New feature wanted. Package Novice Requires little technical knowledge of the package. Priority Medium Non-urgent action required. Effort Medium Requires a moderate time investment. Source Metadata Issues with a file's metadata labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort Medium Requires a moderate time investment. Feature Request New feature wanted. map Affects the map submodule Package Novice Requires little technical knowledge of the package. Priority Medium Non-urgent action required. Source Metadata Issues with a file's metadata
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0