Skip to content

NCAR/music-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

06573e5 · Mar 4, 2025
Sep 5, 2024
Mar 4, 2025
Aug 15, 2024
Nov 27, 2024
Sep 5, 2024
Mar 4, 2025
Mar 4, 2025
Nov 23, 2024
Jan 6, 2025
Jul 23, 2020
Dec 20, 2024
Jan 6, 2025

Repository files navigation

MusicBox

MusicBox: A MUSICA model for boxes and columns.

License CI Status codecov PyPI version DOI

Copyright (C) 2020 National Science Foundation - National Center for Atmospheric Research

Installation

pip install acom_music_box

Command line tool

MusicBox provides a command line tool that can run configurations as well as some pre-configured examples. Basic plotting can be done if gnuplot is installed.

Checkout the command line options

music_box -h                                        

Run an example. Notice that the output, in csv format, is printed to the terminal.

music_box -e Chapman

Output can be saved to a csv file and printed to the terminal.

music_box -e Chapman -o output.csv

Output can be saved to a csv file and the terminal output can be suppressed by specifying the --output-format

music_box --output-format csv -e Chapman -o output.csv

Output can be saved to a file as netcdf file when --output-format netcdf is passed

music_box --output-format netcdf -e Chapman -o output.nc

Output can be saved to a file in csv format when a filename is not specified. In this case a timestamped csv file is made

music_box --output-format csv -e Chapman

Output can be saved to a file in netcdf format when a filename is not specified. In this case a timestamped netcdf file is made

music_box --output-format netcdf -e Chapman

You can also run your own configuration

music_box -c my_config.json

Plotting

Some basic plots can be made to show concentrations throughout the simulation

matplotlib

music_box -e Chapman -o output.csv --plot O1D

You can also make multiple plots by specifying groupings of species

music_box -e TS1 --plot O3 --plot PAN,HF 

Note that the windows may overlap each other

By default all plot units are in mol m-3. You can see a list of unit options to specify with --plot-output-unit

music_box -h

It is used like this

 music_box -e TS1 --output-format csv --plot O3 --plot-output-unit "ppb"

gnuplot

If you want ascii plots (maybe you're running over ssh and can't view a graphical window), you can set the plot tool to gnuplo (--plot-tool gnuplot) to view some output

music_box -e Chapman -o output.csv --plot O1D --plot-tool gnuplot

Development and Contributing

For local development, install music-box as an editable installation:

pip install -e '.[dev]'

Tests

pytest