The force
is strong with you. Join us, learn R
, and use your powers for good.
You and BB8 arrived just in time. Rey needs your help!
The Junk boss Unkar is up to no-good once again and Rey needs some parts to repair her starship. With your help she can escape Jakku and join forces with the New Republic.
Connect to your droid
Remote Desktop Connection
(you may need to search for it the 1st time)w7-your7digit#
or R32-your7digit#
Where’s my R? Do you need to install R or RStudio? There’s a nice workaround for you below.
This is a temporary solution to get R
+ RStudio
on your computer for the training.
\\pca.state.mn.us\xdrive\Agency_Files\Data_Services\DAU\Data Analytics User Group\Shared\r\versions
RStudio.exe
in the RStudio\bin
folderStill no R? No worries. You can use R online at RStudio Cloud.
Let’s introduce ourselves and the data we love. Chat with your breakout partner and get to know 3 things about them.
Things to share
Hint: Maybe this is something you can automate with R
Teamwork. You’re going to need to work together to help Rey get off the dusty planet Jakku. Use each other as a resource. Share ideas, share code, collaborate. Make bad jokes.
Here’s one:
A: Adobe Wan Kenobi
?
We are Barbara, Dorian, Kristie and Derek. Yes, we look exactly like our profile photos above.
We aren’t computer scientists and that’s okay!
We make lots of mistakes. Mistakes are funny. Feel free to laugh at them.
 R allows you to write your data analysis in a step-by-step fashion, much like creating a recipe for cookies. And just like a recipe, we can start at the top and read our way down to the bottom.
1 - Code Editor
This is where you write your scripts and document your work. The tabs at the top of the code editor allow you to view scripts and data sets you have open. This is where you’ll spend most of your time.
2 - R Console
This is where code is actually executed by the computer. It shows code that you have run and any errors, warnings, or other messages resulting from that code. You can input code directly into the console and run it, but it won’t be saved for later. That’s why we like to run all of our code directly from a script in the code editor.
3 - Workspace
This pane shows all of the objects and functions that you have created, as well as a history of the code you have run during your current session. The environment tab shows all of your objects and functions. The history tab shows the code you have run. Note the broom icon below the Connections tab. This cleans shop and allows you to clear all of the objects in your workspace.
4 - Plots and files
These tabs allow you to view and open files in your current directory, view plots and other visual objects like maps, view your installed packages and their functions, and access the help window. If at anytime you’re unsure what a function does, enter it’s name after a question mark. For example, try entering ?mean
into the console and push ENTER.
Let’s add a little style so R Studio feels like home. Follow these steps to change the font-size and and color scheme:
Global Options...
Appearance
with the paint bucket.Editor Font size
Dreamweaver
for the classNow that we’re ready, let’s go forth and make some trouble. While BB8 works on tracking down some data for us from his droid friends, we’ll get to know his internal computer.
Let’s make a new project for our Jakku
mischief.
Step 1: Start a new project
"starwars"
Step 2: Open a new script
jakku.R
or lesson1.R
will work wellYou can assign values to new objects using the “left arrow” <-
, which is written by typing a less-than sign followed by a hyphen. It’s more officially known as the assignment operator. Try adding the code below to your R script to assign a value to an object called droid
.
To run a line of code in your script, move the cursor to that line and press CTRL+ENTER.
# Create a new object
droid <- "bb8"
droid
wookie <- "Chewbacca"
wookie
Break some things
# To save text to a character object you need quotation marks: "text"
# Try this:
wookie <- Chewbacca
## Error in eval(expr, envir, enclos): object 'Chewbacca' not found
ERROR
Without quotes, R looks for an object called Chewbacca, and then lets you know that it couldn’t find one.
Copy objects
# To copy an object, assign it to a new name
wookie2 <- wookie
# Or overwrite an object with new "text"
wookie <- "Tarfful"
wookie
# Did this change the value stored in wookie2?
wookie2
You can drop objects with the remove function rm()
. Try it out on some of your wookies.
# Delete objects to clean-up your environment
rm(wookie)
rm(wookie2)
How can we get the wookie
object back?
HINT: You are allowed to re-run code.
Don’t worry about deleting data or objects in R. You can always recreate them! When R loads data files it copies the contents and cuts off any connection to the original data. So your original data files remain safe and won’t suffer any accidental changes. That means if something disappears or goes wrong in R, it’s okay. We can always reload the data using our script.
Everything has a name in R and you can name things almost anything you like. You can even name your data TOP_SECRET_shhhhhh...
or Luke_I_am_your_father
or data_McData_face
.
Sadly, there are a few minor restrictions. Names cannot include spaces or special characters that might be found in math equations, like +
, -
, *
, \
, /
, =
, !
, or )
.
Try running some of these examples. Find new ways to create errors. The more broken the better! Half of learning R is finding what doesn’t work.
n wookies <- 5
n*wookies <- 5
n_wookies <- 5
n.wookies <- 5
all_the_wookies! <- "Everyone on Kashyyyk"
# You can add one wookie
n_wookies <- n_wookies + 1
# But what if you have 10,000 wookies?
n_wookies <- 10,000
# They also cannot begin with a number.
1st_wookie <- "Chewbacca"
88b <- "droid"
# But they can contain numbers!
wookie1 <- "Chewbacca"
bb8 <- "droid"
When we create a new object with the same name as something that already exists, the new object replaces the old one. Sometimes we want to update an existing object and replace the old version. Other times we may want to copy an object to a new name to preserve the original.
This is similar to choosing between Save
and Save As
when saving a file.
We can add multiple values inside c()
to make a vector of items. It’s like a chain of items, where each additional item is connected by a comma. The c
stands for to concatenate or to combine values into a vector.
Let’s use c()
to create a few vectors of names.
# Create a character vector and name it starwars_characters
starwars_characters <- c("Luke", "Leia", "Han Solo")
# Print starwars_characters to the console
starwars_characters
## [1] "Luke" "Leia" "Han Solo"
# Create a numeric vector and name it starwars_ages
starwars_ages <- c(19,19,25)
# Print the ages to the console
starwars_ages
## [1] 19 19 25
A table in R is known as a data frame. We can think of it as a group of columns, where each column is made from a vector. Data frames in R have columns of data that are all the same length.
Let’s make a table with 2 columns to hold the character names and their ages.
# Create table with columns "character" and "ages" with values from the starwars_names and starwars_ages vectors
starwars_df <- data.frame(character = starwars_characters,
ages = starwars_ages)
# Print the starwars_df data frame to the console
starwars_df
## character ages
## 1 Luke 19
## 2 Leia 19
## 3 Han Solo 25
c("Darth", "Darth", "Unknown")
starwars_df <- data.frame(character = starwars_characters, ages = starwars_ages, fathers = __________________)
starwars_df <- data.frame(character = starwars_characters, ages = starwars_ages, fathers = c("Darth", "Darth", "Unknown"))
$column_name
Use the $
sign after the name of your table to see the values in one of your columns.
# View the "ages" column in starwars_df
starwars_df$ages
## [1] 19 19 25
Which of these object names are valid? (Hint: You can test them.)
my starwars fandom
my_wookies55
5wookies
my-wookie
Wookies!!!
Show solution
my_wookies55
Yes!! The FORCE is strong with you!
#comment
The lines of code in the scripts that start with a #
in front are called comments. Every line that starts with a #
is ignored and won’t be run as R code. You can use the #
to add notes in your script to make it easier for others and yourself to understand what is happening and why. You can also use comments to add warnings or instructions for others using your code.
The first step of a good scrap audit is reading in some data to figure out where all the scrap is coming from. Here is a small dataset showing the scrap economy on Jakku. It was salvaged from a crash site, but the transfer was incomplete.
| origin | destination | item | amount | price_d |
|---|---|---|---|---|
| Outskirts | Raiders | Bulkhead | 332 | 300 |
| Niima Outpost | Trade caravan | Hull panels | 1120 | 286 |
| Cratertown | Plutt | Hyperdrives | 45 | 45 |
| Tro—- | Ta—- | So—* | 1 | 10—- |
This looks like it could be useful. Now, if only we had some more data to work with…
BB8: Beep boop Beep.
BB8: I intercepted a large scrapper data set from droid 4P-L of Junk Boss Plutt.
Receiving data now…
scrap_records.csv
item,origin,destination,amount,units,price_per_pound
Flight recorder,Outskirts,Niima Outpost,887,Tons,590.93
Proximity sensor,Outskirts,Raiders,7081,Tons,1229.03
Aural sensor,Tuanul,Raiders,707,Tons,145.27
Electromagnetic filter,Tuanul,Niima Outpost,107,Tons,188.2
...
You: Yikes! This looks like a mess! What can I do with this?
The main data format used in R is the CSV (comma-separated values). A CSV is a simple text file that can be opened in R and most other stats software, including Excel. It looks squished together as plain text, but that’s okay! When opened in R, the text becomes a familiar looking table with columns and rows.
Before we launch ahead, let’s add a package to R that will help us read CSV files.
How to save a CSV from Excel
Step 1: Open your Excel file.
Step 2: Save as CSV
Return to RStudio and open your project. Look at your Files tab in the lower right window. Click on the CSV file you saved and choose View File. Success!
What is an R package?
 They add capabilities like statistical functions, mapping powers, and special charts to R. In order to use a new package we first need to install it. Let’s try it!
The readr package helps import data into R in different formats. It helps you out by cleaning the data of extra white space and formatting tricky date formats automatically.
Add a package to your library
install.packages("readr")
in the lower left consolePackages
tab in the lower right window of RStudio to see the packages in your library
readr
packageYour installed packages are stored in your R library. The Packages
tab on the right shows all of the available packages installed in your library. When you want to use one of them, you load it in R. Loading a package is like opening an App on your phone. To load a package we use the library()
function. Once you load it, the package will stay loaded until you close RStudio.
Let’s load the readr package so we can use the read_csv()
function to read the Jakku scrap data.
library(readr)
read_csv("https://itep-r.netlify.com/data/starwars_scrap_jakku.csv")
## Parsed with column specification:
## cols(
## receipt_date = col_character(),
## item = col_character(),
## origin = col_character(),
## destination = col_character(),
## amount = col_double(),
## units = col_character(),
## price_per_pound = col_double()
## )
## # A tibble: 1,132 x 7
## receipt_date item origin destination amount units price_per_pound
## <chr> <chr> <chr> <chr> <dbl> <chr> <dbl>
## 1 4/1/2013 Flight re~ Outski~ Niima Outp~ 887 Tons 591.
## 2 4/2/2013 Proximity~ Outski~ Raiders 7081 Tons 1229.
## 3 4/3/2013 Vitus-Ser~ Reestki Raiders 4901 Tons 226.
## 4 4/4/2013 Aural sen~ Tuanul Raiders 707 Tons 145.
## 5 4/5/2013 Electroma~ Tuanul Niima Outp~ 107 Tons 188.
## 6 4/6/2013 Proximity~ Tuanul Trade cara~ 32109 Tons 1229.
## 7 4/7/2013 Hyperdriv~ Tuanul Trade cara~ 862 Tons 1485.
## 8 4/8/2013 Landing j~ Reestki Niima Outp~ 13944 Tons 1497.
## 9 4/9/2013 Electroma~ Crater~ Raiders 7788 Tons 188.
## 10 4/10/2013 Sublight ~ Outski~ Niima Outp~ 10642 Tons 7211.
## # ... with 1,122 more rows
Where did the data go after you read it into R? When we want to work with the data in R, we need to give it a name with the assignment operator: <-
.
# Read in scrap data and set name to "scrap"
scrap <- read_csv("https://itep-r.netlify.com/data/starwars_scrap_jakku.csv")
# Type the name of the table to view it in the console
scrap
## # A tibble: 1,132 x 7
## receipt_date item origin destination amount units price_per_pound
## <chr> <chr> <chr> <chr> <dbl> <chr> <dbl>
## 1 4/1/2013 Flight re~ Outski~ Niima Outp~ 887 Tons 591.
## 2 4/2/2013 Proximity~ Outski~ Raiders 7081 Tons 1229.
## 3 4/3/2013 Vitus-Ser~ Reestki Raiders 4901 Tons 226.
## 4 4/4/2013 Aural sen~ Tuanul Raiders 707 Tons 145.
## 5 4/5/2013 Electroma~ Tuanul Niima Outp~ 107 Tons 188.
## 6 4/6/2013 Proximity~ Tuanul Trade cara~ 32109 Tons 1229.
## 7 4/7/2013 Hyperdriv~ Tuanul Trade cara~ 862 Tons 1485.
## 8 4/8/2013 Landing j~ Reestki Niima Outp~ 13944 Tons 1497.
## 9 4/9/2013 Electroma~ Crater~ Raiders 7788 Tons 188.
## 10 4/10/2013 Sublight ~ Outski~ Niima Outp~ 10642 Tons 7211.
## # ... with 1,122 more rows
Notice the row of <three>
letter abbreviations under the column names? These describe the data type of each column.
<chr>
stands for character vector or a string of characters. Examples: “apple”, “apple5”, “5 red apples”<int>
stands for integer. Examples: 5, 34, 1071<dbl>
stands for double. Examples: 5.0000, 3.4E-6, 10.7106We’ll discover more data types later on, such as dates
and logical
(TRUE/FALSE).
1. What data type is the destination
column?
letters
character
TRUE/FALSE
numbers
character
Woop! You got this.
2. What package does read_csv()
come from?
dinosaur
get_data
readr
dplyr
readr
Great job! You are Jedi worthy!
3. How would you load the package junkfinder
?
junkfinder()
library(junkfinder)
load(junkfinder)
gogo_gadget(junkfinder)
library("junkfinder")
Excellent! Keep the streak going.
EXPLORE: Change a function’s options
Functions often have options that you can change to control their behavior. You can set these optins using arguments. Let’s look at a few of the arguments for the function read_csv()
.
Sometimes you may want to ignore the first row in your data file, especially an EPA file that includes a disclaimer on the first row. Yes EPA, we’re looking at you. Please stop.
Let’s open the help window with ?read_csv
and try to find an argument that can help us. There’s a lot of them! But the skip
argument looks like it could be helpful. Take a look at the description near the bottom. The default is skip = 0
, which reads every line, but we can skip the first line by writing skip = 1
. Let’s give it a go.
read_csv("https://itep-r.netlify.com/data/starwars_scrap_jakku.csv", skip = 1)
Other types of data have weird last rows that are a subtotal or just report “END OF DATA”. Sometimes we want read_csv
to ignore the last row, or only pull in a million lines because you don’t want to bog down the memory on an old laptop.
Let’s look through the help window to find an argument that can help us. Type ?read_csv
and scroll down.
The n_max
argument looks like it could be helpful. The default is n_max = Inf
, which means it will read every line, but we can limit the lines we read to only one hundred by using n_max = 100
.
# Read in 100 rows
small_data <- read_csv("https://itep-r.netlify.com/data/starwars_scrap_jakku.csv", skip = 1, n_max = 100)
# Remove the data
rm(small_data)
To see all of a function’s arguments
read_csv( |
TAB
on the keyboardIn data analysis it is really important to look at your data early and often. For that, let’s add a new package called ggplot2!
Install it by running the following in your Console:
install.packages("ggplot2")
NOTE
You can also install packages from the Packages
tab in the lower right window of RStudio.
Here’s a simple chart showing the total amount of scrap sold from each origin location.
library(ggplot2)
ggplot(scrap, aes(y = amount, x = origin)) +
geom_col() +
labs(title = "Which origin sold the most scrap?") +
theme_gray()
## Warning: Removed 910 rows containing missing values (position_stack).
Well, well, well, it looks like there is an All category we should look into more. Either there is a town hogging all the scrap or the data needs some cleaning.
Try changing theme_gray()
to theme_dark()
. What changes on the chart? What stays the same?
Try another theme: theme_classic()
or theme_void()
or delete the entire line and the +
above to see what the default settings are.
You can view all of the available theme options at ggplot2 themes.
Lost in an ERROR message? Is something behaving strangely and want to know why? See the Help! page for some troubleshooting options.
When you close R for the first time you will see some options about saving your workspace and other files. In general, we advise against saving these files. It’s easy enough to re-run your script next time you open your project. This will help RStudio open a fresh and clean environment every time you start it.
Follow these steps to set these options permanently.
Turn off Save Workspace
Tools > Global Options....
on the top RStudio navigation bar
What packages have we added to our
library
?What new functions have we learned?
REVIEW: Functions & arguments
Functions perform steps based on inputs called arguments and usually return an output object. There are functions in R that are really complex but most boil down to the same general setup:
new_output <- function(argument_input1, argument_input2)
You can make your own functions in R and name them almost anything you like, even my_amazing_starwars_function()
.
You can think of a function like a plan for making Clone Troopers.
create_clones(host = "Jango Fett",
n_troopers = 2000)
The function above creates Clone Troopers based on two arguments: the host
and n_troopers
. When we have more than one argument, we use a comma to separate them. With some luck, the function will successfully return a new object - a group of 2,000 Clone Troopers.
The sum()
function
We can use the sum()
function to find the sum age of our Star Wars characters.
# Call the sum function with starwars_ages as input
ages_sum <- sum(starwars_ages) # Assigns the output to starwars_ages_sum
# Print the starwars_ages_sum value to the console
ages_sum
## [1] 63
The sum()
function takes the starwars_ages vector as input, performs a calculation, and returns a number. Note that we assigned the output to the name ages_sum
.
If we don’t assign the output it will be printed to the console and not saved.
# Alternative without assigning output
sum(starwars_ages)
## [1] 63
NOTE
The original
starwars_ages
vector has not changed. Each function has its own “environment” and its calculations happen inside a bubble. In general, what happens inside a function won’t change your objects outside of the function.
starwars_ages
## [1] 19 19 25
EXPLORE: Does the order of arguments matter?
You may be wondering why we included skip =
for the skip argument, but tell R explicitly what argument the other objects belonged to. Well now, that’s an interesting story. When you pass inputs to a function, R assumes you’ve entered them in the same order that is shown on the ?help
page. Let’s say you had a function called feed_porgs()
with 3 arguments:
feed_porgs(breakfast = "fish", lunch = "veggies", dinner = "clams")
.A shorthand to write this would be:
feed_porgs("fish", "veggies", "clams")
.This works out just fine because all of the arguments were entered in the default order, the same as above.
But let’s say we write:
feed_porgs("veggies", "clams", "fish")
Now the function will send veggies to the porgs for breakfast because that is the first argument. But that’s no good for the porgs. So if we really want to write “veggies” first, we’ll need to tell R which food item belongs to which meal.
Like this:
feed_porgs(lunch = "veggies", breakfast = "fish", dinner = "clams")
.Ok, so what about read_csv()
?
For read_csv
, when we wrote:
read_csv(scrap_file, column_names, skip = 1)
R assumes that the first argument (the data file) is scrap_file
and that the 2nd argument “col_names” should be set to column_names
. Next, the skip =
argument is included explicitly because skip is the 10th argument in read_csv()
. If we didn’t include skip =
, R would assume the value 1
that we entered is meant for the function’s 3rd argument.
Let’s launch ourselves into the unknown and use R to make a Word Cloud
. With a little copy-pasting we can make a fun image out of everyone’s name in the class.
Since you’re such a big deal, we can also help you make your name really BIG .
Open R Studio
Copy the code below into your script in RStudio. Start with the line install.packages
and end with the line color = 'random-dark')
.
install.packages(c("wordcloud2", "dplyr"))
library(wordcloud2)
library(dplyr)
#---- Class names ----#
class <- c("Steve" = 8,
"Mike" = 9,
"Eric" = 8,
"Hannah" = 9,
"Jon" = 8,
"Mary" = 9,
"Min" = 9,
"Aida" = 9,
"Matthias" = 8,
"Gao" = 9,
"Ben" = 9,
"Eva" = 9,
"James" = 10,
"Kitty" = 11,
"Zeb" = 9,
#---- Fun names ----#
"R" = 26,
"2019" = 20,
"MPCA" = 16,
"Porgs!" = 84,
"Endor" = 10,
"Jakku" = 10,
"BB8" = 12,
"Rey" = 8,
"Derek" = 8,
"Kristie" = 8,
"Barbara" = 8,
"Dorian" = 8)
# Add 20 Star Wars names as small text, size = 4
class <- c(class, rep(4, 20))
names(class)[(length(class) - 19):length(class)] <- sample_n(starwars, 20)$name
# Plot the Word Cloud with the "random-dark" color theme
wordcloud2(data.frame(word = names(class), freq = class),
size = 1,
color = 'random-dark')
CTRL + ENTER
.Viewer
window shown below to make enough room for your name to appear. You can also click the Zoom
icon to create a bigger word cloud.
package |
An add-on for R that contains new functions that someone created to help you. It’s like an App for R. | |
library |
The name of the folder that stores all your packages, and the function used to load a package. | |
function |
Functions perform an operation on your data and returns a result. The function sum() takes a series of values and returns the sum for you. |
|
argument |
Arguments are options or inputs that you pass to a function to change how it behaves. The argument skip = 1 tells the read_csv() function to ignore the first row when reading in a data file. To see the default values for a function you can type ?read_csv in the console. |


My name is Keith Richards, and everyone died in 2016 except me for some reason.
Portland kombucha brunch sustainable kinfolk. Retro iceland iPhone live-edge. Scenester paleo etsy prism distillery. Bicycle rights food truck fingerstache, kale chips chartreuse leggings letterpress humblebrag. Slow-carb williamsburg XOXO, +1 heirloom tbh echo park pop-up meditation post-ironic actually. Slow-carb sustainable poutine, health goth poke yr quinoa chambray taxidermy deep v readymade. Williamsburg photo booth ugh heirloom you probably haven't heard of them drinking vinegar.


-
- Recycled Tire Tiles
-
- Rugged, heavy duty Tire tile, made from discarded truck and airplane tire.
- Patented manufacturing process is used to convert used truck tires into tiles.
- Slip resilient Spike proof material is ideal for high traffic entrance areas such as shopping malls, airports, golf and ski courses, schools , retail and office environments.
- Indoor and outdoor use.
- Comes in 12″ x 12″ tiles and also in strips of 12″ x 25 feet, easy to install.
-
- PLAIN NATURAL COCO MATS
-
Our plain Coir Doormats are made from selected coconut coir fibers and woven in a tough base with braided edges. Densely woven coir fibers absorb water and brush to whisk away traffic dirt and moisture from foot wear. These mats can be used for household and commercial entrances. We have the capability of custom manufacturing according to specifications.
-
- PERSONALIZED COCO MATS
-
We are capable of reproducing your logo or personalization on any of our coco mats. We use fade resistant paint and high quality ink. We have a fast turnaround process and can meet high volume demands.
-
- VINYL BACKED COCO MATS
-
We offer coco mats that come with a vinyl backing. These coco mats are ideal to be used in recessed areas in entrance ways. We offer them in widths of 15mm, 17mm, 19 mm, 21 mm and 29 mm to fit any recesses. These mats can be cut into desirable measurements. They come in long 12.5 meters rolls with a maximum width of 2 meters.
-
- PRINTED COCO MATS
-
A traditional cocomat printed with our designs as well as traditional designs like Greek key etc. Ink for the design is imprinted deep within the coco fibers of the mat to ensure a long lasting and sharp design. They come in thickness of 1” and 1.75” . We offer them in a natural backing as well as a vinyl backing.
-
- COCO MATTING
-
Coco matting made from natural coco fiber, these heavy duty matting is mostly used in the industry as a safety mat against oil fields. They come in rolls of 150 feet and widths of 18” , 27”, 36” , 45” , 54” , AND 72” . We can custom cut the matting into various lengths and attach canvas ends to prevent the cut ends from fraying.
-
- RECYCLED RUBBER MATTING
-
The discarded and used tires that we collect , the side walls of the tire is used for our ‘TREAD TILE” , parts of the tire is stripped to make our tire link mats, and the rest of the tire is crushed into powder to manufacture our water retainer mats, rubber scroll mats and tire mats.
-
- HORSE VAN MATS
-
Mats made from heavy duty coco fiber, are tightly woven to produce our horse van ramp mats. The tight weaving of these mats provide a slip resistant pathway for the horses to walk up the ramp of the trailer.
-
- ROAD ROLLER MATS
-
Our road roller mats are mats are made from rugged coco fiber. These mats serve as excellent scraper of dirt from large road roller drums. We offer these in more than 75 sizes ranging from 4” wide to 12” wide. We can also custom manufacture to specifications.
-
- COCO GARDEN PRODUCTS
-
Left over coco fiber that is not used for the manufacture of our coco door mats, we convert into coco growing products. Our coco growing medium blocks is a 100 % natural coco potting mix also known as coco peat. It is used a soil reconditioner and structure improver. This 11 lb block is mildew resistant and repels bugs termites and other pests. Each block expands to 17 gallons of mix.Our COCO MULCH BLOCK is a 100% organic bio degradable coco husk product. Provides covering for the garden keeping it moist. Will not mildew or attact bugs. One quart makes upto 55 quarts of mulch.
-
- DOCK BUMPERS
-
- Constructed of tough layers of truck tire material
- Absorbs 80% of impact force
- Anchor bolts are protected by 3″ of rubber to prevent damage
- Long lasting and provides years of protection
- Maintenance free
- The thickness indicates how far the bumper will stand out from the dock


Current Opportunities
We're currently seeking a talented technician for year round steady employment with a minimum of 5 years experience. We work primarily in central and north New Jersey. We offer excellent pay with union pension, health, annuity, disability, and additional benefits. Valid NJDL required. Forward your resume via Email or Fax:
- Fax:<PHONE_NUMBER>
-<EMAIL_ADDRESS>- john@unitedcooling.co


____ _ _________________________________________ \/ \ _/\ / \/ \ / oigtFit \/
VoigtFit Interface¶
class DataSet¶
-
class
VoigtFit.
DataSet
(redshift, name='')[source]¶ Main class of the package
VoigtFit
. The DataSet handles all the major parts of the fit. Spectral data must be added using theadd_data
method. Hereafter the absorption lines to be fitted are added to the DataSet using theadd_line
oradd_many_lines
methods. Lastly, the components of each element is defined using theadd_component
method. When all lines and components have been defined, the DataSet must be prepared by calling theprepare_dataset
method and subsequently, the lines can be fitted using thefit
method.Attributes
- redshift : float
- Systemic redshift of the absorption system.
- name : str [default = ‘’]
- The name of the DataSet, this will be used for saving the dataset to a file structure.
- verbose : bool [default = True]
- If False, the printed information statements will be suppressed.
- data : list(data_chunks)
- A list of data chunks defined for the dataset. A data chunk is
a dictionary with keys ‘wl’, ‘flux’, ‘error’, ‘res’, ‘norm’.
See
DataSet.add_data
. - lines : dict
- A dictionary holding pairs of defined (line_tag :
dataset.Line
) - all_lines : list(str)
- A list of all the defined line tags for easy look-up.
- molecules : dict
- A dictionary holding a list of the defined molecular bands and Jmax
for each molecule:
{molecule* : [[band1, Jmax1], [band2, Jmax2], etc...]}
- regions : list(
regions.Region
) - A list of the fitting regions.
- cheb_order : int [default = -1]
- The maximum order of Chebyshev polynomials to use for the continuum fitting in each region. If negative, the Chebyshev polynomials will not be included in the fit.
- norm_method : str [default = ‘linear’]
- Default normalization method to use for interactive normalization if Chebyshev polynomial fitting should not be used.
- components : dict
- A dictionary of components for each ion defined:
(ion : [z, b, logN, options]). See
DataSet.add_component
. - velspan : float [default = 500]
- The default velocity range to use for the definition of fitting regions.
- ready2fit : bool [default = False]
- This attribute is checked before fitting the dataset. Only when
the attribute has been set to True can the dataset be fitted.
This will be toggled after a successful run of
DataSet.prepare_dataset
. - best_fit : lmfit.Parameters [default = None]
- Best-fit parameters from lmfit. This attribute will be None until the dataset has been fitted.
- pars : lmfit.Parameters [default = None]
- Placeholder for the fit parameters initiated before the fit.
The parameters will be defined during the call to
DataSet.prepare_dataset
based on the defined components.
Methods
activate_all
()Activate all lines defined in the DataSet. activate_fine_lines
(line_tag[, levels])Activate all lines associated to a given fine-structure complex. activate_line
(line_tag)Activate a given line defined by its line_tag activate_molecule
(molecule, band)Activate all lines for the given band of the given molecule. add_component
(ion, z, b, logN[, var_z, …])Add component for a given ion. add_component_velocity
(ion, v, b, logN[, …])Same as for add_component
but input is given as relative velocity instead of redshift.add_data
(wl, flux, res[, err, normalized, mask])Add spectral data to the DataSet. add_fine_lines
(line_tag[, levels, …])Add fine-structure line complexes by providing only the main transition. add_line
(line_tag[, velspan, active])Add an absorption line to the DataSet. add_lines
(line_tags[, velspan])Alias for self.add_many_lines. add_many_lines
(tags[, velspan])Add many lines at once. add_molecule
(molecule, band[, Jmax, …])Add molecular lines for a given band, e.g., “AX(0-0)” of CO. add_spectrum
(filename, res[, normalized, …])Add spectral data from ASCII file (three or four columns accepted). all_active_lines
()Returns a list of all the active lines defined by their line_tag. clear_mask
(line_tag[, idx])Clear the mask for the Region
containing the given line_tag.copy_components
([to_ion, from_ion, logN, …])Copy velocity structure to ion from another ion. deactivate_all
()Deactivate all lines defined in the DataSet. deactivate_fine_lines
(line_tag[, levels])Deactivate all lines associated to a given fine-structure complex. deactivate_line
(line_tag)Deactivate a given line defined by its line_tag. deactivate_molecule
(molecule, band)Deactivate all lines for the given band of the given molecule. delete_component
(ion, index)Remove component of the given ion with the given index. find_ion
(ion)Return a list of all line tags for a given ion. find_line
(line_tag)Look up the fitting Region
for a given line tag.fit
([verbose, plot])Fit the absorption lines using chi-square minimization. fix_structure
([ion])Fix the velocity structure, that is, the redshifts and the b-parameters. free_structure
([ion])Free the velocity structure, that is, the redshifts and the b-parameters. get_lines_for_ion
(ion)Return a list of Line
objects corresponding to the given ion.get_name
()Returns the name of the DataSet. get_resolution
(line_tag[, verbose])Return the spectral resolution for the fitting Region
where the line with the given line_tag is defined.has_ion
(ion[, active_only])Return True if the dataset has lines defined for the given ion. has_line
(line_tag[, active_only])Return True if the given line is defined. interactive_components
(line_tag[, velocity])Define components interactively for a given ion. load_components_from_file
(fname[, fit_pars])Load best-fit parameters from an output file fname. mask_line
(line_tag[, reset, mask, telluric, …])Define exclusion masks for the fitting region of a given line. normalize_line
(line_tag[, norm_method, velocity])Normalize or re-normalize a given line plot_fit
([rebin, fontsize, xmin, xmax, …])Plot all the absorption lines and the best-fit profiles. plot_line
(line_tag[, index, plot_fit, loc, …])Plot a single fitting Region
containing the line corresponding to the given line_tag.prepare_dataset
([norm, mask, verbose, …])Prepare the data for fitting. print_cont_parameters
()Print Chebyshev coefficients for the continuum fit. print_metallicity
(logNHI[, err])Print the total column densities for each element relative to HI in Solar units. print_results
([velocity, elements, systemic])Print the best fit parameters. print_total
()Print the total column densities of all components. remove_fine_lines
(line_tag[, levels])Remove lines associated to a given fine-structure complex. remove_line
(line_tag)Remove an absorption line from the DataSet. remove_molecule
(molecule, band)Remove all lines for the given band of the given molecule. reset_all_regions
()Reset the data in all Regions
defined in the DataSet to use the raw input data.reset_components
([ion])Reset component structure for a given ion. reset_region
(reg)Reset the data in a given regions.Region
to use the raw input data.save
([filename, verbose])Save the DataSet to file using the HDF5 format. save_cont_parameters_to_file
(filename)Save the best-fit continuum parameters to ASCII table output. save_fit_regions
([filename, individual, path])Save the fitting regions to ASCII table output. save_parameters
(filename)Save the best-fit parameters to ASCII table output. set_name
(name)Set the name of the DataSet. set_resolution
(res[, line_tag, verbose])Set the spectral resolution in km/s for the Region
containing the line with the given line_tag.set_systemic_redshift
(z_sys)Update the systemic redshift of the dataset show_components
([ion])Show the defined components for a given ion. show_lines
()Print all defined lines to terminal. sum_components
(ions, components)Calculate the total column density for the given components of the given ion. velocity_plot
(**kwargs)Create a velocity plot, showing all the fitting regions defined, in order to compare different lines and to identify blends and contamination. remove_all_lines -
activate_fine_lines
(line_tag, levels=None)[source]¶ Activate all lines associated to a given fine-structure complex.
Parameters: - line_tag : str
The line tag of the ground state transition to activate.
- levels : str, list(str) [default = None]
The levels of the fine-structure complexes to activate, with the string “a” referring to the first excited level, “b” is the second, etc… Several levels can be given at once as a list: [‘a’, ‘b’] or as a concatenated string: ‘abc’. By default, all levels are included.
-
activate_molecule
(molecule, band)[source]¶ Activate all lines for the given band of the given molecule.
- Ex:
activate_molecule('CO', 'AX(0-0)')
- Ex:
-
add_component
(ion, z, b, logN, var_z=True, var_b=True, var_N=True, tie_z=None, tie_b=None, tie_N=None)[source]¶ Add component for a given ion. Each component defined will be used for all transitions defined for a given ion.
Parameters: - ion : str
The ion for which to define a component: e.g., “FeII”, “HI”, “CIa”, etc.
- z : float
The redshift of the component.
- b : float
The effective broadening parameter for the component in km/s. This parameter is constrained to be in the interval [0 - 1000] km/s.
- logN : float
The 10-base logarithm of the column density of the component. The column density is expected in cm^-2.
- var_z : bool [default = True]
If False, the redshift of the component will be kept fixed.
- var_b : bool [default = True]
If False, the b-parameter of the component will be kept fixed.
- var_N : bool [default = True]
If False, the column density of the component will be kept fixed.
- tie_z, tie_b, tie_N : str [default = None]
Parameter constraints for the different variables.
Notes
The ties are defined relative to the parameter names. The naming is as follows: The redshift of the first component of FeII is called “z0_FeII”, the logN of the second component of SiII is called “logN1_SiII”. For more information about parameter ties, see the documentation for lmfit.
-
add_component_velocity
(ion, v, b, logN, var_z=True, var_b=True, var_N=True, tie_z=None, tie_b=None, tie_N=None)[source]¶ Same as for
add_component
but input is given as relative velocity instead of redshift.
-
add_data
(wl, flux, res, err=None, normalized=False, mask=None)[source]¶ Add spectral data to the DataSet. This will be used to define fitting regions.
Parameters: - wl : ndarray, shape (n)
Input vacuum wavelength array in Ångstrøm.
- flux : ndarray, shape (n)
Input flux array, should be same length as wl
- res : float or string
Spectral resolution either given in km/s (c/R), which is assumed to be constant over the whole spectrum, or as a string referring to a file containing the detailed line-spread function for the given spectrum. See details in the data section of the VoigtFit Parameter Language.
- err : ndarray, shape (n) [default = None]
Error array, should be same length as wl If None is given, an uncertainty of 1 is given to all pixels.
- normalized : bool [default = False]
If the input spectrum is normalized this should be given as True in order to skip normalization steps.
- mask : array, shape (n)
Boolean/int array defining the fitting regions. Only pixels with mask=True/1 will be included in the fit.
-
add_fine_lines
(line_tag, levels=None, full_label=False, velspan=None)[source]¶ Add fine-structure line complexes by providing only the main transition. This function is mainly useful for the CI complexes, where the many lines are closely located and often blended.
Parameters: - line_tag : str
Line tag for the ground state transition, e.g., “CI_1656”
- levels : str, list(str) [default = None]
The levels of the fine-structure complexes to add, starting with “a” referring to the first excited level, “b” is the second, etc.. Several levels can be given at once: [‘a’, ‘b’]. Note that the ground state transition is always included. If levels is not given, all levels are included.
- full_label : bool [default = False]
If True, the label will be translated to the full quantum mechanical description of the state.
-
add_line
(line_tag, velspan=None, active=True)[source]¶ Add an absorption line to the DataSet.
Parameters: - line_tag : str
The line tag for the transition which should be defined. Ex: “FeII_2374”
- velspan : float [default = None]
The velocity span around the line center, which will be included in the fit. If None is given, use the default self.velspan defined (default = 500 km/s).
- active : bool [default = True]
Set the
Line
as active (i.e., included in the fit).
Notes
This will initiate a
Line
class with the atomic data for the transition, as well as creating a fittingRegion
containing the data cutout around the line center.
-
add_many_lines
(tags, velspan=None)[source]¶ Add many lines at once.
Parameters: - tags : list(str)
A list of line tags for the transitions that should be added.
- velspan : float [default = None]
The velocity span around the line center, which will be included in the fit. If None is given, use the default
velspan
defined (500 km/s).
-
add_molecule
(molecule, band, Jmax=0, velspan=None, full_label=False)[source]¶ Add molecular lines for a given band, e.g., “AX(0-0)” of CO.
Parameters: - molecule : str
The molecular identifier, e.g., ‘CO’, ‘H2’
- band : str
The vibrational band of the molecule, e.g., for CO: “AX(0-0)” These bands are defined in
molecules
.- Jmax : int [default = 0]
The maximal rotational level to include. All levels up to and including J will be included.
- velspan : float [default = None]
The velocity span around the line center, which will be included in the fit. If None is given, use the default
velspan
defined (500 km/s).- full_label : bool [default = False]
If True, the label will be translated to the full quantum mechanical description of the state.
-
add_spectrum
(filename, res, normalized=False, mask=None, continuum=None)[source]¶ Add spectral data from ASCII file (three or four columns accepted). This is a wrapper of the method add_data.
Parameters: - filename : string
Filename of the ASCII spectrum containing at least 3 columns: (wavelength, flux, error). A fourth column may be included containing a spectral mask.
- res : float or string
Spectral resolution either given in km/s (c/R), which is assumed to be constant over the whole spectrum, or as a string referring to a file containing the detailed line-spread function for the given spectrum. See details in the documentation.
- normalized : bool [default = False]
If the input spectrum is normalized this should be given as True in order to skip normalization steps.
- mask : array, shape (n)
Boolean/int array defining the fitting regions. Only pixels with mask=True/1 will be included in the fit.
- continuum : array, shape (n)
Continuum spectrum. The input spectrum will be normalized using this continuum spectrum.
-
clear_mask
(line_tag, idx=None)[source]¶ Clear the mask for the
Region
containing the given line_tag. If more regions are defined for the same line (when fitting multiple spectra), the given region can be specified by passing an index idx.
-
copy_components
(to_ion='', from_ion='', logN=0, ref_comp=None, tie_z=True, tie_b=True)[source]¶ Copy velocity structure to ion from another ion.
Parameters: - to_ion : str
The new ion to define.
- from_ion : str
The base ion which will be used as reference.
- logN : float
If logN is given, the starting guess is defined from this value following the pattern of the components defined for anchor relative to the ref_comp (default: the first component).
- ref_comp : int
The reference component to which logN will be scaled.
- tie_z : bool [default = True]
If True, the redshifts for all components of the two ions will be tied together.
- tie_b : bool [default = True]
If True, the b-parameters for all components of the two ions will be tied together.
-
deactivate_all
()[source]¶ Deactivate all lines defined in the DataSet. This will not remove the lines.
-
deactivate_fine_lines
(line_tag, levels=None)[source]¶ Deactivate all lines associated to a given fine-structure complex.
Parameters: - line_tag : str
The line tag of the ground state transition to deactivate.
- levels : str, list(str) [default = None]
The levels of the fine-structure complexes to deactivate, with the string “a” referring to the first excited level, “b” is the second, etc… Several levels can be given at once as a list: [‘a’, ‘b’] or as a concatenated string: ‘abc’. By default, all levels are included.
-
deactivate_line
(line_tag)[source]¶ Deactivate a given line defined by its line_tag. This will exclude the line during the fit but will not remove the data.
-
deactivate_molecule
(molecule, band)[source]¶ Deactivate all lines for the given band of the given molecule. To see the available molecular bands defined, see the manual pdf or
VoigtFit.molecules
.
-
find_line
(line_tag)[source]¶ Look up the fitting
Region
for a given line tag.Parameters: - line_tag : str
The line tag of the line whose region will be returned.
Returns: - regions_of_line : list of
Region
A list of the fitting regions containing the given line. This can be more than one region in case of overlapping or multiple spectra.
-
fit
(verbose=True, plot=False, **kwargs)[source]¶ Fit the absorption lines using chi-square minimization.
Parameters: - verbose : bool [default = True]
This will print the fit results to terminal.
- plot : bool [default = False]
This will make the best-fit solution show up in a new window.
- **kwargs
Keyword arguments are derived from the `scipy.optimize`_ minimization methods. The default method is leastsq_, used in lmfit. This can be changed using the method keyword. See documentation in lmfit and scipy.optimize_.
- rebin : int [default = 1]
Rebin data by a factor rebin before fitting. Passed as part of kwargs.
- sampling : int [default = 3]
Subsampling factor for the evaluation of the line profile. This is only used if the kernel is constant in velocity along the spectrum. Passed as part of kwargs.
Returns: - popt : lmfit.MinimizerResult_
The minimzer results from lmfit containing best-fit parameters and fit details, e.g., exit status and reduced chi squared. See documentation for lmfit.
- chi2 : float
The chi squared value of the best-fit. Note that this value is not the reduced chi squared. This value, and the number of degrees of freedom, are available under the popt object.
- .. _scipy.optimize: https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
- .. _leastsq: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.leastsq.html
- .. _lmfit.MinimizerResult: https://lmfit.github.io/lmfit-py/fitting.html#lmfit.minimizer.MinimizerResult
-
fix_structure
(ion=None)[source]¶ Fix the velocity structure, that is, the redshifts and the b-parameters.
Parameters: - ion : str [default = None]
The ion for which the structure should be fixed. If None is given, the structure is fixed for all ions.
-
free_structure
(ion=None)[source]¶ Free the velocity structure, that is, the redshifts and the b-parameters.
Parameters: - ion : str [default = None]
The ion for which the structure should be released. If None is given, the structure is released for all ions.
-
get_lines_for_ion
(ion)[source]¶ Return a list of
Line
objects corresponding to the given ion.Parameters: - ion : str
The ion for the lines to get.
Returns: - lines_for_ion : list(
Line
) List of Lines defined for the given ion.
-
get_resolution
(line_tag, verbose=False)[source]¶ Return the spectral resolution for the fitting
Region
where the line with the given line_tag is defined.Parameters: - line_tag : str
The line-tag for the line to look up: e.g., “FeII_2374”
- verbose : bool [default = False]
If True, print the returned spectral resolution to std out.
Returns: - resolutions : list of float
A list of the spectral resolution of the fitting regions where the given line is defined.
-
has_ion
(ion, active_only=False)[source]¶ Return True if the dataset has lines defined for the given ion.
-
interactive_components
(line_tag, velocity=False)[source]¶ Define components interactively for a given ion. The components will be defined on the basis of the given line for that ion. If the line is defined in several spectra then the interactive window will show up for each. Running the interactive mode more times for different transitions of the same ion will append the components to the structure. If no components should be added, then simply click enter to terminate the process for the given transition.
Parameters: - line_tag : str
Line tag for the line belonging to the ion for which components should be defined.
- velocity : bool [default = False]
If a True, the region is displayed in velocity space relative to the systemic redshift instead of in wavelength space.
Notes
This will launch an interactive plot showing the fitting region of the given line. The user can then click on the positions of the components which. At the end, the redshifts and estimated column densities are printed to terminal. The b-parameter is assumed to be unresolved, i.e., taken from the resolution.
-
load_components_from_file
(fname, fit_pars=True)[source]¶ Load best-fit parameters from an output file fname. If fit_pars is True, then update the best_fit parameters.
-
mask_line
(line_tag, reset=True, mask=None, telluric=True, velocity=False)[source]¶ Define exclusion masks for the fitting region of a given line. Note that the masked regions are exclusion regions and will not be used for the fit. If components have been defined, these will be shown as vertical lines.
Parameters: - line_tag : str
Line tag for the
Line
whoseRegion
should be masked.- reset : bool [default = True]
If True, clear the mask before defining a new mask.
- mask : array_like, shape (n) [default = None]
If the mask is given, it must be a boolean array of the same length as the region flux, err, and wl arrays. Passing a mask this was supresses the interactive masking process.
- telluric : bool [default = True]
If True, a telluric absorption template and sky emission template is shown for reference.
- velocity : bool [default = False]
If a True, the regions are displayed in velocity space relative to the systemic redshift instead of in wavelength space when masking and defining continuum normalization interactively.
-
normalize_line
(line_tag, norm_method='spline', velocity=False)[source]¶ Normalize or re-normalize a given line
Parameters: - line_tag : str
Line tag of the line whose fitting region should be normalized.
- norm_method : str [default = ‘spline’]
Normalization method used for the interactive continuum fit. Should be on of: [“spline”, “linear”]
- velocity : bool [default = False]
If a True, the regions are displayed in velocity space relative to the systemic redshift instead of in wavelength space when masking and defining continuum normalization interactively.
-
plot_fit
(rebin=1, fontsize=12, xmin=None, xmax=None, max_rows=4, ymin=None, ymax=None, filename=None, subsample_profile=1, npad=50, loc='left', highlight_props=None, residuals=True, norm_resid=False, default_props={}, element_props={}, legend=True, label_all_ions=False, xunit='vel', line_props=None, hl_line_props=None)[source]¶ Plot all the absorption lines and the best-fit profiles. For details, see
VoigtFit.output.plot_all_lines()
.
-
plot_line
(line_tag, index=0, plot_fit=False, loc='left', rebin=1, nolabels=False, axis=None, fontsize=12, xmin=None, xmax=None, ymin=None, ymax=None, show=True, subsample_profile=1, npad=50, residuals=True, norm_resid=False, legend=True, default_props={}, element_props={}, highlight_props=None, label_all_ions=False, xunit='velocity', line_props=None, hl_line_props=None)[source]¶ Plot a single fitting
Region
containing the line corresponding to the given line_tag. For details, seeoutput.plot_single_line()
.
-
prepare_dataset
(norm=True, mask=False, verbose=True, active_only=False, force_clean=False, velocity=False)[source]¶ Prepare the data for fitting. This function sets up the parameter structure, and handles the normalization and masking of fitting regions.
Parameters: - norm : bool [default = True]
Opens an interactive window to let the user normalize each region using the defined
norm_method
.- mask : bool [default = True]
Opens an interactive window to let the user mask each fitting region.
- verbose : bool [default = True]
If this is set, the code will print small info statements during the run.
- force_clean : bool [default = False]
If this is True, components for inactive elements will be removed.
- velocity : bool [default = False]
If a True, the regions are displayed in velocity space relative to the systemic redshift instead of in wavelength space when masking and defining continuum normalization interactively.
Returns: - bool
The function returns True when the dataset has passed all the steps. If one step fails, the function returns False. The
ready2fit
attribute of the dataset is also updated accordingly.
-
print_metallicity
(logNHI, err=0.1)[source]¶ Print the total column densities for each element relative to HI in Solar units.
-
print_results
(velocity=True, elements='all', systemic=None)[source]¶ Print the best fit parameters.
Parameters: - velocity : bool [default = True]
If True, show the relative velocities of each component instead of redshifts.
- elements : list(str) [default = ‘all’]
A list of elements for which to show parameters.
- systemic : float [default = None]
The systemic redshift used as reference for the relative velocities.
-
remove_fine_lines
(line_tag, levels=None)[source]¶ Remove lines associated to a given fine-structure complex.
Parameters: - line_tag : str
The line tag of the ground state transition to remove.
- levels : str, list(str) [default = None]
The levels of the fine-structure complexes to remove, with “a” referring to the first excited level, “b” is the second, etc.. Several levels can be given at once as a list: [‘a’, ‘b’] or as a concatenated string: ‘abc’. By default, all levels are included.
-
remove_line
(line_tag)[source]¶ Remove an absorption line from the DataSet. If this is the last line in a fitting region the given region will be eliminated, and if this is the last line of a given ion, then the components will be eliminated for that ion.
Parameters: - line_tag : str
Line tag of the transition that should be removed.
-
reset_all_regions
()[source]¶ Reset the data in all
Regions
defined in the DataSet to use the raw input data.
-
reset_components
(ion=None)[source]¶ Reset component structure for a given ion.
Parameters: - ion : str [default = None]
The ion for which to reset the components: e.g., ‘FeII’, ‘HI’, ‘CIa’, etc. If `None`is given, all components for all ions will be reset.
-
reset_region
(reg)[source]¶ Reset the data in a given
regions.Region
to use the raw input data.
-
save_cont_parameters_to_file
(filename)[source]¶ Save the best-fit continuum parameters to ASCII table output.
Parameters: - filename : str [default = None]
If None, the
name
attribute will be used.
-
save_fit_regions
(filename=None, individual=False, path='')[source]¶ Save the fitting regions to ASCII table output. The format is as follows: (wavelength , normalized flux , normalized error , best-fit profile , mask)
Parameters: - filename : str [default = None]
Filename for the fitting regions. If None, the
name
attribute will be used.- individual : bool [default = False]
Save the fitting regions to individual files. By default all regions are concatenated into one file.
- path : str [default = ‘’]
Specify a path to prepend to the filename in order to save output to a given directory or path. Can be given both as relative or absolute path. If the path doesn’t end in / it will be appended automatically. The final filename will be:
path/ + filename [+ _regN] + .reg
-
save_parameters
(filename)[source]¶ Save the best-fit parameters to ASCII table output.
Parameters: - filename : str
Filename for the fit parameter file.
-
set_name
(name)[source]¶ Set the name of the DataSet. This parameter is used when saving the dataset.
-
set_resolution
(res, line_tag=None, verbose=True)[source]¶ Set the spectral resolution in km/s for the
Region
containing the line with the given line_tag. If multiple spectra are fitted simultaneously, this method will set the same resolution for all spectra. If line_tag is not given, the resolution will be set for all regions, including the raw data chunks defined inVoigtFit.DataSet.data
!Note – If not all data chunks have the same resolution, this method should be used with caution. It is advised to check the spectral resolution beforehand and only update the appropriate regions using a for-loop.
-
show_components
(ion=None)[source]¶ Show the defined components for a given ion. By default, all ions are shown.
-
show_lines
()[source]¶ Print all defined lines to terminal. The output shows whether the line is active or not and the number of components for the given ion.
-
sum_components
(ions, components)[source]¶ Calculate the total column density for the given components of the given ion.
Parameters: - ions : str or list(str)
List of ions or a single ion for which to calculate the total column density.
- components : list(int)
List of integers corresponding to the indeces of the components to sum over.
Returns: - total_logN : dict()
Dictionary containing the log of total column density for each ion.
- total_logN_err : dict()
Dictionary containing the error on the log of total column density for each ion.
class Line¶
-
class
dataset.
Line
(tag, active=True)[source]¶ Line object containing atomic data for the given transition. Only the line_tag is passed, the rest of the information is looked up in the atomic database.
Attributes
- tag : str
- The line tag for the line, e.g., “FeII_2374”
- ion : str
- The ion for the line; The ion for “FeII_2374” is “FeII”.
- element : str
- Equal to
ion
for backwards compatibility. - l0 : float
- Rest-frame resonant wavelength of the transition. Unit: Angstrom.
- f : float
- The oscillator strength for the transition.
- gam : float
- The radiation damping constant or Einstein coefficient.
- mass : float
- The atomic mass in atomic mass units.
- active : bool [default = True]
- The state of the line in the dataset. Only active lines will be included in the fit.
Methods
get_properties
()Return the principal atomic constants for the transition: l0, f, and gam. set_active
()Set the line active; include the line in the fit. set_inactive
()Set the line inactive; exclude the line in the fit.
class Region¶
-
class
regions.
Region
(velspan, specID, line=None)[source]¶ A Region contains the fitting data, exclusion mask and line information. The class is instantiated with the velocity span, velspan, and a spectral ID pointing to the raw data chunk from DataSet.data, and can include a
dataset.Line
instance for the first line belonging to the region.Attributes
- velspan : float
- The velocity range to used for the fitting region.
- lines : list(
dataset.Line
) - A list of Lines defined in the region.
- label : str
- A LaTeX label describing the lines in the region for plotting purposes.
- res : float
- Spectral resolution of the region in km/s.
- wl : array_like, shape (N)
- Data array of wavelengths in Ångstrøm.
- flux : array_like, shape (N)
- Data array of fluxes (normalized if
normalized
is True). - err : array_like, shape (N)
- Array of uncertainties for each flux element.
- normalized : bool
- True if the data in the region are normlized.
- mask : array_like, shape (N)
- Exclusion mask for the region: 0/False = pixel is not included in the fit. 1/True = pixel is included in the fit.
- new_mask : bool
- Internal parameter for
VoigtFit.DataSet.prepare_dataset()
. If True, an interactive masking process will be initiated in the preparation stage. - cont_err : float
- An estimate of the uncertainty in the continuum fit.
- specID : str
- A spectral identifier to point back to the raw data chunk.
Methods
add_data_to_region
(data_chunk, cutout)Define the spectral data for the fitting region. add_line
(line)Add a new dataset.Line
to the fitting region.clear_mask
()Clear the already defined mask in the region. define_mask
([z, dataset, telluric, z_sys])Use an interactive window to define the mask for the region. generate_label
([active_only, ignore_finelines])Automatically generate a descriptive label for the region. has_active_lines
()Return True is at least one line in the region is active. has_line
(line_tag)Return True if a line with the given line_tag is defined in the region. is_normalized
()Return True if the region data is normalized. normalize
([plot, norm_method, z_sys])Normalize the region if the data are not already normalized. remove_line
(line_tag)Remove absorption line with the given line_tag from the region. set_label
(text)Set descriptive text label for the given region. unpack
()Return the data of the region (wl, flux, error, mask) set_mask -
add_data_to_region
(data_chunk, cutout)[source]¶ Define the spectral data for the fitting region.
Parameters: - data_chunk : dict()
A data_chunk as defined in the data structure of
DataSet.data
.- cutout : bool array
A boolean array defining the subset of the data_chunk which makes up the fitting region.
-
add_line
(line)[source]¶ Add a new
dataset.Line
to the fitting region.
-
define_mask
(z=None, dataset=None, telluric=True, z_sys=None)[source]¶ Use an interactive window to define the mask for the region.
Parameters: - z : float [default = None]
If a redshift is given, the lines in the region are shown as vertical lines at the given redshift.
- dataset :
VoigtFit.DataSet
[default = None] A dataset with components defined for the lines in the region. If a dataset is passed, the components of the lines in the region are shown.
- telluric : bool [default = True]
Show telluric absorption and sky emission line templates during the masking.
- z_sys : float [default = None]
If a systemic redshift is given, the region is displayed in velocity space relative to the given systemic redshift instead of in wavelength space.
-
generate_label
(active_only=True, ignore_finelines=True)[source]¶ Automatically generate a descriptive label for the region.
-
normalize
(plot=True, norm_method='linear', z_sys=None)[source]¶ Normalize the region if the data are not already normalized. Choose from two methods:
- 1: define left and right continuum regions
- and fit a linear continuum.
- 2: define the continuum as a range of points
- and use spline interpolation to infer the continuum.
If z_sys is not None, show the region in velocity space using instead of wavelength space.
module voigt¶
The module contains functions to evaluate the optical depth, to convert this to observed transmission and to convolve the observed spectrum with the instrumental profile.
-
voigt.
Voigt
(wl, l0, f, N, b, gam, z=0)[source]¶ Calculate the optical depth Voigt profile.
Parameters: - wl : array_like, shape (N)
Wavelength grid in Angstroms at which to evaluate the optical depth.
- l0 : float
Rest frame transition wavelength in Angstroms.
- f : float
Oscillator strength.
- N : float
Column density in units of cm^-2.
- b : float
Velocity width of the Voigt profile in cm/s.
- gam : float
Radiation damping constant, or Einstein constant (A_ul)
- z : float
The redshift of the observed wavelength grid l.
Returns: - tau : array_like, shape (N)
Optical depth array evaluated at the input grid wavelengths l.
-
voigt.
convolve_numba
[source]¶ Define convolution function for a wavelength dependent kernel.
Parameters: - P : array_like, shape (N)
Intrinsic line profile.
- kernel : np.array, shape (N, M)
Each row of the kernel corresponds to the wavelength dependent line-spread function (LSF) evaluated at each pixel of the input profile P. Each LSF must be normalized!
Returns: - P_con : np.array, shape (N)
Resulting profile after performing convolution with kernel.
Notes
This function is decorated by the jit decorator from `numba`_ in order to speed up the calculation.
-
voigt.
evaluate_continuum
(x, pars, reg_num)[source]¶ Evaluate the continuum model using Chebyshev polynomials. All regions are fitted with the same order of polynomials.
Parameters: - x : array_like, shape (N)
Input wavelength grid in Ångstrøm.
- pars : dict(lmfit.Parameters)
An instance of lmfit.Parameters containing the Chebyshev coefficients for each region.
- reg_num : int
The region number, i.e., the index of the region in the list
VoigtFit.DataSet.regions
.
Returns: - cont_model : array_like, shape (N)
The continuum Chebyshev polynomial evaluated at the input wavelengths x.
-
voigt.
evaluate_profile
(x, pars, z_sys, lines, components, kernel, sampling=3)[source]¶ Evaluate the observed Voigt profile. The calculated optical depth, tau, is converted to observed transmission, f:
\[f = e^{-\tau}\]The observed transmission is subsequently convolved with the instrumental broadening profile assumed to be Gaussian with a full-width at half maximum of res. The resolving power is assumed to be constant in velocity space.
Parameters: - x : array_like, shape (N)
Wavelength array in Ångstrøm on which to evaluate the profile.
- pars : dict(lmfit.Parameters)
An instance of lmfit.Parameters containing the line parameters.
- lines : list(
Line
) List of lines to evaluate. Should be a list of
Line
objects.- components : dict
Dictionary containing component data for the defined ions. See
VoigtFit.DataSet.components
.- kernel : np.array, shape (N, M) or float
The convolution kernel for each wavelength pixel. If an array is given, each row of the array must specify the line-spread function (LSF) at the given wavelength pixel. The LSF must be normalized! If a float is given, the resolution FWHM is given in km/s (c/R). In this case the spectral resolution is assumed to be constant in velocity space.
- sampling : integer [default = 3]
The subsampling factor used for defining the input logarithmically space wavelength grid. The number of pixels in the evaluation will be sampling * N, where N is the number of input pixels. The final profile will be interpolated back onto the original wavelength grid defined by x.
Returns: - profile_obs : array_like, shape (N)
Observed line profile convolved with the instrument profile.
module output¶
-
output.
load_lsf
(lsf_fname, wl)[source]¶ Load a Line-Spread Function table following format from HST: First line gives wavelength in Angstrom and the column below each given wavelength defines the kernel in pixel space:
wl1 wl2 wl3 … wlNlsf11 lsf21 lsf31 … lsfN1lsf12 lsf22 lsf32 … lsfN2::lsf1M lsf2M lsf3M … lsfNMParameters: - lsf_fname : string
The filename containing the LSF data.
- wl : array like, shape (N)
The wavelength grid onto which the LSF will be evaluated
Returns: - kernel : np.array, shape(N, M)
A grid of interpolated LSF evaluated at each given input wavelength of the array wl of shape N, where M is the number of pixels in the LSF.
Notes
The output kernel is transposed with respect to the input format for ease of computation in the convolution since indexing is faster along rows than columns.
-
output.
plot_H2
(dataset, n_rows=None, xmin=None, xmax=None, ymin=-0.1, ymax=2.5, short_labels=False, rebin=1, smooth=0)[source]¶ Generate plot for H2 absorption lines.
Parameters: - dataset :
VoigtFit.DataSet
An instance of the class
VoigtFit.DataSet
containing the H2 lines to plot.- n_rows : int [default = None]
Number of rows to show in figure. If None, the number will be determined automatically.
- xmin : float
The lower x-limit in Å. If nothing is given, the extent of the fit region is used.
- xmax : float
The upper x-limit in Å. If nothing is given, the extent of the fit region is used.
- ymin : float [default = -0.1]
The lower y-limit in normalized flux units.
- ymax : float [default = 2.5]
The upper y-limit in normalized flux units.
- rebin : int [defualt = 1]
Rebinning factor for the spectrum, default is no binning.
- smooth : float [default = 0]
Width of Gaussian kernel for smoothing.
- dataset :
-
output.
plot_all_lines
(dataset, plot_fit=True, rebin=1, fontsize=12, xmin=None, xmax=None, ymin=None, ymax=None, max_rows=4, filename=None, subsample_profile=1, npad=50, residuals=True, norm_resid=False, legend=True, loc='left', show=True, default_props={}, element_props={}, highlight_props=None, label_all_ions=False, xunit='vel', line_props=None, hl_line_props=None)[source]¶ Plot all active absorption lines. This function is a wrapper of
plot_single_line()
. For a complete description of input parameters, see the documentation forplot_single_line()
.Parameters: - dataset :
VoigtFit.DataSet
Instance of the
VoigtFit.DataSet
class containing the line regions to plot.- max_rows : int [default = 4]
The maximum number of rows of figures. Each row consists of two figure panels.
- filename : str
If a filename is given, the figures are saved to a pdf file.
- dataset :
-
output.
plot_residual
(dataset, line_tag, index=0, rebin=1, xmin=None, xmax=None, axis=None)[source]¶ Plot residuals for the best-fit to a given absorption line.
Parameters: - dataset : class DataSet
An instance of DataSet class containing the line region to plot.
- line_tag : str
The line tag of the line to show, e.g., ‘FeII_2374’
- index : int [default = 0]
The line index. When fitting the same line in multiple spectra this indexed points to the index of the given region to be plotted.
- rebin: int
Integer factor for rebinning the spectral data.
- xmin : float
The lower x-limit in relative velocity (km/s). If nothing is given, the extent of the region is used.
- xmax : float
The upper x-limit in relative velocity (km/s). If nothing is given, the extent of the region is used.
- axis : matplotlib.axes.Axes
The plotting axis of matplotlib. If None is given, a new figure and axis will be created.
-
output.
plot_single_line
(dataset, line_tag, index=0, plot_fit=False, loc='left', rebin=1, nolabels=False, axis=None, fontsize=12, subsample_profile=1, xmin=None, xmax=None, ymin=None, ymax=None, show=True, npad=50, legend=True, residuals=False, norm_resid=False, default_props={}, element_props={}, highlight_props=None, label_all_ions=False, xunit='velocity', line_props=None, hl_line_props=None)[source]¶ Plot a single absorption line.
Parameters: - dataset :
VoigtFit.DataSet
Instance of the
VoigtFit.DataSet
class containing the lines- line_tag : str
The line tag of the line to show, e.g., ‘FeII_2374’
- index : int [default = 0]
The line index. When fitting the same line in multiple spectra this indexed points to the index of the given region to be plotted.
- plot_fit : bool [default = False]
If True, the best-fit profile will be shown
- loc : str [default = ‘left’]
Places the line tag (right or left).
- rebin : int [default = 1]
Rebinning factor for the spectrum
- nolabels : bool [default = False]
If True, show the axis x- and y-labels.
- axis : matplotlib.axes.Axes
The plotting axis of matplotlib. If None is given, a new figure and axis will be created.
- fontsize : int [default = 12]
The fontsize of text labels.
- xmin : float
The lower x-limit in relative velocity (km/s). If nothing is given, the extent of the region is used.
- xmax : float
The upper x-limit in relative velocity (km/s). If nothing is given, the extent of the region is used.
- ymin : float [default = None]
The lower y-limit in normalized flux units. Default is determined from the data.
- ymax : float [default = None]
The upper y-limit in normalized flux units. Default is determined from the data.
- show : bool [default = True]
Show the figure.
- subsample_profile : int [default = 1]
Subsampling factor to calculate the profile on a finer grid than the data sampling. By default the profile is evaluated on the same grid as the data.
- npad : int [default = 50]
Padding added to the synthetic profile before convolution. This removes end artefacts from the FFT routine.
- residuals : bool [default = False]
Add a panel above the absorption line to show the residuals of the fit.
- norm_resid : bool [default = False]
Show normalized residuals.
- legend : bool [default = True]
Show line labels as axis legend.
- default_props : dict
Dictionary of transition tick marker properties. The dictionary is passed to matplotlib.axes.Axes.axvline to control color, linewidth, linestyle, etc.. Two additional keywords can be defined: The keyword text is a string that will be printed above or below each tick mark for each element. The keyword loc controls the placement of the tick mark text for the transistions, and must be one either ‘above’ or ‘below’.
- element_props : dict
Dictionary of properties for individual elements. Each element defines a dictionary with individual properties following the format for default_props.
- Ex:
element_props={'SiII': {'color': 'red', 'lw': 1.5},
'FeII': {'ls': '--', 'alpha': 0.2}}
This will set the color and linewidth of the tick marks of SiII transitions and the linestyle and alpha-parameter of FeII transitions.
- Ex:
- highlight_props : dict/list [default = None]
A dictionary of ions (e.g., “FeII”, “CIa”, etc.) used to calculate a separate profile for this subset of ions. Each ion as a keyword must specify a dictionary which can change individual properties for the given ion. Similar to element_props. If an empty dictionary is given, the default parameters will be used. Alternatively, a list of ions can be given to use default properties for all ions.
Ex:
highlight_props={'SiII':{}, 'FeII':{'color': 'blue'}}
This will highlight SiII transitions with default highlight properties, and FeII transistions with a user specified color.
Ex:
highlight_props=['SiII', 'FeII']
This will highlight SiII and FeII transitions using default highlight properties.
- label_all_ions : bool [default = False]
Show labels for all ions defined. The labels will appear above the component tick marks.
- xunit : string [default = ‘velocity’]
The unit of the x-axis, must be either ‘velocity’ or ‘wavelength’. Shortenings are acceptable too, e.g., ‘vel’/’v’ or ‘wave’/’wl’.
- line_props : dict [default = None]
A dictionary of keywords to change the default line properties of the best-fit profile; e.g., ‘color’, ‘lw’, ‘linestyle’. All keywords will be passed to the `plot function`_ of matplotlib.
- hl_line_props : dict [default = None]
A dictionary of keywords to change the default line properties of the best-fit profile for highlighted ions. All keywords will be passed to the `plot function`_ of matplotlib.
- .. _plot function: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.plot.html
- dataset :
-
output.
print_T_model_pars
(dataset, thermal_model, filename=None)[source]¶ Print the turbulence and temperature parameters for physical model.
-
output.
print_cont_parameters
(dataset)[source]¶ Print the Chebyshev coefficients of the continuum normalization.
-
output.
print_metallicity
(dataset, params, logNHI, err=0.1)[source]¶ Print the metallicity derived from different species. This will add the column densities for all components of a given ion.
Parameters: - dataset :
VoigtFit.DataSet
An instance of the
VoigtFit.DataSet
class containing the definition of data and absorption lines.- params : lmfit.Parameters
Output parameter dictionary, e.g.,
VoigtFit.DataSet.best_fit
. See lmfit for details.- logNHI : float
Column density of neutral hydrogen.
- err : float [default = 0.1]
Uncertainty (1-sigma) on logNHI.
- .. _lmfit: https://lmfit.github.io/lmfit-py/index.html
- dataset :
-
output.
print_results
(dataset, params, elements='all', velocity=True, systemic=0)[source]¶ Print the parameters of the best-fit.
Parameters: - dataset :
VoigtFit.DataSet
An instance of the
VoigtFit.DataSet
class containing the line region to plot.- params : lmfit.Parameters
Output parameter dictionary, e.g.,
dataset.Dataset.best_fit
. See lmfit for details.- elements : list(str) [default = ‘all’]
A list of ions for which to print the best-fit parameters. By default all ions are shown.
- velocity : bool [default = True]
Show the components in relative velocity or redshift.
- systemic : float [default = 0]
Systemic redshift used to calculate the relative velocities. By default the systemic redshift defined in the dataset is used.
- .. _lmfit: https://lmfit.github.io/lmfit-py/index.html
- dataset :
-
output.
print_total
(dataset)[source]¶ Print the total column densities of all species. This will sum all the components of each ion. The uncertainty on the total column density is calculated using random resampling within the errors of each component.
-
output.
rebin_spectrum
(wl, spec, err, n, method='mean')[source]¶ Rebin input spectrum by a factor of n. Method is either mean or median, default is mean.
Parameters: - wl : array_like, shape (N)
Input wavelength array.
- spec : array_like, shape (N)
Input flux array.
- err : array_like, shape (N)
Input error array.
- n : int
Integer rebinning factor.
- method : str [default = ‘mean’]
Rebin method, either ‘mean’ or ‘median’.
Returns: - wl_r : array_like, shape (M)
Rebinned wavelength array, the new shape will be N/n.
- spec_r : array_like, shape (M)
Rebinned flux array, the new shape will be N/n.
- err_r : array_like, shape (M)
Rebinned error array, the new shape will be N/n.
-
output.
save_cont_parameters_to_file
(dataset, filename)[source]¶ Save Chebyshev coefficients to file.
-
output.
save_fit_regions
(dataset, filename, individual=False, path='')[source]¶ Save fit regions to ASCII file.
Parameters: - filename : str
Filename to be used. If the filename already exists, it will be overwritten. A .reg file extension will automatically be append if not present already.
- individual : bool [default = False]
If True, save each fitting region to a separate file. The individual filenames will be the basename given as filename with _regN appended, where N is an integer referring to the region number.
- path : str [default = ‘’]
Specify a path to prepend to the filename in order to save output to a given directory or path. Can be given both as relative or absolute path. If the directory does not exist, it will be created. The final filename will be:
path/ + filename [+ _regN] + .reg
-
output.
show_H2_bands
(ax, z, bands, Jmax, color='blue', short_labels=False)[source]¶ Add molecular H2 band identifications to a given matplotlib axis.
Parameters: - ax : matplotlib.axes.Axes
The axis instance to decorate with H2 line identifications.
- z : float
The redshift of the H2 system.
- bands : list(str)
A list of molecular bands of H2. Ex: [‘BX(0-0)’, ‘BX(1-0)’]
- Jmax : int or list(int)
The highest rotational J-level to include in the identification. A list of Jmax for each band can be passed as well. Lines are currently only defined up to J=7.
-
output.
show_components
(self, ion=None)[source]¶ Show the defined components for a given ion. By default, all ions are shown.
-
output.
sum_components
(dataset, ion, components)[source]¶ Calculate the total abundance for given components of the given ion.
Parameters: - dataset :
VoigtFit.DataSet
An instance of the
VoigtFit.DataSet
class containing the definition of data and absorption lines.- ion : str
Ion for which to calculate the summed abundance.
- components : list(int)
List of indeces of the components to sum over.
Returns: - total_logN : float
The 10-base log of total column density.
- total_logN_err : float
The error on the 10-base log of total column density.
- dataset :


An Indo-European Plant Teacher
Number 10
by Gracie and Zarkov
INTRODUCTION
Encounters with entities who teach or guide are a characteristic feature of hallucinogenic ayahuasca trances. For discussion purposes, we have granted ontological status to these entities without regard for the epistemological or metaphysical implications of that status.We have been interested in these phenomena for several years, but the South American vine, Banisteriopsis caapi, which is the basis for ayahuasca, is not readily available in North America. The DMT-containing admixture plants, Psychotria viridis, and Diplopteris cabrarana, which produce the vivid hallucinations, are even harder to obtain. Therefore, we have been investigating combinations of synthetic DMT with various beta-carboline containing plants, not only B. caapi, but also Passiflora incarnata and Peganum harmala.
PEGANUM HARMALA
P. harmala, or Syrian Rue, is the plant from which harmine was first isolated, as well as a source of harmaline and tetrahydroharmine. Total beta-Carboline content runs almost 4% by weight in the seeds of Syrian Rue. These alkaloids occur in roughly the same proportions as in B. caapi. Ten grams of Syrian Rue seeds provide about 400mg of total beta-Carbolines, about that amount in a typical dose of ayahuasca.Syrian Rue grows in semi-arid conditions. It originated in Central Asia, and is held in high esteem throughout Asia Minor as a medicinal, aphrodisiac and dye plant. There is no solid historical evidence of ritual or religious use. It is sometimes known as 'ruin weed' since it often grows on the tells covering the ruins of ancient cities in the Near East. It now grows wild in Eurasia and has recently been spread to Texas, Nevada, New Mexico and Southern California. Dye quality seeds are available from several West Coast seed services for about $50.00 per pound.
PREPARATION
We prepared our hallucinogenic brew in a manner similar to that used to prepare ayahuasca. Fifty grams of seeds were finely ground in a spice mill. The powdered seeds were added to 4 quarts of water and boiled in a slow cooker overnight. The resulting liquid was poured off and saved, and 4 quarts of fresh water were added to the residue. This second wash was also boiled for 12 hours. Both washes had a noticeable yellow color, indicating the possible presence of harmine. Both washes were strained while hot though a cloth coffee filter and then reduced to a final volume of 500ml. Synthetic N,N-DMT-HCl was boiled in during the final reduction (not boiling in the DMT adversely affects the brew's potency).
THE HIGH
We drank the brew on empty stomachs. First effects were noticed in about five minutes. Physical side effects include tingling extremities, slight tremor, lassitude and very slight nausea. The mental effects of the come-on are similar to the initial effects of smoked DMT but are milder and in slow motion. The anti-depressant effects of the beta-Carbolines are quite striking; a strange calm elation is felt.The DMT-like effects peak in about 25-30 minutes with strong visual disturbances. We were in a darkened room and the closed-eye geometric patterns were very vivid. We felt a 'presence' in these patterns which we could bring into direct contact by a combination of repeated nonsense babbling (which turned into glossolalia) and direct address to the 'entity,' e.g. 'Who are you?' 'Show yourself!' 'Do you want to talk?' etc.
THE PLANT TEACHER
On both occasions, we contacted a 'teacher' who identified himself with the Syrian Rue plant. During our discussions with him (which were out loud; subvocalizing was ineffective) the teacher showed us visions, answered questions and provided specific health, emotional and psychological advice. The 'voice in the head' phenomenon was not as strongly constituted as on high dose mushrooms. However, the vividness, clarity and understandability of the visionary illustrations which often accompanied the conversations were striking. Intense feelings (which shifted with the visions), changes in tone of voice and manner of speaking, including glossolalia (as recorded on tape) and strong contact highs were additional phenomena noted. The plant teacher had a definite personality which was strongly male, very friendly, humorous, with an interest in story-telling bordering on the garrulous.We have independent confirmation of contact phenomena by an associate who tried the same combination.
THE VISIONS
Representative visions and raps included:
- Plant diagrams and information on watering, plant diseases and placement of the Syrian Rue plant in our garden.
- A diagram of a human heart, showing the auricular node and the neurology of the heartbeat.
- Art and artifacts from the Old European civilization C. 10,000 BC, e.g., Catal Huyuk; including pottery and statuary.
- A vision of the Goddess, holding the plant teacher and the human contactee intertwined in Her hands.
- An amazingly vivid and intense 'movie' of the last scene from Robert A. Heinlein's Starship Troopers, showing the destruction of an insect planet by human warriors.
- The ruins of Persepolis, then, upon request, Persepolis in its original polychrome, sunlit splendor.
- A vision of the plant teacher as a Mongol warlord, in golden armor, astride an armored and caparisoned woolly mammoth.
- A vision of Gracie's mother at Gracie's age, from the inside, that is, Gracie experienced her mother from her mother's point of view.
- Various pieces of psychological and relationship advice, including insights into both our childhoods.
The visions faded about three hours after ingestion with the presence slowly fading in the fourth hour. The total trip lasts about 6 hours.
DOSAGE
This brew can be very intense and we could not recommend it to anyone who has not had significant experience with similar visionary states such as high dose mushrooms (5gm+, smoked DMT (40mg+) or mescaline (500mg+). Individual sensitivity to the beta-Carboline/DMT combination varies greatly, so we recommend that one 'sneak-up' on the effects. While our nominal dose would be 10 grams of seeds with 40 mg of DMT, 30 mg of DMT will definitely allow for contact. Five grams of seeds with 20 mg of DMT seems to be the threshold dose. The intensity of the visual effects seems most dependent upon the dosage of DMT. The length of the effects and the depth of the contact seem most dependent upon the dose of Syrian Rue. Our personal preference is 7 grams of seeds with 30 mg of DMT, with a booster dose of 5 grams Rue and 20 mg DMT after one hour.
WARNING
THE INTERACTION OF CERTAIN FOODS AND DRUGS WITH THE MAO INHIBITION BROUGHT ON BY BETA-CARBOLINES CAN BE FATAL!! The following substances must not be ingested within 48 hours before and after taking the brew:
- All amphetamines or related compounds , such as MDA, MDMA, phenylpropanolamine, ephedrine, etc. [add 'smart drugs' to this category.]
- Any foods containing tyramine, or where enzymatic processes have been used: e.g., yoghurt, sour cream, aged cheeses, wines, especially port or Chianti, beer, fermented sausages (pepperoni), soy sauce, etc.
- Certain other foods, including: shellfish, bananas, liver, avocados, broad beans, chocolate, coffee and others.
This list is not all-inclusive. Please do further research before attempting to experiment! The dangerous interaction usually precipitates a hypertensive crisis and certain people are especially sensitive to the effects, particularly those with heart abnormalities or high blood pressure. We ourselves have had a few close calls while investigating the beta-Carbolines.
Good physical health and the advice of a 'hip' physician are helpful, nevertheless, exercise caution if you become interested in these combinations.
COMPARISON WITH AYAHUASCA
While our direct experience with B. caapi and DMT admixtures is very limited, we have these preliminary comments. The Syrian Rue experience is less heavy, and the entity more casual, garrulous and intimate. The caapi entity seems more formal, more experienced with human contact, especially in health and psychology, and seems to be a more powerful teacher.
CHEMICAL ANALYSIS
The chemical analysis of ayahuasca can be found in Stafford, Psychedelics Encyclopedia, and Schultes and Hoffman, The Botany and Chemistry of Hallucinogens. A more detailed analysis of the brew is in McKenna, et. al., Journal of Ethnopharmacology, 10 (1984), 195-223.
CONCLUSION
A full account of our various experiments with beta-Carbolines and DMT will be in our forthcoming book: Notes from Underground: Psychedelic Perspectives for the Next Millennium, which will be published by High Frontiers Press sometime early in 1992.We'd like to acknowledge the information and moral support provided by Dennis, Terence and Kat McKenna, which made it possible for us to structure the experiments so as to make contact on our first attempt.
Finally, the plant teacher said that it would like to communicate with any human willing to take the brew.

Gracie and Zarkov
Copyright 1986 by Gracie and Zarkov productions. We believe that in a truly free society the price of packaged information would be driven down to the cost of reproduction and transmission. We, therefore, give blanket permission and encourage photocopy, quotation, reprint or entry into a database of all or part of our articles provided that the copier or quoter does not take credit for our statements!Watch for the book in 1992.
From the AHF BBS<PHONE_NUMBER>


Welcome to the ATCF HTTP Server homepage!
Current Active Storms
Last updated at {{ last_updated | safe }} UTC
{{ data | safe }}All params can be can be lowercase or uppercase.
| Name | Details | Example |
|---|---|---|
| id | Returns storms by depression ID. | 26L |
| name | Returns storms by international WMO name. | Delta |
| basin | Returns storms by their respective oceanic basin. | ATL |
Responses
All responeses will be in JSON format.
| Name | Details |
|---|---|
| last-updated | Date string (HH:MM:SS) of when the API was last updated. (UTC-0) |
| storms | Returns a dictionary of dictionaries for each active storm. |
| id | (Nested in storms response) Key is the depression ID of an active storm. Contains a dictionary of the values (basin, date, latitude, longitude, name, pressure, time, vmax1) |
1. Vmax is the maximum 1-minute sustained winds in knots.
Example url to get all storms in the Atlantic basin: http://<IP_ADDRESS>:5000/api/?basin=atl
A live api of all storms can be found at http://<IP_ADDRESS>:5000/api/


Useful functions to connect to 'TM1' <https://www.ibm.com/uk-en/marketplace/planning-and-analytics> instance from R via REST API. With the functions in the package, data can be imported from 'TM1' via mdx view or native view, data can be sent to 'TM1', processes and chores can be executed, and cube and dimension metadata information can be taken.
| Version: | 1.1.1 |
| Depends: | R (≥ 3.0.0) |
| Imports: | jsonlite, httr |
| Published: | 2018-10-30 |
| Author: | Muhammed Ali Onder |
| Maintainer: | Muhammed Ali Onder <muhammedalionder at gmail.com> |
| BugReports: | http://github.com/muhammedalionder/tm1r/issues |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | http://github.com/muhammedalionder/tm1r |
| NeedsCompilation: | no |
| CRAN checks: | tm1r results |
| Reference manual: | tm1r.pdf |
| Package source: | tm1r_1.1.1.tar.gz |
| Windows binaries: | r-devel: tm1r_1.1.1.zip, r-release: tm1r_1.1.1.zip, r-oldrel: tm1r_1.1.1.zip |
| OS X binaries: | r-release: tm1r_1.1.1.tgz, r-oldrel: tm1r_1.1.1.tgz |
| Old sources: | tm1r archive |
Please use the canonical form https://CRAN.R-project.org/package=tm1r to link to this page.


Like {@link io.vertx.ext.web.Route#blockingHandler(Handler, boolean)} called with ordered = true
Specify a blocking request handler for the route. This method works just like {@link #handler(Handler)} excepted that it will run the blocking handler on a worker thread so that it won't block the event loop. Note that it's safe to call context.next() from the blocking handler as it will be executed on the event loop context (and not on the worker thread.
If the blocking handler is ordered it means that any blocking handlers for the same context are never executed concurrently but always in the order they were called. The default value of ordered is true. If you do not want this behaviour and don't mind if your blocking handlers are executed in parallel you can set ordered to false.
the blocking request handler
if true handlers are executed in sequence, otherwise are run in parallel
a reference to this, so the API can be used fluently
Add a content type consumed by this route. Used for content based routing.
the content type
a reference to this, so the API can be used fluently
Disable this route. While disabled the router will not route any requests or failures to it.
a reference to this, so the API can be used fluently
Enable this route.
a reference to this, so the API can be used fluently
Append a failure handler to the route failure handlers list. The router routes failures to failurehandlers depending on whether the various criteria such as method, path, etc match. When method, path, etc are the same for different routes, You should add multiple failure handlers to the same route object rather than creating two different routes objects with one failure handler for route
the request handler
a reference to this, so the API can be used fluently
the path prefix (if any) for this route
Append a request handler to the route handlers list. The router routes requests to handlers depending on whether the various criteria such as method, path, etc match. When method, path, etc are the same for different routes, You should add multiple handlers to the same route object rather than creating two different routes objects with one handler for route
the request handler
a reference to this, so the API can be used fluently
Specify this is the last route for the router.
a reference to this, so the API can be used fluently
Add an HTTP method for this route. By default a route will match all HTTP methods. If any are specified then the route will only match any of the specified methods
the HTTP method to add
a reference to this, so the API can be used fluently
the http methods accepted by this route
Specify the order for this route. The router tests routes in that order.
the order
a reference to this, so the API can be used fluently
Set the path prefix for this route. If set then this route will only match request URI paths which start with this path prefix. Only a single path or path regex can be set for a route.
the path prefix
a reference to this, so the API can be used fluently
Set the path prefix as a regular expression. If set then this route will only match request URI paths, the beginning of which match the regex. Only a single path or path regex can be set for a route.
the path regex
a reference to this, so the API can be used fluently
Add a content type produced by this route. Used for content based routing.
the content type
a reference to this, so the API can be used fluently
Remove this route from the router
a reference to this, so the API can be used fluently
When you add a new route with a regular expression, you can add named capture groups for parameters.
However, if you need more complex parameters names (like "param_name"), you can add parameters names with
this function. You have to name capture groups in regex with names: "p0", "p1", "p2", ...
For example: If you declare route with regex /(?
group names
a reference to this, so the API can be used fluently
If true then the normalised request path will be used when routing (e.g. removing duplicate /) Default is true
use normalised path for routing?
a reference to this, so the API can be used fluently
Generated using TypeDoc
A route is a holder for a set of criteria which determine whether an HTTP request or failure should be routed to a handler.
Tim Fox


Post edited 1 x times, last by
Topicstarter
Ever since Origin went down and came back up a day or so ago, my BBLog history graph isn't showing.
In the graph window, I now get "Invalid platform. The selected platform does not exist."
This is the PC version, Win7x64 in Firefox (latest plugin).
Anyone else getting this?
Adamski-NZ wrote:
Ever since Origin went down and came back up a day or so ago, my BBLog history graph isn't showing.
In the graph window, I now get "Invalid platform. The selected platform does not exist."
This is the PC version, Win7x64 in Firefox (latest plugin).
Anyone else getting this?
Oh yeah same here same thing happen to me. But they actually update battlelog but never posted a changelog!
Topicstarter
Thanks - it's not just me then! I had already updated to the latest (4.60) but still got the error.
BrainFooLong
Administrator
Head to
http://getbblog.com/en/board/post/133687
Topicstarter
Much appreciated - thanks!


zcash-android-wallet-sdk
/
cash.z.wallet.sdk
/
Initializer
/
DefaultBirthdayStore
/
getBirthday
getBirthday
fun
getBirthday
(
)
:
WalletBirthday
Get the birthday of the wallet, saved in this store.