Last Updated: 09/22/2023

How to use the CCMC-created Python Script to write an SEP Scoreboard JSON data file

You can download the helper script (sep_json_writer.py) here (last updated on 2021.08.11). The helper script is supposed to help the modeler to provide their model data to the CCMC in the proper JSON format required by the SEP Scoreboard.

There are three ways to use the helper script to write out JSON data files for the SEP Scoreboard.

  1. If your model is written in Python, inside your Python script, call the class inside the helper script file. (If you're going to go to this trouble, it would be better to load the Python JSON library and write it. See https://stackabuse.com/reading-and-writing-json-to-a-file-in-python/ on how to do that.)
  2. Call the helper script with command line arguments.
  3. Make a Python library file with your data and import it. (This is the least recommended method.)

Method 1 - Call the class inside the helper script

Really, if you're able to do this, it would be better for you to add this to your python script:

#Import Python's JSON reading-and-writing library. It's built in. No need to download or install anything.
import json

#Get all your data into a python dictionary, organized exactly like the JSON output you are looking for.
data = {<get all your data into the python dictionary>}

#Open an output file, named however you please. We suggest your file name be <ModelShortName>.<PredictionWindowStartTime>.<IssueTime>.json
with open('YourModelShortName.PWStartTime.IssueTime.json', 'w') as outfile:
    json.dump(data, outfile)

If you really don't want to do that, you can follow these steps:

  1. Define dataD as a python dictionary with all your values (see sep_example_python_dictionary_format.py as an example)
  2. Set the following variables: . output_file_basename (string, the basename you want the output file to have, otherwise it will be .<issue_time>.<current_time>.json) . output_dir (string, full path to directory to hold the output JSON files) . log_msgs (boolean, True if you want to log messages, False if you don’t want to log messages) . log_dir (string, full path to log directory. Feel free to use ‘./’, the current directory.) . log_starter (string, beginning of the log filename NOTE: date and time will be added automatically).
  3. Add the following to your code:
from sep_json_writer import ConvertToJSON

ConvertToJSON(dataD, output_file_basename, output_dir, log_msgs, log_dir, log_starter)

Method 2 - Call the helper script with command line arguments

This section has

usage: sep_json_writer.py

    [-h]
    [-o OUTPUT_FILENAME]
    [-d OUTPUT_DIR]
    [-n]
    [-l LOG_DIR]
    [-b LOG_STARTER]
    [--import-data-dictionary]
    [--data-dictionary DATA_DICTIONARY]
    [--contact-name CONTACT_NAME]
    [--contact-email CONTACT_EMAIL]
    [--model-short-name MODEL_SHORT_NAME]
    [--spase-id SPASE_ID]
    [--issue-time ISSUE_TIME]
    [--mode MODE]
    [--cme-start-time CME_START_TIME]
    [--cme-liftoff-time CME_LIFTOFF_TIME]
    [--cme-lat CME_LAT]
    [--cme-lon CME_LON]
    [--cme-pa CME_PA]
    [--cme-half-width CME_HALF_WIDTH]
    [--cme-speed CME_SPEED]
    [--cme-acceleration CME_ACCELERATION]
    [--cme-height CME_HEIGHT]
    [--cme-time-at-height-time CME_TIME_AT_HEIGHT_TIME]
    [--cme-time-at-height-height CME_TIME_AT_HEIGHT_HEIGHT]
    [--cme-coordinates CME_COORDINATES]
    [--cme-catalog CME_CATALOG]
    [--cme-catalog-id CME_CATALOG_ID]
    [--cme-urls [CME_URLS [CME_URLS ...]]]
    [--flare-last-data-time FLARE_LAST_DATA_TIME]
    [--flare-start-time FLARE_START_TIME]
    [--flare-peak-time FLARE_PEAK_TIME]
    [--flare-end-time FLARE_END_TIME]
    [--flare-location FLARE_LOCATION]
    [--flare-intensity FLARE_INTENSITY]
    [--flare-integrated-intensity FLARE_INTEGRATED_INTENSITY]
    [--flare-noaa-region FLARE_NOAA_REGION]
    [--flare-urls [FLARE_URLS [FLARE_URLS ...]]]
    [--cme-sim-model CME_SIM_MODEL]
    [--cme-sim-completion-time CME_SIM_COMPLETION_TIME]
    [--cme-sim-urls [CME_SIM_URLS [CME_SIM_URLS ...]]]
    [--pi-observatory PI_OBSERVATORY]
    [--pi-instrument PI_INSTRUMENT]
    [--pi-last-data-time PI_LAST_DATA_TIME]
    [--pi-ongoing-events-start-time [PI_ONGOING_EVENTS_START_TIME [PI_ONGOING_EVENTS_START_TIME ...]]]
    [--pi-ongoing-events-threshold [PI_ONGOING_EVENTS_THRESHOLD [PI_ONGOING_EVENTS_THRESHOLD ...]]]
    [--pi-ongoing-events-energy-min [PI_ONGOING_EVENTS_ENERGY_MIN [PI_ONGOING_EVENTS_ENERGY_MIN ...]]]
    [--pi-ongoing-events-energy-max [PI_ONGOING_EVENTS_ENERGY_MAX [PI_ONGOING_EVENTS_ENERGY_MAX ...]]]
    [--magcon-method [MAGCON_METHOD [MAGCON_METHOD ...]]]
    [--magcon-lat [MAGCON_LAT [MAGCON_LAT ...]]]
    [--magcon-lon [MAGCON_LON [MAGCON_LON ...]]]
    [--magcon-angle-great-circle [MAGCON_ANGLE_GREAT_CIRCLE [MAGCON_ANGLE_GREAT_CIRCLE ...]]]
    [--magcon-angle-lat [MAGCON_ANGLE_LAT [MAGCON_ANGLE_LAT ...]]]
    [--magcon-angle-lon [MAGCON_ANGLE_LON [MAGCON_ANGLE_LON ...]]]
    [--magcon-solar-wind-observatory [MAGCON_SOLAR_WIND_OBSERVATORY [MAGCON_SOLAR_WIND_OBSERVATORY ...]]]
    [--magcon-solar-wind-speed [MAGCON_SOLAR_WIND_SPEED [MAGCON_SOLAR_WIND_SPEED ...]]]
    [--magnetogram-observatory [MAGNETOGRAM_OBSERVATORY [MAGNETOGRAM_OBSERVATORY ...]]]
    [--magnetogram-instrument [MAGNETOGRAM_INSTRUMENT [MAGNETOGRAM_INSTRUMENT ...]]]
    [--magnetogram-product [MAGNETOGRAM_PRODUCT [MAGNETOGRAM_PRODUCT ...]]]
    [--magnetogram-product-last-data-time [MAGNETOGRAM_PRODUCT_LAST_DATA_TIME [MAGNETOGRAM_PRODUCT_LAST_DATA_TIME ...]]]
    [--energy-min ENERGY_MIN]
    [--energy-max ENERGY_MAX]
    [--energy-units ENERGY_UNITS]
    [--species SPECIES]
    [--location LOCATION]
    [--prediction-window PREDICTION_WINDOW PREDICTION_WINDOW]
    [--peak-intensity PEAK_INTENSITY]
    [--peak-intensity-units PEAK_INTENSITY_UNITS]
    [--peak-intensity-uncertainty PEAK_INTENSITY_UNCERTAINTY]
    [--peak-intensity-uncertainty-low PEAK_INTENSITY_UNCERTAINTY_LOW]
    [--peak-intensity-uncertainty-high PEAK_INTENSITY_UNCERTAINTY_HIGH]
    [--peak-intensity-time PEAK_INTENSITY_TIME]
    [--peak-intensity-esp PEAK_INTENSITY_ESP]
    [--peak-intensity-esp-units PEAK_INTENSITY_ESP_UNITS]
    [--peak-intensity-esp-uncertainty PEAK_INTENSITY_ESP_UNCERTAINTY]
    [--peak-intensity-esp-uncertainty-low PEAK_INTENSITY_ESP_UNCERTAINTY_LOW]
    [--peak-intensity-esp-uncertainty-high PEAK_INTENSITY_ESP_UNCERTAINTY_HIGH]
    [--peak-intensity-esp-time PEAK_INTENSITY_ESP_TIME]
    [--peak-intensity-max PEAK_INTENSITY_MAX]
    [--peak-intensity-max-units PEAK_INTENSITY_MAX_UNITS]
    [--peak-intensity-max-uncertainty PEAK_INTENSITY_MAX_UNCERTAINTY]
    [--peak-intensity-max-uncertainty-low PEAK_INTENSITY_MAX_UNCERTAINTY_LOW]
    [--peak-intensity-max-uncertainty-high PEAK_INTENSITY_MAX_UNCERTAINTY_HIGH]
    [--peak-intensity-max-time PEAK_INTENSITY_MAX_TIME]
    [--fluences [FLUENCES [FLUENCES ...]]]
    [--fluence-units [FLUENCE_UNITS [FLUENCE_UNITS ...]]]
    [--fluence-uncertainty-low [FLUENCE_UNCERTAINTY_LOW [FLUENCE_UNCERTAINTY_LOW ...]]]
    [--fluence-uncertainty-high [FLUENCE_UNCERTAINTY_HIGH [FLUENCE_UNCERTAINTY_HIGH ...]]]
    [--event-length-start-times [EVENT_LENGTH_START_TIMES [EVENT_LENGTH_START_TIMES ...]]]
    [--event-length-end-times [EVENT_LENGTH_END_TIMES [EVENT_LENGTH_END_TIMES ...]]]
    [--event-length-threshold-starts [EVENT_LENGTH_THRESHOLD_STARTS [EVENT_LENGTH_THRESHOLD_STARTS ...]]]

    [--event-length-threshold-units [EVENT_LENGTH_THRESHOLD_UNITS [EVENT_LENGTH_THRESHOLD_UNITS ...]]]
    [--thresh-crossing-times [THRESH_CROSSING_TIMES [THRESH_CROSSING_TIMES ...]]]
    [--thresh-uncertainties [THRESH_UNCERTAINTIES [THRESH_UNCERTAINTIES ...]]]
    [--crossing-thresholds [CROSSING_THRESHOLDS [CROSSING_THRESHOLDS ...]]]
    [--crossing-threshold-units [CROSSING_THRESHOLD_UNITS [CROSSING_THRESHOLD_UNITS ...]]]
    [--probabilities [PROBABILITIES [PROBABILITIES ...]]]
    [--prob-uncertainties [PROB_UNCERTAINTIES [PROB_UNCERTAINTIES ...]]]
    [--prob-thresholds [PROB_THRESHOLDS [PROB_THRESHOLDS ...]]]
    [--prob-threshold-units [PROB_THRESHOLD_UNITS [PROB_THRESHOLD_UNITS ...]]]
    [--all-clear ALL_CLEAR]
    [--all-clear-threshold ALL_CLEAR_THRESHOLD]
    [--all-clear-threshold-units ALL_CLEAR_THRESHOLD_UNITS]
    [--all-clear-probability-threshold ALL_CLEAR_PROBABILITY_THRESHOLD]
    [--sep-profile SEP_PROFILE]
    [--native-id NATIVE_ID]

Details about the optional arguments for sep_json_writer.py

flagsdescriptionrequired
-h, --helpshow this help message and exitOptional Supercedes all other arguments
-o OUTPUT_FILENAME, --output OUTPUT_FILENAMEJSON output filename.Optional Default is the <model_short_name>.<prediction_window_start_time>.<issue_time>.json
-d OUTPUT_DIR, --output-dir OUTPUT_DIRFull path to output directory. Default is current directory.Optional Default is the current directory.
-n, --no-loggingTurn off logging.Optional It is turned on by default.
-l LOG_DIR, --log-dir LOG_DIRFull path to log directory.Optional Default is the current directory.
-b LOG_STARTER, --log-basename LOG_STARTERBeginning of the log filename (date and time will be added automatically).Optional Default is 'isep_model_run'.
--import-data-dictionaryimport the data dictionary (in the 'sep_forecast_submission_dataDict' variable from a file named 'named input_sep.py', OR use the --data-dictionary option to specify the full path to the file that holds the 'sep_forecast_submission_dataDict' variable.Optional
--data-dictionary DATA_DICTIONARYfull path to the file holding the 'sep_forecast_submission_dataDict' data dictionary. NOTE: this is ignored if --import-data-dictionary is not used.Optional
--model-short-name [MODEL_SHORT_NAME [MODEL_SHORT_NAME ...]]Short name (e.g. acronym) of model to appear on scoreboard. Consider including version number with acronym if distinction needed. 30 character limit.Required
--spase-id SPASE_IDLink to URL of full model description metadata in CCMC metadata registry in SPASE format (contact CCMC to register your model).Required
--issue-time ISSUE_TIMEForecast issue time (e.g. model run is complete and forecast is created)Required
--mode MODEAllowed values: forecast, historical, nowcast, simulated_realtime_forecast. Default is 'forecast'.Optional
--cme-start-time CME_START_TIMEProvide if forecast is issued based on a CME trigger. Timestamp of 1st coronagraph image CME is visible in.Optional
--cme-liftoff-time CME_LIFTOFF_TIMETimestamp of coronagraph image with 1st indication of CME liftoff (used by CACTUS).Optional
--cme-lat CME_LATCME latitude (deg).Optional, but required with cme-lon
--cme-lon CME_LONCME latitude (deg).Optional, but required with cme-lat
--cme-pa CME_PACME plane-of-sky position angle (measured from solar north in degrees counter-clockwise ).Optional
--cme-half-width CME_HALF_WIDTHCME half-width (deg).Optional
--cme-speed CME_SPEEDCME speed (km/s).Optional
--cme-acceleration CME_ACCELERATIONCME acceleration (km/s^2).Optional
--cme-height CME_HEIGHTCME height at which the above parameters were derived (solar radii from Sun center).Optional
--cme-time-at-height-time CME_TIME_AT_HEIGHT_TIMECME time at specificied height.Optional, required with cme_time_at_height_height
--cme-time-at-height-height CME_TIME_AT_HEIGHT_HEIGHTSpecificied height in solar radii.Optional, required with cme_time_at_height_time
--cme-coordinates CME_COORDINATESCoordinate system for CME lat/lon parameters (e.g. HEEQ or Carrington)Optional, but required with cme-lat or cme-lon
--cme-catalog CME_CATALOGName of catalog where CME information was pulled from. Allowed values: ARTEMIS, DONKI, HELCATS, JHU APL, CACTUS_NRL, CACTUS_SIDC, CORIMP, SEEDS, SOHO_CDAW, STEREO_COR1, SWPC (contact us to add a new catalog name)Optional
--cme-catalog-id CME_CATALOG_IDID value for the catalog where CME information was pulled from.Required if catalog value is DONKI, otherwise it is optional
--cme-urls [CME_URLS [CME_URLS ...]]List of urls where CME information can be found, or information was pulled from.Optional, more than one is allowed
--flare-last-data-time FLARE_LAST_DATA_TIMELast time data timestamp that was used to create forecast (relevant for forecasts issued before flare end times)Optional
--flare-start-time FLARE_START_TIMEFlare start timeOptional
--flare-peak-time FLARE_PEAK_TIMEFlare peak timeOptional
--flare-end-time FLARE_END_TIMEFlare end timeOptional
--flare-location FLARE_LOCATIONFlare location in Stonyhurst coordinates (i.e., N00W00/S00E00 format).Optional
--flare-intensity FLARE_INTENSITYFlare intensity (W/m^2)Optional
--flare-integrated-intensity FLARE_INTEGRATED_INTENSITYFlare integrated intensity (J/m^2)Optional
--flare-noaa-region FLARE_NOAA_REGIONAssociated NOAA active region number (including the preceding 1)Optional
--flare-urls [FLARE_URLS [FLARE_URLS ...]]List of urls where flare information can be found, or information was pulled from.Optional, more than one is allowed
--cme-sim-model CME_SIM_MODELModel nameOptional
--cme-sim-completion-time CME_SIM_COMPLETION_TIMESimulation completion timeOptional, required if cme-sim-model is used
--cme-sim-urls [CME_SIM_URLS [CME_SIM_URLS ...]]List of urls where simulation information can be found, or information was pulled from.Optional, more than one is allowed
--pi-observatory PI_OBSERVATORYName of observatory/spacecraft data are from.Optional
--pi-instrument PI_INSTRUMENTName of instrument data are from.Optional, required if pi-observatory used
--pi-last-data-time PI_LAST_DATA_TIMELast time data timestamp used to create forecast.Optional, required if pi-observatory used
--pi-ongoing-events-start-time [PI_ONGOING_EVENTS_START_TIME [PI_ONGOING_EVENTS_START_TIME ...]]If an ongoing event triggers your forecast, this is the start time.Optional
--pi-ongoing-events-threshold [PI_ONGOING_EVENTS_THRESHOLD [PI_ONGOING_EVENTS_THRESHOLD ...]]If an ongoing event triggers your forecast, this is the threshold used to define the event in pfu.Optional, required if pi-ongoing-events-start-time used
--pi-ongoing-events-energy-min [PI_ONGOING_EVENTS_ENERGY_MIN [PI_ONGOING_EVENTS_ENERGY_MIN ...]]If an ongoing event triggers your forecast, this is the min of energy channel range in MeV.Optional, required if pi-ongoing-events-start-time used
--pi-ongoing-events-energy-max [PI_ONGOING_EVENTS_ENERGY_MAX [PI_ONGOING_EVENTS_ENERGY_MAX ...]]If an ongoing event triggers your forecast, this is the max of energy channel range in MeV. -1 represents an unbounded integral channel.Optional, required if pi-ongoing-events-start-time used
--magcon-method [MAGCON_METHOD [MAGCON_METHOD ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. allowed values: Parker Spiral, PFSS-Parker Spiral, WSA, WSA-ENLIL, ADAPT-WSA-ENLIL (contact us to add your method to this format).Optional, required if magnetic_connectivity was used
--magcon-lat [MAGCON_LAT [MAGCON_LAT ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Latitude (deg) position of magnetic field line footpoint linking the observing spacecraft to the Sun (in Stonyhurst coordinates).Optional
--magcon-lon [MAGCON_LON [MAGCON_LON ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Longitude (deg) position of magnetic field line footpoint linking the observing spacecraft to the Sun (in Stonyhurst coordinates).Optional, required, if magnetic_connectivity used
--magcon-angle-great-circle [MAGCON_ANGLE_GREAT_CIRCLE [MAGCON_ANGLE_GREAT_CIRCLE ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Angle (deg) between the related solar event and the foot point of the magnetic field line linking the observing spacecraft to the Sun.Optional
--magcon-angle-lat [MAGCON_ANGLE_LAT [MAGCON_ANGLE_LAT ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Angle between the related solar event and the foot point of the magnetic field line linking the observing spacecraft to the Sun. connection angle lat = solar event lat - magnetic connectivity footpoint latOptional
--magcon-angle-lon [MAGCON_ANGLE_LON [MAGCON_ANGLE_LON ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Angle between the related solar event and the foot point of the magnetic field line linking the observing spacecraft to the Sun. connection angle lon = solar event lon - magnetic connectivity footpoint lonOptional, required, if connection_angle used).
--magcon-solar-wind-observatory [MAGCON_SOLAR_WIND_OBSERVATORY [MAGCON_SOLAR_WIND_OBSERVATORY ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Use if a certain solar wind speed was assumed to compute the magnetic connectivity observatory string optional Name of observatory/spacecraft data are fromOptional, required, if solar_wind used
--magcon-solar-wind-speed [MAGCON_SOLAR_WIND_SPEED [MAGCON_SOLAR_WIND_SPEED ...]]Provide if specific magnetic connectivity information was used to produce your forecast method string required, if magnetic_connectivity used. Use if a certain solar wind speed was assumed to compute the magnetic connectivity. Assumed solar wind speed to compute magnetic connectivity.Optional, required, if solar_wind used
--magnetogram-observatory [MAGNETOGRAM_OBSERVATORY [MAGNETOGRAM_OBSERVATORY ...]]Provide if a magnetogram was used to produce your forecast. Name of observatory/spacecraft data are from.Optional, required if magnetogram was used.
--magnetogram-instrument [MAGNETOGRAM_INSTRUMENT [MAGNETOGRAM_INSTRUMENT ...]]Provide if a magnetogram was used to produce your forecast. Name of instrument data are from.Optional, required if magnetogram was used.
--magnetogram-product [MAGNETOGRAM_PRODUCT [MAGNETOGRAM_PRODUCT ...]]Provide if a magnetogram was used to produce your forecast. Name of data product used.Optional
--magnetogram-product-last-data-time [MAGNETOGRAM_PRODUCT_LAST_DATA_TIME [MAGNETOGRAM_PRODUCT_LAST_DATA_TIME ...]]Provide if a magnetogram was used to produce your forecast Last time data timestamp available at the time of forecast.Optional, required if magnetogram was used.
--energy-min ENERGY_MINMin of energy channel range.Required
--energy-max ENERGY_MAXMax of energy channel range. -1 represented an unbounded integral channel.Required
--energy-units ENERGY_UNITSEnergy channel unitsRequired
--species SPECIESValid values are: electron, proton, helium, helium3, helium4, oxygen, iron, ion.Required
--location LOCATIONValid values are: mercury, venus, earth, mars, psp, stereoa, stereob, dawn, juno, L1, L2, L4, L5.Required
--prediction-window PREDICTION_WINDOW PREDICTION_WINDOWStart time and end time (in that order) of the prediction window that is relevant to the given data. Start of forecast prediction window must be within one hour of forecast issue time when in 'forecast' mode.Required
--peak-intensity PEAK_INTENSITYForecast peak intensity value.Optional
--peak-intensity-units PEAK_INTENSITY_UNITSForecast peak intensity value units.Optional, required if peak-intensity used
--peak-intensity-uncertainty PEAK_INTENSITY_UNCERTAINTYForecast peak intensity uncertainty valuesame units as peak intensity).Optional
--peak-intensity-uncertainty-low PEAK_INTENSITY_UNCERTAINTY_LOWForecast peak intensity lowest uncertainty value (same units as peak intensity).Optional, required if peak-intensity-uncertainty-high used. Ignored if peak-intensity-uncertainty used.
--peak-intensity-uncertainty-high PEAK_INTENSITY_UNCERTAINTY_HIGHForecast peak intensity highest uncertainty value (same units as peak intensity).Optional, required if peak-intensity-uncertainty-low used. Ignored if peak-intensity-uncertainty used.
--peak-intensity-time PEAK_INTENSITY_TIMEForecast time for reaching peak intensity value.Optional
--peak-intensity-esp PEAK_INTENSITY_ESPForecast peak intensity value in the vicinity of shock passage.Optional
--peak-intensity-esp-units PEAK_INTENSITY_ESP_UNITSForecast peak intensity units in the vicinity of shock passage.Optional, required if peak-intensity-esp used
--peak-intensity-esp-uncertainty PEAK_INTENSITY_ESP_UNCERTAINTYForecast peak intensity in the vicinity of shock passage uncertainty value (same units as peak intensity).Optional, cannot be used with either peak-intensity-esp-uncertainty-low or peak-intensity-esp-uncertainty-high
--peak-intensity-esp-uncertainty-low PEAK_INTENSITY_ESP_UNCERTAINTY_LOWForecast peak intensity in the vicinity of shock passage lowest uncertainty value (same units as peak intensity).Optional, required if peak-intensity-esp-uncertainty-high used. Cannot be used if peak-intensity-esp-uncertainty is used.
--peak-intensity-esp-uncertainty-high PEAK_INTENSITY_ESP_UNCERTAINTY_HIGHForecast peak intensity in the vicinity of shock passage highest uncertainty value (same units as peak intensity).Optional, required if peak-intensity-esp-uncertainty-low used. Cannot be used if peak-intensity-esp-uncertainty is used.
--peak-intensity-esp-time PEAK_INTENSITY_ESP_TIMEForecast time for reaching peak intensity value in the vicinity of shock passage.Optional
--peak-intensity-max PEAK_INTENSITY_MAXForecast max peak intensity for the entire prediction window value.Optional
--peak-intensity-max-units PEAK_INTENSITY_MAX_UNITSForecast max peak intensity value unitsOptional, required if peak-intensity-max used
--peak-intensity-max-uncertainty PEAK_INTENSITY_MAX_UNCERTAINTYForecast max peak intensity uncertainty value (same units as intensity) (for symmetric uncertainties).Optional, cannot be used with either peak-intensity-max-uncertainty-low or peak-intensity-max-uncertainty-high
--peak-intensity-max-uncertainty-low PEAK_INTENSITY_MAX_UNCERTAINTY_LOWForecast max peak intensity low uncertainty value (same units as peak intensity).Optional, required if peak-intensity-max-uncertainty-high used. Cannot be used if peak-intensity-max-uncertainty is used.
--peak-intensity-max-uncertainty-high PEAK_INTENSITY_MAX_UNCERTAINTY_HIGHForecast max peak intensity high uncertainty value (same units as peak intensity).Optional, required if peak-intensity-max-uncertainty-low used. Cannot be used if peak-intensity-max-uncertainty is used.
--peak-intensity-max-time PEAK_INTENSITY_MAX_TIMEForecast time for reaching max peak intensity value.Optional
--fluences [FLUENCES [FLUENCES ...]]Forecast fluence value (corresponds to event length).Optional
--fluence-units [FLUENCE_UNITS [FLUENCE_UNITS ...]]Forecast fluence units.Optional, required if fluence used
--fluence-uncertainty-low [FLUENCE_UNCERTAINTY_LOW [FLUENCE_UNCERTAINTY_LOW ...]]Forecast fluence lowest uncertainty value (same units as fluence).Optional, required if fluence-uncertainty-high used.
--fluence-uncertainty-high [FLUENCE_UNCERTAINTY_HIGH [FLUENCE_UNCERTAINTY_HIGH ...]]Forecast fluence highest uncertainty value (same units as fluence).Optional, required if fluence-uncertainty-low used.
--event-length-start-times [EVENT_LENGTH_START_TIMES [EVENT_LENGTH_START_TIMES ...]]Event length must fall within prediction window. Forecast energetic particle event start time ('onset' time).Optional
--event-length-end-times [EVENT_LENGTH_END_TIMES [EVENT_LENGTH_END_TIMES ...]]Forecast energetic particle event end time.Optional
--event-length-threshold-starts [EVENT_LENGTH_THRESHOLD_STARTS [EVENT_LENGTH_THRESHOLD_STARTS ...]]Threshold used to extract start times.Optional, required if event-length-start-time used
--event-length-threshold-ends [EVENT_LENGTH_THRESHOLD_ENDS [EVENT_LENGTH_THRESHOLD_ENDS ...]]Threshold used to extract end times.Optional
--event-length-threshold-units [EVENT_LENGTH_THRESHOLD_UNITS [EVENT_LENGTH_THRESHOLD_UNITS ...]]Units of threshold.Optional, required if event-length-start-time used
--thresh-crossing-times [THRESH_CROSSING_TIMES [THRESH_CROSSING_TIMES ...]]Multiple threshold_crossings can be provided for the same forecast energy channel. Forecast threshold crossing time.Optional, more than one is allowed
--thresh-uncertainties [THRESH_UNCERTAINTIES [THRESH_UNCERTAINTIES ...]]Forecast crossing time uncertainty in hours.Optional, more than one is allowed
--crossing-thresholds [CROSSING_THRESHOLDS [CROSSING_THRESHOLDS ...]]Particle intensity threshold value crossing time refers to.Optional, required if thresh-crossing-times used, more than one is allowed
--crossing-threshold-units [CROSSING_THRESHOLD_UNITS [CROSSING_THRESHOLD_UNITS ...]]Units of threshold.Optional, required if thresh-crossing-times used, more than one is allowed
--probabilities [PROBABILITIES [PROBABILITIES ...]]Multiple probabilities can be provided for the same forecast energy channel. forecast probability value (range 0 to 1).Optional, more than one is allowed
--prob-uncertainties [PROB_UNCERTAINTIES [PROB_UNCERTAINTIES ...]]Plus/minus error bar for probability_value (in probability_value units).Optional, more than one is allowed
--prob-thresholds [PROB_THRESHOLDS [PROB_THRESHOLDS ...]]Particle intensity threshold value probability forecast refers to.Optional, required if probabilities is used, more than one is allowed
--prob-threshold-units [PROB_THRESHOLD_UNITS [PROB_THRESHOLD_UNITS ...]]Units of threshold.Optional, required if probabilities is used, more than one is allowed
--all-clear ALL_CLEARThere are three situations for setting all_clear_boolean=false: (1) for >10MeV energy channel, your forecast of peak intensity OR threshold crossing exceeds 10 pfu OR your probability forecast for a threshold of 10 pfu exceeds your custom probability_threshold; (2) for the >100MeV energy channel, your forecast of peak intensity OR threshold crossing exceeds 1 pfu OR your probability forecast for a threshold of 1 pfu exceeds your custom probability_threshold; (3) for your custom (non-integral) energy channel, your forecast peak intensity OR threshold crossing exceeds your custom threshold. NOTE: Custom cases are being stored, but will not be used in the all-clear scoreboard display.Optional
--all-clear-threshold ALL_CLEAR_THRESHOLDParticle intensity threshold value all_clear_boolean refers to. Can be 10 pfu for >10MeV channel, 1 pfu for >100MeV channel, or a custom threshold value.Optional, required if all-clear is used
--all-clear-threshold-units ALL_CLEAR_THRESHOLD_UNITSUnits of threshold.Optional, required if all-clear is used
--all-clear-probability-threshold ALL_CLEAR_PROBABILITY_THRESHOLDProbability threshold value all_clear_boolean refers to. Must specify this threshold if setting all_clear_boolean based on probability forecast.Optional
--sep-profile SEP_PROFILEText file with 2 columns: datetime string and predicted SEP intensity for this energy channel.Optional
--native-id NATIVE_IDSpecify only if forecast has a native id from your model run.Optional

Sample Commands and Resulting Output

Sample 1:

Simple Command line example, where only one probability forecast is being made

    ./sep_json_writer.py --model-short-name MAG4-LOS-FE --spase-id spase://CCMC/SimulationModel/MAG4/v20190127 --issue-time 2017-09-10T23:30Z --mode forecast --energy-min 10 --energy-max -1 --energy-units MeV --species proton --location earth --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z --probabilities 0.85 --prob-uncertainties 0.08 --prob-thresholds 10 --prob-threshold-units pfu --all-clear False --all-clear-threshold 10.0 --all-clear-threshold-units pfu --all-clear-probability-threshold 0.3

It is hard to read all those values when they are on the same line, so let's list all the arguments on their own line for readability.

./sep_json_writer.py
    --model-short-name MAG4-LOS-FE
    --spase-id spase://CCMC/SimulationModel/MAG4/v20190127
    --issue-time 2017-09-10T23:30Z
    --mode forecast
    --energy-min 10
    --energy-max -1
    --energy-units MeV
    --species proton
    --location earth
    --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z
    --probabilities 0.85
    --prob-uncertainties 0.08
    --prob-thresholds 10
    --prob-threshold-units pfu
    --all-clear False
    --all-clear-threshold 10.0
    --all-clear-threshold-units pfu
    --all-clear-probability-threshold 0.3

JSON Output from the Previous Example

    {
      "sep_forecast_submission": {
        "model": {
          "short_name": "MAG4-LOS-FE",
          "spase_id": "spase://CCMC/SimulationModel/MAG4/v20190127"
        },
        "issue_time": "2017-09-10T23:30Z",
        "mode": "forecast",
        "forecasts": [
          {
            "energy_channel": {
            "min": "10",
            "max": "-1",
            "units": "MeV"
            },
          "species": "proton",
          "location": "earth",
          "prediction_window": {
            "start_time": "2017-09-11T00:00Z",
            "end_time": "2017-09-11T23:59Z"
          },
          "probabilities": [
            {
              "probability_value": "0.85",
              "uncertainty": "0.08",
              "threshold": "10",
              "threshold_units": "pfu"
            }
          ],
          "all_clear": {
            "all_clear_boolean": false,
            "threshold": "10.0",
            "threshold_units": "pfu",
            "probability_threshold": "0.3"
          }
        }
        ]
      }
    }

Sample 2:

Another command line example, where multiple probability forecasts are being made

    ./sep_json_writer.py --model-short-name MAG4_LOS_FE --spase-id spase://CCMC/SimulationModel/MAG4/v20190127 --issue-time 2017-09-10T23:30Z --mode forecast --energy-min 10 --energy-max -1 --energy-units MeV --species proton --location earth --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z --probabilities 0.85 0.22 --prob-uncertainties 0.08 None --prob-thresholds 10 100.0 --prob-threshold-units pfu pfu --all-clear False --all-clear-threshold 10.0 --all-clear-threshold-units pfu --all-clear-probability-threshold 0.3 --energy-min 100 --energy-max -1 --energy-units MeV --species proton --location earth --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z --probabilities 0.01 --prob-uncertainties None --prob-thresholds 1 --prob-threshold-units pfu --all-clear True --all-clear-threshold 1.0 --all-clear-threshold-units pfu --all-clear-probability-threshold 0.2

Here's that same example in a more human-readable format:

    ./sep_json_writer.py
        --model-short-name MAG4_LOS_FE
        --spase-id spase://CCMC/SimulationModel/MAG4/v20190127
        --issue-time 2017-09-10T23:30Z
        --mode forecast
        --energy-min 10
        --energy-max -1
        --energy-units MeV
        --species proton
        --location earth
        --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z
        --probabilities 0.85 0.22
        --prob-uncertainties 0.08 None
        --prob-thresholds 10 100.0
        --prob-threshold-units pfu pfu
        --all-clear False
        --all-clear-threshold 10.0
        --all-clear-threshold-units pfu
        --all-clear-probability-threshold 0.3
        --energy-min 100
        --energy-max -1
        --energy-units MeV
        --species proton
        --location earth
        --prediction-window 2017-09-11T00:00Z 2017-09-11T23:59Z
        --probabilities 0.01
        --prob-uncertainties None
        --prob-thresholds 1
        --prob-threshold-units pfu
        --all-clear True
        --all-clear-threshold 1.0
        --all-clear-threshold-units pfu
        --all-clear-probability-threshold 0.2

JSON Output from the Previous Example

    { "sep_forecast_submission": {
      "model": {
        "short_name": "MAG4_LOS_FE",
        "spase_id": "spase://CCMC/SimulationModel/MAG4/v20190127"
      },
      "issue_time": "2017-09-10T23:30Z",
      "mode": "forecast",
      "forecasts": [
        {
          "energy_channel": {
            "min": "10",
            "max": "-1",
            "units": "MeV"
          },
          "species": "proton",
          "location": "earth",
          "prediction_window": {
            "start_time": "2017-09-11T00:00Z",
            "end_time": "2017-09-11T23:59Z"
          },
          "probabilities": [
            {
              "probability_value": "0.85",
              "uncertainty": "0.08",
              "threshold": "10",
              "threshold_units": "pfu"
            },
            {
              "probability_value": "0.22",
              "threshold": "100.0",
              "threshold_units": "pfu"
            }
          ],
          "all_clear": {
            "all_clear_boolean": false,
            "threshold": "10.0",
            "threshold_units": "pfu",
            "probability_threshold": "0.3"
          }
        },
        {
          "energy_channel": {
            "min": "100",
            "max": "-1",
            "units": "MeV"
          },
          "species": "proton",
          "location": "earth",
          "prediction_window": {
            "start_time": "2017-09-11T00:00Z",
            "end_time": "2017-09-11T23:59Z"
          },
          "probabilities": [
            {
              "probability_value": "0.01",
              "threshold": "1",
              "threshold_units": "pfu"
            }
          ],
          "all_clear": {
            "all_clear_boolean": true,
            "threshold": "1.0",
            "threshold_units": "pfu",
            "probability_threshold": "0.2"
          }
        }
      ]
    } }

Sample 3:

Another command line example, where multiple intensity/flux forecasts are being made, with model triggers

    ./sep_json_writer.py --model-short-name MODEL ACRONYM --spase-id spase://CCMC/SimulationModel/MODEL_NAME1/VERSION --issue-time 2017-09-10T20:00Z --mode forecast --cme-start-time 2017-09-10T16:06Z --cme-lat -9 --cme-lon 108 --cme-pa 261 --cme-half-width 70 --cme-speed 2500 --cme-height 21.5 --cme-time-at-height-time 2017-09-10T17:15Z --cme-time-at-height-height 21.5 --cme-coordinates HEEQ --cme-catalog DONKI --cme-urls [https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4") --cme-sim-model WSA-ENLIL+Cone --cme-sim-completion-time 2017-09-11T09:42Z --cme-sim-urls [https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1") --energy-min 10 --energy-max -1 --energy-units MeV --species proton --location earth --prediction-window 2017-09-10T17:15Z 2017-09-17T00:00Z --peak-intensity 1000.0 --peak-intensity-units pfu --peak-intensity-time 2017-09-11T00:00Z --peak-intensity-esp 100 --peak-intensity-esp-units pfu --peak-intensity-esp-time 2017-09-13T00:00Z --event-length-start-time 2017-09-10T22:00Z --event-length-end-time 2017-09-13T00:00Z --event-length-threshold-start 1.0 --event-length-threshold-units pfu --thresh-crossing-times 2017-09-10T22:00Z --crossing-thresholds 10.0 --crossing-threshold-units pfu --all-clear false --all-clear-threshold 10.0 --all-clear-threshold-units pfu --sep-profile samplesepprofile10MeV.txt --energy-min 100 --energy-max -1 --energy-units MeV --species proton --location earth --prediction-window 2017-09-10T19:30Z 2017-09-17T22:30Z --peak-intensity 10.0 --peak-intensity-units pfu --peak-intensity-time 2017-09-11T01:00Z --peak-intensity-esp None --peak-intensity-esp-units None --peak-intensity-esp-time None --event-length-start-time 2017-09-10T22:00Z --event-length-end-time 2017-09-12T00:00Z --event-length-threshold 0.3 --event-length-threshold-units pfu --thresh-crossing-times 2017-09-10T22:00Z --crossing-thresholds 1.0 --crossing-threshold-units pfu --all-clear false --all-clear-threshold 1.0 --all-clear-threshold-units pfu --sep-profile samplesepprofile100MeV.txt

Here's that same example in a more human-readable format:

    ./sep_json_writer.py
        --model-short-name MODEL ACRONYM
        --spase-id spase://CCMC/SimulationModel/MODEL_NAME1/VERSION
        --issue-time 2017-09-10T20:00Z
        --mode forecast
        --cme-start-time 2017-09-10T16:06Z
        --cme-lat -9
        --cme-lon 108
        --cme-pa 261
        --cme-half-width 70
        --cme-speed 2500
        --cme-height 21.5
        --cme-time-at-height-time 2017-09-10T17:15Z
        --cme-time-at-height-height 21.5
        --cme-coordinates HEEQ
        --cme-catalog DONKI
        --cme-urls [https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4")
        --cme-sim-model WSA-ENLIL+Cone
        --cme-sim-completion-time 2017-09-11T09:42Z
        --cme-sim-urls [https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1")
        --energy-min 10
        --energy-max -1
        --energy-units MeV
        --species proton
        --location earth
        --prediction-window 2017-09-10T17:15Z 2017-09-17T00:00Z
        --peak-intensity 1000.0
        --peak-intensity-units pfu
        --peak-intensity-time 2017-09-11T00:00Z
        --peak-intensity-esp 100
        --peak-intensity-esp-units pfu
        --peak-intensity-esp-time 2017-09-13T00:00Z
        --event-length-start-time 2017-09-10T22:00Z
        --event-length-end-time 2017-09-13T00:00Z
        --event-length-threshold-start 1.0
        --event-length-threshold-units pfu
        --thresh-crossing-times 2017-09-10T22:00Z
        --crossing-thresholds 10.0
        --crossing-threshold-units pfu
        --all-clear false
        --all-clear-threshold 10.0
        --all-clear-threshold-units pfu
        --sep-profile samplesepprofile10MeV.txt
        --energy-min 100
        --energy-max -1
        --energy-units MeV
        --species proton
        --location earth
        --prediction-window 2017-09-10T19:30Z 2017-09-17T22:30Z
        --peak-intensity 10.0
        --peak-intensity-units pfu
        --peak-intensity-time 2017-09-11T01:00Z
        --peak-intensity-esp None
        --peak-intensity-esp-units None
        --peak-intensity-esp-time None
        --event-length-start-time 2017-09-10T22:00Z
        --event-length-end-time 2017-09-12T00:00Z
        --event-length-threshold 0.3
        --event-length-threshold-units pfu
        --thresh-crossing-times 2017-09-10T22:00Z
        --crossing-thresholds 1.0
        --crossing-threshold-units pfu
        --all-clear false
        --all-clear-threshold 1.0
        --all-clear-threshold-units pfu
        --sep-profile samplesepprofile100MeV.txt

JSON Output from the Previous Example

    { "sep_forecast_submission": {
      "model": {
      "short_name": "MODEL ACRONYM",
      "spase_id": "spase://CCMC/SimulationModel/MODEL_NAME1/VERSION"
      },
      "issue_time": "2017-09-10T20:00Z",
      "mode": "forecast",
      "triggers": [
        {
          "cme": {
            "start_time": "2017-09-10T16:06Z",
            "lat": "-9",
            "lon": "108",
            "pa": "261",
            "half_width": "70",
            "speed": "2500",
            "height": "21.5",
            "time_at_height": {
              "time": "2017-09-10T17:15Z",
              "height": "21.5"
            },
            "coordinates": "HEEQ",
            "catalog": "DONKI",
            "urls": [
              "[https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CME/13107/4")"
            ]
          }
        },
        {
          "cme_simulation": {
            "model": "WSA-ENLIL+Cone",
            "simulation_completion_time": "2017-09-11T09:42Z",
            "urls": [
              "[https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1](https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1 "https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/WSA-ENLIL/13114/1")"
            ]
          }
        }
      ],
      "forecasts": [
        {
          "energy_channel": {
            "min": "10",
            "max": "-1",
            "units": "MeV"
          },
          "species": "proton",
          "location": "earth",
          "prediction_window": {
            "start_time": "2017-09-10T17:15Z",
            "end_time": "2017-09-17T00:00Z"
          },
          "peak_intensity": {
            "intensity": "1000.0",
            "units": "pfu",
            "time": "2017-09-11T00:00Z"
          },
          "peak_intensity_esp": {
            "intensity": "100",
            "units": "pfu"
          },
          "event_lengths": [
            {
              "start_time": "2017-09-10T22:00Z",
              "end_time": "2017-09-13T00:00Z",
              "threshold_start": "1.0",
              "threshold_units": "pfu"
            }
          ],
          "threshold_crossings": [
            {
              "crossing_time": "2017-09-10T22:00Z",
              "threshold": "10.0",
              "threshold_units": "pfu"
            }
          ],
          "all_clear": {
            "all_clear_boolean": false,
            "threshold": "10.0",
            "threshold_units": "pfu"
          },
          "sep_profile": "samplesepprofile10MeV.txt"
        },
        {
          "energy_channel": {
            "min": "100",
            "max": "-1",
            "units": "MeV"
          },
          "species": "proton",
          "location": "earth",
          "prediction_window": {
            "start_time": "2017-09-10T19:30Z",
            "end_time": "2017-09-17T22:30Z"
          },
          "peak_intensity": {
            "intensity": "10.0",
            "units": "pfu",
            "time": "2017-09-11T01:00Z"
          },
          "event_lengths": [
            {
              "start_time": "2017-09-10T22:00Z",
              "end_time": "2017-09-13T00:00Z",
              "threshold": "0.3",
              "threshold_units": "pfu"
            }
          ],
          "threshold_crossings": [
            {
              "crossing_time": "2017-09-10T22:00Z",
              "threshold": "1.0",
              "threshold_units": "pfu"
            }
          ],
          "all_clear": {
            "all_clear_boolean": false,
            "threshold": "1.0",
            "threshold_units": "pfu"
          },
          "sep_profile": "samplesepprofile100MeV.txt"
        }
      ]
    } }

Method 3 - Make a Python library file with your data and import it

(Note: This is the least recommended method)

  1. Create a file named input_sep.py in the same directory with the downloaded helper script.
  2. Inside input_sep.py, put a python dictionary named sep_forecast_submission_dataDict.
    The contents of the input_sep.py file will look like this:
    sep_forecast_submission_dataDict = {_...lots of data here in a python dictionary format...organized exactly like the JSON output you are looking for..._ }
  3. Then run the script like this on the terminal command line:
    ./sep_json_writer.py --import-data-dictionary

However, the best way to write your data to a JSON file is to load the JSON library for your language and use it to write out a JSON file. This is the best method to ensure that the JSON is properly formatted.

You can google ' write json file' and get the steps to do that in your programming language.

Contact Dr. M. Leila Mays and/or Joycelyn Jones for additional assistance.