Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions install/database/2026_09_10_solohi_source.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
INSERT INTO datasources (
id,
name,
description,
units,
layeringOrder,
enabled,
sourceIdGroup,
displayOrder
)
VALUES
(503, 'SoloHI', 'Solar Orbiter Heliospheric Imager', NULL, 1, 0, '', 0);

INSERT INTO datasource_property (
sourceId,
label,
name,
fitsName,
description,
uiOrder
)
VALUES
(503, 'Observatory', 'SOLO', 'Solar_Orbiter', 'Solar Orbiter', 1),
(503, 'Instrument', 'SoloHI', 'SoloHI', 'SoloHI', 2),
(503, 'Measurement', 'Difference Mosaic', 'Difference Mosaic', 'Difference Mosaic', 3);
4 changes: 4 additions & 0 deletions install/helioviewer/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def create_datasource_table(cursor):
(134, 'PUNCH', 'PUNCH WFI+NFI PAM Mosaic', NULL, 1, 0, '', 0, 0, 0, 0),
(132, 'GOES', 'CCOR-1', NULL, 1, 0, '', 0, 0, 0, 0),
(133, 'SWFO-L1', 'CCOR-2', NULL, 1, 0, '', 0, 0, 0, 0),
(503, 'SoloHI', 'Solar Orbiter Heliospheric Imager', NULL, 1, 0, '', 0, 0, 0, 0),
(601, 'SPICE 77.04', 'Solar Orbiter SPICE 77.04', 'NM', 1, 0, '', 0, 0, 0, 0),
(602, 'SPICE 103.19', 'Solar Orbiter SPICE 103.19', 'NM', 1, 0, '', 0, 0, 0, 0),
(603, 'SPICE 70.38', 'Solar Orbiter SPICE 70.38', 'NM', 1, 0, '', 0, 0, 0, 0),
Expand Down Expand Up @@ -942,6 +943,9 @@ def create_datasource_property_table(cursor):
(133, 'Instrument', 'CCOR-2', 'CCOR2', 'CCOR-2',2),
(133, 'Detector', 'CCOR-2', '1', 'CCOR-2',2),
(133, 'Measurement', 'white-light', 'white-light', 'White Light',3),
(503, 'Observatory', 'SOLO', 'Solar_Orbiter', 'Solar Orbiter', 1),
(503, 'Instrument', 'SoloHI', 'SoloHI', 'SoloHI', 2),
(503, 'Measurement', 'Difference Mosaic', 'Difference Mosaic', 'Difference Mosaic', 3),
(601, 'Observatory', 'SOLO', 'Solar_Orbiter', 'Solar Orbiter', 1),
(601, 'Instrument', 'SPICE', 'SPICE', 'SPICE', 2),
(601, 'Measurement', 'intensity', 'intensity', 'intensity', 3),
Expand Down
1 change: 1 addition & 0 deletions install/helioviewer/hvpull/net/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ def get_servers(cls):
"kcor": "KCORDataServer",
"hv_kcor": "HVKCORDataServer",
"solar_orbiter": "SolarOrbiterDataServer",
"solohi": "SoloHIDataServer",
"spice": "SpiceDataServer",
"suvi": "SUVIDataServer",
"iris": "IRISDataServer",
Expand Down
3 changes: 1 addition & 2 deletions install/helioviewer/hvpull/servers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ def get_starttime(self):
"""Default start time to use when retrieving data"""
return datetime.datetime.utcnow() - datetime.timedelta(hours=6)

def get_dates(self, starttime, endtime):
def get_dates(self, starttime, endtime, fmt = "%Y/%m/%d"):
"""Get a complete list of dates between the start and the end time"""
fmt = "%Y/%m/%d"
dates = [starttime.strftime(fmt)]

date = starttime.date()
Expand Down
23 changes: 23 additions & 0 deletions install/helioviewer/hvpull/servers/solohi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import datetime
from helioviewer.hvpull.servers import DataServer

class SoloHIDataServer(DataServer):
def __init__(self):
"""Defines the root directory of where the data is kept at LMSAL."""
DataServer.__init__(self, "https://solohi.nrl.navy.mil/so_data/MOS_jp2/", "SoloHI")

def compute_directories(self, start_date, end_date):
"""Computes a list of remote directories expected to contain files"""
dirs = []

for date in self.get_dates(start_date, end_date, "%Y%m%d"):
dirs.append(os.path.join(self.uri, date))

return dirs

def get_datetime_from_file(self, filename):
url_filename = os.path.basename(filename)
url_datetime = url_filename[-23:-8]
return datetime.datetime.strptime(url_datetime, '%Y%m%d_%H%M%S')

5 changes: 5 additions & 0 deletions install/helioviewer/jp2parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def getData(self):
# For PUNCH, the different types (e.g. CAM, PAM) are only in the file name,
# not anywhere inside the metadata.
image['detector'] = self._get_punch_file_type(self._filepath)
elif image['instrument'] == 'SoloHI':
imageData.nickname = 'HI Difference Mosaic'
image['detector'] = "SoloHI"
# In sunpy V3, the nickname changed to include the filter.
# Having the space in it breaks how helioviewer loads images due to
# the space in the file name. To prevent this problem we're selecting
Expand Down Expand Up @@ -129,6 +132,8 @@ def getData(self):
elif image['instrument'] == "SPICE":
image['measurement'] = 'intensity'
image['line'] = self._get_spice_line(imageData)
elif image['instrument'] == 'SoloHI':
image['measurement'] = 'Difference Mosaic'
else:
image['measurement'] = measurement
image['date'] = self._get_date(imageData)
Expand Down
10 changes: 5 additions & 5 deletions management/data/get_jp2_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def get_config(filepath):
default_userconfig = os.path.join(basedir, 'settings/settings.cfg')

if filepath is not None and os.path.isfile(filepath):
config.readfp(open(filepath))
config.read_file(open(filepath))
elif os.path.isfile(default_userconfig):
config.readfp(open(default_userconfig))
config.read_file(open(default_userconfig))
else:
config.readfp(open(os.path.join(basedir, 'settings/settings.example.cfg')))
config.read_file(open(os.path.join(basedir, 'settings/settings.example.cfg')))

return config

Expand All @@ -72,12 +72,12 @@ def get_db_with_config(cfg):
dbuser = conf.get('database', 'dbuser')
dbpass = conf.get('database', 'dbpass')
db, cursor = get_db_cursor(dbhost, dbname, dbuser, dbpass)
return cursor
return db, cursor

def main():
args = parse_args()
print(args)
cursor = get_db_with_config(args.config)
db, cursor = get_db_with_config(args.config)

extract_datasource_name(args.jp2_file, cursor)

Expand Down
Loading