wiki:u/madams

Version 47 (modified by madams, 9 years ago) ( diff )

Marissa Adams (madams@pas.rochester.edu)

Graduated from the University of Rochester with a Physics B.S., and Mathematics B.A. From May 2014 to August 2015 I have been employed as a technical assistant in the group. In the Fall of 2015 I will be continuing my education at the University of Rochester Department of Physics & Astronomy as a PhD student (plasma physics). Here, on my page, I am documenting, as well as describing projects I have worked on/assisted with during my stay! Hopefully you find it useful.


Projects

CollidingFlows


Image 1. Temporal evolution of the column density map of two colliding flows over approximately 27 Myr. Left panes are the projection of the mass down the x-axis, down the barrel of the two flows. The right panes illustrate the collision region, looking down the y-axis. Units of distance are in parsecs. Pink points are the sinks that form. The flows collide at a shear angle of 15 degrees from the normal.

With E. Kaminski, A. Frank, F. Heitsch, C. Hiag, and J. Carroll-Nellenback.

Visualizing PN/PPN Data with SHAPE

With B. Balick, M. Huarte-Espinosa, A. Frank.

Under Construction

  • Shape Wiki User Guide that I have crafted.

Turbulence Studies

With J. Carroll-Nellenback, A. Frank.


Scripts

Image Compressor (bash)

#!/bin/bash                                                                                                                        
#Script compressor.sh                                                                                                              

files=$@

if [ "$files" == "" ];
then
    echo "Error: No files specified, dude."
    exit
fi

for i in $files;
do
    echo \"$i\"
    gs \
        -o "${i%.pdf}-comp.pdf" \
        -sDEVICE=pdfwrite \
        -dColorConversionStrategy=/LeaveColorUnchanged \
        -dColorsampleMonoImages=false \
        -dColorsampleGrayImages=false \
        -dColorsampleColorImages=false \
        -dAutoFilterColorImages=false \
        -dAutoFilterGrayImages=false \
        -dColorImageFilter=/FlateEncode \
        -dGrayImageFilter=/FlateEncode \
        "${i}"
done

Name Changer (python)

  • For post processing elements (in particular column density maps).
  • Changes the name of the file easily so you don't have to do funky visualization stuff in visit.
import os
import sys

start = int(sys.argv[1])
end = int(sys.argv[2])

for i in range(start,end+1):
    inpfig="Mass_along_1_00"+str(i)+".bov"
    outfig="mass1_along_1_00"+str(i)+".bov"
    sfig = "mv %s %s" %(inpfig,outfig)
    os.system(sfig)

.okc to .csv Converter (python)

  • Reads in .okc files, converts the data in the .okc to proper units, spits out a .csv so you can import the data into excel.
#!/usr/bin/env python                                                                                                              
# ^ program.py not python program.py                                                                                               

import glob
import numpy

time_scaler = 0.00825*3.81360279481384188E+14*3.16888E-8*1E-6
mass_scaler = 0.619591607894786331E+32*5.03E-34

# cd into the out directory                                                                                                        
out_dir = "./out/"

# Accessing the *.okc files and sorts them                                                                                         
lst = glob.glob(out_dir + "*.okc")
lst.sort()

with open("./s15_rawsink_data_scaled.csv", "w") as sink_f:
    sink_f.write("Time" + "," + "Core 1 Mass" + "," + "Core 2 Mass" + "," + "Core 3 Mass" + ","+ "Core 4 Mass"  + "," + "Core 5 Ma\
ss\n")

    for i in range(0,len(lst)):
        with open(lst[i]) as f:
            okc_lines = f.readlines()
            noparams, nosinks, noparams_mm = [int(x) for x in okc_lines[0].split()]
            sinkdata =[float(y[3]) for y in [x.split() for x in okc_lines[-nosinks:]]]
            sink_f.write(str(i*time_scaler) + ",")
            for j in sinkdata:
                sink_f.write(str(j*mass_scaler) + ",")
            for j in range(0,5-len(sinkdata)):
                sink_f.write("0.0" + ",")
            sink_f.write("\n")

Post Processing Submissions (bash)

  • Creates post processing directories in your out directory.
  • Edits and submits the jobs for your executable.
  • You do have to manually move the simulation into the directory once the job has completed.
#!/bin/bash                                                                                                                        

   ## INITIALIZING INVARIANTS ##                                                                                                   

#Put the name of your executable here!                                                                                             
EXECUTABLE="astrobear_Bvn"
#Put the name of your bash script here!                                                                                            
SUBMISSION_SCRIPT="job.sh"

   ## FINDING RUN DIRECTORIES ##                                                                                                   

#/scratch/[USERNAME]/[REST OF PATH]/ Make sure script is here <--                                                                    

cd /scratch/[USERNAME]/[REST OF PATH]/

PP_PATH="Directory1, Directory2"

   ## MAKING A LOOP ##                                                                                                             

for d in ${PP_PATH}; do

    cd ${d}

      ## MAKING UNIQUE DIRECTORIES ##                                                                                              

   #Name of the directory we're going to create in...                                                                              
    DIRECTORY_NAME="${EXECUTABLE}_`echo ${d} | tr -d '/'`_`date +%s`"
   #your out directory.                                                                                                            
    OUTPUT_DIR="out/"

   #Checker to see if you have an out directory.                                                                                   
    if [ \! -e ${OUTPUT_DIR} ] || [ \! -d ${OUTPUT_DIR} ]; then
        echo "There is a problem with your ${OUTPUT_DIR} directory, please check. Exiting."
        exit
    fi

   #Makes a new directory in your out directory for post processing with the executable, run, and date in the name.                
    mkdir out/${DIRECTORY_NAME}

      ## EDITTING BATCH SCRIPT ##                                                                                                  
   #Note this change is universal for all PP_PATH                                                                                  
    sed -i 's/--reservation .*//' job.sh
    sed -i 's/-N .*/-N 32/' job.sh
    sed -i 's/--ntasks-per-node .*/--ntasks-per-node 16/' job.sh
    sed -i 's/-c .*/-c 1/' job.sh
    sed -i 's/-p .*/-p debug/' job.sh
    sed -i 's/--time .*/--time 00-00:30:00/' job.sh
    sed -i 's/#SBATCH --mail-user email1@pas.rochester.edu/##SBATCH --mail-user email1@pas.rochester.edu/' job.sh
#    sed -i 's/#SBATCH --mail-user email2@pas.rochester.edu/##SBATCH --mail-user email2@pas.rochester.edu/' job.sh                 
    sed -i "s/astrobear.* > astrobear.*.log/${EXECUTABLE} > ${EXECUTABLE}.log/" job.sh

      ## SUBMIT BATCH SCRIPT ##                                                                                                    
    sbatch ${SUBMISSION_SCRIPT}

    cd ../../
done


Recent Blog Entries


Page last updated at 06-02-2015.

Attachments (2)

Note: See TracWiki for help on using the wiki.